@font-face {
    font-family: 'Segoe UI Historic';
    src: url('/segoeuithis.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-bg: #f0f2f5;
    --secondary-bg: #ffffff;
    --text-color: #050505;
    --subtle-text: #65676b;
    --border-color: #ced0d4;
    --accent-red: #ff3b30;
    --accent-blue: #007aff;
    --accent-purple: #af52de;
    --accent-green: #34c759;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-color-hover: rgba(0, 0, 0, 0.1);
    --font-heading: 'Segoe UI Historic', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    margin: 0;
    background-color: var(--primary-bg);
    color: var(--text-color);
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light {
    --primary-bg: #f0f2f5;
    --secondary-bg: #ffffff;
    --text-color: #050505;
    --subtle-text: #65676b;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-color-hover: rgba(0, 0, 0, 0.1);
}

body.dark {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --text-color: #e8e8e8;
    --subtle-text: #888888;
    --border-color: #2a2a2a;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-color-hover: rgba(0, 0, 0, 0.15);
}

body.synthwave {
    --primary-bg: #1A1033;
    --secondary-bg: #2A1B4D;
    --text-color: #E6E0FF;
    --subtle-text: #A99CDE;
    --border-color: #4D3D80;
    --accent-red: #FF4D9D;
    --accent-blue: #00E5FF;
    --accent-purple: #D05AFF;
    --accent-green: #2EFF7B;
    --shadow-color: rgba(0, 229, 255, 0.1);
    --shadow-color-hover: rgba(0, 229, 255, 0.15);
}

body.forest {
    --primary-bg: #2E3C30;
    --secondary-bg: #435847;
    --text-color: #E8F5E9;
    --subtle-text: #A5D6A7;
    --border-color: #5C7761;
    --accent-red: #E57373;
    --accent-blue: #64B5F6;
    --accent-purple: #BA68C8;
    --accent-green: #FFB74D;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --shadow-color-hover: rgba(0, 0, 0, 0.2);
}

body.rose {
    --primary-bg: #FFF0F5;
    --secondary-bg: #FFFFFF;
    --text-color: #5C3A47;
    --subtle-text: #B28390;
    --border-color: #FADADD;
    --accent-red: #E53935;
    --accent-blue: #82A9D1;
    --accent-purple: #C0799E;
    --accent-green: #7CB342;
    --shadow-color: rgba(184, 131, 144, 0.1);
    --shadow-color-hover: rgba(184, 131, 144, 0.15);
}

body.amoled {
    --primary-bg: #000000;
    --secondary-bg: #111111;
    --text-color: #F5F5F5;
    --subtle-text: #9E9E9E;
    --border-color: #212121;
    --accent-red: #EF5350;
    --accent-blue: #42A5F5;
    --accent-purple: #AB47BC;
    --accent-green: #66BB6A;
    --shadow-color: rgba(255, 255, 255, 0.05);
    --shadow-color-hover: rgba(255, 255, 255, 0.1);
}

body.liquid-glass {
    background: linear-gradient(135deg, #4f00bc, #1b5a9d);
    background-attachment: fixed;
    --primary-bg: transparent; /* The body background is the real bg */
    --secondary-bg: rgba(255, 255, 255, 0.08);
    --text-color: #f5f5f7;
    --subtle-text: rgba(245, 245, 247, 0.65);
    --border-color: rgba(255, 255, 255, 0.15);
    --accent-red: #ff3b8d;
    --accent-blue: #0ae4ff;
    --accent-purple: #bf5af2;
    --accent-green: #30d158;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-color-hover: rgba(0, 0, 0, 0.2);
}

/* System prefers-color-scheme */
@media (prefers-color-scheme: dark) {
    body:not(.light):not(.synthwave):not(.forest):not(.rose):not(.amoled):not(.liquid-glass) {
        --primary-bg: #121212;
        --secondary-bg: #1e1e1e;
        --text-color: #e8e8e8;
        --subtle-text: #888888;
        --border-color: #2a2a2a;
        --shadow-color: rgba(0, 0, 0, 0.1);
        --shadow-color-hover: rgba(0, 0, 0, 0.15);
    }
}

/* --- Title Screen --- */
#title-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('./title-background.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    z-index: 2000;
    transition: opacity 0.5s ease-out;
    opacity: 1;
    overflow: hidden;
}
#title-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 0;
}
#title-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
.title-screen-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.title-left-panel {
    background: rgba(18, 18, 18, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 0 40px rgba(0,0,0,0.3);
    animation: slideInFromLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

@media (min-width: 600px) {
    .title-left-panel {
        padding: 3rem;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.title-logo {
    width: 100%;
    max-width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.8s ease-out, logoGlow 3s infinite alternate;
}

@keyframes logoGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(255, 59, 48, 0.4));
    }
    to {
        filter: drop-shadow(0 0 15px rgba(255, 59, 48, 0.8));
    }
}

#title-screen h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.8s 0.2s ease-out backwards;
}
.tagline {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    margin: 0 0 2.5rem 0;
    max-width: 400px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.8s 0.4s ease-out backwards;
}
#title-bg-icons {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
}
.bg-icon {
    position: absolute;
    bottom: -100px; /* Start off-screen */
    color: rgba(255, 255, 255, 0.1);
    animation: float-up 20s infinite linear;
    opacity: 0;
    transform: translateX(0);
}

