:root {
    --blue-950: #071b3a;
    --blue-900: #0a2a5e;
    --blue-800: #0f3f86;
    --blue-700: #155ec0;
    --blue-600: #1976d2;
    --blue-500: #2196f3;
    --blue-400: #48b4ff;
    --blue-300: #8bd6ff;
    --blue-100: #e8f5ff;
    --cyan-300: #67e8f9;
    --ink: #10233f;
    --muted: #526783;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --line: rgba(25, 118, 210, 0.18);
    --shadow: 0 28px 80px rgba(7, 27, 58, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--blue-950);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 14%, rgba(103, 232, 249, 0.42), transparent 28rem),
        radial-gradient(circle at 82% 10%, rgba(72, 180, 255, 0.36), transparent 24rem),
        linear-gradient(145deg, #f7fbff 0%, #e9f6ff 42%, #d9efff 100%);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(120deg, rgba(10, 42, 94, 0.08), transparent 38%),
        linear-gradient(300deg, rgba(25, 118, 210, 0.12), transparent 46%);
}

.public-shell {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 48px);
    text-align: center;
}

.login-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.login-shell {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 48px) clamp(18px, 4vw, 48px) 20px;
}

.login-card {
    position: relative;
    width: min(94vw, 720px);
    padding: clamp(24px, 4vw, 42px);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    content: "";
    background: linear-gradient(90deg, var(--blue-900), var(--blue-500), var(--cyan-300));
}

.login-brand {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 22px;
    align-items: center;
    margin-bottom: 28px;
}

.login-brand .logo {
    width: 112px;
    margin: 0;
}

.login-brand h1 {
    margin-bottom: 8px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-language-selector {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.login-language-selector label {
    color: var(--blue-900);
    font-weight: 800;
}

.login-language-selector select {
    min-height: 46px;
    width: 100%;
    padding: 10px 38px 10px 14px;
    border: 1px solid rgba(25, 118, 210, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 245, 255, 0.96));
    color: var(--blue-900);
    font: inherit;
    font-weight: 750;
    outline: none;
}

.login-language-selector select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.14);
}

.login-form label:not(.remember-row) {
    display: grid;
    gap: 8px;
    color: var(--blue-900);
    font-weight: 800;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    min-height: 52px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(25, 118, 210, 0.24);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font: inherit;
    outline: none;
    box-shadow: 0 14px 34px rgba(10, 42, 94, 0.08);
}

.login-form input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.14);
}

.remember-row {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-weight: 700;
}

.login-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.primary-button,
.secondary-button {
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, var(--blue-800), var(--blue-500));
    box-shadow: 0 18px 38px rgba(21, 94, 192, 0.24);
}

.secondary-button {
    color: var(--blue-800);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 245, 255, 0.95));
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.as-link {
    display: inline-flex;
    align-items: center;
}

.login-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.external-login {
    display: flex;
    justify-content: center;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.login-links button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue-700);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.login-links a {
    color: var(--blue-700);
    font-weight: 800;
    text-decoration: none;
}

.credential-note {
    margin-top: 22px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 750;
}

.login-message.error {
    color: #8a1f32;
    background: #ffe8ee;
}

.login-message.success {
    color: var(--blue-900);
    background: var(--blue-100);
}

.public-card,
.document-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.public-card::before,
.document-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    content: "";
    background: linear-gradient(90deg, var(--blue-800), var(--blue-500), var(--cyan-300));
}

.public-card {
    width: min(92vw, 680px);
    padding: clamp(22px, 4vw, 38px);
    border-radius: 26px;
}

.document-shell {
    min-height: 100vh;
    padding: clamp(18px, 4vw, 48px);
}

.document-card {
    width: min(100%, 940px);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 46px);
    border-radius: 24px;
    text-align: left;
}

.language-selector-container {
    width: 100%;
    margin-bottom: 22px;
    text-align: right;
}

#language-select,
#privacy-language-select,
#public-document-language-select {
    min-height: 42px;
    padding: 8px 38px 8px 14px;
    border: 1px solid rgba(25, 118, 210, 0.28);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 245, 255, 0.96));
    color: var(--blue-900);
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    box-shadow: 0 10px 30px rgba(25, 118, 210, 0.12);
}

#language-select:focus,
#privacy-language-select:focus,
#public-document-language-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.16);
}

