/* grid.css */

.worker-dot {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;


    &.anchor {
        border: 1px solid white; /* helps contrast */
    }
}

.grid-wrapper {
    .intern-area {
        margin: 10px;
    }
}

.grid-wrapper {
    padding: 5px 0;
    background-color: #111;
    border: 2px solid #333;
    border-radius: 10px;
    margin: 1rem auto;
    max-width: fit-content;
    box-shadow: 0 0 10px #000;
    position: relative;
    min-width: 100%;
}

.grid {
    position: relative;
}

.grid-loading {
    height: 300px;
}


.grid-inner {
    margin: 10px;
}

.grid-tiles-defeated-badge {
    position: absolute;
    top: 40px;
    right: 8px;
    font-size: 0.8rem;
    color: #ccc;
    border-radius: 4px;
    z-index: 10;
    transition: background 0.2s;
}

.grid-roster-button {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1rem;
    padding: 4px 6px;
    background: #222;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 4px;
    text-decoration: none;
    z-index: 10;
    transition: background 0.2s;
}

.grid-roster-button:hover {
    background: #333;
    color: white;
}

.grid-roster-button.has-shadows {
    background: #0a0;
    color: black;
    border-color: #0f0;
}

.grid-roster-button.has-shadows:hover {
    background: #0f0;
    color: black;
}

.grid-header {
    text-align: center;
    margin-bottom: 1rem;
}

.department-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
}

.department-stats,
.department-scaling {
    font-size: 0.9rem;
    color: #bbb;
    margin: 0.25rem 0;

    a {
        text-decoration: none;
    }
}

.grid-footer {
    text-align: center;
    margin-top: 1rem;
}

.grid-wrapper.layer_standard {
    border-color: #556;
}

.grid-wrapper.layer_mega_block {
    border-color: gold;
    box-shadow: 0 0 20px gold;
}

.grid-wrapper.layer_corrupt_sector {
    border-color: crimson;
    background-color: #1a0d0d;
    box-shadow: 0 0 10px crimson;
}

.grid-wrapper.layer_dense_cache {
    border-color: darkorange;
    background-color: #1e1400;
    box-shadow: 0 0 10px darkorange;
}

.bonus-dig-wrapper {
    border-color: gold;
    background-color: #1e1400;
    box-shadow: 0 0 10px gold;
}

.dirt {
    color: tomato;
}

.layer_dense_cache.dirt {
    color: darkorange;
}

.layer_corrupt_sector.dirt {
    color: darkred;
}

.layer_mega_block.dirt {
    color :gold;
}

.layer_bonus.dirt {
    color: gold;
}


.valuable {
    color: gold;
    text-shadow: 0 0 5px gold, 0 0 10px orange;
}

.junk {
    color: burlywood;
}

.tile {
    width: calc(var(--tile-size) * var(--ui-scale));
    height: calc(var(--tile-size) * var(--ui-scale));
    font-size: calc(var(--font-size) * var(--ui-scale));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: white;
    border: 1px solid #333;
    user-select: none;
    transition: all 0.1s ease-out;
    .tile-icon {
        font-family: Georgia, serif;
    }
}

/* Only apply hover effects to undug tiles */
.tile.undug:hover {
    border-color: #666;
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.tile-content {
    z-index: 2;
    position: relative;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background-color: limegreen;
    z-index: 1;
    transition: width 0.1s ease;
}

.queue-toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;

    .action-buttons {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

.queue-toggle-switch .label-text {
    color: white;
    font-size: 0.85rem;
}

.damage-stats-display {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #ccc;
    text-align: center;
    font-size: 12px;
}

.damage-stats-display .stat-item {
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    white-space: nowrap;

}

.damage-stats-display .stat-label {
    color: #bbb;
    font-size: inherit;
}

.damage-stats-display .stat-value {
    color: #00ff66;
    font-weight: bold;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #333;
    border: 1px solid grey;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.2s;
    border-radius: 20px;
}

.slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: cyan;
    transition: 0.2s;
    border-radius: 50%;
}

input[type="checkbox"]:checked + .slider::before {
    background-color: limegreen;
    transform: translateX(18px);
}

.grid-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.intern-overlay {
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* clicks pass through to the grid cells */
    z-index: 5;          /* above the grid but below any modals */
}

.intern-overlay .label {
    background: #ffc;
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 1.2em;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

/* desktop & wide, arrow to the right */
.intern-overlay .label::after {
    content: '← Start a process';
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
}

/* when the frame is narrow (mobile), arrow down */
@media (max-width: 689px) {
    .intern-overlay .label::after {
        content: '↑ Start a process';
        right: 50%;
        top: auto;
        bottom: -20px;
        transform: translateX(50%);
    }
}

.bonus-block-panel {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 12px;
}

@media (max-width: 700px) {
    .bonus-block-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        border-left: none;
        width: 100%;
    }

    .tile-progression {
        display: flex;
        flex-wrap: wrap;
        max-width: 100px;
        justify-content: flex-end;
    }
}
.bonus-dig-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 4px;
    border: 2px solid #333;
    border-radius: 10px;
    padding-top: 4px;
    width: 95px;
    .mining-spinner {
        width: 32px;
        height: 32px;
        top: 35%;
    }
    .damage-floater {
        font-size: 16px;
    }
    .bonus-label {
        font-family: monospace;
        color: #ccc;
        font-size: 0.55rem;
        line-height: 1.2;
        text-align: center;
        max-width: 100%;
        white-space: pre-line;
        user-select: none;

    }
    .tile {
        width: 64px;
        height: 61px;
        font-size: 64px;
        padding: 0;
        line-height: 64px;
        border: none;
    }
}

.bonus-block {
    background-color: #111;
    border: 2px solid #666;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-family: monospace;
    color: #0f0;
    transition: border-color 0.2s;
    width: 75px;
    height: 75px;
}

.bonus-block.active {
    border-color: limegreen;
    text-shadow: 0 0 6px limegreen;
}

.active-badge {
    color: limegreen;
    font-weight: bold;
    font-size: 0.65rem;
}
