/* ============================================================
   THOMASAI 3.0 — SYMMETRIC DESIGN SYSTEM
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Surfaces */
    --bg: #0b0b0a;
    --bg-soft: #131210;
    --bg-card: #181714;
    --bg-elev: #1f1d18;

    /* Ink */
    --ink: #f5f2eb;
    --ink-dim: #9d978a;
    --ink-faint: #5c574e;
    --ink-ghost: #2e2b25;

    /* Lines */
    --line: #1f1d19;
    --line-bright: #302d27;
    --line-accent: #3d362b;

    /* Brand */
    --accent: #ff8c42;
    --accent-soft: #ffa366;
    --accent-deep: #cc6a30;
    --accent-glow: rgba(255, 140, 66, 0.15);

    /* Status */
    --green: #21d07a;
    --red: #ff4444;
    --blue: #5b9eff;

    /* Spacing scale */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-7: 32px;
    --s-8: 40px;
    --s-9: 56px;
    --s-10: 72px;

    /* Layout */
    --rail-w: 220px;
    --container-max: 1200px;
    --content-max: 760px;

    /* Type */
    --serif: 'Instrument Serif', 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    /* Radii */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;

    /* Easing */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Shadows */
    --sh-1: 0 1px 2px rgba(0,0,0,0.4);
    --sh-2: 0 4px 12px rgba(0,0,0,0.5);
    --sh-3: 0 12px 32px rgba(0,0,0,0.4);
}

::selection { background: var(--accent); color: var(--bg); }

html, body { height: 100%; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LAYOUT — SYMMETRIC GRID
   ============================================================ */

.app {
    display: grid;
    grid-template-columns: var(--rail-w) 1fr;
    grid-template-rows: 60px 1fr 36px;
    grid-template-areas:
        "topbar topbar"
        "rail   main"
        "footer footer";
    height: 100vh;
    width: 100vw;
}

/* Topbar */
.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--s-7);
    border-bottom: 1px solid var(--line);
    background: rgba(11,11,10,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}
.brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}
.brand-mark {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 18px;
    font-style: italic;
    position: relative;
    transition: all .25s var(--ease);
}
.brand-mark::after {
    content: '';
    position: absolute;
    width: 4px; height: 4px;
    background: var(--accent);
    bottom: -2px; right: -2px;
}
.brand-mark:hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}
.brand-name {
    font-family: var(--serif);
    font-size: 20px;
    letter-spacing: -0.02em;
}
.brand-name em { font-style: italic; color: var(--accent); }
.brand-version {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    margin-left: var(--s-2);
    padding: 3px 6px;
    border: 1px solid var(--line-bright);
    border-radius: var(--r-sm);
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: var(--s-5);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
}
.status-pill {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 5px 10px;
    border: 1px solid var(--line-bright);
    border-radius: var(--r-sm);
}
.status-dot {
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s infinite;
    box-shadow: 0 0 6px rgba(33,208,122,0.4);
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Rail (Sidebar Nav) */
.rail {
    grid-area: rail;
    border-right: 1px solid var(--line);
    background: rgba(11,11,10,0.4);
    display: flex;
    flex-direction: column;
    padding: var(--s-7) 0;
    overflow-y: auto;
}
.rail-section {
    padding: 0 var(--s-6);
    margin-bottom: var(--s-6);
}
.rail-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    color: var(--ink-faint);
    margin-bottom: var(--s-4);
    text-transform: uppercase;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: 12px 0;
    color: var(--ink-dim);
    cursor: pointer;
    position: relative;
    transition: all .25s var(--ease);
}
.nav-item:hover { color: var(--ink); padding-left: 4px; }
.nav-item.active { color: var(--ink); }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--s-6));
    top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 18px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-glow);
}
.nav-icon {
    font-size: 16px;
    color: var(--ink-faint);
    min-width: 20px;
    transition: color .2s;
}
.nav-item:hover .nav-icon { color: var(--ink); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-num {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-faint);
    min-width: 18px;
    transition: color .2s;
}
.nav-item.active .nav-num { color: var(--accent); }
.nav-text {
    font-family: var(--serif);
    font-size: 18px;
    font-style: italic;
}
.rail-divider {
    height: 1px;
    background: var(--line);
    margin: 0 var(--s-6) var(--s-5);
}
.rail-stats {
    padding: 0 var(--s-6);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    line-height: 2;
    margin-top: auto;
}
.rail-stats i {
    font-size: 8px;
    margin-right: 6px;
    color: var(--ink-faint);
}
.rail-stats .status-dot {
    color: #00ff00;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.rail-stats span { color: var(--accent); }

/* Main Content */
.main {
    grid-area: main;
    position: relative;
    overflow: hidden;
}

/* Panels */
.panel {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
}
.panel.active { display: flex; }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-4) var(--s-8);
    border-bottom: 1px solid var(--line);
    background: rgba(11,11,10,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
    min-height: 64px;
}
.panel-title {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
}
.panel-num {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--accent);
}
.panel-title-text {
    font-family: var(--serif);
    font-size: 24px;
    font-style: italic;
    letter-spacing: -0.02em;
}
.panel-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

