:root {
    /* --- CORE PALETTE (Signal Bars) --- */
    --color-cyan: #5fffff;
    --color-green: #05ff74;
    --color-yellow: #ffea00;
    --color-red: #ff0000;
    --color-blue: #2a88ff;
    
    /* --- CUSTOM THEME COLORS --- */
    --color-dark: #130918;
    --color-offwhite: #ece2d0;
    --color-primary: #f1aa1c;
    
    /* --- THEME VARIABLES (Forced Dark Mode) --- */
    --theme-bg: var(--color-dark);
    --theme-text: var(--color-offwhite);
    --theme-bg-glass: rgba(19, 9, 24, 0.6);
    --theme-border-glass: rgba(236, 226, 208, 0.1);
    --theme-card-bg: rgba(19, 9, 24, 0.4);
    --theme-input-bg: var(--color-dark);
    --theme-tag-bg: rgba(19, 9, 24, 0.6);
    --theme-primary: var(--color-primary);

    /* Full Vibrancy Signal Colors */
    --theme-cyan: var(--color-cyan);
    --theme-green: var(--color-green);
    --theme-yellow: var(--color-yellow);
    --theme-red: var(--color-red);
    
    /* Text Contrast Layers */
    --theme-text-high: var(--color-offwhite);
    --theme-text-med: rgba(236, 226, 208, 0.8);
    --theme-text-low: rgba(236, 226, 208, 0.6);

    /* SPACING */
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    background-color: var(--theme-bg);
    /* 3 Strategic Signal Clusters using Original Vibrant Colors */
    background-image: 
        linear-gradient(90deg, 
            var(--color-cyan) 0, var(--color-cyan) 30px,
            transparent 30px, transparent 60px,
            var(--color-green) 60px, var(--color-green) 90px,
            transparent 90px, transparent 120px,
            var(--color-yellow) 120px, var(--color-yellow) 150px,
            transparent 150px, transparent 180px,
            var(--color-red) 180px, var(--color-red) 210px,
            transparent 210px
        ),
        linear-gradient(90deg, 
            var(--color-cyan) 0, var(--color-cyan) 30px,
            transparent 30px, transparent 60px,
            var(--color-green) 60px, var(--color-green) 90px,
            transparent 90px, transparent 120px,
            var(--color-yellow) 120px, var(--color-yellow) 150px,
            transparent 150px, transparent 180px,
            var(--color-red) 180px, var(--color-red) 210px,
            transparent 210px
        ),
        linear-gradient(90deg, 
            var(--color-cyan) 0, var(--color-cyan) 30px,
            transparent 30px, transparent 60px,
            var(--color-green) 60px, var(--color-green) 90px,
            transparent 90px, transparent 120px,
            var(--color-yellow) 120px, var(--color-yellow) 150px,
            transparent 150px, transparent 180px,
            var(--color-red) 180px, var(--color-red) 210px,
            transparent 210px
        );
    background-size: 210px 100%;
    background-repeat: no-repeat;
    background-position: 10% 0, 50% 0, 90% 0;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    color: var(--theme-text);
}

.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    padding: 0 2rem;
    background: var(--theme-bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--theme-border-glass);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-title {
    margin: 0 !important;
    font-size: clamp(1.3rem, 3.5vw, 2rem) !important;
    white-space: nowrap;
    cursor: pointer;
    z-index: 101;
    text-align: left;
    color: var(--theme-primary);
    font-weight: 700;
    text-transform: uppercase;
}

.ticker-text {
    font-size: 0.65rem;
    color: var(--theme-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-top: -2px;
}

.header-title:hover {
    text-shadow: 0 0 15px var(--theme-primary);
}

.header-side-left { justify-self: start; }
.header-side-right { justify-self: end; display: flex; align-items: center; }

#login-btn, #logout-btn {
    background: transparent;
    color: var(--theme-text) !important;
    border: 2px solid var(--theme-text);
    border-radius: 8px;
    box-shadow: none;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.15s ease;
    opacity: 1 !important;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Barlow', sans-serif;
    letter-spacing: 1px;
}

