/* ==========================================================================
   Crashing Moon — Hub Stylesheet (hub.css)
   Based on DESIGN.md (Esports Cockpit & Command Center)
   Powered by ui.css tokens
   ========================================================================== */

@import url('ui.css');

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient Background Grid Motif */
.bg-motif {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-motif-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at center, var(--line) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, black 20%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, black 20%, transparent 85%);
    opacity: 0.4;
}

.bg-motif-glow-1 {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 480px;
    background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.08) 0%, rgba(20, 24, 34, 0.4) 60%, transparent 75%);
    filter: blur(90px);
    opacity: 0.85;
}

.bg-motif-glow-2 {
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 550px;
    height: 450px;
    background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
    filter: blur(100px);
    opacity: 0.6;
}

.wrapper {
    position: relative;
    z-index: 1;
    max-width: 1540px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 48px);
}

/* ==========================================================================
   TOP NAVIGATION
   ========================================================================== */
nav, .game-select-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    margin: 14px auto 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
}

.game-select-nav {
    max-width: 1540px;
    width: calc(100% - clamp(32px, 6vw, 96px));
}

.game-select-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.brand, .game-select-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.brand:hover, .game-select-brand:hover {
    opacity: 0.88;
}

.brand-dot, .game-select-brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}

.brand-text {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.05em;
    color: var(--text);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-nav-ghost, .game-select-home-link, .theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 14px;
    min-height: 32px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text-2);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.btn-nav-ghost:hover, .game-select-home-link:hover, .theme-toggle-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--line-strong);
}

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

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    line-height: 1;
}

.theme-toggle-icon svg {
    display: block;
    width: 15px;
    height: 15px;
}

.theme-toggle-label {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

/* ==========================================================================
   GAME SELECTION VIEW (Step 1)
   ========================================================================== */
#gameSelectView, #roomSelectView {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.game-select-content, .room-select-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 80px;
    text-align: center;
}

.game-select-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius);
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.game-select-title {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.5vw, 52px);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 10px 0;
    line-height: 1.1;
}

.game-select-subtitle {
    font-size: 15px;
    color: var(--text-2);
    max-width: 580px;
    margin: 0 auto 36px auto;
    line-height: 1.6;
}

.game-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 820px;
}

.game-choice-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.game-choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

.game-choice-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(var(--accent-rgb), 0.25);
    background: var(--surface-2);
}

.game-choice-card:hover::before {
    background: var(--accent);
}

.game-choice-card:active {
    transform: translateY(-1px) scale(0.99);
}

.game-choice-card-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.game-choice-card-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 10px 0;
}

.game-choice-card-desc {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.55;
    margin: 0;
}

/* ==========================================================================
   RESUME ACTIVE SESSION BANNER
   ========================================================================== */
#resumeSessionContainer {
    width: 100%;
    max-width: 820px;
    margin-bottom: 24px;
}

.resume-session-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.02) 60%), var(--surface);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.resume-session-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0.85;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.resume-session-banner:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-rgb), 0.04) 60%), var(--surface-2);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(var(--accent-rgb), 0.3);
}

.resume-session-banner:hover::before {
    opacity: 1;
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}

.resume-session-banner:active {
    transform: translateY(0);
}

.resume-session-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.resume-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 9px;
    border-radius: var(--radius);
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resume-session-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(92, 201, 138, 0.8);
    animation: resume-pulse 2s infinite ease-in-out;
}

@keyframes resume-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.resume-session-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.resume-session-sub {
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-2);
    margin: 0;
    line-height: 1.45;
}

.resume-session-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    min-height: 40px;
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.25);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.resume-session-btn svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.resume-session-banner:hover .resume-session-btn {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.45);
    transform: translateX(2px);
}

.resume-session-banner:hover .resume-session-btn svg {
    transform: translateX(3px);
}

/* Backwards compatibility aliases */
.resume-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    text-align: left;
}

.resume-card-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.resume-card-desc {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 2px;
}

.resume-card-btn {
    padding: 7px 18px;
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.resume-card-btn:hover {
    opacity: 0.9;
}

/* ==========================================================================
   ROOM SELECTION VIEW (Step 2)
   ========================================================================== */
.room-top-action-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    width: 100%;
}

.room-manage-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.room-manage-trigger-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface-3);
}

.room-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 960px;
}

.room-choice-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.room-choice-card:hover {
    background: var(--surface-2);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.room-choice-card.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}

