/* Block Logic – Blockbuster-style puzzle, dark modern aesthetic */

.game-content {
    background: var(--surface-color, #161B22);
    color: var(--text-primary, #F8FAFC);
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.stats {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--accent, #ffae00);
    font-weight: bold;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.stats-btn {
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid var(--border-color, rgba(255,255,255,0.2));
    background: var(--button-bg, #282828);
    color: var(--accent, #ffae00);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-btn:hover {
    border-color: var(--accent, #ffae00);
    background: rgba(255, 174, 0, 0.15);
}

.block-logic-wrap {
    position: relative;
    display: inline-block;
    touch-action: none;
}

#block-logic-canvas {
    display: block;
    border-radius: 12px;
    background: var(--block-grid-bg, #0d1117);
    box-shadow: inset 0 0 0 2px var(--border-color, rgba(255,255,255,0.08));
    cursor: crosshair;
}

body.light-theme .block-logic-wrap #block-logic-canvas {
    background: var(--block-grid-bg, #1a1f2e);
}

/* Game Over overlay */
.game-over-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.game-over-overlay.visible {
    display: flex;
}

.game-over-box {
    background: var(--surface-color, #161B22);
    color: var(--text-primary, #F8FAFC);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    border: 2px solid var(--accent, #ffae00);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.game-over-box h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    color: var(--accent, #ffae00);
}

.game-over-box p {
    margin: 0 0 20px 0;
    color: var(--text-secondary, #8B949E);
}

.game-over-btn {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #0F172A);
    background: var(--accent, #ffae00);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-over-btn:hover {
    background: #ffc933;
    transform: scale(1.02);
}

/* Level Up overlay */
.level-up-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    z-index: 9;
    pointer-events: none;
}

.level-up-overlay.visible {
    display: flex;
    animation: level-up-fade 1.5s ease-out forwards;
}

@keyframes level-up-fade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.level-up-box {
    background: linear-gradient(135deg, var(--accent, #ffae00) 0%, #ff8c00 100%);
    color: #0F172A;
    border-radius: 16px;
    padding: 24px 36px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 174, 0, 0.4);
    animation: level-up-pop 0.5s ease-out;
}

@keyframes level-up-pop {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.level-up-box h3 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.level-up-box p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Tray */
.tray-wrap {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tray-label {
    font-size: 0.95rem;
    color: var(--text-secondary, #8B949E);
    font-weight: 600;
}

.hint-instruction {
    color: var(--accent, #ffae00);
    font-weight: 700;
}

.tray {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    background: var(--button-bg, #282828);
    border-radius: 12px;
    border: 2px solid var(--border-color, rgba(255,255,255,0.1));
    min-height: 80px;
    align-items: center;
    justify-content: center;
}

.tray-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 72px;
    padding: 8px;
    background: var(--surface-color, #161B22);
    border-radius: 10px;
    border: 2px dashed var(--border-color, rgba(255,255,255,0.15));
    cursor: grab;
    transition: all 0.2s ease;
    touch-action: none;
}

.tray-slot:hover {
    border-color: var(--accent, #ffae00);
    background: rgba(255, 174, 0, 0.08);
}

.tray-slot.hint-target {
    border: 2px solid var(--accent, #ffae00);
    background: rgba(255, 174, 0, 0.2);
    box-shadow: 0 0 12px rgba(255, 174, 0, 0.5);
    animation: hint-pulse 0.8s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 174, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 174, 0, 0.8); }

.tray-slot:active {
    cursor: grabbing;
}

.tray-slot.dragging {
    opacity: 0.4;
    pointer-events: none;
}

.tray-slot canvas {
    display: block;
    pointer-events: none;
}

.hint {
    color: var(--text-secondary, #8B949E);
    font-size: 0.85rem;
    margin-top: 16px;
    text-align: center;
    max-width: 420px;
}