.logo {
    display: block;
    max-width: 146px;
    margin: 0 auto 22px;
    border-radius: 50%;
    box-shadow: 0 18px 45px rgba(10, 42, 94, 0.22);
}

.document-card .logo {
    border-radius: 18px;
}

h1 {
    margin: 0 0 12px;
    color: var(--blue-900);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 850;
    line-height: 1.04;
    letter-spacing: 0;
}

.public-card > p {
    max-width: 54ch;
    margin-right: auto;
    margin-left: auto;
    color: var(--muted);
}

p {
    margin: 0 0 25px;
    font-size: 1.08rem;
    line-height: 1.65;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 8px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--blue-800), var(--blue-500));
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 18px 42px rgba(21, 94, 192, 0.24);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 50px rgba(21, 94, 192, 0.3);
}

.download-button img {
    height: 42px;
}

.video-container {
    width: 100%;
    max-width: 590px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 22px;
    background: linear-gradient(145deg, var(--blue-950), var(--blue-800));
    box-shadow: 0 22px 60px rgba(7, 27, 58, 0.26);
}

.video-container video {
    display: block;
    width: 100%;
    height: auto;
}

.copyright {
    margin-top: 25px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.footer-links a,
.text-link,
.back-link,
.document-card a {
    color: var(--blue-700);
    font-weight: 800;
    text-decoration: none;
}

.footer-links a:hover,
.text-link:hover,
.back-link:hover,
.document-card a:hover {
    color: var(--blue-500);
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
}

.document-card h1,
.document-card h2,
.document-card h3 {
    color: var(--blue-900);
    letter-spacing: 0;
}

.document-card h1 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.document-card h2 {
    margin-top: 34px;
    margin-bottom: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 1.35rem;
}

.document-card h3 {
    margin-top: 24px;
    font-size: 1.15rem;
}

.document-card p,
.document-card ul {
    margin-bottom: 15px;
    color: #263d5d;
    font-size: 1rem;
    line-height: 1.7;
}

.document-card ul {
    padding-left: 22px;
}

.document-card .section {
    margin-bottom: 30px;
}

.document-card .section img {
    display: block;
    width: min(100%, 260px);
    max-height: 360px;
    margin: 14px auto 18px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(232, 245, 255, 0.72);
    box-shadow: 0 14px 36px rgba(7, 27, 58, 0.14);
}

.document-card iframe {
    display: block;
    width: min(100%, 720px);
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 20px auto;
    border: 0;
    border-radius: 16px;
}

.document-footer {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 0.95rem;
}

.ad-footer {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 8px 12px 14px;
}

.ad-slot {
    display: flex;
    width: min(100%, 468px);
    min-height: 60px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
}

.ad-slot-placeholder {
    border: 1px dashed rgba(21, 94, 192, 0.46);
    color: var(--blue-800);
    background:
        repeating-linear-gradient(
            135deg,
            rgba(232, 245, 255, 0.82),
            rgba(232, 245, 255, 0.82) 10px,
            rgba(139, 214, 255, 0.22) 10px,
            rgba(139, 214, 255, 0.22) 20px
        );
}

.ad-slot-production {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
}

.game-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.game-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: clamp(16px, 3vw, 34px);
    flex: 1;
}

.game-card {
    position: relative;
    width: 100%;
    padding: clamp(20px, 3vw, 34px);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.game-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    content: "";
    background: linear-gradient(90deg, var(--blue-800), var(--blue-500), var(--cyan-300));
}

.game-loading {
    text-align: center;
    font-weight: 800;
}

.game-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 42px rgba(7, 27, 58, 0.12);
}

.game-brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--blue-900);
    font-weight: 900;
    text-decoration: none;
}

.game-brand img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.game-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.game-stats span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--blue-900);
    background: var(--blue-100);
    font-size: 0.84rem;
    font-weight: 850;
}

.material-symbols-rounded {
    font-family: "Material Symbols Rounded";
    font-size: 1.15rem;
    font-weight: normal;
    line-height: 1;
    font-style: normal;
    font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
}