@keyframes float-up {
    0% { transform: translateY(0) translateX(0vw); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(-60vh) translateX(2vw); }
    90% { opacity: 1; }
    100% { transform: translateY(-120vh) translateX(-2vw); opacity: 0; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.version-info {
    display: none;
}

.title-update-info {
    margin-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
}

.title-update-info h3 {
    color: #fff;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.title-update-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.title-update-info li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.title-update-info li i {
    color: var(--accent-blue);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

#start-game-btn {
    width: 100%;
    min-width: 200px;
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.8s 0.6s ease-out backwards, buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    }
}

/* --- Main Game Layout --- */
#game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem 120px 1rem;
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
header {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    margin-bottom: 2rem;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.channel-info h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: var(--font-heading);
    max-width: 180px; /* Limit width */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#channel-description-header {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: var(--subtle-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    line-height: 1.3;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.icon-btn {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--subtle-text);
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.icon-btn:hover {
    background-color: var(--primary-bg);
}
#stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--secondary-bg);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-color);
}
.stat-item i {
    font-size: 1.5rem;
    color: var(--subtle-text);
}
.stat-item i.fa-dollar-sign { color: var(--accent-green); }
.stat-item div { line-height: 1.3; }
.stat-item span {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}
.stat-item p {
    margin: 0;
    color: var(--subtle-text);
    font-size: 0.8rem;
}

/* --- Views & Content --- */
.view {
    padding: 0 1rem;
}
#create-view {
    padding: 0; /* Remove padding for full-width content */
}
.view-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 1rem; /* Add padding here for headers */
}
#create-view > .view-header {
    margin-bottom: 0;
    padding-bottom: 1rem;
    padding-top: 0;
}
.view-header h2 {
    font-size: 1.8rem;
    margin: 0 0 0.25rem 0;
    font-weight: 700;
    font-family: var(--font-heading);
}
.view-header p {
    color: var(--subtle-text);
    margin: 0;
    font-size: 1rem;
}

.view-toggle-buttons {
    display: flex;
    gap: 0.5rem;
    background-color: var(--primary-bg);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    margin-left: 1rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--subtle-text);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn.active {
    background-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 122, 255, 0.3);
}

