/**
 * SkakVision - Minimalist Futuristic Cyber Stylesheet
 * 100% Bootstrapped & Open Source. Zero External Dependencies.
 * Spatial Void, Frosted Glassmorphism, Fluid Single-Stage Viewport.
 */

:root {
    --bg-void: #05070a;
    --bg-surface: rgba(12, 17, 27, 0.78);
    --bg-card: rgba(18, 25, 40, 0.7);
    --bg-pill: rgba(255, 255, 255, 0.05);
    --bg-pill-hover: rgba(255, 255, 255, 0.1);

    --neon-cyan: #00f0ff;
    --neon-cyan-glow: rgba(0, 240, 255, 0.35);
    --neon-emerald: #10b981;
    --neon-emerald-glow: rgba(16, 185, 129, 0.35);
    --neon-purple: #8b5cf6;
    --neon-purple-glow: rgba(139, 92, 246, 0.35);
    --neon-rose: #f43f5e;
    --neon-rose-glow: rgba(244, 63, 94, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(0, 240, 255, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.04);

    --board-light: #ece0ca;
    --board-dark: #82664b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-pill: 9999px;

    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

body.light-theme {
    --bg-void: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(248, 250, 252, 0.85);
    --bg-pill: rgba(0, 0, 0, 0.04);
    --bg-pill-hover: rgba(0, 0, 0, 0.08);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glass-focus: rgba(0, 180, 220, 0.5);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --text-primary: #090d16;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

/* Base Reset & Atmospheric Canvas */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Radial Luminescence */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle 800px at 50% -120px, rgba(0, 240, 255, 0.1), transparent 70%),
        radial-gradient(circle 700px at 85% 60%, rgba(139, 92, 246, 0.06), transparent 60%),
        radial-gradient(circle 650px at 15% 80%, rgba(16, 185, 129, 0.06), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Minimal Top Bar (Brand + Single Hamburger Menu) */
.minimal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}

.brand-minimal {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    pointer-events: auto;
}

.brand-text {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    color: #ffffff;
}

.brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    pointer-events: auto;
}

.minimal-status-pill {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-emerald);
    box-shadow: 0 0 10px var(--neon-emerald);
}

/* Hamburger Button Icon */
.hamburger-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hamburger-btn .bar {
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s ease;
}

.hamburger-btn:hover {
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 18px var(--neon-cyan-glow);
    transform: scale(1.05);
}

.hamburger-btn:hover .bar {
    background-color: var(--neon-cyan);
}

/* Viewport Stage: Single Fluid Container */
.viewport-stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 1rem 2rem 1rem;
    position: relative;
    z-index: 1;
}

.stage-section {
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ========================================================================= */
/* PHASE 1: MEDIA PICKER APERTURE                                            */
/* ========================================================================= */
.picker-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hologram-picker-aperture {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.hologram-picker-aperture::before,
.hologram-picker-aperture::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: var(--neon-cyan);
    pointer-events: none;
    transition: all 0.3s ease;
}

.hologram-picker-aperture::before {
    top: 16px;
    left: 16px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.hologram-picker-aperture::after {
    bottom: 16px;
    right: 16px;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

.hologram-picker-aperture:hover,
.hologram-picker-aperture.dragover {
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.25), 0 25px 60px rgba(0, 0, 0, 0.7);
    transform: translateY(-3px);
}

.hologram-picker-aperture:hover::before,
.hologram-picker-aperture.dragover::before {
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    box-shadow: -2px -2px 10px var(--neon-cyan);
}

.hologram-picker-aperture:hover::after,
.hologram-picker-aperture.dragover::after {
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    box-shadow: 2px 2px 10px var(--neon-cyan);
}

.aperture-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
    border: 1px solid rgba(0, 240, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
    animation: pulse-aperture 3.5s ease-in-out infinite;
}

@keyframes pulse-aperture {
    0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(0, 240, 255, 0.25); }
    50% { transform: scale(1.06); box-shadow: 0 0 45px rgba(0, 240, 255, 0.5); }
}

.aperture-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, #ffffff 40%, var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aperture-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.aperture-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.aperture-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.aperture-hint kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-family: var(--font-mono);
}