/* Common: Hero Block */
.hero {
    padding: var(--s-9) var(--s-8) var(--s-7);
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
}
.hero-eyebrow {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.28em;
    color: var(--accent);
    margin-bottom: var(--s-5);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    text-transform: uppercase;
}
.hero-eyebrow::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent);
}
.hero-h1 {
    font-family: var(--serif);
    font-size: clamp(40px, 5.5vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: var(--s-5);
}
.hero-h1 em {
    font-style: italic;
    color: var(--accent);
}
.hero-lede {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink-dim);
    font-style: italic;
    max-width: 560px;
}

/* Form Controls */
.input {
    background: var(--bg-card);
    border: 1px solid var(--line-bright);
    border-radius: var(--r-md);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    padding: 12px 14px;
    outline: none;
    transition: all .2s var(--ease);
    width: 100%;
}
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.input::placeholder { color: var(--ink-faint); }

.select {
    background: var(--bg-card);
    border: 1px solid var(--line-bright);
    border-radius: var(--r-sm);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 12px;
    outline: none;
    cursor: pointer;
    transition: all .2s;
}
.select:hover { border-color: var(--line-accent); }
.select:focus { border-color: var(--accent); }
.select option { background: var(--bg-card); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--r-sm);
    color: #fff;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 11px 18px;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.btn:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
    transform: translateY(-1px);
    box-shadow: var(--sh-2);
}
.btn-ghost {
    background: transparent;
    border-color: var(--line-bright);
    color: var(--ink-dim);
}
.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--ink-dim);
    color: var(--ink);
    transform: none;
    box-shadow: none;
}
.btn-danger {
    background: transparent;
    border-color: var(--red);
    color: var(--red);
}
.btn-danger:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line-bright);
    background: transparent;
    color: var(--ink-dim);
    border-radius: var(--r-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.btn-icon:hover { border-color: var(--ink); color: var(--ink); }

/* ============================================================
   SCROLLBARS
   ============================================================ */
.scrollable { overflow-y: auto; }
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 3px; }
.scrollable::-webkit-scrollbar-thumb:hover { background: var(--line-accent); }

/* ============================================================
   AI PANEL
   ============================================================ */
.chat-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.chat-messages {
    flex: 1;
    padding: var(--s-8);
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
}
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--s-8);
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
}
.chat-welcome .hero-lede { margin-bottom: var(--s-9); }
.feat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.feat {
    background: var(--bg);
    padding: var(--s-6);
    transition: all .3s var(--ease);
}
.feat:hover { background: rgba(255,140,66,0.04); }
.feat-num {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: var(--s-3);
}
.feat-title {
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    margin-bottom: var(--s-2);
}
.feat-desc {
    font-size: 12px;
    color: var(--ink-dim);
    line-height: 1.55;
}