#login-btn:hover, #logout-btn:hover {
    background: var(--theme-text);
    color: var(--theme-bg) !important;
    border-color: var(--theme-text);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--theme-primary);
}

.container {
    align-self: center;
    width: 90vw;
    max-width: 850px;
    margin: 4vh auto;
    padding: var(--space-lg);
    background: var(--theme-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--theme-border-glass);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    color: var(--theme-text);
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Star Icons Display */
.star-icon {
    font-size: 1.2rem;
    color: var(--theme-text-low);
    display: inline-block;
    margin: 0 1px;
}

.average-rating-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
}

.average-rating-wrapper .star-icon {
    font-size: 3rem; /* Much larger stars */
}

.average-rating-wrapper .rating-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--theme-primary);
}

.star-icon.full {
    color: var(--theme-primary);
    text-shadow: 0 0 5px rgba(241, 170, 28, 0.4);
}

.star-icon.half {
    position: relative;
    color: transparent;
    background: linear-gradient(90deg, var(--theme-primary) 50%, var(--theme-text-low) 50%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Ensure mini-stars in player card are visible */
.mini-stars .star-icon {
    font-size: 1rem;
}

/* Star Rating Input (Interactive) */
#star-rating-input-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.star {
    font-size: 3.5rem;
    cursor: pointer;
    color: var(--theme-text-low);
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
    padding: 0 0.25rem;
}

.star:hover {
    transform: scale(1.2);
}

.star.selected {
    color: var(--theme-primary);
    text-shadow: 0 0 10px rgba(241, 170, 28, 0.4);
}

/* Disposition Selection */
.disposition-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.disp-btn {
    flex: 1;
    max-width: 150px;
    padding: 0.8rem;
    border: 2px solid var(--theme-border-glass);
    background: var(--theme-card-bg);
    color: var(--theme-text);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-family: 'Barlow', sans-serif;
    letter-spacing: 1px;
}

.disp-btn.friendly:hover, .disp-btn.friendly.selected {
    border-color: var(--theme-green);
    color: var(--theme-green);
    background: rgba(5, 255, 116, 0.1);
}

.disp-btn.hostile:hover, .disp-btn.hostile.selected {
    border-color: var(--theme-red);
    color: var(--theme-red);
    background: rgba(255, 0, 0, 0.1);
}

.disp-btn.selected {
    box-shadow: 0 0 15px currentColor;
    transform: scale(1.05);
}

/* Tag Selection */
#tag-selection-input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.tag-category {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tag-category-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--theme-text-low);
    font-weight: 700;
    border-bottom: 1px solid var(--theme-border-glass);
    padding-bottom: 0.25rem;
}

.tag-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag-item {
    padding: 0.4rem 0.8rem;
    border: 1px solid currentColor; /* Use text color for border */
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    background: var(--theme-card-bg);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--theme-text-med);
}

.tag-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    color: var(--theme-text-high);
}

.tag-item.selected {
    box-shadow: 0 0 15px currentColor; /* Glow with the trait color */
    font-weight: 700;
    color: var(--theme-text-high);
}

/* Mad Libs & Combat Report Layouts */
.mad-libs-placeholders {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem; /* Increased spacing to preview */
}

.mad-libs-placeholders .form-group {
    min-width: 300px;
    max-width: 400px;
    flex: 1; 
    margin-bottom: 0;
}

.combat-report-fields {
    margin-top: 1rem;
    margin-bottom: 2.5rem; /* Increased space before submit button */
}

.combat-report-fields select {
    padding: 0.6rem 1rem; /* Tighter padding for combat selects */
    text-align: left;
    text-align-last: left;
}

.checkbox-group {
    justify-content: center; /* Center the toggle */
}