#post-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 600px) {
    #post-options { grid-template-columns: 1fr 1fr; }
}
.post-btn {
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-align: left;
    color: var(--text-color);
    background-color: var(--secondary-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}
.post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-color-hover);
    border-color: var(--border-color);
}
.post-btn:active {
    transform: scale(0.98) translateY(-1px);
}
.post-btn i { font-size: 1.75rem; margin-bottom: 0.75rem; }
.post-btn h3 { margin: 0 0 0.25rem 0; font-size: 1.2rem; font-weight: 600; font-family: var(--font-heading); }
.post-btn p { margin: 0; font-size: 0.85rem; color: var(--subtle-text); line-height: 1.4; }
.post-btn.video { background: linear-gradient(45deg, #ff3b30, #d42a2a); }
.post-btn.short { background: linear-gradient(45deg, #007aff, #005fcc); }
.post-btn.shoutout { background: linear-gradient(45deg, #af52de, #8e44ad); }
.post-btn.ai-video { background: linear-gradient(45deg, var(--accent-purple), #8e44ad); }
.post-btn.live { background: linear-gradient(45deg, #34c759, #27ae60); }
.post-btn.podcast { background: linear-gradient(45deg, #fd7e14, #e85a19); }
.post-btn.community { background: linear-gradient(45deg, #6c757d, #495057); }

.post-btn-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    flex-shrink: 0;
}
.post-btn.video .post-btn-icon { background-color: var(--accent-red); }
.post-btn.short .post-btn-icon { background-color: var(--accent-blue); }
.post-btn.live .post-btn-icon { background-color: var(--accent-green); }
.post-btn.ai-video .post-btn-icon { background-color: var(--accent-purple); }
.post-btn.shoutout .post-btn-icon { background-color: var(--accent-purple); }
.post-btn.podcast .post-btn-icon { background-color: #fd7e14; }
.post-btn.community .post-btn-icon { background-color: #6c757d; }

.post-btn-text {
    flex-grow: 1;
}

.post-btn h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.post-btn p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--subtle-text);
    line-height: 1.4;
}
.post-btn.large {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
}
.post-btn.large:first-child {
    grid-column: 1 / -1;
}
@media (min-width: 700px) {
    .core-content-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .post-btn.large:first-child {
        grid-column: auto;
    }
}

.post-btn.large .post-btn-icon {
    font-size: 1.75rem;
    width: 56px;
    height: 56px;
    border-radius: 16px;
}
.post-btn.large h3 {
    font-size: 1.25rem;
}
.post-btn.large p {
    font-size: 0.9rem;
}

.post-btn.short h3, .post-btn.live h3 {
    font-size: 1rem;
}
.post-btn.short p, .post-btn.live p {
    font-size: 0.8rem;
}
.post-btn-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--accent-red);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: badge-pulse 1.5s infinite;
}
@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--primary-bg);
    box-shadow: none;
}
.post-btn:disabled:hover {
    transform: none;
    border-color: transparent;
}

/* --- Bottom Nav --- */
#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 1rem 1rem;
    z-index: 1000;
    pointer-events: none;
}
.nav-content {
    position: relative;
    display: block;
    height: 74px; /* Adjusted height for nav buttons */
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    padding: 0;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.nav-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.75rem;
    box-sizing: border-box;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.nav-page.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

#nav-page-2 {
    grid-template-columns: repeat(5, 1fr);
}

body.dark .nav-content, body.synthwave .nav-content, body.forest .nav-content, body.amoled .nav-content, body.liquid-glass .nav-content {
    background-color: rgba(28, 28, 30, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.nav-btn {
    background: none; border: none;
    color: var(--subtle-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    border-radius: 16px;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}
body.dark .nav-btn, body.synthwave .nav-btn, body.forest .nav-btn, body.amoled .nav-btn, body.liquid-glass .nav-btn {
    color: var(--subtle-text);
}
.nav-btn i { font-size: 1.25rem; margin-bottom: 2px; }
.nav-btn.active {
    background-color: var(--accent-blue);
    color: #fff;
}
.nav-btn:not(.active):hover {
    color: var(--text-color);
}
body.dark .nav-btn:not(.active):hover, body.synthwave .nav-btn:not(.active):hover, body.forest .nav-btn:not(.active):hover, body.amoled .nav-btn:not(.active):hover, body.liquid-glass .nav-btn:not(.active):hover {
    color: var(--text-color);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.modal-content {
    background-color: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 550px;
    text-align: center;
    position: relative;
    animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}
body.liquid-glass .modal-content {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}
@keyframes slide-up {
    from { transform: translateY(30px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-content h2 {
    margin-top: 0; margin-bottom: 1.5rem; font-size: 1.5rem;
    font-weight: 600; font-family: var(--font-heading);
}
.modal-content .close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: var(--subtle-text);
    background-color: var(--primary-bg);
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    transition: background-color 0.2s;
}
.modal-content .close-btn:hover { background-color: var(--border-color); }
body.dark .modal-content .close-btn, body.synthwave .modal-content .close-btn, body.forest .modal-content .close-btn, body.amoled .modal-content .close-btn, body.liquid-glass .modal-content .close-btn {
    color: var(--subtle-text);
    background-color: var(--primary-bg);
}
body.dark .modal-content .close-btn:hover, body.synthwave .modal-content .close-btn:hover, body.forest .modal-content .close-btn:hover, body.amoled .modal-content .close-btn:hover, body.liquid-glass .modal-content .close-btn:hover {
    background-color: var(--border-color);
}

/* --- Forms & Buttons --- */
textarea, input[type="text"], select {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: var(--font-body);
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--primary-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; height: 120px; }
textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}
select {
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2365676b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}
body.dark select, body.synthwave select, body.forest select, body.amoled select, body.liquid-glass select {
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23888888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.form-group { text-align: left; margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--subtle-text); font-size: 0.9rem; }
.primary-btn {
    width: 100%; padding: 1rem; font-size: 1.1rem; font-weight: 600; border: none;
    border-radius: 16px; cursor: pointer; background-color: var(--accent-blue);
    color: white; transition: background-color 0.2s, transform 0.1s;
}
.primary-btn:hover { background-color: #006ae6; }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled {
    background-color: var(--border-color);
    color: var(--subtle-text);
    cursor: not-allowed;
}
.secondary-btn {
    width: 100%;
    min-width: 200px;
    position: relative;
    z-index: 1;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--accent-blue);
    border-radius: 16px;
    cursor: pointer;
    background-color: transparent;
    color: white;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 1rem;
}
.secondary-btn:hover {
    background-color: rgba(0, 122, 255, 0.2);
}
.end-stream-btn { background-color: var(--accent-red); margin-top: 1rem; }
.end-stream-btn:hover { background-color: #d13027; }

/* --- Loading & Results Modals --- */
.loader-container { position: relative; width: 76px; height: 76px; margin: 20px auto; }
#loading-progress { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1rem; font-weight: 700; color: var(--subtle-text); }
.loader { border: 8px solid var(--border-color); border-top: 8px solid var(--accent-blue); border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; margin: 0; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.result-modal-content {
    padding: 0;
    max-width: 600px;
    overflow: hidden;
}
#result-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
#result-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
}
#result-modal-body {
    padding: 1rem 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}
#result-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
#result-modal-footer .primary-btn {
    width: 100%;
}

.video-player-mockup {
    position: relative; background: #000; color: #fff; border-radius: 16px; margin-bottom: 1.5rem;
    cursor: pointer; border: 1px solid var(--border-color); overflow: hidden; aspect-ratio: 9 / 12;
    display: flex; align-items: center; justify-content: center;
}
.video-player-mockup img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.video-player-overlay { position: relative; z-index: 2; background-color: rgba(0,0,0,0.5); width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; }
.video-player-icon { font-size: 2.5rem; margin-bottom: 0.5rem; color: rgba(255, 255, 255, 0.8); transition: transform 0.2s, color 0.2s; }
.video-player-mockup:hover .video-player-icon { color: #fff; transform: scale(1.1); }
#video-script-display {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 5rem; /* Space for status/icon */
    padding: 0.5rem;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}
.result-main-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (min-width: 600px) {
    .result-main-info {
        grid-template-columns: 1fr 1fr;
    }
}
.new-subs, #earnings-container {
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background-color: var(--primary-bg);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.new-subs h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}
.new-subs h3 .fa-arrow-up { color: var(--accent-green); }
.new-subs h3 .fa-arrow-down { color: var(--accent-red); }
.new-subs h3 p {
    font-size: 0.8rem;
    color: var(--subtle-text);
    margin: 0.25rem 0 0 0;
    font-weight: 400;
}
#earnings-text {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
    font-family: var(--font-heading);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.video-stats { display: flex; justify-content: center; gap: 1rem; font-size: 1rem; margin-bottom: 1.5rem; background: var(--secondary-bg); padding: 1rem; border-radius: 16px; border: 1px solid var(--border-color); flex-wrap: wrap; }
.video-stats span { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.new-subs { margin-bottom: 1.5rem; font-size: 1.2rem; font-weight: 500; }
.new-subs h3.gained { color: var(--accent-green); }
.new-subs h3.lost { color: var(--accent-red); }
#earnings-container { margin-bottom: 1.5rem; padding: 0.75rem; background-color: rgba(52, 199, 89, 0.15); border: 1px solid rgba(52, 199, 89, 0.3); border-radius: 12px; }
#earnings-text { color: #34c759; font-weight: 600; font-size: 1.1rem; margin: 0; font-family: var(--font-heading); }

/* Comments */
#result-comments h3, #past-video-details-comments-container h3 { margin: 0 0 0.75rem 0; font-weight: 600; font-family: var(--font-heading); text-align: left;}
#comments-list, #past-video-details-comments-list { max-height: 250px; overflow-y: auto; text-align: left; background: var(--primary-bg); padding: 0.5rem; border-radius: 12px; margin-bottom: 1.5rem; border: 1px solid var(--border-color); flex-shrink: 1; }
.comment, .pinned-comment { padding: 0.75rem; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 4px; }
.comment:last-child { border-bottom: none; }
.comment p { margin: 0; font-size: 0.95rem; color: var(--text-color); line-height: 1.5; }
.user-line { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment .user { font-weight: 600; margin-bottom: 0; font-size: 0.9rem; }
.comment-user-badge { font-size: 0.65rem; font-weight: 600; padding: 3px 8px; border-radius: 12px; line-height: 1; text-transform: uppercase; }
.comment-user-badge.new { background-color: var(--accent-blue); color: white; }
.comment-user-badge.recurring { background-color: var(--primary-bg); color: var(--subtle-text); border: 1px solid var(--border-color); }
.comment-body { display: flex; justify-content: space-between; align-items: flex-start; }
.comment-actions { display: flex; gap: 12px; flex-shrink: 0; margin-left: 10px; }
.comment-actions button { background: none; border: none; cursor: pointer; color: var(--subtle-text); font-size: 1rem; padding: 0; transition: color 0.2s; }
.comment-actions button:hover { color: var(--text-color); }
.comment-actions button.hearted i { color: var(--accent-red); }
#pinned-comment-container { margin-bottom: 1rem; text-align: left; }
.pinned-comment { background-color: rgba(0, 122, 255, 0.08); border: 1px solid rgba(0, 122, 255, 0.2); border-radius: 12px; }
.pinned-label { font-size: 0.8rem; font-weight: 600; color: var(--subtle-text); display: flex; align-items: center; gap: 5px; }

/* --- Analytics View --- */
#past-videos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
}
#past-videos-list > p { color: var(--subtle-text); }
.past-video-item {
    background-color: var(--secondary-bg);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.past-video-item:hover {
    transform: translateY(-2px);
    background-color: var(--primary-bg);
    box-shadow: 0 4px 10px var(--shadow-color-hover);
}
.past-video-content { display: flex; align-items: center; gap: 1rem; }
.past-video-thumbnail { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background-color: var(--primary-bg); }
.past-video-info { flex-grow: 1; min-width: 0; }
.past-video-info h4 { margin: 0 0 0.5rem 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-family: var(--font-heading); }
.past-video-stats { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--subtle-text); flex-wrap: wrap; }
.past-video-stats span { display: flex; align-items: center; gap: 5px; }
.past-video-subs.gained { color: var(--accent-green); font-weight: 600; }
.past-video-subs.lost { color: var(--accent-red); font-weight: 600; }
.saga-tag { display: inline-block; background-color: rgba(0, 122, 255, 0.15); color: var(--accent-blue); padding: 3px 8px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-right: 6px; vertical-align: middle; }

/* --- Feed View (TikTok Mode) --- */
#feed-view-container {
    height: calc(100vh - 280px); /* Adjust based on header and nav height */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    border-radius: 16px;
    background-color: #000;
    position: relative;
}
@media (max-height: 700px) {
    #feed-view-container {
        height: 50vh;
    }
}

.feed-item {
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    cursor: pointer;
}

.feed-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.5) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem 5rem 1.5rem 1.5rem; /* Space on right for actions */
    box-sizing: border-box;
}

.feed-item-info {
    text-align: left;
}

.feed-item-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    line-height: 1.4;
}

.feed-item-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.feed-item-creator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feed-item-creator img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    background-color: var(--primary-bg);
}

.feed-item-creator span {
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.feed-item-actions {
    position: absolute;
    right: 1rem;
    bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.feed-action-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    transition: transform 0.2s;
}

.feed-action-btn:active {
    transform: scale(1.1);
}

.feed-action-btn i {
    font-size: 1.8rem;
}

/* --- Channel View --- */
.settings-card { background-color: var(--secondary-bg); border-radius: 16px; padding: 1.5rem; border: 1px solid var(--border-color); }
.profile-picture-group { text-align: center; }
.profile-picture-container { position: relative; width: 120px; height: 120px; margin: 0.5rem auto 1rem auto; }
#channel-profile-picture { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--border-color); background-color: var(--primary-bg); }
.profile-picture-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.data-actions { display: flex; justify-content: flex-start; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.action-btn { background-color: var(--secondary-bg); border: 1px solid var(--border-color); color: var(--text-color); padding: 0.75rem 1.25rem; border-radius: 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 8px; }
.action-btn:hover { background-color: var(--primary-bg); }
.action-btn:disabled {
    background-color: var(--border-color);
    color: var(--subtle-text);
    cursor: not-allowed;
}
.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--subtle-text);
    transition: all 0.3s ease;
}
.sync-status.syncing { color: var(--accent-blue); }
.sync-status.syncing i { animation: spin 1.5s linear infinite; }
.sync-status.synced { color: var(--accent-green); }
.sync-status.error { color: var(--accent-red); }
.sync-status i {
    transition: color 0.3s ease;
    animation: none;
}
#profile-picture-prompt-input { height: 100px; }

/* --- Settings View --- */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}
.theme-option {
    padding: 1rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background-color: var(--primary-bg);
    text-transform: capitalize;
}
.theme-option.active {
    border-color: var(--accent-blue);
    background-color: var(--accent-blue);
    color: white;
}
.theme-option:not(.active):hover {
    background-color: var(--secondary-bg);
    border-color: var(--subtle-text);
}
.year-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}
#year-slider {
    flex-grow: 1;
    margin: 0;
}
#year-display {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
    background-color: var(--primary-bg);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    min-width: 60px;
    text-align: center;
}
.danger-btn {
    background-color: #e53935;
    border: none;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.danger-btn:hover {
    background-color: #c62828;
}

.sandbox-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.sandbox-actions .danger-btn {
    grid-column: 1 / -1;
}

/* --- AI Assistance View --- */
#ai-chat-container { display: flex; flex-direction: column; height: 65vh; max-height: 500px; background-color: var(--secondary-bg); border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; }
body.liquid-glass #ai-chat-container {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}
#ai-chat-messages { flex-grow: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.ai-chat-message { display: flex; gap: 10px; max-width: 85%; }
.ai-chat-user { align-self: flex-end; flex-direction: row-reverse; }
.ai-chat-avatar { width: 36px; height: 36px; border-radius: 50%; background-color: var(--primary-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--subtle-text); }
.ai-chat-user .ai-chat-avatar { background-color: var(--accent-blue); color: white; border: none; }
.ai-chat-bubble { padding: 0.75rem 1rem; border-radius: 18px; line-height: 1.5; font-size: 0.95rem; }
.ai-chat-assistant .ai-chat-bubble { background-color: var(--primary-bg); border-top-left-radius: 4px; }
.ai-chat-user .ai-chat-bubble { background-color: var(--accent-blue); color: white; border-top-right-radius: 4px; }
#ai-chat-input-area { display: flex; padding: 0.75rem; border-top: 1px solid var(--border-color); gap: 0.5rem; }
#ai-chat-input { flex-grow: 1; border: none; background: var(--primary-bg); padding: 0.75rem 1rem; border-radius: 18px; font-size: 0.9rem; color: var(--text-color); }
#ai-chat-send-btn { background: var(--accent-blue); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; flex-shrink: 0; cursor: pointer; transition: background-color 0.2s; }
#ai-chat-send-btn:hover { background-color: #006ae6; }
.typing-dots { display: flex; gap: 4px; align-items: center; height: 100%; padding: 4px 0; }
.typing-dots span { width: 8px; height: 8px; border-radius: 50%; background-color: var(--subtle-text); animation: typing-bounce 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: -1.0s; }
.typing-dots span:nth-child(3) { animation-delay: -0.8s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* --- Upgrades View --- */
#upgrades-list, #merch-list { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 600px) { #upgrades-list, #merch-list { grid-template-columns: 1fr 1fr; } }
.upgrade-card { background-color: var(--secondary-bg); border-radius: 16px; padding: 1.25rem; border: 1px solid var(--border-color); display: flex; flex-direction: column; text-align: left; gap: 0.5rem; }
body.liquid-glass .upgrade-card {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}
.upgrade-header { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; }
.upgrade-header i { color: var(--accent-blue); font-size: 1.5rem; }
.upgrade-card h3 { margin: 0; font-size: 1.1rem; font-weight: 600; font-family: var(--font-heading); }
.upgrade-card p { margin: 0 0 0.75rem 0; color: var(--subtle-text); flex-grow: 1; font-size: 0.9rem; }
.upgrade-info { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.upgrade-cost { font-size: 1.1rem; font-weight: 700; color: var(--accent-green); }
.upgrade-owned { font-size: 0.9rem; font-weight: 700; color: var(--accent-blue); }
.upgrade-card .primary-btn { padding: 0.75rem 1rem; font-size: 0.9rem; width: auto; min-width: 120px; }

/* --- Studio & Opportunities Tabs --- */
.studio-tabs { 
    display: flex; 
    justify-content: center; 
    gap: 0.5rem; 
    margin-bottom: 1.5rem; 
    background-color: var(--primary-bg); 
    padding: 0.5rem; 
    border-radius: 12px; 
}
.studio-tab-btn, .opportunities-tab-btn { 
    background: transparent; 
    border: none; 
    padding: 0.5rem 1rem; 
    border-radius: 8px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: var(--subtle-text); 
    cursor: pointer; 
    transition: all 0.2s; 
    flex-grow: 1;
    white-space: nowrap;
}
.studio-tab-btn.active, .opportunities-tab-btn.active { 
    background-color: var(--accent-blue); 
    color: #fff; 
}
.studio-tab-content, .opportunities-tab-content { display: none; }
.studio-tab-content.active, .opportunities-tab-content.active { display: block; animation: fade-in 0.3s ease-out; }

/* --- Opportunities View --- */
#trends-list, #sponsors-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
#trends-list > p, #sponsors-list > p { color: var(--subtle-text); text-align: center; padding: 2rem 0; }
.trend-item {
    background-color: var(--secondary-bg);
    border-radius: 16px;
    padding: 1.25rem;
    border-left: 5px solid var(--accent-purple);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.trend-item h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.trend-item p { margin: 0; color: var(--subtle-text); font-size: 0.9rem; }
.trend-info { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.trend-bonus { font-weight: 700; color: var(--accent-green); font-size: 1.1rem; }
.trend-lifespan { font-size: 0.8rem; color: var(--subtle-text); }
.sponsor-card {
    background-color: var(--secondary-bg);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    text-align: left;
}
.sponsor-card h3 { margin: 0 0 0.5rem 0; font-family: var(--font-heading); }
.sponsor-card p { margin: 0 0 1rem 0; color: var(--subtle-text); font-size: 0.9rem; }
.sponsor-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.sponsor-payout { font-size: 1.1rem; font-weight: 700; color: var(--accent-green); }

/* --- Leaderboard View (replaces old modal styles) --- */
#leaderboard-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 65vh;
}
.leaderboard-tabs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; background-color: var(--primary-bg); padding: 0.5rem; border-radius: 12px; }
.leaderboard-tab-btn { background: transparent; border: none; padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; color: var(--subtle-text); cursor: pointer; transition: all 0.2s; flex-grow: 1; }
.leaderboard-tab-btn.active { background-color: var(--accent-blue); color: #fff; }
#leaderboard-list-container {
    background-color: var(--secondary-bg);
    border-radius: 16px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    max-height: 65vh;
    display: flex;
    flex-direction: column;
}
.leaderboard-header {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 1rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--subtle-text);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.leaderboard-header .subs-col {
    text-align: right;
}
#leaderboard-list {
    overflow-y: auto;
    padding-right: 8px;
    flex-grow: 1;
}
.leaderboard-item { 
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center; 
    gap: 1rem; 
    padding: 0.75rem 1rem; 
    border-radius: 12px; 
    margin-top: 0.5rem;
}
.leaderboard-item:first-child {
    margin-top: 0;
}
.leaderboard-item.current-user { 
    background-color: rgba(0, 122, 255, 0.1); 
    border: 1px solid rgba(0, 122, 255, 0.3); 
}
.leaderboard-rank { font-size: 1.2rem; font-weight: 700; color: var(--subtle-text); width: 30px; text-align: center; }
.leaderboard-rank .fa-trophy { font-size: 1.5rem; }
.leaderboard-rank .rank-1 { color: #FFD700; } .leaderboard-rank .rank-2 { color: #C0C0C0; } .leaderboard-rank .rank-3 { color: #CD7F32; }

.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.leaderboard-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background-color: var(--primary-bg); flex-shrink: 0; }
.leaderboard-info { flex-grow: 1; min-width: 0; }
.leaderboard-info p { margin: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-channel { font-weight: 600; font-size: 1rem; }
.leaderboard-user { font-size: 0.85rem; color: var(--subtle-text); }
.leaderboard-stat { 
    font-size: 1rem; 
    font-weight: 600;
    justify-self: flex-end;
}

/* --- Tutorial Modal --- */
#tutorial-modal {
    z-index: 1900;
}
#tutorial-highlight-box {
    position: absolute;
    border: 3px solid var(--accent-blue);
    border-radius: 16px;
    box-shadow: 0 0 20px 5px rgba(0, 122, 255, 0.7);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1901;
    background-color: rgba(0, 122, 255, 0.1);
}
#tutorial-content-box {
    position: absolute;
    z-index: 1902;
    max-width: 350px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}
#tutorial-nav .primary-btn, #tutorial-nav .action-btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}
#tutorial-step-indicator {
    font-weight: 600;
    color: var(--subtle-text);
}