.material-symbols-rounded.filled {
    font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

.game-stat-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: var(--blue-900);
    background: var(--blue-100);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.game-stat-button:hover,
.game-stat-button:focus-visible {
    color: white;
    background: var(--blue-800);
    outline: none;
}

.game-stat-button.logout-stat .material-symbols-rounded {
    font-size: 1.25rem;
}

.game-hero {
    margin-bottom: 18px;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--blue-700);
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
}

.game-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.game-action-card {
    display: grid;
    gap: 8px;
    min-height: 150px;
    align-content: center;
    padding: 18px;
    border: 1px solid rgba(25, 118, 210, 0.2);
    border-radius: 18px;
    color: var(--blue-900);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 34px rgba(7, 27, 58, 0.1);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.game-action-card img {
    width: 82px;
    height: 82px;
    object-fit: contain;
}

.game-action-card.compact {
    min-height: 124px;
}

.game-action-card.compact img {
    width: 72px;
    height: 72px;
}

.game-action-card:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.game-action-icon {
    display: inline-grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 18px;
    color: var(--blue-800);
    background: var(--blue-100);
    font-size: 2rem;
}

.choice-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.choice-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--blue-900);
    font-weight: 800;
}

.choice-row small {
    color: var(--muted);
}

.quiz-card {
    max-width: 840px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.quiz-score {
    display: grid;
    gap: 8px;
    justify-items: center;
    color: var(--blue-900);
    font-weight: 850;
}

.quiz-score strong {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: var(--blue-700);
    font-size: 1.6rem;
}

.quiz-timer {
    height: 8px;
    margin: 16px 0 22px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(25, 118, 210, 0.12);
}

.quiz-timer::before {
    display: block;
    width: calc(var(--progress) * 1%);
    height: 100%;
    content: "";
    background: linear-gradient(90deg, var(--blue-800), var(--cyan-300));
}

.quiz-question {
    margin: 0 0 20px;
    color: var(--blue-900);
    text-align: center;
}

.quiz-options {
    display: grid;
    gap: 10px;
}

.quiz-option {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid rgba(25, 118, 210, 0.22);
    border-radius: 16px;
    color: var(--blue-900);
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.quiz-option span {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: var(--blue-700);
}

.quiz-option.correct {
    color: #0b5d31;
    border-color: rgba(39, 174, 96, 0.42);
    background: #e9f9f0;
}

.quiz-option.wrong {
    color: #8a1f32;
    border-color: rgba(220, 38, 38, 0.38);
    background: #ffe8ee;
}

.quiz-option.neutral {
    opacity: 0.72;
}

.quiz-helps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.quiz-helps button {
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--blue-800);
    background: var(--blue-100);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.quiz-helps button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.audience-results {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.audience-row {
    display: grid;
    grid-template-columns: 28px 1fr 48px;
    gap: 8px;
    align-items: center;
}

.audience-row div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(25, 118, 210, 0.12);
}

.audience-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--blue-500);
}

.quiz-hint,
.quiz-result {
    margin-top: 18px;
    color: var(--blue-900);
    font-weight: 800;
}

.friend-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.friend-card {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.friend-card img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 50%;
}

.friend-card div {
    display: grid;
    gap: 4px;
}

.friend-card span {
    color: var(--muted);
}

.profile-summary {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 18px;
}

.profile-summary > img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 24px;
    background: var(--blue-100);
}

.profile-summary dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.profile-summary dl div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.profile-summary dt {
    color: var(--muted);
    font-weight: 800;
}

.profile-summary dd {
    margin: 0;
    color: var(--blue-900);
    font-weight: 850;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 560px) {
    .public-card,
    .document-card,
    .login-card {
        width: 100%;
        border-radius: 20px;
    }

    .login-brand {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .login-actions {
        justify-content: stretch;
    }

    .primary-button,
    .secondary-button {
        flex: 1 1 100%;
    }

    .language-selector-container {
        text-align: center;
    }

    .download-button img {
        height: 38px;
    }

    .document-card .section img {
        width: min(100%, 190px);
        max-height: 280px;
    }

    .game-topbar {
        grid-template-columns: 1fr;
    }

    .game-actions {
        grid-template-columns: 1fr;
    }

    .quiz-header {
        align-items: flex-start;
    }

    .friend-card,
    .profile-summary,
    .profile-summary dl div {
        grid-template-columns: 1fr;
    }

    .profile-summary > img {
        width: 140px;
        height: 140px;
    }
}
