/* =========================================================
   CYBER SLIDER: NEON MATRIX - Futuristic Picture Slider CSS
   ========================================================= */

:root {
    --bg-dark: #070913;
    --bg-panel: rgba(13, 18, 36, 0.75);
    --bg-card: rgba(18, 26, 51, 0.65);
    --glass-border: rgba(0, 245, 255, 0.22);
    --glass-border-focus: rgba(0, 245, 255, 0.85);
    
    --accent-cyan: #00f5ff;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-amber: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --glow-cyan: 0 0 15px rgba(0, 245, 255, 0.45);
    --glow-purple: 0 0 15px rgba(168, 85, 247, 0.45);
    --glow-amber: 0 0 15px rgba(245, 158, 11, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 245, 255, 0.12) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
    display: flex;
    flex-direction: column;
}

/* Header Navigation (Matching Canvas Clash Standard) */
.game-header {
    position: sticky;
    top: 0;
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 14, 26, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.header-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.65));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.brand-logo:hover .header-logo-img {
    transform: scale(1.12) rotate(-3deg);
    filter: drop-shadow(0 0 16px rgba(236, 72, 153, 0.85));
}

.brand-logo .clash-text {
    background: linear-gradient(135deg, #00d2ff, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-center-auth {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 650px;
}

.btn-chip-auth {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-full);
    padding: 0.4rem 1.1rem;
    color: #cbd5e1;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-chip-auth:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent-cyan);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.user-hero-chip {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-full);
    padding: 0.4rem 1.1rem;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.user-hero-chip:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.hero-score-badge {
    background: rgba(0, 210, 255, 0.2);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 0.76rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.btn-auth-pill {
    background: linear-gradient(135deg, #6366f1, #00d2ff);
    color: #fff;
    border: none;
    font-weight: 700;
}

.btn-auth-pill:hover {
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
    transform: translateY(-1px);
}

/* Mobile Tab Switcher */
.mobile-view-tabs {
    display: none;
    background: rgba(13, 18, 36, 0.95);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.4rem;
    gap: 0.3rem;
}

.mobile-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.mobile-tab-btn.active {
    background: rgba(0, 245, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid var(--glass-border);
}

/* 3-Column Main Grid Layout (Expanded Column 1 for Tree Picture Gallery) */
.slider-main-container {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(640px, 1.85fr) minmax(360px, 1.1fr) minmax(290px, 0.95fr);
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    max-width: 1900px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1400px) {
    .slider-main-container {
        grid-template-columns: 1fr 1fr;
    }
    .slider-leaderboard-col {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .slider-main-container {
        grid-template-columns: 1fr;
    }
    .slider-leaderboard-col {
        grid-column: span 1;
    }
}

/* Glass Panels */
.cyber-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.panel-header {
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.panel-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    background: rgba(0, 245, 255, 0.12);
    border: 1px solid rgba(0, 245, 255, 0.3);
    color: var(--accent-cyan);
}

/* ===================================================
   COLUMN 1: PUZZLE COLLECTIONS (Tree & 4-Column Grid)
   =================================================== */
.gallery-col-card {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 600px;
    height: 100%;
}

.gallery-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.gallery-col-header .card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.gallery-search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    justify-content: flex-end;
}

.gallery-search-input {
    width: 100%;
    max-width: 320px;
    padding: 0.48rem 1.1rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.84rem;
    outline: none;
    transition: all 0.25s ease;
}

.gallery-search-input:focus {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.35);
}

.compact-zone {
    background: rgba(99, 102, 241, 0.08);
    border: 1.5px dashed rgba(99, 102, 241, 0.4);
    border-radius: 9999px;
    padding: 0.52rem 1.2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin-bottom: 0.25rem;
}

.compact-zone:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-cyan);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    transform: translateY(-1px);
}

.compact-zone .upload-icon {
    font-size: 1.15rem;
}

/* Custom Image URL Zone */
.custom-url-zone {
    margin: 8px 0 12px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.custom-url-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.custom-url-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}
.custom-url-input:focus {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}
.custom-url-input::placeholder {
    color: var(--text-dim);
    font-size: 0.82rem;
}
.btn-load-url {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, #00f5ff 0%, #3b82f6 50%, #a855f7 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.35);
    transition: all 0.25s ease;
    flex-shrink: 0;
    height: 38px;
    box-sizing: border-box;
}
.btn-load-url:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 245, 255, 0.6);
    filter: brightness(1.1);
}
.btn-load-url:active {
    transform: translateY(1px);
}
.custom-url-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-left: 2px;
    line-height: 1.3;
}

.tree-gallery-container {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1.1rem;
    flex: 1;
    min-height: 480px;
    height: 100%;
}

@media (max-width: 900px) {
    .tree-gallery-container {
        grid-template-columns: 1fr;
    }
}

.gallery-tree-sidebar {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.2);
}

.tree-section-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.2rem;
}

.tree-categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tree-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.42rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    user-select: none;
    gap: 0.4rem;
}

