/* ======================================================
   CASE: SHADOW SYNDICATE
   Match-3 Board, HUD, Tiles & Special Animations
====================================================== */

#screen-gameplay {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    display: none;
    flex-direction: column;
}

#screen-gameplay.active {
    display: flex;
}

/* Gameplay Header & HUD */
.gameplay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.gameplay-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--antique-gold);
    letter-spacing: 1px;
}

.hud-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    background: var(--card-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem;
    margin-bottom: 0.8rem;
    text-align: center;
}

.hud-item .hud-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.hud-item .hud-value {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: bold;
    color: #fff;
}

.hud-item.moves .hud-value {
    color: #e67e22;
}

.hud-item.timer .hud-value {
    color: #5dade2;
}

.hud-item.score .hud-value {
    color: var(--antique-gold);
}

/* Objective Container (Story Mode) */
.hud-objective-container {
    background: rgba(30, 41, 59, 0.7);
    border: 1px dashed var(--antique-gold);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.8rem;
}

.objective-header {
    font-size: 0.75rem;
    color: var(--antique-gold);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.objectives-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.objective-badge {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.objective-badge.done {
    border-color: #2ecc71;
    color: #2ecc71;
}

/* 8x8 Match-3 Board Grid */
.board-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 520px;
    margin: 0 auto;
    background: #111923;
    border: 3px solid #233142;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 15px rgba(0,0,0,0.6);
    padding: 6px;
}

.match3-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    width: 100%;
    height: 100%;
}

/* Individual Tiles */
.tile {
    position: relative;
    background: var(--card-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
    padding: 4px;
    touch-action: manipulation;
}

.tile:hover {
    background: var(--card-surface-light);
    transform: scale(1.04);
}

.tile.selected {
    border: 2px solid var(--antique-gold);
    box-shadow: 0 0 12px var(--gold-glow);
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.06);
    z-index: 5;
    animation: pulseSelected 1s infinite alternate;
}

@keyframes pulseSelected {
    from { box-shadow: 0 0 6px var(--gold-glow); }
    to { box-shadow: 0 0 14px rgba(212, 175, 55, 0.7); }
}

.noir-icon {
    width: 82%;
    height: 82%;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.15s ease;
}

/* Special Items Decoration */
.tile.has-special {
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-color: rgba(212, 175, 55, 0.7);
}

.tile.special-bomb {
    box-shadow: inset 0 0 8px rgba(231, 76, 60, 0.5);
    border-color: #e74c3c;
}

.tile.special-master {
    box-shadow: inset 0 0 10px rgba(52, 152, 219, 0.6);
    border-color: #3498db;
    animation: masterGaze 1.5s infinite alternate;
}

@keyframes masterGaze {
    from { filter: drop-shadow(0 0 2px #3498db); }
    to { filter: drop-shadow(0 0 8px #5dade2); }
}

.special-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(14, 22, 33, 0.85);
    border: 1px solid var(--antique-gold);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--antique-gold);
    font-weight: bold;
    pointer-events: none;
}

/* Pop Out clearing animation */
.tile.pop-out {
    transform: scale(0);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.6, -0.28, 0.735, 0.045), opacity 0.2s ease;
}