.msg {
    display: flex;
    gap: var(--s-4);
    animation: msgIn .35s var(--ease);
}
@keyframes msgIn { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }
.msg-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--line-bright);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-dim);
}
.msg.user .msg-avatar {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}
.msg-body { flex: 1; min-width: 0; }
.msg-who {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: var(--s-2);
}
.msg-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    word-wrap: break-word;
}
.msg.user .msg-text { color: var(--ink-dim); }
.msg-text pre {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: var(--s-4);
    margin: var(--s-3) 0;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
}
.msg-text code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid var(--line);
}
.msg-text strong { color: var(--accent); font-weight: 600; }
.msg-text a { color: var(--accent); text-decoration: underline; }
.msg-img {
    max-width: 320px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-bright);
    margin-top: var(--s-2);
    display: block;
}

.typing { display: flex; gap: 5px; align-items: center; padding: var(--s-2) 0; }
.t-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: tdot 1.4s infinite ease-in-out;
}
.t-dot:nth-child(2){animation-delay:.15s}
.t-dot:nth-child(3){animation-delay:.3s}
@keyframes tdot { 0%,60%,100%{transform:scale(.5);opacity:.3} 30%{transform:scale(1.2);opacity:1} }

/* Composer */
.composer {
    border-top: 1px solid var(--line);
    background: rgba(11,11,10,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--s-5) var(--s-8);
    flex-shrink: 0;
}
.composer-inner {
    max-width: 880px;
    margin: 0 auto;
}
.composer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--s-2);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.composer-box {
    display: flex;
    align-items: flex-end;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--bg-card);
    border: 1px solid var(--line-bright);
    border-radius: var(--r-md);
    transition: all .2s var(--ease);
}
.composer-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.composer-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
}
.composer-textarea::placeholder {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-faint);
}
.composer-actions {
    display: flex;
    gap: var(--s-2);
    align-items: center;
}
.composer-img-preview {
    margin-bottom: var(--s-3);
    display: flex;
    gap: var(--s-2);
    align-items: center;
}
.composer-img-preview img {
    height: 80px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-bright);
}
.btn-send {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-send:hover {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================================
   STREAM (PICTURES) PANEL
   ============================================================ */
.stream-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
}
.stream-overlay {
    padding: var(--s-9) var(--s-8) var(--s-8);
    max-width: 1400px;
    margin: 0 auto;
}
.stream-search-row {
    display: flex;
    gap: var(--s-3);
    margin-bottom: var(--s-8);
    max-width: 500px;
}
.stream-section {
    margin-bottom: var(--s-8);
}
.stream-section-title {
    font-family: var(--serif);
    font-size: 28px;
    font-style: italic;
    margin-bottom: var(--s-2);
}
.stream-section-subtitle {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: var(--s-5);
}
.stream-row {
    display: flex;
    gap: var(--s-4);
    overflow-x: auto;
    padding-bottom: var(--s-4);
    scrollbar-width: thin;
    scrollbar-color: var(--line-bright) transparent;
}
.stream-row::-webkit-scrollbar { height: 6px; }
.stream-row::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 3px; }

.stream-item {
    flex: 0 0 180px;
    cursor: pointer;
    transition: transform .3s var(--ease);
}
.stream-item:hover { transform: translateY(-4px); }
.stream-poster-wrap {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: var(--s-3);
    border: 1px solid var(--line);
    background: var(--bg-card);
}
.stream-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease);
}
.stream-item:hover .stream-poster { transform: scale(1.05); }
.stream-rating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--green);
}
.stream-info { padding: 0 var(--s-1); }
.stream-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    margin-bottom: var(--s-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stream-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
}
.stream-badge {
    padding: 2px 6px;
    border: 1px solid currentColor;
    border-radius: 2px;
    font-weight: 700;
}

/* Stream Player */
.stream-player {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 5;
    display: none;
    flex-direction: column;
}
.stream-player.active { display: flex; }
.stream-player-bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-5);
    background: rgba(0,0,0,0.9);
    border-bottom: 1px solid var(--line);
}
.stream-player iframe {
    flex: 1;
    border: none;
    background: #000;
}

/* ============================================================
   GAMES PANEL
   ============================================================ */