.tree-node-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tree-node .tree-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.tree-node .tree-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node .tree-count-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.tree-node:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.tree-node.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(6, 182, 212, 0.25) 100%);
    border-color: rgba(6, 182, 212, 0.6);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.tree-node.active .tree-count-badge {
    background: rgba(6, 182, 212, 0.3);
    color: #67e8f9;
}

.tree-node.user-node {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.35);
    color: #fde047;
    margin-bottom: 0.25rem;
}

.tree-node.user-node .tree-count-badge {
    background: rgba(234, 179, 8, 0.25);
    color: #fef08a;
}

.tree-node.most-jigged-node {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
    color: #fdba74;
    margin-bottom: 0.25rem;
}

.tree-node.most-jigged-node .tree-count-badge {
    background: rgba(249, 115, 22, 0.25);
    color: #ffedd5;
}

.tree-node.community-node {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.35);
    color: #67e8f9;
    margin-bottom: 0.4rem;
}

.tree-node.community-node .tree-count-badge {
    background: rgba(6, 182, 212, 0.25);
    color: #cffafe;
}

/* Gallery Pictures Grid Area */
.gallery-grid-area {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.gallery-active-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.85rem;
    background: rgba(15, 23, 42, 0.45);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.active-category-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.active-category-icon {
    font-size: 1.15rem;
}

.active-category-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.active-category-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 255, 0.35) rgba(0, 0, 0, 0.3);
}

@media (max-width: 1450px) {
    .preset-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.preset-card {
    position: relative;
    height: 115px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.preset-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.preset-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 210, 255, 0.6);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.preset-card:hover img {
    transform: scale(1.08);
}

.preset-card.active, .preset-card.selected {
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.5);
    transform: translateY(-2px);
}

.puzzle-daily-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.18rem 0.55rem;
    border-radius: 9999px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.02em;
}

.preset-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%);
    padding: 0.45rem 0.6rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.preset-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.preset-tag {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Column 2: Center Arena */
.slider-arena-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Pre-Game Setup Card */
.setup-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setup-hero-banner {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(0, 245, 255, 0.3);
    max-height: 240px;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.setup-hero-banner img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.hero-overlay-details {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(7, 9, 19, 0.95) 0%, rgba(7, 9, 19, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

.daily-ribbon {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--glow-amber);
}

.hero-puzzle-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
}

.hero-puzzle-cat {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Difficulty Control */
.difficulty-control-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.diff-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.diff-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.diff-active-label {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--accent-cyan);
    background: rgba(0, 245, 255, 0.12);
    border: 1px solid rgba(0, 245, 255, 0.35);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
}

.diff-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.diff-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 12px var(--accent-cyan);
    cursor: pointer;
    border: 2px solid #fff;
    transition: transform 0.15s ease;
}

.diff-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.diff-ticks-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
}

.diff-tick.active {
    color: var(--accent-cyan);
}

/* Mode Options */
.options-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
}

.option-toggle.active {
    background: rgba(0, 245, 255, 0.12);
    border-color: var(--accent-cyan);
    color: #fff;
}

.option-toggle input {
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

/* Instructions card */
.quick-rules-box {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    font-size: 0.82rem;
    color: #e9d5ff;
    line-height: 1.45;
}

/* Start Button */
.btn-start-slider {
    background: linear-gradient(135deg, #00f5ff 0%, #3b82f6 50%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 6px 25px rgba(0, 245, 255, 0.45);
    transition: all 0.25s ease;
}

.btn-start-slider:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 245, 255, 0.7);
}

/* ==========================================================================
   2. GAMEPLAY SCREEN (DEDICATED FULL VIEWPORT ARENA)
   ========================================================================== */
.gameplay-screen {
    width: 100%;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem 1.5rem;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    gap: 0.85rem;
}

/* Top Navigation HUD */
.game-hud {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    gap: 0.85rem;
    flex-wrap: nowrap;
    z-index: 50;
}

.hud-left-group, .hud-right-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.btn-back-menu {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-back-menu:hover {
    background: rgba(0, 245, 255, 0.2);
    border-color: var(--accent-cyan);
    color: #fff;
    transform: translateX(-2px);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
}

.glass-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.stat-item i {
    font-style: normal;
    color: var(--accent-cyan);
}

.stat-lbl-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-left: 2px;
}

/* Centered Viewport Wrapper */
.slider-viewport-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    min-height: 0;
}

/* Board Arena Box (Centered in Viewport) */
.board-arena-box {
    position: relative;
    background: rgba(5, 8, 18, 0.9);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: 0 0 40px rgba(0, 245, 255, 0.25), inset 0 0 30px rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(65vh, 580px, 94vw);
    height: min(65vh, 580px, 94vw);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    margin: auto;
}

.slider-board-grid {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.slider-tile {
    position: absolute;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.15s ease;
    border: 1px solid rgba(0, 245, 255, 0.35);
    background-color: #000;
}

.slider-tile:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 14px rgba(0, 245, 255, 0.7);
    z-index: 10;
}

