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

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    @view-transition { navigation: auto; }
}

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

@font-face {
    font-family: 'Arial Rounded MT';
    src: url('../fonts/ArialRoundedMT-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Arial Rounded MT';
    src: url('../fonts/ArialRoundedMT-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

:root {
    --primary-bg:          #0a0e27;
    --text-white:          #ffffff;
    --text-gray:           #b8c1db;
    --card-bg:             rgba(20, 26, 55, 0.6);
    --card-border:         rgba(184, 193, 219, 0.12);
    --primary-blue:        #4a6fa5;
    --primary-blue-hover:  #5a7fb5;
    --gradient-blue:       linear-gradient(135deg, #2b3a87 0%, #4a6fa5 100%);
    --gradient-blue-hover: linear-gradient(135deg, #3545a0 0%, #5a80c5 100%);
    --success-color:       #4caf50;
    --error-color:         #f44336;
    --warning-color:       #ff9800;
    --font-family:         'Arial Rounded MT', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --link-color:          #4a9eff;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    background-image: radial-gradient(ellipse 80% 40% at 50% -5%, #0f1a40 0%, transparent 70%);
    background-attachment: fixed;
    color: var(--text-white);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    animation: pageIn 0.25s ease-out;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-family); }
input  { font-family: var(--font-family); }
ul { list-style: none; }
img { max-width: 100%; }

#snow {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.navbar {
    background: transparent;
    padding: 1rem 2rem;
    position: fixed;
    top: 0; width: 100%;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(184, 193, 219, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.nav-logo {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1.5rem; font-weight: 700;
    color: inherit; text-decoration: none;
    transition: opacity 0.3s ease;
}
.nav-logo:hover { opacity: 0.8; text-decoration: none; }
.nav-logo img { width: 40px; height: 40px; }
.nav-app-title { font-size: 1.5rem; font-weight: 700; color: var(--text-white); text-align: center; text-decoration: none; }
.nav-app-title:hover { text-decoration: none; }
.lang-switcher { display: flex; justify-content: flex-end; position: relative; }
.lang-toggle {
    background: rgba(74, 111, 165, 0.15);
    border: 1px solid rgba(74, 111, 165, 0.3);
    color: var(--text-white);
    cursor: pointer; padding: 0.5rem 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    border-radius: 8px;
    font-family: var(--font-family); font-size: 0.9rem; font-weight: 500;
    transition: background 0.3s ease;
}
.lang-toggle:hover { background: rgba(74, 111, 165, 0.25); }
.globe-icon { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.lang-toggle-text { min-width: 60px; text-align: left; }
.lang-chevron { width: 10px; height: 10px; opacity: 0.7; transition: transform 0.2s ease; }
.lang-switcher.open .lang-chevron { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute; top: 100%; right: 0;
    background: var(--card-bg); backdrop-filter: blur(10px);
    border: 1px solid var(--card-border); border-radius: 10px;
    padding: 0.5rem; min-width: 130px; margin-top: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0; pointer-events: none; transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.lang-switcher.open .lang-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.lang-btn {
    background: transparent; border: none; color: var(--text-gray);
    cursor: pointer; padding: 0.5rem 0.75rem; border-radius: 6px;
    font-family: var(--font-family); font-size: 0.9rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%;
    transition: background 0.2s ease;
}
.lang-btn:hover { background: rgba(74, 111, 165, 0.2); color: var(--text-white); }
.flag-icon { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }

.screen {
    display: none;
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}
.screen.active {
    display: flex;
    animation: screenIn 0.22s ease-out;
}
@keyframes screenIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#screen-home.active  { flex-direction: column; gap: 1.25rem; padding: 2rem; }
#screen-create.active,
#screen-join.active  { flex-direction: column; align-items: center; padding: 2rem; }
#screen-lobby.active { flex-direction: column; align-items: center; padding: 2rem; }

#screen-psychic.active,
#screen-guesser.active,
#screen-reveal.active,
#screen-final.active {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 2rem 3rem;
}

.btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.875rem 2rem; border: none; border-radius: 50px;
    font-family: var(--font-family); font-size: 1rem; font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    -webkit-appearance: none; appearance: none;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.btn-primary {
    background: var(--gradient-blue);
    color: var(--text-white);
    width: 100%;
}
.btn-primary:hover:not(:disabled) {
    background: var(--gradient-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 111, 165, 0.3);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: saturate(0.5); }

.btn-secondary {
    background: transparent;
    color: var(--text-white);
    border: 2px solid rgba(184, 193, 219, 0.35);
    width: 100%;
}
.btn-secondary:hover {
    background: rgba(184, 193, 219, 0.08);
    border-color: rgba(184, 193, 219, 0.65);
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    width: 100%;
}
.btn-text:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.btn-discord {
    background: #5865F2; color: #fff; border: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
}
.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.35);
}

.btn-icon { width: 18px; height: 18px; flex-shrink: 0; filter: brightness(0) invert(1); }
.discord-icon { width: 22px; height: 17px; flex-shrink: 0; }

.input-field {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(10, 14, 39, 0.6);
    color: var(--text-white);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-field:focus {
    outline: none;
    border-color: rgba(114, 164, 242, 0.65);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.12);
}
.input-field::placeholder { color: var(--text-gray); opacity: 0.7; }

.input-group { text-align: left; }
.input-group label {
    display: block;
    font-size: 1rem; font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-white);
}
.input-hint { font-size: 0.85rem; color: var(--text-gray); margin-top: 0.5rem; opacity: 0.8; }

.setting-label-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.5rem;
}
.setting-label-row label { margin-bottom: 0; }
.slider-value { font-size: 0.9rem; font-weight: 700; color: var(--text-white); }

.slider-field {
    width: 100%; height: 6px;
    -webkit-appearance: none; appearance: none;
    background: rgba(74, 111, 165, 0.2);
    border-radius: 3px; cursor: pointer; outline: none;
}
.slider-field::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px;
    background: var(--primary-blue); border-radius: 50%; cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: -6px;
}
.slider-field::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-field::-moz-range-thumb {
    width: 18px; height: 18px;
    background: var(--primary-blue); border-radius: 50%; border: none; cursor: pointer;
}

.mp-code-field {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 1.2rem;
    text-align: center;
}

.auth-divider {
    display: flex; align-items: center; gap: 1rem;
    color: var(--text-gray); font-size: 0.875rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--card-border);
}

