.mining-spinner {
    width: calc(var(--spinner-size) * var(--ui-scale));
    height: calc(var(--spinner-size) * var(--ui-scale));
    font-size: calc(var(--font-size) * var(--ui-scale));
    position: absolute;
    top: calc(50% + var(--spinner-offset, 0px));
    left: calc(50% + var(--spinner-offset, 0px));
    border: calc(3px * var(--ui-scale)) solid white;
    border-top: calc(3px * var(--ui-scale)) solid transparent;
    border-radius: 50%;
    animation: spin var(--spinner-speed) linear infinite;
    animation-delay: var(--spinner-delay, 0s);
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}


.damage-floater {
    font-size: calc(var(--damage-font-size) * var(--ui-scale));
    position: absolute;
    top: 50%;
    left: calc(50% + var(--offset-ratio) * var(--tile-size) * var(--ui-scale));
    transform: translateX(-50%);
    font-weight: bold;
    animation: float-wave 3s ease-in-out forwards;
    pointer-events: none;
    z-index: 5;
    text-shadow:
            -1px -1px 0 #000,
            1px -1px 0 #000,
            -1px  1px 0 #000,
            1px  1px 0 #000;
}

.damage-floater.crit {
    font-size: calc(var(--damage-font-size) * var(--ui-scale) * 1.2);
    font-weight: bolder;
    animation: float-wave 1.2s ease-in-out forwards, crit-pulse 0.6s ease-out;
}

@keyframes float-wave {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) translateX(0);
    }
    10% {
        transform: translate(-50%, -50%) translateY(-4px) translateX(-3px);
    }
    20% {
        transform: translate(-50%, -50%) translateY(-8px) translateX(3px);
    }
    30% {
        transform: translate(-50%, -50%) translateY(-12px) translateX(-3px);
    }
    40% {
        transform: translate(-50%, -50%) translateY(-16px) translateX(3px);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-20px) translateX(-3px);
    }
    60% {
        transform: translate(-50%, -50%) translateY(-24px) translateX(3px);
    }
    70% {
        transform: translate(-50%, -50%) translateY(-28px) translateX(-3px);
    }
    80% {
        transform: translate(-50%, -50%) translateY(-32px) translateX(3px);
    }
    90% {
        transform: translate(-50%, -50%) translateY(-36px) translateX(-1px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-40px) translateX(0);
    }
}

@keyframes crit-pulse {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.4);
    }
    40% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}


.tile.chain-zap {
    box-shadow: 0 0 10px var(--chain-color, rgba(0, 200, 255, 0.8));
    background-color: var(--chain-color, rgba(0, 200, 255, 0.08)); /* subtle tint */
    animation: chain-flicker 1s ease-out;
}

@keyframes chain-flicker {
    0% {
        box-shadow: 0 0 14px var(--chain-color, rgba(0, 255, 255, 1));
        background-color: var(--chain-color, rgba(0, 255, 255, 0.12));
    }
    50% {
        box-shadow: 0 0 8px var(--chain-color, rgba(0, 255, 255, 0.5));
        background-color: var(--chain-color, rgba(0, 255, 255, 0.06));
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 255, 255, 0);
        background-color: transparent;
    }
}

.you-are-mining-here {
    box-shadow: inset 0 0 4px 2px cyan;
    border-color: cyan;
    animation: pulse-mine 1s ease-in-out infinite;
    cursor: pointer;
}

.you-are-queued-here {
    box-shadow: inset 0 0 4px 2px #c0fbfb;
}

@keyframes pulse-mine {
    0%, 100% { box-shadow: inset 0 0 4px 2px cyan; }
    50% { box-shadow: inset 0 0 6px 3px white; }
}

/* Anti-bot protection visual feedback */
.requires-mouse-movement {
    background-color: rgba(255, 107, 107, 0.1) !important;
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { 
        border-color: #ff6b6b; 
        background-color: rgba(255, 107, 107, 0.1);
    }
    50% { 
        border-color: #ff9999; 
        background-color: rgba(255, 107, 107, 0.2);
    }
}

.mouse-movement-indicator {
    animation: fade-in-bounce 0.3s ease-out;
}