/* Remove rigid grid-2 for placeholders to allow centering of single items */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.checkbox-group label {
    cursor: pointer;
    color: var(--theme-text) !important;
    text-align: left !important;
    font-size: 0.85rem !important;
}

.checkbox-group input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    accent-color: var(--theme-primary);
}

/* Skull Toggle UI */
.skull-toggle {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem;
    border: 2px solid rgba(255, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 1.5rem 0;
    color: var(--theme-red);
    opacity: 0.5;
    background: var(--theme-card-bg);
    user-select: none;
}

.skull-toggle:hover {
    background: rgba(255, 0, 0, 0.05);
    border-color: var(--theme-red);
    opacity: 0.8;
    transform: translateY(-2px);
}

.skull-toggle.active {
    background: rgba(255, 0, 0, 0.15);
    border-color: var(--theme-red);
    color: var(--theme-red);
    opacity: 1;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2), inset 0 0 10px rgba(255, 0, 0, 0.1);
}

.skull-icon svg {
    filter: drop-shadow(0 0 5px currentColor);
    transition: transform 0.3s ease;
}

.skull-toggle.active .skull-icon svg {
    transform: scale(1.1);
}

.skull-text {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.combat-fields-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

#combat-weapon {
    flex: 3; /* Heavier weight */
}

#combat-weapon-level {
    flex: 1; /* Lighter weight */
    min-width: 80px;
}

/* --- REUSABLE COMPONENTS --- */
.rt-btn, .submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border: 2px solid var(--theme-text);
    border-radius: 8px;
    background: transparent;
    color: var(--theme-text) !important;
    position: relative;
    box-shadow: none;
    transition: all 0.15s ease;
    text-decoration: none;
    outline: none;
    width: auto;
    min-width: 160px;
    margin: 0 auto;
}

.rt-btn:hover, .submit-btn:hover {
    background: var(--theme-text);
    color: var(--theme-bg) !important;
    border-color: var(--theme-text);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--theme-primary);
}

.rt-btn.offwhite, .submit-btn.offwhite { 
    background: transparent; 
    border-color: var(--theme-text);
    color: var(--theme-text) !important;
}

.submit-btn.primary {
    border-color: var(--theme-primary);
    color: var(--theme-primary) !important;
}

.submit-btn.primary:hover {
    background: var(--theme-primary);
    color: var(--color-dark) !important;
}

.link-text {
    color: var(--theme-primary);
    cursor: pointer;
    font-weight: 700;
}

.link-text:hover {
    text-decoration: underline;
}

.rt-input, .auth-form input, select, textarea {
    width: 100%;
    background: var(--theme-input-bg);
    border: 2px solid var(--theme-border-glass);
    padding: 0.8rem 1.5rem;
    color: var(--theme-text);
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    border-radius: 50px;
    text-align: center;
    text-align-last: center; /* Centers select text in some browsers */
}

/* Specific Select Styling */
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none; /* Firefox support */
    background-image: linear-gradient(45deg, transparent 50%, var(--theme-primary) 50%),
                      linear-gradient(135deg, var(--theme-primary) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px),
                         calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px,
                     5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.5rem; /* Space for the arrow */
}
option {
    background: var(--theme-input-bg);
    color: var(--theme-text);
}

.rt-input::placeholder, .auth-form input::placeholder {
    color: var(--theme-text);
    opacity: 0.4;
    text-align: center;
}

.rt-input:focus, .auth-form input:focus {
    background: var(--theme-input-bg);
    border-color: var(--theme-primary);
    box-shadow: 0 0 15px rgba(241, 170, 28, 0.1);
}

.form-group {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.form-group label, .form-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--theme-primary);
    opacity: 0.9;
    text-align: center;
    margin: 0;
    font-weight: 700;
}

.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

.tiny-btn {
    background: transparent;
    border: 2px solid var(--theme-text);
    color: var(--theme-text);
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.tiny-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
    background: transparent;
}