#btn-discord-login.hidden + .auth-divider { display: none !important; }

.mp-divider {
    display: flex; align-items: center; gap: 1rem;
    color: var(--text-gray); font-size: 0.9rem;
    margin: 0.25rem 0;
}
.mp-divider::before, .mp-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--card-border);
}

.setup-container {
    background: rgba(14, 19, 45, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.setup-container::before {
    content: '';
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 60%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 193, 219, 0.25), transparent);
    pointer-events: none;
}
@media (min-width: 500px) {
    .setup-container { max-width: 560px; }
}

.login-header { margin-bottom: 1.25rem; }

.login-logo-wrap {
    display: inline-flex; flex-shrink: 0;
    margin-bottom: 1rem;
    animation: floatLogo 3.5s ease-in-out infinite;
}
@keyframes floatLogo {
    0%, 100% { transform: translateY(-8px); }
    50%       { transform: translateY(8px); }
}

.login-logo {
    width: 90px; height: 90px;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}
.login-header-text {
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.login-title-row {
    display: flex; align-items: baseline; gap: 0.5rem;
    justify-content: center; margin-bottom: 0.5rem;
}
.login-title { font-size: 2rem; font-weight: 700; }
.login-title-row .login-title { margin-bottom: 0; }
.login-subtitle { font-size: 0.95rem; color: rgba(184, 193, 219, 0.6); }
.version-number {
    font-size: 0.75rem; color: var(--text-gray); opacity: 0.5;
    letter-spacing: 0.05em; text-decoration: none;
    transition: opacity 0.2s;
}
.version-number:hover { opacity: 1; text-decoration: underline; }

@media (min-width: 500px) {
    .setup-container { max-width: 560px; }
    .login-header {
        display: flex; align-items: center; gap: 1.5rem;
        text-align: left; margin-bottom: 1.5rem;
    }
    .login-logo-wrap { margin-bottom: 0; }
    .login-logo { width: 130px; height: 130px; }
    .login-header-text { align-items: flex-start; flex: 1; min-width: 0; }
    .login-title-row { justify-content: flex-start; }
}

.setup-form { display: flex; flex-direction: column; gap: 1rem; }
.setup-form .btn-text { margin-top: 0.25rem; }
#home-auth, #home-play { display: flex; flex-direction: column; gap: 0.75rem; }

.mode-greeting {
    display: flex; align-items: center; justify-content: center;
    margin-top: 0.6rem;
}
.mode-greeting-info { display: flex; align-items: center; gap: 0.5rem; }
.greeting-avatar {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0; opacity: 0.85;
}
.greeting-text { font-size: 1.15rem; color: var(--text-gray); }
.greeting-logout-btn {
    background: transparent; border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer; padding: 4px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, background 0.2s;
    margin-left: 0.1rem;
}
.greeting-logout-btn img {
    width: 16px; height: 16px;
    opacity: 1; filter: invert(1);
}
.greeting-logout-btn:hover {
    color: rgba(255, 80, 80, 0.85);
    background: rgba(255, 80, 80, 0.1);
}
.greeting-logout-btn:hover img {
    filter: invert(40%) sepia(1) saturate(5) hue-rotate(320deg);
}

.donation-cta {
    padding: 1.25rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(114, 164, 242, 0.1) 0%, rgba(74, 111, 165, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid rgba(114, 164, 242, 0.2);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
    position: relative; overflow: hidden;
}
.donation-cta::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(114, 164, 242, 0.12), transparent 70%);
    pointer-events: none;
}
.donation-cta h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.35rem; }
.donation-cta p  { font-size: 0.85rem; color: var(--text-gray); margin-bottom: 1rem; }
.kofi-button {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, #72a4f2 0%, #4a6fa5 100%);
    color: white; text-decoration: none;
    padding: 0.65rem 1.5rem; border-radius: 50px;
    font-size: 0.9rem; font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(114, 164, 242, 0.3);
}
.kofi-button:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(114, 164, 242, 0.5); text-decoration: none; }
.kofi-icon-svg { width: 20px; height: 20px; flex-shrink: 0; }

