/* EU-Quiz - plain CSS, no framework */

:root {
    --eu-blue: #003399;
    --eu-yellow: #FFCC00;
    --bg: #f2f4f8;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --muted: #5a5f73;
    --green: #1a9e5c;
    --red: #d1373f;
    --border: #dde1ea;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.link-back {
    color: var(--eu-blue);
    text-decoration: none;
    font-weight: 600;
}

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

h1 {
    color: var(--eu-blue);
    margin-top: 0;
}

.subtitle {
    color: var(--muted);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 700px;
}

.start-card {
    text-align: center;
}

.hidden {
    display: none !important;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--eu-blue);
    color: #fff;
}

.btn-primary:hover {
    background: #00266e;
}

.btn-secondary {
    background: var(--eu-yellow);
    color: var(--text);
}

.btn-secondary:hover {
    background: #e6b800;
}

.btn-large {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    margin-top: 12px;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

form label {
    display: block;
    font-weight: 600;
    margin-top: 14px;
    margin-bottom: 6px;
}

form input[type="text"] {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.error-text {
    color: var(--red);
    font-weight: 600;
    margin-top: 12px;
}

.lobby-grid {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.qr-box img {
    display: block;
    border: 8px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.lobby-info {
    text-align: center;
}

.session-code-label {
    margin: 0;
    color: var(--muted);
}

.session-code {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--eu-blue);
    margin: 4px 0;
}

.player-url {
    color: var(--muted);
    word-break: break-all;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--muted);
    font-weight: 600;
}

.badge {
    background: var(--eu-yellow);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.timer {
    background: var(--eu-blue);
    color: #fff;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 1.1rem;
    min-width: 3.5em;
    text-align: center;
}

.options-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.options-list li {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.options-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.option-btn {
    padding: 18px 14px;
    font-size: 1rem;
    border: 2px solid var(--eu-blue);
    background: #fff;
    color: var(--eu-blue);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: var(--eu-blue);
    color: #fff;
}

.option-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.results-box {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.results-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.result-row {
    display: grid;
    grid-template-columns: 60px 1fr 90px;
    align-items: center;
    gap: 10px;
}

.result-label {
    font-weight: 700;
}

.bar-track {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 20px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--eu-blue);
    transition: width 0.4s ease;
}

.bar-fill.correct {
    background: var(--green);
}

.result-pct {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.source-details {
    margin-top: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}

.source-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--eu-blue);
}

.source-details a {
    color: var(--eu-blue);
    word-break: break-all;
}

.explanation-box {
    margin-top: 16px;
    padding: 14px 18px;
    background: #e8f5e9;
    border-left: 4px solid var(--green);
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.explanation-box p {
    margin: 6px 0 0 0;
}

.waiting-next {
    color: var(--muted);
    text-align: center;
}

.spinner {
    font-size: 2.5rem;
    text-align: center;
}

.ranking-list {
    padding-left: 24px;
}

.ranking-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.ranking-list li.own-row {
    font-weight: 800;
    color: var(--eu-blue);
}

@media (max-width: 600px) {
    .card {
        padding: 18px;
    }

    .session-code {
        font-size: 2.2rem;
    }

    .options-buttons {
        grid-template-columns: 1fr;
    }

    .result-row {
        grid-template-columns: 44px 1fr 60px;
    }
}