/* --- Title Choice Modal --- */
.title-option-card {
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
    text-align: left;
    transition: background-color 0.2s;
}
.title-option-card:hover {
    background-color: var(--secondary-bg);
}
.title-option-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--subtle-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.title-option-card p {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 40px;
    line-height: 1.4;
    color: var(--text-color);
}
.title-option-card .action-btn,
.title-option-card .primary-btn {
    width: 100%;
}

/* --- Thumbnail Choice Modal --- */
.thumbnail-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
}

.thumbnail-option-btn {
    padding: 1.25rem;
    flex-direction: column;
    height: auto;
    text-align: left;
    align-items: flex-start;
}

.thumbnail-option-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-blue);
}

.thumbnail-option-btn span {
    font-size: 1.1rem;
    font-weight: 700;
}

.thumbnail-option-btn p {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--subtle-text);
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
    white-space: normal;
}

/* --- Live Stream Modal --- */
.live-modal-content { max-width: 90vw; width: 100%; max-width: 1000px; padding: 1.5rem; }
.live-stream-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .live-stream-layout { grid-template-columns: 2fr 1fr; } }
.live-stream-info { display: flex; flex-direction: column; }
#live-stream-header { font-size: 1rem; font-weight: 700; color: var(--accent-red); margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.live-indicator { animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
#live-thumbnail { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px; margin-bottom: 1rem; border: 1px solid var(--border-color); }
#live-title { margin: 0 0 1rem 0; font-size: 1.4rem; text-align: left; font-weight: 600; font-family: var(--font-heading); }
#live-stats-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.live-stat { background: var(--primary-bg); padding: 0.75rem; border-radius: 12px; font-size: 0.9rem; font-weight: 500; border: 1px solid var(--border-color); }
.live-stat i { color: var(--subtle-text); margin-right: 5px; }
.live-chat-container { display: flex; flex-direction: column; background: var(--primary-bg); border-radius: 16px; min-height: 400px; max-height: 70vh; border: 1px solid var(--border-color); }
body.liquid-glass .live-chat-container {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}
.live-chat-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); text-align: left; }
.live-chat-header h3 { margin: 0; font-size: 1rem; font-family: var(--font-heading); }
#live-chat-messages { flex-grow: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-message { text-align: left; max-width: 90%; }
.chat-message .chat-user { font-size: 0.8rem; font-weight: 600; color: var(--subtle-text); margin-bottom: 0.25rem; display: block; }
.chat-message .chat-text { background: var(--secondary-bg); padding: 0.5rem 0.85rem; border-radius: 16px; margin: 0; font-size: 0.9rem; word-wrap: break-word; line-height: 1.4; border: 1px solid var(--border-color); }
.chat-message.creator { align-self: flex-end; }
.chat-message.creator .chat-text { background-color: var(--accent-blue); color: white; border-color: transparent; }
.chat-message.creator .chat-user { color: var(--accent-blue); }
.live-chat-input-area { display: flex; padding: 0.75rem; border-top: 1px solid var(--border-color); gap: 0.5rem; background-color: var(--primary-bg); }
#live-chat-reply-input { flex-grow: 1; border: 1px solid var(--border-color); background: var(--secondary-bg); padding: 0.75rem 1rem; border-radius: 18px; font-size: 0.9rem; color: var(--text-color); }
#live-chat-send-btn { background: var(--accent-blue); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; flex-shrink: 0; cursor: pointer; }