.input-with-action .tiny-btn {
    position: absolute;
    right: 1.5rem;
    border: none;
    opacity: 0.5;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
}

.input-with-action .tiny-btn:hover {
    opacity: 1;
    background: transparent;
}

.search-box {
    height: 60px;
    background: var(--theme-input-bg);
    border-radius: 50px;
    position: relative;
    border: 2px solid var(--theme-border-glass);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.search-box:focus-within {
    border-color: var(--theme-primary);
    box-shadow: 0 0 20px rgba(241, 170, 28, 0.2);
}

.search-box input {
    height: 100%;
    width: 100%;
    outline: none;
    border: none !important;
    padding: 0 25px !important;
    background: transparent !important;
    color: var(--theme-text) !important;
    font-size: 1.1rem !important;
    text-align: left;
}

/* Ensure no browser-default search icons appear */
.search-box input::-webkit-search-decoration,
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-results-button,
.search-box input::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
}

.search-box input::placeholder {
    font-size: 0.9rem;
}

/* TYPOGRAPHY overrides */
.welcome-msg { margin-bottom: 0.5rem; text-align: center; color: var(--theme-primary); }
#home-auth-prompt.ui-section { margin-bottom: 1rem; }

/* --- PROFILE UI --- */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

#profile-name {
    font-size: clamp(2rem, 8vw, 3.5rem);
    text-align: center;
    width: 100%;
    margin: 1rem 0;
    color: var(--theme-text-high);
    text-transform: uppercase;
    font-weight: 700;
}

/* Key Stats Row */
.key-stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.25rem 0 0.25rem 0;
    width: 100%;
    color: var(--theme-text-med);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#most-seen-display, #most-used-weapon-display {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    white-space: nowrap; /* Keep label and value together */
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 0.9rem;
    color: var(--theme-text-high);
}

/* Most Seen On Module (Legacy style override) */
.most-seen-wrapper {
    margin: 0; padding: 0; background: none; border: none;
}
.module-title, .map-list, .map-row { display: none; } /* Hide old structure if present */

/* --- RESULTS & LISTS --- */
.results-container, .reviews-container {
    max-height: 40vh;
    overflow-y: auto;
    margin-top: 0.5rem;
    background: transparent;
    padding-right: 5px;
    scrollbar-width: thin; /* Firefox support */
    scrollbar-color: var(--theme-border-glass) transparent; /* Firefox support */
}

.reviews-container::-webkit-scrollbar { width: 4px; }
.reviews-container::-webkit-scrollbar-track { background: transparent; }
.reviews-container::-webkit-scrollbar-thumb { background: var(--theme-border-glass); border-radius: 2px; }

.search-result-item {
    padding: 1rem;
    border: 1px solid var(--theme-border-glass);
    background: var(--theme-card-bg);
    margin-bottom: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--theme-text-high);
    transition: all 0.2s ease;
}
.search-result-item:hover { 
    background: var(--theme-border-glass);
    border-color: var(--theme-primary);
}

.review-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-glass);
    padding: 1.2rem;
    margin-bottom: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.review-card:hover {
    border-color: var(--theme-primary);
    background: var(--theme-border-glass);
    transform: translateY(-2px);
}

.review-meta { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.7rem; 
    color: var(--theme-text-med); 
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.review-trait { 
    font-weight: 700; 
    letter-spacing: 1.5px;
}
.review-trait.friendly { color: var(--theme-cyan); text-shadow: 0 0 10px rgba(95, 255, 255, 0.2); }
.review-trait.hostile { color: var(--theme-red); text-shadow: 0 0 10px rgba(255, 0, 0, 0.2); }

.review-comment {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--theme-text-high);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    max-height: none !important;
}

.intel-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--theme-border-glass);
    color: var(--theme-text-med);
    padding: 0.5rem 1rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50px;
}

.filter-btn:hover {
    color: var(--theme-text-high);
    border-color: var(--theme-text-high);
}