.games-body {
    flex: 1;
    overflow-y: auto;
}
.games-content {
    padding: var(--s-9) var(--s-8) var(--s-8);
    max-width: 1400px;
    margin: 0 auto;
}
.games-controls {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-6);
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
}
.games-controls .input { flex: 1; min-width: 240px; }

.cat-bar {
    display: flex;
    gap: var(--s-2);
    flex-wrap: wrap;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--s-7);
}
.cat-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-dim);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all .2s;
}
.cat-btn:hover {
    border-color: var(--line-accent);
    color: var(--ink);
}
.cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.cat-btn-count {
    margin-left: 6px;
    color: var(--ink-faint);
    font-size: 9px;
}
.cat-btn.active .cat-btn-count { color: rgba(255,255,255,0.7); }

.games-stats {
    display: flex;
    gap: var(--s-6);
    margin-bottom: var(--s-6);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    text-transform: uppercase;
}
.games-stats b {
    color: var(--accent);
    font-weight: 600;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--s-4);
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    transition: all .25s var(--ease);
    position: relative;
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--sh-3);
}
.game-card-img {
    aspect-ratio: 4/3;
    background: var(--bg-soft);
    overflow: hidden;
    position: relative;
}
.game-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
}
.game-card:hover .game-card-img img {
    transform: scale(1.06);
}
.game-card-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all .2s;
    z-index: 5;
    backdrop-filter: blur(4px);
}
.game-card:hover .game-card-fav { opacity: 1; }
.game-card-fav:hover { background: var(--accent); border-color: var(--accent); }
.game-card-fav.is-fav {
    opacity: 1;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.game-card-body {
    padding: var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.game-card-name {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-card-tags {
    display: flex;
    gap: var(--s-1);
    flex-wrap: wrap;
}
.game-tag {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 6px;
    background: var(--bg-soft);
    border-radius: 2px;
    color: var(--ink-dim);
}
.game-tag.action { background: rgba(255,68,68,0.12); color: #ff6b6b; }
.game-tag.racing { background: rgba(91,158,255,0.12); color: var(--blue); }
.game-tag.sports { background: rgba(33,208,122,0.12); color: var(--green); }
.game-tag.shooting { background: rgba(255,68,68,0.12); color: #ff6b6b; }
.game-tag.skill { background: rgba(255,140,66,0.12); color: var(--accent-soft); }
.game-tag.strategy { background: rgba(155,89,182,0.12); color: #c39bd3; }
.game-tag.io { background: rgba(253,121,168,0.12); color: #fd79a8; }
.game-tag.puzzle { background: rgba(162,155,254,0.12); color: #a29bfe; }

.empty-state {
    padding: var(--s-9);
    text-align: center;
    color: var(--ink-faint);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    grid-column: 1 / -1;
}

/* Games player overlay */
.game-player {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 5;
    display: none;
    flex-direction: column;
}
.game-player.active { display: flex; }
.game-player-bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-5);
    background: rgba(0,0,0,0.9);
    border-bottom: 1px solid var(--line);
}
.game-player-title {
    font-family: var(--serif);
    font-size: 18px;
    font-style: italic;
    color: var(--ink);
    flex: 1;
}
.game-player iframe {
    flex: 1;
    border: none;
    background: #fff;
}

/* ============================================================
   PROXY PANEL
   ============================================================ */
.proxy-content {
    padding: var(--s-9) var(--s-8) var(--s-8);
    max-width: var(--container-max);
    margin: 0 auto;
}
.proxy-search-row {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-6);
    margin-bottom: var(--s-5);
}
.proxy-search-row .input { flex: 1; }
.proxy-quick {
    display: flex;
    gap: var(--s-2);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
}
.proxy-quick-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-right: var(--s-2);
}
.proxy-quick-btn {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-dim);
    font-family: var(--sans);
    font-size: 12px;
    transition: all .2s;
}
.proxy-quick-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.proxy-frame-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 5;
    display: none;
    flex-direction: column;
}
.proxy-frame-overlay.active { display: flex; }
.proxy-toolbar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-5);
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
}
.proxy-toolbar .url-display {
    flex: 1;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-dim);
    padding: 8px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.proxy-frame-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.proxy-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.proxy-lock-overlay.hidden {
    display: none;
}

