:root {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --particle-hue-min: 180;
    --particle-hue-max: 260;
    --accent-gradient: linear-gradient(45deg, #a29bfe, #6c5ce7);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-bg: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --button-shadow: rgba(0, 0, 0, 0.2);
    --theme-color-glow: hsla(220, 90%, 70%, 0.95);
    --dropdown-bg: rgba(12, 17, 32, 0.9);
    --dropdown-border: rgba(255, 255, 255, 0.1);
    --dropdown-shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="cosmic"] {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --particle-hue-min: 180;
    --particle-hue-max: 260;
    --accent-gradient: linear-gradient(45deg, #a29bfe, #6c5ce7);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-bg: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --button-shadow: rgba(0, 0, 0, 0.2);
    --theme-color-glow: hsla(220, 90%, 70%, 0.95);
    --dropdown-bg: rgba(12, 17, 32, 0.9);
    --dropdown-border: rgba(255, 255, 255, 0.15);
    --dropdown-shadow: rgba(0, 0, 0, 0.35);
}

[data-theme="aurora"] {
    --bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    --particle-hue-min: 140;
    --particle-hue-max: 200;
    --accent-gradient: linear-gradient(45deg, #10b981, #06b6d4);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(16, 185, 129, 0.25);
    --card-bg: rgba(15, 23, 42, 0.4);
    --card-border: rgba(16, 185, 129, 0.15);
    --card-hover-bg: rgba(16, 185, 129, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --button-shadow: rgba(16, 185, 129, 0.15);
    --theme-color-glow: hsla(160, 90%, 70%, 0.95);
    --dropdown-bg: rgba(15, 23, 42, 0.95);
    --dropdown-border: rgba(16, 185, 129, 0.2);
    --dropdown-shadow: rgba(0, 0, 0, 0.5);
}

[data-theme="cyberpunk"] {
    --bg-gradient: linear-gradient(135deg, #09090b 0%, #180828 100%);
    --particle-hue-min: 300;
    --particle-hue-max: 340;
    --accent-gradient: linear-gradient(45deg, #f43f5e, #d946ef);
    --glass-bg: rgba(9, 9, 11, 0.75);
    --glass-border: rgba(244, 63, 94, 0.3);
    --card-bg: rgba(9, 9, 11, 0.5);
    --card-border: rgba(244, 63, 94, 0.2);
    --card-hover-bg: rgba(244, 63, 94, 0.15);
    --text-primary: #fafafa;
    --text-secondary: #e4e4e7;
    --button-shadow: rgba(244, 63, 94, 0.2);
    --theme-color-glow: hsla(320, 90%, 70%, 0.95);
    --dropdown-bg: rgba(9, 9, 11, 0.96);
    --dropdown-border: rgba(244, 63, 94, 0.25);
    --dropdown-shadow: rgba(0, 0, 0, 0.5);
}

[data-theme="ocean"] {
    --bg-gradient: linear-gradient(135deg, #032b45 0%, #075e8a 100%);
    --particle-hue-min: 180;
    --particle-hue-max: 220;
    --accent-gradient: linear-gradient(45deg, #38bdf8, #0369a1);
    --glass-bg: rgba(3, 43, 69, 0.65);
    --glass-border: rgba(56, 189, 248, 0.25);
    --card-bg: rgba(3, 43, 69, 0.4);
    --card-border: rgba(56, 189, 248, 0.15);
    --card-hover-bg: rgba(56, 189, 248, 0.1);
    --text-primary: #f0f9ff;
    --text-secondary: #bae6fd;
    --button-shadow: rgba(56, 189, 248, 0.15);
    --theme-color-glow: hsla(200, 90%, 70%, 0.95);
    --dropdown-bg: rgba(3, 43, 69, 0.95);
    --dropdown-border: rgba(56, 189, 248, 0.2);
    --dropdown-shadow: rgba(0, 0, 0, 0.4);
}

[data-theme="solar"] {
    --bg-gradient: linear-gradient(135deg, #1c0a00 0%, #3a1c00 100%);
    --particle-hue-min: 20;
    --particle-hue-max: 50;
    --accent-gradient: linear-gradient(45deg, #f97316, #eab308);
    --glass-bg: rgba(28, 10, 0, 0.75);
    --glass-border: rgba(249, 115, 22, 0.3);
    --card-bg: rgba(28, 10, 0, 0.5);
    --card-border: rgba(249, 115, 22, 0.2);
    --card-hover-bg: rgba(249, 115, 22, 0.15);
    --text-primary: #fffbeb;
    --text-secondary: #fef3c7;
    --button-shadow: rgba(249, 115, 22, 0.2);
    --theme-color-glow: hsla(35, 90%, 70%, 0.95);
    --dropdown-bg: rgba(28, 10, 0, 0.96);
    --dropdown-border: rgba(249, 115, 22, 0.25);
    --dropdown-shadow: rgba(0, 0, 0, 0.5);
}

[data-theme="forest"] {
    --bg-gradient: linear-gradient(135deg, #051c14 0%, #0a2d20 100%);
    --particle-hue-min: 90;
    --particle-hue-max: 140;
    --accent-gradient: linear-gradient(45deg, #22c55e, #14b8a6);
    --glass-bg: rgba(5, 28, 20, 0.65);
    --glass-border: rgba(34, 197, 94, 0.25);
    --card-bg: rgba(5, 28, 20, 0.4);
    --card-border: rgba(34, 197, 94, 0.15);
    --card-hover-bg: rgba(34, 197, 94, 0.1);
    --text-primary: #f0fdf4;
    --text-secondary: #bbf7d0;
    --button-shadow: rgba(34, 197, 94, 0.15);
    --theme-color-glow: hsla(115, 90%, 70%, 0.95);
    --dropdown-bg: rgba(5, 28, 20, 0.95);
    --dropdown-border: rgba(34, 197, 94, 0.2);
    --dropdown-shadow: rgba(0, 0, 0, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    font-size: 16px;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Cambira, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    text-align: center;
    /* Allow more horizontal space so grid can fit more cards per row */
    max-width: 1200px;
    width: 100%;
}

h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    transition: color 0.3s ease;
}

.top-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
}

.top-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    background: rgba(255,255,255,0.12);
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.top-version {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
}

.top-button:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.18);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.theme-select-container {
    position: relative;
    display: inline-block;
}

#themeBtn {
    cursor: pointer;
    outline: none;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    min-width: 200px;
    background: var(--dropdown-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--dropdown-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--dropdown-shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    
    /* Animation initial states */
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.theme-option.active {
    background: var(--accent-gradient);
    color: white;
}

.theme-option.active .theme-preview {
    border-color: white !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.theme-preview {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-option:hover .theme-preview {
    transform: scale(1.2);
    border-color: white;
}

.top-button-icon {
    font-size: 1.1rem;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: none;
    cursor: pointer;
    min-width: 200px;
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #ff5252, #ff7979);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #26de81, #20bf6b);
}

.btn-tertiary {
    background: linear-gradient(45deg, #a29bfe, #6c5ce7);
}

.btn-tertiary:hover {
    background: linear-gradient(45deg, #fd79a8, #e84393);
}

.btn-back {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    margin-top: 2rem;
    min-width: 150px;
}

.btn-back:hover {
    background: linear-gradient(45deg, #55a3ff, #0770c7);
}

.page-content {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin: 1rem 0;
    border: 1px solid var(--glass-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.page-content h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: color 0.3s ease;
}

.page-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.feature-list {
    text-align: left;
    color: var(--text-secondary);
    margin: 1rem 0;
    transition: color 0.3s ease;
}

.feature-list li {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1rem;
        min-width: 180px;
    }

    .button-container {
        gap: 1.2rem;
    }

    body {
        padding: 15px;
    }

    .page-content {
        padding: 1.5rem;
    }

    .page-content h2 {
        font-size: 1.7rem;
    }

    .page-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.7rem;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
        min-width: 160px;
    }

    .button-container {
        gap: 1rem;
    }

    .page-content {
        padding: 1rem;
    }
}

/* Desktop - Optional horizontal layout for larger screens */
@media (min-width: 992px) {
    .button-container {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeInUp 0.8s ease-out;
}
/* Card grid styles */
.card-grid {
    display: grid;
    /* Use auto-fill with a slightly larger min width so cards are a bit bigger */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 1.5rem;
    align-items: start;
}

.card {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    border: 1px solid var(--card-border);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
    background: var(--card-hover-bg);
}

.card-media {
    width: 100%;
    border-radius: 4px;
    padding-top: 100%; /* square */
    background: rgba(255,255,255,0.02);
    display: block;
    position: relative;
    overflow: hidden;
}

.card-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    height: 75%;
    object-fit: contain;
    pointer-events: none;
}

.card-title {
    margin-top: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: color 0.3s ease;
}
.section {
    margin-top: 1.2rem;
    text-align: left;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin: 0 0 0.6rem 0;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.25);
    transition: color 0.3s ease;
}
.iframe-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Use dvh for better mobile support */
    height: 100dvh; 
    background: #ffffff;
    z-index: 1000;
    display: none;
    -webkit-overflow-scrolling: touch;
    /* Prevent zoom on mobile */
    touch-action: manipulation;
}

.iframe-fullscreen iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.close-button {
    position: fixed;
    top: 50px;
    right: 50px;
    z-index: 1001;
    background: #ff0000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 20px;
}

/* Add these media queries for mobile responsiveness */
@media (max-width: 768px) {
    .iframe-fullscreen {
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        -webkit-overflow-scrolling: touch;
    }

    .close-button {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 16px;
    }
}

/* Search bar: full-width at top of sections */
.search-wrap {
    position: sticky;
    top: 18px;
    z-index: 6;
    margin-bottom: 1rem;
    /* keep the wrap transparent so background shows through */
    display: block;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: white;
    outline: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    transition: box-shadow 0.18s ease, transform 0.12s ease;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-input:focus {
    box-shadow: 0 8px 30px rgba(173, 173, 173, 0.25);
    transform: translateY(-1px);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.tool-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 18px;
    padding: 1.25rem;
    text-align: left;
}

.tool-card h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.tool-card label {
    display: block;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.35rem;
}

.tool-card input {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

/* ==========================================================================
   Arcade Dashboard Layout
   ========================================================================== */
.arcade-container {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: stretch;
    text-align: left;
    width: 100%;
    min-height: 600px;
}

/* Sidebar Selector */
.arcade-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 280px;
    flex-shrink: 0;
}

.arcade-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.arcade-tab-btn:hover {
    background: var(--card-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.15);
}

.arcade-tab-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 0 20px var(--theme-color-glow);
    color: #ffffff;
}

.arcade-tab-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.arcade-tab-text {
    display: flex;
    flex-direction: column;
}

.arcade-tab-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.arcade-tab-tag {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    opacity: 0.65;
    margin-top: 2px;
}

.arcade-tab-btn.active .arcade-tab-tag {
    opacity: 0.9;
}

/* Arcade Play Cabinet */
.arcade-cabinet {
    flex-grow: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2.2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cabinet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.06) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0.3;
}

/* Game Pane System */
.game-pane {
    display: none;
    animation: paneFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.game-pane.active {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    height: 100%;
}

@keyframes paneFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.9rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pane-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.65rem;
    margin: 0;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.pane-stats {
    display: flex;
    gap: 0.85rem;
}

.pane-stat {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.4rem 0.9rem;
    border-radius: 99px;
    color: var(--text-primary);
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.04);
    display: inline-flex;
    align-items: center;
}

.game-desc {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.game-sandbox {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    flex-grow: 1;
    justify-content: center;
}

/* ==========================================================================
   Word Scramble Upgraded Styles
   ========================================================================== */
.scramble-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 0.8rem 0;
}

.scramble-letters span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22), inset 0 2px 4px rgba(255, 255, 255, 0.18);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, border-color 0.2s;
    animation: letterFloat 3.5s ease-in-out infinite alternate;
}

.scramble-letters span:nth-child(even) {
    animation-delay: 0.6s;
    animation-duration: 4s;
}

.scramble-letters span:nth-child(3n) {
    animation-delay: 1.2s;
    animation-duration: 3.2s;
}

@keyframes letterFloat {
    from { transform: translateY(0) rotate(-1.5deg); }
    to { transform: translateY(-7px) rotate(1.5deg); }
}

.scramble-hint {
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    text-align: center;
}

/* ==========================================================================
   Sliding Puzzle Upgraded Styles
   ========================================================================== */
.puzzle-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.4rem 0;
}

.puzzle-board {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    grid-template-rows: repeat(3, 76px);
    gap: 0.65rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.55);
}

.puzzle-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 3px rgba(255, 255, 255, 0.25);
    transition: transform 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s, box-shadow 0.12s;
}

.puzzle-tile:hover:not(.empty) {
    transform: scale(1.04) translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.35);
}

.puzzle-tile:active:not(.empty) {
    transform: scale(0.97) translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.puzzle-tile.empty {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    box-shadow: none;
    cursor: default;
}

/* ==========================================================================
   Guess the Number Upgraded Styles
   ========================================================================== */
.guess-meter {
    display: flex;
    justify-content: center;
    margin-bottom: 0.4rem;
}

.guess-range {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.45rem 1.3rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.guess-history-container {
    margin-top: 1rem;
    border-top: 1.5px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.9rem;
    text-align: left;
}

.guess-history-container h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
}

.guess-history {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 32px;
}

.guess-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    animation: badgePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.guess-badge.too-high {
    background: rgba(239, 68, 68, 0.12);
    color: #ff5252;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.guess-badge.too-low {
    background: rgba(59, 130, 246, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.guess-badge.correct {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

@keyframes badgePop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Math Challenge Display Screen
   ========================================================================== */
.math-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.4rem;
    border-radius: 22px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.math-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.4rem;
}

.math-equation {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.3rem;
    color: var(--text-primary);
    text-shadow: 0 0 15px var(--theme-color-glow);
    letter-spacing: 1px;
}

/* ==========================================================================
   Tic Tac Toe Upgraded Styles
   ========================================================================== */
.ttt-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.4rem 0;
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 0.65rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.55);
}

.ttt-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    cursor: pointer;
    color: transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ttt-cell:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    transform: scale(1.03);
}

.ttt-cell:active:not(:disabled) {
    transform: scale(0.96);
}

.ttt-cell[data-val="X"] {
    color: #ff5252;
    text-shadow: 0 0 12px rgba(255, 82, 82, 0.65);
    background: rgba(255, 82, 82, 0.07);
    border-color: rgba(255, 82, 82, 0.32);
}

.ttt-cell[data-val="O"] {
    color: #38bdf8;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
    background: rgba(56, 189, 248, 0.07);
    border-color: rgba(56, 189, 248, 0.32);
}

.ttt-cell:disabled {
    cursor: default;
}

/* ==========================================================================
   Chess Sandbox Upgraded Styles
   ========================================================================== */
.chess-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.4rem 0;
    overflow-x: auto;
    width: 100%;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 46px);
    grid-template-rows: repeat(8, 46px);
    border: 4px solid rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    background: rgba(0, 0, 0, 0.25);
    transition: transform 0.5s ease-in-out;
}

.chess-square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
}

.chess-square.light {
    background-color: rgba(240, 217, 181, 0.18);
    color: var(--text-primary);
}

.chess-square.dark {
    background-color: rgba(181, 136, 99, 0.38);
    color: var(--text-primary);
}

.chess-square.selected {
    background-color: rgba(255, 235, 59, 0.45) !important;
    box-shadow: inset 0 0 10px rgba(255, 235, 59, 0.7);
    transform: scale(1.05);
    z-index: 4;
}

.chess-square.highlighted {
    background-color: rgba(76, 175, 80, 0.35) !important;
    box-shadow: inset 0 0 8px rgba(76, 175, 80, 0.5);
}

.chess-piece {
    pointer-events: none;
    transition: transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.chess-board.flipped {
    transform: rotate(180deg);
}

.chess-board.flipped .chess-square {
    transform: rotate(180deg);
}

.chess-board.flipped .chess-square.selected {
    transform: rotate(180deg) scale(1.05);
}

/* ==========================================================================
   Input & Message Controls
   ========================================================================== */
.game-input-group {
    display: flex;
    justify-content: center;
    width: 100%;
}

.game-input-group input {
    max-width: 320px;
    width: 100%;
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.75rem 1.2rem;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    outline: none;
    transition: all 0.25s ease;
}

.game-input-group input:focus {
    border-color: var(--theme-color-glow);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
}

.game-message {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    min-height: 1.5rem;
    transition: all 0.2s ease;
    padding: 0.4rem;
    border-radius: 8px;
}

.game-message.success {
    color: #10b981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.game-message.error {
    color: #ff5252;
    text-shadow: 0 0 8px rgba(255, 82, 82, 0.25);
}

/* ==========================================================================
   Responsive Adaptation for Arcade
   ========================================================================== */
@media (max-width: 900px) {
    .arcade-container {
        flex-direction: column;
        gap: 1.5rem;
        min-height: auto;
    }
    
    .arcade-selector {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.6rem;
        gap: 0.6rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    
    .arcade-tab-btn {
        min-width: 155px;
        flex-shrink: 0;
        padding: 0.85rem;
    }
    
    .arcade-tab-icon {
        font-size: 1.3rem;
    }
    
    .arcade-tab-title {
        font-size: 0.9rem;
    }
    
    .arcade-tab-tag {
        font-size: 0.72rem;
    }
    
    .arcade-cabinet {
        padding: 1.5rem;
    }
    
    .pane-header h2 {
        font-size: 1.45rem;
    }
    
    .chess-board {
        grid-template-columns: repeat(8, 38px);
        grid-template-rows: repeat(8, 38px);
    }
    
    .chess-square {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .chess-board {
        grid-template-columns: repeat(8, 32px);
        grid-template-rows: repeat(8, 32px);
    }
    
    .chess-square {
        font-size: 1.5rem;
    }
    
    .puzzle-board {
        grid-template-columns: repeat(3, 68px);
        grid-template-rows: repeat(3, 68px);
        gap: 0.5rem;
    }
    
    .puzzle-tile {
        font-size: 1.5rem;
    }
    
    .tic-tac-toe-board {
        grid-template-columns: repeat(3, 72px);
        grid-template-rows: repeat(3, 72px);
        gap: 0.5rem;
    }
    
    .ttt-cell {
        font-size: 1.8rem;
    }
    
    .math-equation {
        font-size: 1.95rem;
    }
}

.calc-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 1rem;
    color: white;
    font-weight: 700;
    background: linear-gradient(45deg, #4ecdc4, #26de81);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}

.numeric-keypad {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(3, minmax(54px, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(12, 17, 32, 0.96);
    backdrop-filter: blur(12px);
    color: white;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    min-width: 220px;
    max-width: 280px;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.numeric-keypad.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
}

.numeric-keypad button {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 14px 0;
    font-size: 1.05rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.numeric-keypad button:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.numeric-keypad button.action-key {
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.95rem;
}

.numeric-keypad button.enter-key {
    grid-column: span 3;
    background: linear-gradient(45deg, #4ecdc4, #26de81);
}

.numeric-keypad button.enter-key:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

.numeric-keypad button.backspace-key {
    background: rgba(255, 255, 255, 0.14);
}

.clear-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 1rem;
    margin-top: 0.75rem;
    color: white;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.calc-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    color: #f1f1f1;
    min-height: 72px;
    line-height: 1.5;
}

.feature-list h3 {
    color: white;
    margin-bottom: 0.75rem;
}

.feature-list ul {
    list-style: disc inside;
}

.feature-list li {
    margin-bottom: 0.45rem;
    color: rgba(255,255,255,0.92);
}

@media (max-width: 480px) {
    .search-input { padding: 10px 12px; font-size: 0.95rem; }
}

.footer-counter {
    margin-top: 2rem;
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}