.filter-btn.active {
    background: var(--theme-primary);
    color: var(--color-dark);
    border-color: var(--theme-primary);
    box-shadow: 0 0 15px rgba(241, 170, 28, 0.2);
}

#tag-cloud-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.25rem 0 1.5rem 0;
}

.top-tag {
    padding: 0.2rem 0.6rem;
    border: 1.5px solid var(--tag-color);
    border-radius: 4px;
    background: var(--theme-tag-bg);
    color: var(--tag-color);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: default;
}

/* Profile Review Card Redesign */
.review-card.profile-review-card {
    padding: 1rem;
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-glass);
    margin-bottom: 0.5rem;
    cursor: default;
}
.review-card.profile-review-card:hover {
    background: var(--theme-border-glass);
    transform: none;
    box-shadow: none;
}
.review-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.mini-stars { font-size: 0.8rem; letter-spacing: 2px; }
.star-filled { color: var(--theme-primary); }
.star-empty { color: var(--theme-text-low); }
.review-date { font-size: 0.7rem; color: var(--theme-text-low); }
.review-tags-row { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.mini-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border: 1.5px solid var(--tag-color);
    border-radius: 3px;
    font-weight: 700;
    background: var(--theme-tag-bg);
    color: var(--tag-color);
}

/* Auth Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--theme-bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--theme-bg);
    border: 1px solid var(--theme-border-glass);
    width: 90%;
    max-width: 440px;
    padding: 3rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Limit height */
    overflow-y: auto; /* Enable scrolling */
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

/* HUD Corners */
.hud-corner {
    position: absolute;
    width: 15px;
    height: 15px;
    border: 1px solid var(--theme-primary);
    opacity: 0.5;
    pointer-events: none;
    z-index: 100;
}
.hud-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.hud-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.hud-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.hud-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* --- HUD & UTILS --- */
.hidden { display: none !important; }
.ui-section { margin-bottom: 2.5rem; }
.separator-line { height: 1px; background: var(--theme-border-glass); margin: 2rem 0; }

.status-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--theme-green);
}

.blinking-dot {
    width: 8px;
    height: 8px;
    background-color: var(--theme-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--theme-green);
    animation: rt-blink 1.5s infinite;
}

@keyframes rt-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

/* --- MOBILE TWEAKS --- */
@media (max-width: 600px) {
    .top-bar {
        padding: 0 0.5rem;
    }

    #user-info {
        max-width: 160px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    #display-username {
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    .modal-content {
        padding: 1.5rem 0.75rem; /* Less horizontal padding for more width */
        width: 98%;
    }
    
    body {
        background-image: linear-gradient(90deg, 
            var(--color-cyan) 0, var(--color-cyan) 30px,
            transparent 30px, transparent 60px,
            var(--color-green) 60px, var(--color-green) 90px,
            transparent 90px, transparent 120px,
            var(--color-yellow) 120px, var(--color-yellow) 150px,
            transparent 150px, transparent 180px,
            var(--color-red) 180px, var(--color-red) 210px,
            transparent 210px
        );
        background-position: center 0;
        background-size: 210px 100%;
        background-attachment: scroll; /* Fixed attachment is buggy on many mobile browsers */
    }

    .average-rating-wrapper .star-icon {
        font-size: 2.2rem; /* Slightly less huge on mobile */
    }

    .average-rating-wrapper .rating-value {
        font-size: 1.5rem;
    }
}

.mission-text {
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 4px;
    opacity: 0.4;
    margin-top: 4rem;
    text-transform: uppercase;
    color: var(--theme-text);
}

.warning-text { color: var(--theme-red); font-weight: 700; letter-spacing: 1px; }
.success-text { color: var(--theme-green); font-weight: 700; letter-spacing: 1px; }
.cyan-text { color: var(--theme-cyan); }
.tiny-text { font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase; color: var(--theme-text-low); }