/* Confetti */
#confetti-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }

/* --- Additional styles for liquid-glass theme --- */
body.liquid-glass .stat-item,
body.liquid-glass .settings-card,
body.liquid-glass #ai-chat-container,
body.liquid-glass .upgrade-card,
body.liquid-glass .leaderboard-item,
body.liquid-glass .live-chat-container {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

body.liquid-glass #game-container {
    background-color: rgba(0,0,0,0.1);
    border-radius: 16px;
    padding: 1rem;
}

/* --- Time Travel Era Styles --- */

/* Era: 2005-2009 (Classic) */
body.era-2005-2009 {
    --font-heading: 'Arial', 'Helvetica', sans-serif;
    --font-body: 'Arial', 'Helvetica', sans-serif;
    --primary-bg: #e5e5e5;
    --secondary-bg: #ffffff;
    --border-color: #cccccc;
    --text-color: #000000;
    --subtle-text: #555555;
    --accent-blue: #003399;
}
body.era-2005-2009 #game-container {
    background-color: #f7f7f7;
    border: 1px solid #cccccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
body.era-2005-2009 .stat-item,
body.era-2005-2009 .post-btn,
body.era-2005-2009 .nav-content,
body.era-2005-2009 .modal-content,
body.era-2005-2009 .settings-card,
body.era-2005-2009 .upgrade-card,
body.era-2005-2009 .past-video-item,
body.era-2005-2009 input,
body.era-2005-2009 textarea,
body.era-2005-2009 select,
body.era-2005-2009 .primary-btn,
body.era-2005-2009 .action-btn {
    border-radius: 4px;
}
body.era-2005-2009 .post-btn {
    background: var(--accent-blue) !important;
}
body.era-2005-2009 .nav-btn.active {
    background-color: var(--accent-blue);
    border: 1px solid #001a4d;
}
body.era-2005-2009 #bottom-nav {
    padding: 0.5rem;
}
body.era-2005-2009 .nav-content {
    background-color: #f0f0f0;
    border-radius: 0;
    border-top: 2px solid #ccc;
    box-shadow: none;
    height: 60px;
}