/* Quick Samples Pills */
.quick-samples-deck {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.deck-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    margin-bottom: 0.65rem;
}

.deck-pills {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.deck-sample-pill {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-pill);
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.deck-sample-pill:hover {
    border-color: var(--border-glass-focus);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
    transform: translateY(-1px);
}

.sample-tag {
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* ========================================================================= */
/* PHASE 2: ANIMATED EDGE HIGHLIGHT & BACKGROUND DISSOLVE MORPH              */
/* ========================================================================= */
.morph-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.morph-frame {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px var(--neon-cyan-glow);
    border: 1px solid var(--border-glass-focus);
}

.morph-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.morph-frame img.dissolved {
    filter: blur(10px) brightness(0.2) contrast(150%);
    opacity: 0.15;
    transform: scale(0.96);
}

/* Animated Laser Sweep Line */
.morph-laser-sweep {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 35px var(--neon-cyan);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.morph-laser-sweep.active {
    animation: laser-morph 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes laser-morph {
    0% { top: 0%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Animated SVG Wireframe Grid */
.morph-grid-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.morph-grid-svg.active {
    opacity: 1;
}

.grid-line {
    stroke: var(--neon-cyan);
    stroke-width: 0.6;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    filter: drop-shadow(0 0 4px var(--neon-cyan));
    animation: draw-line 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

.morph-hud-badge {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(5, 7, 11, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass-focus);
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 10;
    white-space: nowrap;
}

/* ========================================================================= */
/* PHASE 3 & 4: THE DIGITAL ARENA & SETUP FLOW                               */
/* ========================================================================= */
.arena-centerpiece {
    width: 100%;
    max-width: min(480px, 92vw);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Player HUD Chips (Minimalist) */
.player-hud {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.85rem;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.player-hud.top {
    margin-bottom: 0.5rem;
}

.player-hud.bottom {
    margin-top: 0.5rem;
}

.player-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.player-chip-dot.green {
    background: var(--neon-emerald);
    box-shadow: 0 0 8px var(--neon-emerald);
}

.player-name {
    font-size: 0.84rem;
    font-weight: 700;
}

.player-status-side {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mat-diff {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-pill);
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
}

.captured-pieces {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cap-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Central Board Theater */
.board-theater-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000000;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 240, 255, 0.12);
    border: 1px solid var(--border-glass);
}

.board-b72b1 {
    border: none !important;
}

.white-1e1d7 {
    background-color: var(--board-light) !important;
}

.black-3c85d {
    background-color: var(--board-dark) !important;
}

.notation-322f9 {
    font-family: var(--font-mono) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    opacity: 0.75;
}

/* Floating Status Pills over Board */
.thinking-pill {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    background: rgba(5, 7, 11, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass-focus);
    border-radius: var(--radius-pill);
    color: var(--neon-cyan);
    font-size: 0.74rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.check-pill {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.95rem;
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid var(--neon-rose);
    border-radius: var(--radius-pill);
    color: var(--neon-rose);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 0 20px var(--neon-rose-glow);
    z-index: 10;
    animation: check-throb 1s infinite;
}

@keyframes check-throb {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.08); }
}

/* Legal Move Dots & Rings */
.legal-move-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
    pointer-events: none;
    z-index: 10;
}

.legal-capture-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 4px solid var(--neon-rose);
    box-shadow: inset 0 0 12px var(--neon-rose);
    pointer-events: none;
    z-index: 10;
}

.hint-highlight {
    box-shadow: inset 0 0 20px var(--neon-cyan) !important;
}

/* ========================================================================= */
/* INTERACTIVE SETUP PROMPT (FLUID QUESTIONS HUD)                            */
/* ========================================================================= */
.setup-flow-hud {
    width: 100%;
    margin-top: 0.85rem;
}

.flow-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 0.95rem 0.85rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.flow-prompt-text {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.flow-options-row {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
}

.btn-flow-choice {
    flex: 1;
    max-width: 200px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-pill);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-flow-choice:hover {
    background: var(--bg-pill-hover);
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 20px var(--neon-cyan-glow);
    transform: translateY(-2px);
    color: #ffffff;
}

.choice-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.choice-dot.white {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
}

.choice-dot.black {
    background: #1e293b;
    border: 1px solid #475569;
}

.flow-subrow {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0.85rem;
}

.btn-text-subtle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-text-subtle:hover {
    color: var(--neon-cyan);
}

.btn-flow-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-flow-back:hover {
    color: #ffffff;
}

/* Link Share Card */
.link-share-box {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.link-share-box input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--neon-cyan);
    outline: none;
}

.link-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

#invite-qrcode {
    padding: 6px;
    background: #ffffff;
    border-radius: 6px;
    display: inline-block;
}

#invite-qrcode img,
#invite-qrcode canvas {
    display: block;
}

.link-waiting-indicator {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

/* Bot Level Selector */
.bot-level-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.btn-level-pill {
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-pill);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-level-pill:hover {
    border-color: var(--border-glass-focus);
    color: #ffffff;
}

.btn-level-pill.active {
    background: rgba(0, 240, 255, 0.18);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px var(--neon-cyan-glow);
}

/* ========================================================================= */
/* EDIT BOARD DRAWER                                                         */
/* ========================================================================= */
.edit-drawer {
    width: 100%;
    margin-top: 0.75rem;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    text-align: center;
}

.edit-drawer-header {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    margin-bottom: 0.6rem;
}

.piece-tray-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.piece-tray-row {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.piece-tray-btn {
    width: 38px;
    height: 38px;
    padding: 2px;
    background: var(--bg-pill);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.piece-tray-btn img {
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
}

.piece-tray-btn:hover {
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 12px var(--neon-cyan-glow);
    transform: translateY(-2px);
}

.piece-tray-btn.active {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 18px var(--neon-cyan-glow);
    transform: scale(1.08);
}

.piece-tray-btn.trash-btn {
    color: var(--neon-rose);
    font-size: 1.1rem;
}

.edit-actions-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* In-Game Action HUD */
.game-hud-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hud-pill {
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.hud-pill:hover {
    border-color: var(--border-glass-focus);
    color: #ffffff;
    box-shadow: 0 0 15px var(--neon-cyan-glow);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.btn-pill {
    border-radius: var(--radius-pill);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    box-shadow: 0 6px 25px rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-pill);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-secondary:hover {
    background: var(--bg-pill-hover);
    border-color: var(--border-glass-focus);
    color: #ffffff;
}

.btn-outline-accent {
    background: transparent;
    color: var(--neon-cyan);
    border-color: var(--border-glass-focus);
}

.btn-outline-accent:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 18px var(--neon-cyan-glow);
}

/* ========================================================================= */
/* SLIDE-OVER HAMBURGER MENU DRAWER                                          */
/* ========================================================================= */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 11, 0.75);
    backdrop-filter: blur(10px);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
    display: block;
    opacity: 1;
}

.minimal-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-surface);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-left: 1px solid var(--border-glass);
    z-index: 999;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -15px 0 50px rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}

.minimal-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.drawer-brand {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--neon-cyan);
}

.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.drawer-close:hover {
    color: var(--neon-rose);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-nav-item i {
    width: 18px;
    color: var(--neon-cyan);
    font-size: 0.95rem;
}

.drawer-nav-item:hover {
    background: var(--bg-pill);
    border-color: var(--border-glass);
    color: #ffffff;
    transform: translateX(3px);
}

.drawer-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 0.75rem 0;
}

.drawer-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0.35rem 0 0.25rem 0.75rem;
}

.drawer-info-pill {
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--neon-emerald);
    line-height: 1.4;
    margin-bottom: 0.45rem;
}

.drawer-diag-box {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #000000;
    color: var(--neon-emerald);
    border-radius: 4px;
    font-size: 0.68rem;
    max-height: 140px;
    overflow-y: auto;
    font-family: var(--font-mono);
}

/* Modals & Toasts */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 11, 0.85);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.25rem;
}

.modal-backdrop.show {
    display: flex;
}

.modal-dialog {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--neon-emerald);
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
}

/* Toast */
.app-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass-focus);
    color: #ffffff;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--neon-cyan-glow);
    z-index: 2000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    white-space: nowrap;
}

.app-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 520px) {
    .hologram-picker-aperture {
        padding: 2.25rem 1.25rem;
    }
    .aperture-title {
        font-size: 1.3rem;
    }
    .bot-level-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}