.lock-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.lock-text {
    font-family: 'Instrument Serif', serif;
    font-size: 28px;
    color: #fff;
    margin-bottom: 8px;
}

.lock-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--ink-dim);
}

/* ============================================================
   PLANS PANEL
   ============================================================ */
.plans-content {
    padding: var(--s-9) var(--s-8);
    max-width: var(--container-max);
    margin: 0 auto;
}

.vip-donation-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    margin-bottom: var(--s-6);
}

.vip-header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--line);
}

.vip-icon {
    font-size: 32px;
}

.vip-title {
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    flex: 1;
}

.vip-badge {
    background: var(--accent);
    color: var(--bg);
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.vip-features {
    display: grid;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
}

.vip-feature {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.feature-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.feature-text {
    font-size: 14px;
    color: var(--ink-dim);
}

.redeem-section {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

.redeem-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-dim);
    margin-bottom: var(--s-3);
}

.redeem-bar {
    display: flex;
    gap: var(--s-2);
}
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-5);
    margin-top: var(--s-7);
}
.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-7) var(--s-6);
    display: flex;
    flex-direction: column;
    transition: all .25s var(--ease);
    position: relative;
}
.plan-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-bright);
}
.plan-card.popular {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 12px 40px rgba(255,140,66,0.12);
}
.plan-card.vip {
    border-color: rgba(33,208,122,0.4);
    background: linear-gradient(135deg, rgba(33,208,122,0.05), var(--bg-card));
}
.plan-banner {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 3px;
}
.plan-tier {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: var(--s-2);
}
.plan-name {
    font-family: var(--serif);
    font-size: 36px;
    font-style: italic;
    line-height: 1;
    margin-bottom: var(--s-2);
}
.plan-card.popular .plan-name { color: var(--accent); }
.plan-card.vip .plan-name { color: var(--green); }
.plan-price {
    font-family: var(--sans);
    margin-bottom: var(--s-3);
}
.plan-price b {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}
.plan-price small {
    font-size: 12px;
    color: var(--ink-dim);
    margin-left: 4px;
}
.plan-tagline {
    font-size: 12px;
    color: var(--ink-dim);
    line-height: 1.5;
    margin-bottom: var(--s-5);
}
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-5);
    flex: 1;
}
.plan-features li {
    font-size: 13px;
    color: var(--ink);
    padding: var(--s-2) 0 var(--s-2) 22px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}
.plan-features li.muted { color: var(--ink-faint); }
.plan-features li.muted::before { content: "✕"; color: var(--ink-faint); }

.redeem-bar {
    margin-top: var(--s-7);
    padding: var(--s-5);
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}

/* ============================================================
   NEWS PANEL
   ============================================================ */
.news-content {
    padding: var(--s-9) var(--s-8);
    max-width: var(--container-max);
    margin: 0 auto;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s-4);
    margin-top: var(--s-7);
}
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-5);
    transition: all .25s var(--ease);
}
.news-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--sh-2);
}
.news-card-label {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--s-3);
}
.news-card-url {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    word-break: break-all;
}
.news-card-url:hover { text-decoration: underline; }

/* ============================================================
   SETTINGS PANEL
   ============================================================ */
.settings-content {
    padding: var(--s-9) var(--s-8);
    max-width: 1100px;
    margin: 0 auto;
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--s-5);
    margin-top: var(--s-7);
}
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-6);
}
.settings-card-title {
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    color: var(--ink);
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line);
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-3) 0;
    gap: var(--s-3);
}
.settings-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.settings-row label {
    font-size: 13px;
    color: var(--ink-dim);
}
.settings-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line-bright);
    border-radius: var(--r-sm);
    background: none;
    cursor: pointer;
}
.settings-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
.settings-row select {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink);
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.settings-row .btn { padding: 8px 14px; font-size: 10px; }