.room-choice-card.active::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.room-choice-card-name {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.room-choice-card-badge {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

/* ==========================================================================
   MAIN HUB SCREEN (Step 3: Cards & Tools)
   ========================================================================== */
#hubContentScreen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 84px; /* clearance for footer */
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0 20px 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.tab-button {
    padding: 9px 20px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-2);
    font-family: var(--font-display);
    font-size: 17px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-button:hover {
    color: var(--text);
    background: var(--surface-2);
}

.tab-button.active {
    color: var(--accent-ink);
    background: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.35);
}

.tab-content {
    width: 100%;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: grid;
}

/* Grid Container */
.grid-container {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    width: 100%;
}

/* Tool Cards */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.tool-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.tool-card.preview-open {
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(var(--accent-rgb), 0.25);
}

/* Preview Drawer */
.preview-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: #000;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.preview-drawer.open {
    max-height: 220px;
}

.screenshot {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.preview-zoom-btn:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

.tool-card .info {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 14px;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-title-row h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.preview-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all 0.15s;
}

.preview-hint:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.button-group {
    display: flex;
    gap: 8px;
}

.open-button {
    flex: 1.2;
    padding: 8px 12px;
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.open-button:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.35);
}

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

.copy-button {
    flex: 1;
    padding: 8px 10px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.copy-button:hover {
    background: var(--surface-3);
    border-color: var(--text-2);
}

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

/* ==========================================================================
   STUDIO FOOTER / TELEMETRY TOOLBAR
   ========================================================================== */
.hub-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(11, 12, 15, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 10px 0;
}

[data-theme-mode="light"] .hub-footer {
    background: rgba(244, 244, 245, 0.92);
}

.hub-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-brand-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand-text {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.studio-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.unified-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.pill-dot-blue {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.pill-label {
    color: var(--muted);
    font-weight: 700;
    font-size: 11px;
}

.toolbar-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.pill-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding-right: 14px;
    cursor: pointer;
    outline: none;
}

.toolbar-select-arrow {
    position: absolute;
    right: 0;
    font-size: 8px;
    color: var(--muted);
    pointer-events: none;
}

.pill-host-val {
    color: var(--text);
    font-weight: 600;
}

.btn-pill-action {
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-pill-action:hover {
    background: var(--surface-3);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-toolbar-danger {
    background: rgba(var(--danger-rgb), 0.15);
    border: 1px solid rgba(var(--danger-rgb), 0.35);
    color: var(--danger);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-toolbar-danger:hover {
    background: var(--danger);
    color: #fff;
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--line);
}

.footer-actions {
    display: flex;
    align-items: center;
}

.footer-link {
    color: var(--muted);
    font-size: 12.5px;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-link:hover {
    color: var(--text);
}

/* ==========================================================================
   MODALS & LIGHTBOX (Cockpit Elevation)
   ========================================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-box {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.lightbox-title {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
}

.lightbox-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s;
}

.lightbox-close:hover {
    color: var(--text);
}

.lightbox-img-wrapper {
    background: #000;
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

.lightbox-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
}

/* Modal Session Manager Internal Elements */
.modal-create-section {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.modal-create-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.modal-create-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
}

.modal-create-input:focus {
    border-color: var(--accent);
}

.room-create-theme-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    position: relative;
}

.room-create-theme-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.room-create-theme-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    padding-right: 14px;
    outline: none;
}

.room-create-theme-arrow {
    position: absolute;
    right: 8px;
    font-size: 8px;
    color: var(--muted);
    pointer-events: none;
}

.btn-session-switch {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-session-switch:hover {
    opacity: 0.9;
}

.session-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    transition: background 0.15s;
}

.session-item:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
}

.session-item-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.session-item-actions {
    display: flex;
    gap: 6px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 74px;
    right: 24px;
    background: var(--surface-2);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: toastIn 0.2s ease forwards;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .resume-session-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 20px;
        gap: 16px;
    }
    .resume-session-btn {
        width: 100%;
        justify-content: center;
    }
    .game-cards-grid {
        grid-template-columns: 1fr;
    }
    .grid-container {
        grid-template-columns: 1fr;
    }
    .hub-footer-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .studio-toolbar {
        justify-content: center;
    }
}

/* ==========================================================================
   ROOM CARDS (Dynamic JS Generated)
   ========================================================================== */
.room-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1140px;
    margin: 0 auto;
    text-align: left;
    width: 100%;
}

.room-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-height: 165px;
    cursor: pointer;
    position: relative;
}

.room-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.room-card.is-active {
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.3);
}

.room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.room-card-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
}

.room-card-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
    word-break: break-all;
    text-transform: uppercase;
}

.room-preset-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 11.5px;
    margin-bottom: 12px;
    width: fit-content;
}

.room-preset-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
    flex-shrink: 0;
}

.room-preset-pill-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.room-preset-pill-val {
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-mono);
}

.room-card-desc {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    margin-bottom: 0;
}