.slider-tile.movable {
    border-color: var(--accent-green);
}

.slider-tile.blank {
    background: transparent !important;
    border: 1px dashed rgba(0, 245, 255, 0.25) !important;
    box-shadow: none !important;
    cursor: default;
}

.tile-number-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(7, 9, 19, 0.85);
    border: 1px solid rgba(0, 245, 255, 0.6);
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    pointer-events: none;
    text-shadow: 0 0 5px var(--accent-cyan);
}

/* Ghost Overlay */
.ghost-image-overlay {
    position: absolute;
    inset: 8px;
    pointer-events: none;
    opacity: 0.22;
    border-radius: var(--radius-sm);
    background-size: 100% 100%;
    z-index: 1;
    display: none;
    transition: opacity 0.2s ease;
}

/* Floating Bottom Control Bar */
.game-bottombar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius-full);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    z-index: 50;
    flex-wrap: wrap;
}

.btn-tool {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-tool:hover {
    background: rgba(0, 245, 255, 0.2);
    border-color: var(--accent-cyan);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 14px rgba(0, 245, 255, 0.4);
}

.btn-tool.active {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.3), rgba(168, 85, 247, 0.3));
    border-color: var(--accent-cyan);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 245, 255, 0.25);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
    transform: translateY(-1px);
}

/* Column 3: Hall of Fame (Leaderboard) */
.leaderboard-filters-row {
    padding: 0.65rem 1rem;
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.lb-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.lb-pill:hover,
.lb-pill.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    color: #fff;
    box-shadow: var(--glow-purple);
}

.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: calc(100vh - 250px);
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 245, 255, 0.3);
}

.lb-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.lb-rank.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: var(--glow-amber); }
.lb-rank.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.lb-rank.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); }

.lb-player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.lb-meta {
    flex: 1;
    overflow: hidden;
}

.lb-player-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-subtext {
    font-size: 0.68rem;
    color: var(--text-dim);
}

.lb-score-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lb-time {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--accent-cyan);
    font-variant-numeric: tabular-nums;
}

.lb-moves {
    font-size: 0.68rem;
    color: var(--text-dim);
}

/* Victory Modal */
.victory-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.victory-card {
    background: rgba(13, 18, 36, 0.95);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    box-shadow: 0 0 40px rgba(0, 245, 255, 0.4), 0 20px 40px rgba(0, 0, 0, 0.8);
    animation: victoryPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes victoryPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.victory-trophy {
    font-size: 3.5rem;
    animation: floatTrophy 2s ease-in-out infinite alternate;
}

@keyframes floatTrophy {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.victory-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #00f5ff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.victory-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.v-stat-val {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
}

.v-stat-lbl {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

.victory-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.btn-v-action {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    transition: all 0.2s ease;
}

.btn-v-replay {
    background: linear-gradient(135deg, #00f5ff, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.4);
}

.btn-v-hall {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
    .slider-main-container {
        grid-template-columns: 280px 1fr 280px;
        gap: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 992px) {
    .mobile-view-tabs {
        display: flex;
    }

    .slider-main-container {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }

    .slider-collection-col,
    .slider-leaderboard-col {
        display: none;
    }

    .slider-collection-col.mobile-active,
    .slider-leaderboard-col.mobile-active,
    .slider-arena-col.mobile-active {
        display: flex;
    }

    .options-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   In-game Save Progress Button & Pause Modal (Jigsaw Puzzle Master Standard)
   ========================================================================== */

.btn-save-progress {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(16, 185, 129, 0.2)) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
    color: #e2e8f0 !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-save-progress:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(16, 185, 129, 0.35)) !important;
    border-color: #34d399 !important;
    color: #fff !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.3) !important;
}

.btn-save-progress.is-paused {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(239, 68, 68, 0.25)) !important;
    border-color: #f59e0b !important;
    color: #fbbf24 !important;
    animation: pausePulse 1.8s infinite ease-in-out;
}

@keyframes pausePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.5); }
}

.pause-modal-card {
    max-width: 440px;
    width: 90%;
    padding: 2.25rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.25);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg, 16px);
}

.pause-icon-badge {
    font-size: 2.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

.pause-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.pause-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.5;
    margin: -0.25rem 0 0.25rem 0;
}

.pause-meta-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-md, 10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-chip {
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

.pause-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-pause-resume {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-md, 10px);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-pause-resume:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.55);
}

.btn-pause-save-exit {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-md, 10px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pause-save-exit:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Resume Saved Game Banner */
.slider-resume-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: var(--radius-md, 10px);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease;
}

.resume-banner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.resume-icon {
    font-size: 1.5rem;
}

.resume-texts {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.resume-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

.resume-meta {
    font-size: 0.78rem;
    color: #94a3b8;
}

.resume-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-resume-cta {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-resume-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-discard-cta {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-discard-cta:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}