@keyframes fade-in-bounce {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Buffer tiles - invisible to users but detectable by bots */
.buffer-tile,
.shadow-tile,
.phantom-tile {
  position: absolute;
  opacity: 0;
  pointer-events: auto;
  width: calc(var(--tile-size) * var(--ui-scale));
  height: calc(var(--tile-size) * var(--ui-scale));
  z-index: -1; /* Behind other elements */
  
  /* Hide from users but keep structure for bots */
  visibility: hidden; /* Alternative hiding method */
  
  /* Make it slightly visible for debugging (remove in production) */
  /* opacity: 0.05; */
  /* border: 1px dashed red; */
}

/* Buffer tiles scattered around the grid */
.buffer-tile.overlay-type:nth-child(3n+1) {
  top: 10%;
  left: 5%;
}

.buffer-tile.overlay-type:nth-child(3n+2) {
  top: 60%;
  right: 8%;
}

.buffer-tile.overlay-type:nth-child(3n+3) {
  bottom: 15%;
  left: 50%;
}

/* Active mining honeypots positioned strategically */
.buffer-tile.active-mining {
  top: 30%;
  right: 15%;
  z-index: -5; /* Slightly higher to catch bots looking for active tiles */
}

/* Shadow tiles positioned offscreen */
.shadow-tile.offscreen-type {
  left: -100px;
  top: 50%;
}

/* Phantom tiles - tiny and invisible */
.phantom-tile.hidden-type {
  width: 1px;
  height: 1px;
  opacity: 0;
  visibility: hidden;
}

.phantom-tile.hidden-type:nth-child(even) {
  z-index: -10;
  background: transparent;
}

/* Honeypot tile contents should look realistic */
.buffer-tile .tile,
.shadow-tile .tile,
.phantom-tile .tile {
  /* Match real tile styling */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  color: white;
  border: 1px solid #333;
}

/* Honeypot progress bars should look realistic */
.buffer-tile .progress-bar,
.shadow-tile .progress-bar,
.phantom-tile .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: limegreen;
  z-index: 1;
  transition: width 0.1s ease;
}

/* Honeypot icons should be appealing to automated systems */
.buffer-tile .tile-icon,
.shadow-tile .tile-icon {
  color: gold;
  text-shadow: 0 0 5px gold;
  font-family: Georgia, serif;
}

.phantom-tile .tile-icon {
  color: burlywood;
  font-family: Georgia, serif;
}

/* Honeypot mining spinners should look active */
.buffer-tile .mining-spinner {
  width: calc(var(--spinner-size, 24px) * var(--ui-scale, 1));
  height: calc(var(--spinner-size, 24px) * var(--ui-scale, 1));
  position: absolute;
  top: 50%;
  left: 50%;
  border: 3px solid white;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin var(--spinner-speed, 3s) linear infinite;
  transform: translate(-50%, -50%);
  z-index: 3;
}

/* Drag-to-queue functionality styles */
.drag-selected {
    box-shadow: 0 0 0 3px #00ff00, inset 0 0 0 2px rgba(0, 255, 0, 0.3) !important;
    border-color: #00ff00 !important;
    background-color: rgba(0, 255, 0, 0.1) !important;
    animation: drag-pulse 0.3s ease-in-out infinite alternate;
    z-index: 10 !important;
}

.drag-preview {
    position: fixed;
    border: 2px dashed #00ff00;
    background: rgba(0, 255, 0, 0.1);
    pointer-events: none;
    z-index: 1000;
    display: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    padding: 2px;
    border-radius: 4px;
    text-shadow: 1px 1px 0 #000;
}

/* Click feedback animation */
.tile-click-feedback {
    animation: click-ripple 0.3s ease-out;
}

@keyframes click-ripple {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
    }
}

/* Mobile touch improvements */
.dig-tile-wrapper {
    touch-action: none; /* Prevents scrolling when dragging on mobile */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none; /* Prevents text selection on mobile */
}

@keyframes drag-pulse {
    0% {
        box-shadow: 0 0 0 3px #00ff00, inset 0 0 0 2px rgba(0, 255, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 0 3px #00ffaa, inset 0 0 0 2px rgba(0, 255, 170, 0.5);
    }
}

/* Disable text selection during drag to prevent interference */
.grid {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Queue mode specific styles */
.queue-mode-enabled .dig-tile-wrapper {
    cursor: crosshair;
}