.settings-about {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--s-7);
}
.settings-about-h {
    font-family: var(--serif);
    font-size: 36px;
    font-style: italic;
    color: var(--accent);
    margin-bottom: var(--s-2);
}
.settings-about-sub {
    font-size: 13px;
    color: var(--ink-dim);
    margin-bottom: var(--s-2);
}
.settings-links {
    display: flex;
    justify-content: center;
    gap: var(--s-5);
    margin-top: var(--s-5);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
}
.settings-links a {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    transition: color .2s;
}
.settings-links a:hover { color: var(--accent-soft); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--s-7);
    border-top: 1px solid var(--line);
    background: rgba(11,11,10,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
}
.footer-r { display: flex; gap: var(--s-5); align-items: center; }
.footer-r a { color: var(--ink-faint); transition: color .2s; }
.footer-r a:hover { color: var(--accent); }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--s-5);
}
.modal.active { display: flex; }
.modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-card {
    position: relative;
    background: var(--bg-elev);
    border: 1px solid var(--line-bright);
    border-radius: var(--r-md);
    padding: var(--s-7) var(--s-6);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-close {
    position: absolute;
    top: var(--s-3);
    right: var(--s-3);
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--ink-dim);
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    transition: all .2s;
}
.modal-close:hover { background: var(--bg-card); color: var(--ink); }
.modal-h {
    font-family: var(--serif);
    font-size: 28px;
    font-style: italic;
    color: var(--ink);
    margin-bottom: var(--s-5);
}
.modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

/* ============================================================
   INTRO
   ============================================================ */
.intro {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .6s var(--ease), visibility .6s;
}
.intro-content { text-align: center; }
.intro-title {
    font-family: var(--serif);
    font-size: 64px;
    font-style: italic;
    color: var(--accent);
    margin-bottom: var(--s-3);
    opacity: 0;
    transform: translateY(20px);
    animation: introUp .8s forwards .2s var(--ease-spring);
}
.intro-version {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.4em;
    color: var(--ink-dim);
    opacity: 0;
    animation: introFade .8s forwards .6s;
}
.intro-loader {
    margin-top: var(--s-6);
    display: flex;
    gap: var(--s-2);
    justify-content: center;
    opacity: 0;
    animation: introFade .8s forwards .9s;
}
.intro-loader span {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: loadPulse 1.2s infinite;
}
.intro-loader span:nth-child(2) { animation-delay: .2s; }
.intro-loader span:nth-child(3) { animation-delay: .4s; }
@keyframes introUp { to { opacity: 1; transform: translateY(0); } }
@keyframes introFade { to { opacity: 1; } }
@keyframes loadPulse { 0%,100% { opacity: .3; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .feat-grid { grid-template-columns: 1fr 1fr; }
    .feat-grid .feat:first-child { grid-column: 1 / -1; }
    .plans-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: 60px auto 1fr 36px;
        grid-template-areas:
            "topbar"
            "rail"
            "main"
            "footer";
    }
    .rail {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: var(--s-3) var(--s-5);
    }
    .rail-section {
        display: flex;
        gap: var(--s-4);
        padding: 0;
        margin: 0;
    }
    .rail-label, .rail-divider, .rail-stats { display: none; }
    .nav-item { padding: 8px 12px; white-space: nowrap; }
    .nav-item.active::before { display: none; }
    .nav-item.active { color: var(--accent); }
    .hero { padding: var(--s-7) var(--s-5); }
    .panel-head { padding: var(--s-3) var(--s-5); }
    .chat-messages { padding: var(--s-5); }
    .composer { padding: var(--s-3) var(--s-5); }
    .games-content, .stream-overlay, .news-content, .plans-content, .proxy-content, .settings-content {
        padding: var(--s-7) var(--s-5);
    }
}

@media (max-width: 560px) {
    .hero-h1 { font-size: 38px !important; }
    .feat-grid { grid-template-columns: 1fr; }
    .feat-grid .feat:first-child { grid-column: auto; }
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-3); }
    .stream-item { flex: 0 0 130px; }
    .topbar { padding: 0 var(--s-4); }
    .topbar-meta { display: none; }
    .footer { padding: 0 var(--s-4); font-size: 8px; }
    .plans-grid { grid-template-columns: 1fr; }
}