/* Era: 2010-2012 (Cosmic Panda) */
body.era-2010-2012 {
    --primary-bg: #222222;
    --secondary-bg: #333333;
    --text-color: #e0e0e0;
    --subtle-text: #999999;
    --border-color: #444444;
    --accent-blue: #cc3333;
}
body.era-2010-2012 #game-container {
    max-width: 960px;
}
body.era-2010-2012 header {
    background-color: var(--secondary-bg);
    padding: 1rem;
    margin: -1rem -1rem 2rem -1rem;
    border-bottom: 1px solid var(--border-color);
}
body.era-2010-2012 .stat-item {
    background-color: #444;
}
body.era-2010-2012 .post-btn {
    border-radius: 8px;
    background: linear-gradient(45deg, #444, #555) !important;
}
body.era-2010-2012 .post-btn:hover {
     background: linear-gradient(45deg, #555, #666) !important;
}
body.era-2010-2012 .primary-btn {
    background-color: var(--accent-blue);
}
body.era-2010-2012 .nav-btn.active {
    color: var(--accent-blue);
    background-color: transparent;
}
body.era-2010-2012 .nav-content {
    background: #fafafa;
    border-radius: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}
body.era-2010-2012 .nav-btn.active span {
    color: var(--accent-blue);
    border-bottom: 3px solid var(--accent-blue);
    padding-bottom: 4px;
}
body.era-2010-2012 .nav-btn.active i {
    color: var(--accent-blue);
}
body.era-2010-2012 .nav-btn.active {
    background: transparent;
}

/* Era: 2013-2016 (Google+ Era) */
body.era-2013-2016 {
    --primary-bg: #f1f1f1;
    --secondary-bg: #ffffff;
    --text-color: #333333;
    --subtle-text: #767676;
    --border-color: #e8e8e8;
    --accent-blue: #d93025;
    --font-heading: 'Roboto', 'Inter', sans-serif;
    --font-body: 'Roboto', 'Inter', sans-serif;
}
body.era-2013-2016 #stats {
    grid-template-columns: 1fr;
}
body.era-2013-2016 .stat-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    box-shadow: none;
    border: 1px solid var(--border-color);
}
body.era-2013-2016 .stat-item div {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}
body.era-2013-2016 .stat-item p {
    font-size: 1rem;
}
body.era-2013-2016 .stat-item i { display: none; }
body.era-2013-2016 .post-btn {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    background: var(--secondary-bg) !important;
}
body.era-2013-2016 .post-btn p { opacity: 1; color: var(--subtle-text); }
body.era-2013-2016 .nav-content {
    background: #fafafa;
    border-radius: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}
body.era-2013-2016 .nav-btn.active span {
    color: var(--accent-blue);
    border-bottom: 3px solid var(--accent-blue);
    padding-bottom: 4px;
}
body.era-2013-2016 .nav-btn.active i {
    color: var(--accent-blue);
}
body.era-2013-2016 .nav-btn.active {
    background: transparent;
}