.category-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.category-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    box-shadow: 0 0 0 1px var(--card-border);
    border-radius: 20px;
    outline: none;
    color: var(--text-gray);
    padding: 7px 15px; font-size: 0.87rem;
    font-family: var(--font-family);
    overflow: hidden;
    -webkit-appearance: none; appearance: none;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.category-btn:hover { background: rgba(74, 111, 165, 0.2); color: var(--text-white); box-shadow: 0 0 0 1px rgba(74, 111, 165, 0.4); }
.category-btn.active { background: var(--gradient-blue); box-shadow: none; color: #fff; }

.lobby-setup-container { max-width: 860px; }

@media (min-width: 500px) {
    .lobby-setup-container { max-width: 860px; }
}

.mp-waiting-layout {
    display: flex; flex-direction: column; gap: 1.25rem;
    width: 100%;
}
@media (min-width: 640px) {
    .mp-waiting-layout { flex-direction: row; align-items: flex-start; gap: 2rem; }
}

.mp-players-col {
    display: flex; flex-direction: column; gap: 1rem;
    background: rgba(20, 25, 50, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 16px; padding: 1.25rem;
    flex: 0 0 260px;
}

.lobby-host-col,
.lobby-guest-col {
    display: flex; flex-direction: column; gap: 1rem;
    flex: 1; min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(74, 111, 165, 0.15);
    border-radius: 16px; padding: 1.5rem;
}

.mp-game-code-display {
    background: linear-gradient(135deg, rgba(43, 58, 135, 0.3) 0%, rgba(74, 111, 165, 0.12) 100%);
    border: 2px solid rgba(74, 111, 165, 0.5);
    border-radius: 12px; padding: 1rem 1.5rem;
    text-align: center; font-size: 1rem; color: var(--text-gray);
}
.mp-game-code-display strong {
    display: block;
    font-size: clamp(1.5rem, 8vw, 2.4rem); font-weight: 700;
    color: var(--text-white);
    letter-spacing: 0.4em; padding-left: 0.4em;
    margin-top: 0.25rem;
    text-shadow: 0 0 20px rgba(74, 111, 165, 0.4);
}
.btn-copy-code {
    background: none; border: none; cursor: pointer;
    padding: 4px; border-radius: 6px; opacity: 0.6;
    transition: opacity 0.15s;
    display: inline-flex; align-items: center;
}
.btn-copy-code:hover { opacity: 1; }
.btn-copy-code img { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.copy-code-btn {
    background: none; border: none;
    font-size: 1.1rem; opacity: 0.6;
    cursor: pointer; margin-top: 0.4rem;
    transition: opacity 0.2s;
    display: block; margin-left: auto; margin-right: auto;
}
.copy-code-btn:hover { opacity: 1; }

.mp-player-list { display: flex; flex-direction: column; gap: 0.5rem; }

.player-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 10px; font-size: 0.95rem;
    text-align: left;
    transition: background 0.2s;
}
.player-item.is-me {
    background: rgba(74, 111, 165, 0.12);
    border-color: rgba(74, 111, 165, 0.35);
}
.player-avatar {
    width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.player-avatar-default {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gradient-blue);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.player-name { flex: 1; font-size: 0.95rem; }
.host-badge {
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid rgba(241, 196, 15, 0.4);
    color: #f1c40f;
    border-radius: 10px; padding: 2px 8px;
    font-size: 0.75rem; font-weight: 700;
}

.mp-waiting-hint { color: var(--text-gray); font-size: 0.85rem; text-align: center; font-style: italic; }

.lobby-config-display {
    display: flex; flex-direction: column; gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.settings-section-title {
    font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-gray); margin-bottom: 0.5rem; opacity: 0.8;
}
.config-item {
    display: flex; justify-content: space-between;
    padding: 6px 0; border-bottom: 1px solid var(--card-border);
    font-size: 0.9rem; color: var(--text-gray);
}
.config-item:last-child { border-bottom: none; }
.config-item strong { color: var(--text-white); }

.spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(74, 111, 165, 0.3);
    border-top-color: #4a6fa5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.msg-box {
    width: 100%; margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem; font-weight: 500;
    text-align: center;
    animation: msgFadeIn 0.15s ease;
}
.msg-box.hidden { display: none; }
.msg-box.msg-info    { background: #1a2347; border: 1px solid rgba(74,111,165,0.4); color: var(--text-gray); }
.msg-box.msg-success { background: #0f2a1a; border: 1px solid rgba(39,174,96,0.5);  color: #5dbb7f; }
.msg-box.msg-error   { background: #2a0f0f; border: 1px solid rgba(231,76,60,0.5);  color: #e87b6e; }
@keyframes msgFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%);
    padding: 9px 18px; border-radius: 6px;
    font-size: 0.88rem; font-weight: 500;
    z-index: 9999; white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.toast:not(.hidden) { opacity: 1; }
.toast-info    { background: #1a2347; border: 1px solid rgba(74,111,165,0.4); color: var(--text-gray); }
.toast-success { background: #0f2a1a; border: 1px solid rgba(39,174,96,0.5);  color: #5dbb7f; }
.toast-error   { background: #2a0f0f; border: 1px solid rgba(231,76,60,0.5);  color: #e87b6e; }

.game-container {
    width: 100%; max-width: 680px;
    display: flex; flex-direction: column; gap: 0;
}

.game-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 1.25rem; flex-wrap: wrap;
    padding: 0.85rem 1.25rem;
    background: var(--card-bg); backdrop-filter: blur(10px);
    border-radius: 14px; border: 1px solid var(--card-border);
}
.round-info { color: var(--text-gray); font-size: 0.92rem; }
.round-info strong { color: var(--text-white); font-size: 1.1rem; }

.role-badge {
    padding: 5px 14px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 700;
}
.psychic-badge { background: rgba(241, 196, 15, 0.15); border: 1px solid rgba(241, 196, 15, 0.4); color: #f1c40f; }
.guesser-badge { background: rgba(74, 111, 165, 0.15); border: 1px solid rgba(74, 111, 165, 0.35); color: #72a4f2; }

.scores-mini { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.mini-score {
    font-size: 0.78rem; color: var(--text-gray);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px; border-radius: 10px;
}
.mini-score.is-me { color: #72a4f2; background: rgba(74, 111, 165, 0.15); }

.quit-game-row { margin-top: 1.25rem; display: flex; justify-content: center; }
.quit-game-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    width: auto;
}
.quit-game-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}
.quit-game-btn .btn-icon {
    filter: brightness(0) invert(1);
    opacity: 0.45;
}

.theme-category {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(114, 164, 242, 0.75);
    margin: 0 0 4px;
}

.theme-subject {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 700;
    color: var(--text-white);
    background: rgba(74, 111, 165, 0.12);
    border: 1px solid rgba(74, 111, 165, 0.3);
    border-radius: 12px;
    padding: 10px 20px;
    margin: 0 0 0.5rem;
    letter-spacing: 0.01em;
}

.theme-display {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin: 0 0 1rem;
}
.theme-label {
    font-size: clamp(0.95rem, 2.5vw, 1.25rem); font-weight: 700;
    padding: 6px 16px; border-radius: 8px;
}
.theme-left  { background: rgba(231, 76, 60, 0.15);  border: 1px solid rgba(231, 76, 60, 0.35);  color: #f1948a; }
.theme-right { background: rgba(52, 152, 219, 0.15); border: 1px solid rgba(52, 152, 219, 0.35); color: #7fb3d9; }
.theme-sep   { font-size: 1.3rem; color: var(--text-gray); }

.dial-wrapper { position: relative; width: 100%; max-width: 520px; margin: 0 auto 0.5rem; }
.dial-canvas  { display: block; width: 100%; height: auto; touch-action: none; }
.dial-canvas.interactive { cursor: crosshair; }
.dial-labels {
    display: flex; justify-content: space-between;
    padding: 5px 8px 0;
    font-size: 0.82rem; font-weight: 700;
    color: var(--text-gray); letter-spacing: 0.03em;
}
.dial-label-left  { color: #f1948a; }
.dial-label-right { color: #7fb3d9; }

.zone-hint { text-align: center; color: var(--text-gray); font-size: 0.85rem; margin: 2px 0 12px; }
.clue-form { margin-top: 6px; }
.btn-submit-theme { margin-top: 10px; }
.clue-instruction { color: var(--text-gray); font-size: 0.92rem; margin-bottom: 10px; }
.clue-input-row { display: flex; gap: 10px; }
.clue-input { flex: 1 !important; width: auto !important; border-radius: 12px; }
.clue-input-row .btn { width: auto; flex-shrink: 0; }
.psychic-waiting {
    text-align: center; padding: 20px;
    color: var(--text-gray);
    display: flex; align-items: center; gap: 12px; justify-content: center;
}

.theme-labels-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px;
}
.theme-labels-row .input-field { flex: 1; min-width: 0; }
.theme-labels-sep { color: var(--text-gray); flex-shrink: 0; font-size: 1.1rem; opacity: 0.7; }
@media (max-width: 540px) {
    .theme-labels-row { flex-direction: column; }
    .theme-labels-sep { display: none; }
}

.waiting-clue {
    text-align: center; padding: 18px;
    color: var(--text-gray); margin-bottom: 8px;
    display: flex; align-items: center; gap: 12px; justify-content: center;
}
.clue-revealed {
    text-align: center; margin-bottom: 12px;
    padding: 14px 20px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 14px;
}
.clue-label { color: var(--text-gray); font-size: 0.85rem; margin-bottom: 5px; }
.clue-text  { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; color: var(--text-white); letter-spacing: 0.02em; }

.guess-footer { margin-top: 12px; }
.waiting-count { font-size: 0.88rem; color: var(--text-gray); margin-bottom: 10px; }
.waiting-count strong { color: var(--text-white); font-size: 1rem; }
.guesser-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.drag-hint { color: var(--text-gray); font-size: 0.85rem; text-align: center; }
.submitted-msg {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; color: var(--text-gray);
    background: rgba(74, 111, 165, 0.1);
    border: 1px solid rgba(74, 111, 165, 0.25);
    border-radius: 10px;
}
.submitted-msg p { margin: 0; }

.clue-banner {
    text-align: center; font-size: 1rem; color: var(--text-gray);
    margin: 0 0 14px; padding: 10px 16px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
}
.clue-banner strong { color: var(--text-white); font-size: 1.2rem; margin-left: 6px; }

.round-results { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
}
.result-dot    { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.result-name   { flex: 1; font-weight: 600; }
.result-pts    { margin-left: auto; font-weight: 700; border-radius: 10px; padding: 2px 10px; font-size: 0.85rem; }
.pts-badge-0   { background: rgba(127, 127, 127, 0.15); color: #9e9e9e; }
.pts-badge-1   { background: rgba(39, 174, 96, 0.15);   color: #81c784; }
.pts-badge-2   { background: rgba(241, 196, 15, 0.15);  color: #ffd54f; }
.pts-badge-3   { background: rgba(230, 126, 34, 0.15);  color: #ffb74d; }
.pts-badge-4   { background: rgba(231, 76, 60, 0.15);   color: #e57373; }

.reveal-actions { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.reveal-actions .btn-primary { width: auto; }

.end-container {
    width: 100%; max-width: 600px;
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.end-title { font-size: 2rem; font-weight: 700; text-align: center; }
.end-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.end-actions .btn { width: auto; }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; }
.podium-place {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 16px; min-width: 90px; text-align: center;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px;
}
.rank-1 { order: 2; border-color: rgba(241, 196, 15, 0.5); background: rgba(241, 196, 15, 0.08); padding-bottom: 22px; }
.rank-2 { order: 1; border-color: rgba(189, 189, 189, 0.4); background: rgba(189, 189, 189, 0.06); padding-bottom: 12px; }
.rank-3 { order: 3; border-color: rgba(188, 122, 77, 0.4);  background: rgba(188, 122, 77, 0.06); }
.podium-medal  { font-size: 1.8rem; }
.podium-avatar img, .podium-avatar .player-avatar-default { width: 40px; height: 40px; border-radius: 50%; }
.podium-name   { font-weight: 700; font-size: 0.9rem; }
.podium-score  { color: #72a4f2; font-size: 0.85rem; }

.final-scores { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.final-player {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
}
.final-player.is-me { border-color: rgba(74, 111, 165, 0.45); background: rgba(74, 111, 165, 0.1); }
.final-rank  { width: 22px; font-size: 0.9rem; color: var(--text-gray); text-align: center; }
.final-name  { flex: 1; font-weight: 600; }
.final-score { color: #72a4f2; font-weight: 700; }

.hidden { display: none !important; }
.error-message {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 10px; padding: 1rem;
    color: #ff6b6b; font-size: 0.95rem; text-align: center;
}

footer {
    text-align: center;
    padding: 1.5rem 2rem;
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 400;
    z-index: 2;
    margin-top: auto;
    opacity: 0.65;
}
.footer-links {
    display: flex; justify-content: center; align-items: center;
    gap: 0.75rem; margin-bottom: 0.5rem;
}
.footer-sep { opacity: 0.4; }
footer a { color: inherit; text-decoration: none; transition: color 0.3s ease; }
footer a:hover { color: var(--text-white); }

button:focus { outline: none; }

:focus-visible {
    outline: 2px solid rgba(74, 111, 165, 0.85);
    outline-offset: 3px;
    border-radius: 4px;
}
.btn:focus-visible,
.category-btn:focus-visible,
.lang-toggle:focus-visible,
.lang-btn:focus-visible,
.input-field:focus-visible {
    outline: 2px solid rgba(74, 111, 165, 0.85);
    outline-offset: 3px;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .lang-toggle-text { display: none; }
    .nav-logo span { display: none; }
    .nav-app-title { font-size: 1.1rem; white-space: nowrap; }
    .nav-container { grid-template-columns: 1fr auto 1fr; }
    .navbar { padding: 0.75rem 1rem; }
    .login-title { font-size: 1.5rem; }
}
@media (max-width: 540px) {
    body { padding-top: 60px; }
    .setup-container { padding: 1.5rem 1.25rem; }
    .lobby-setup-container { padding: 1.25rem 1rem; }
    .game-container { padding: 0; }
    .clue-input-row { flex-direction: column; }
    .clue-input-row .btn { width: 100%; }
    .reveal-actions { flex-direction: column; align-items: stretch; }
    .theme-display  { gap: 8px; }
    .theme-label    { padding: 5px 10px; font-size: 0.9rem; }
    .podium         { gap: 6px; }
    .podium-place   { min-width: 72px; padding: 10px; }
    .game-header    { gap: 8px; }
    .mp-waiting-layout { flex-direction: column; }
}