/* ==========================================================================
   Quizzly Games / Daily Trivia
   Builds on the site's dark design tokens (style.css). Animations respect
   prefers-reduced-motion.
   ========================================================================== */

/* Button links are inline by default: their padding then overflows the line without
   taking space, so wrapped buttons overlap and margins look too small on phones */
.btn-modern-primary,
.btn-modern-secondary,
.btn-modern-outline {
    display: inline-block;
}

.games-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.games-nav a {
    padding: 0.45rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.games-nav a:hover,
.games-nav a.active {
    background: rgba(249, 200, 70, 0.15);
    border-color: rgba(249, 200, 70, 0.4);
    color: var(--secondary-color);
}

/* Daily Trivia hero card */
.daily-hero {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at 85% 15%, rgba(249, 200, 70, 0.25), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(26, 115, 232, 0.3), transparent 50%),
        linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid rgba(249, 200, 70, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.daily-hero-icon {
    position: absolute;
    right: -1rem;
    bottom: -2rem;
    font-size: 11rem;
    color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.daily-hero h2 {
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.daily-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin: 1rem 0 1.5rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.daily-meta i {
    color: var(--secondary-color);
    margin-right: 0.35rem;
}

.games-stat {
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: 100%;
}

.games-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.games-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.games-coming {
    border-style: dashed !important;
    opacity: 0.75;
}

/* Leaderboard: compact rows with the same spacing on every side */
.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    min-height: 0;
}

.leaderboard-row.is-me {
    background: rgba(249, 200, 70, 0.1);
    border-color: rgba(249, 200, 70, 0.35);
}

.leaderboard-rank {
    width: 1.75rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.leaderboard-rank.top-1 { color: #ffd34d; }
.leaderboard-rank.top-2 { color: #d4d9e0; }
.leaderboard-rank.top-3 { color: #e09a5c; }

.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
}

.leaderboard-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.leaderboard-name-text {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.leaderboard-you {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: 1px;
    background: rgba(249, 200, 70, 0.2);
    color: var(--secondary-color);
}

.leaderboard-points {
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.leaderboard-gap {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
}

.leaderboard-empty {
    margin: 0;
    padding: 1.25rem 0.75rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Bootstrap 5.3 colours table cells through its own variables; keep them on the dark theme */
.table-modern {
    --bs-table-color: rgba(255, 255, 255, 0.9);
    --bs-table-bg: transparent;
    --bs-table-hover-color: #fff;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: rgba(255, 255, 255, 0.9);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}

.period-tabs .btn {
    border-radius: 50px;
}

/* Archive calendar */
.trivia-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
}

.trivia-calendar-head {
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    padding-bottom: 0.25rem;
}

.trivia-day {
    position: relative;
    min-height: 74px;
    padding: 0.4rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

a.trivia-day:hover {
    border-color: rgba(249, 200, 70, 0.5);
    color: #fff;
}

.trivia-day-number {
    font-weight: 700;
}

.trivia-day-score {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.trivia-day.state-played {
    background: rgba(52, 168, 83, 0.15);
    border-color: rgba(52, 168, 83, 0.4);
    color: #fff;
}

.trivia-day.state-missed {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.trivia-day.state-today {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 1px var(--secondary-color) inset;
    color: #fff;
}

.trivia-day.state-in_progress {
    background: rgba(26, 115, 232, 0.15);
    border-color: rgba(26, 115, 232, 0.45);
    color: #fff;
}

.trivia-day.outside {
    visibility: hidden;
}

.trivia-day-icons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    font-size: 0.8rem;
}

.trivia-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.trivia-legend span::before {
    content: '';
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 4px;
    margin-right: 0.35rem;
    vertical-align: -1px;
}

.trivia-legend .lg-played::before { background: rgba(52, 168, 83, 0.6); }
.trivia-legend .lg-missed::before { background: rgba(255, 255, 255, 0.2); }
.trivia-legend .lg-today::before { border: 2px solid var(--secondary-color); }
.trivia-legend .lg-progress::before { background: rgba(26, 115, 232, 0.6); }

@media (max-width: 575.98px) {
    .trivia-calendar { gap: 0.2rem; }
    .trivia-day { min-height: 54px; padding: 0.25rem; font-size: 0.7rem; }
    .trivia-day-score { font-size: 0.7rem; }
}

/* ==========================================================================
   Player
   ========================================================================== */

.trivia-player {
    max-width: 760px;
    margin: 0 auto;
}

.trivia-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.trivia-progress-dots {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.trivia-progress-dots span {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.3s ease, transform 0.3s ease;
}

.trivia-progress-dots span.current { background: var(--secondary-color); transform: scale(1.25); }
.trivia-progress-dots span.correct { background: #34a853; }
.trivia-progress-dots span.incorrect,
.trivia-progress-dots span.missed { background: #ea4335; }
.trivia-progress-dots span.pending { background: #fbbc04; }

.trivia-score {
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.trivia-timer {
    height: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.trivia-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #34a853, var(--secondary-color));
    transform-origin: left center;
}

.trivia-timer-bar.warning {
    background: linear-gradient(90deg, #ea4335, #fbbc04);
}

.trivia-timer-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.trivia-stage {
    min-height: 360px;
    padding: 2rem;
    border-radius: 24px;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    color: #fff;
    position: relative;
}

.trivia-stage.enter {
    animation: triviaEnter 0.35s ease-out;
}

@keyframes triviaEnter {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.trivia-question-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.trivia-chip {
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.trivia-chip.difficulty-hard { background: rgba(234, 67, 53, 0.2); color: #ff8a80; }
.trivia-chip.difficulty-medium { background: rgba(251, 188, 4, 0.2); color: #ffd54f; }
.trivia-chip.difficulty-easy { background: rgba(52, 168, 83, 0.2); color: #81c995; }

.trivia-prompt {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    overflow-wrap: anywhere;
}

.trivia-media {
    margin-bottom: 1.25rem;
    text-align: center;
}

.trivia-media img,
.trivia-media video {
    max-width: 100%;
    max-height: 320px;
    border-radius: 16px;
}

.trivia-media audio {
    width: 100%;
}

.trivia-media .ratio {
    border-radius: 16px;
    overflow: hidden;
}

.trivia-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 575.98px) {
    .trivia-options { grid-template-columns: 1fr; }
    .trivia-stage { padding: 1.25rem; }
    .trivia-prompt { font-size: 1.15rem; }
}

.trivia-option {
    width: 100%;
    text-align: left;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.trivia-option:hover:not(:disabled) {
    border-color: rgba(249, 200, 70, 0.6);
    transform: translateY(-1px);
}

.trivia-option:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.trivia-option[aria-pressed="true"] {
    border-color: var(--secondary-color);
    background: rgba(249, 200, 70, 0.15);
}

.trivia-option-key {
    display: inline-flex;
    width: 1.6rem;
    height: 1.6rem;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.trivia-association {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.trivia-association-group {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.6rem;
}

.trivia-association-group h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 0.4rem;
}

.trivia-association-group li {
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 0.3rem;
    font-weight: 600;
    list-style: none;
}

.trivia-association-group ul {
    padding: 0;
    margin: 0;
}

.trivia-hints li {
    padding: 0.6rem 0.8rem;
    border-left: 3px solid var(--secondary-color);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 10px 10px 0;
    margin-bottom: 0.5rem;
    list-style: none;
}

.trivia-hints {
    padding: 0;
    margin: 0 0 1rem;
}

.trivia-answer-input {
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.trivia-answer-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--secondary-color);
    color: #fff;
    box-shadow: none;
}

.trivia-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.trivia-feedback {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(13, 17, 23, 0.92);
    animation: triviaFade 0.25s ease-out;
    padding: 1.5rem;
}

@keyframes triviaFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.trivia-feedback-icon {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.trivia-feedback.correct .trivia-feedback-icon { color: #34a853; }
.trivia-feedback.incorrect .trivia-feedback-icon,
.trivia-feedback.missed .trivia-feedback-icon { color: #ea4335; }
.trivia-feedback.pending .trivia-feedback-icon { color: #fbbc04; }

.trivia-interstitial {
    text-align: center;
    padding: 3rem 1rem;
}

.trivia-interstitial .countdown {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    line-height: 1;
    margin: 1rem 0;
}

.trivia-banner {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.trivia-banner.offline {
    background: rgba(234, 67, 53, 0.15);
    border: 1px solid rgba(234, 67, 53, 0.4);
    color: #ffb4ab;
}

/* Results */
.result-score {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.result-row-icon.correct { color: #34a853; }
.result-row-icon.incorrect,
.result-row-icon.unanswered { color: #ea4335; }
.result-row-icon.pending { color: #fbbc04; }

.formula-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-wrap;
}

/* Homepage promo */
.games-promo-section {
    padding: 3.5rem 0;
    background: linear-gradient(180deg, #0d1117, #121a2b);
}

.games-promo {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.games-promo-text {
    flex: 1 1 340px;
}

.games-promo-tiles {
    flex: 1 1 280px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    max-width: 360px;
}

.games-promo-tiles span {
    aspect-ratio: 1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
}

.games-promo-tiles span.hit {
    background: rgba(52, 168, 83, 0.25);
    border-color: rgba(52, 168, 83, 0.5);
    color: #81c995;
}

.games-promo-tiles span.star {
    background: rgba(249, 200, 70, 0.2);
    border-color: rgba(249, 200, 70, 0.5);
    color: var(--secondary-color);
}

@media (prefers-reduced-motion: reduce) {
    .trivia-stage.enter,
    .trivia-feedback,
    .trivia-option,
    .trivia-progress-dots span,
    .games-nav a {
        animation: none !important;
        transition: none !important;
    }
}

/* Rewards: level, XP, badges */
.level-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    background: linear-gradient(135deg, #fbbc04, #f29900);
    flex-shrink: 0;
}
.level-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.level-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #fbbc04, #f29900); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.badge-tile {
    --rarity: #9aa0a6;
    text-align: center;
    padding: 1rem 0.75rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.badge-tile.earned { border-color: var(--rarity); }
.badge-tile.locked { opacity: 0.5; }
.badge-tile.locked .badge-icon { filter: grayscale(1); }
.badge-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--rarity);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--rarity);
    margin-bottom: 0.5rem;
}
.badge-rarity { color: var(--rarity); font-weight: 600; }
.rarity-common { --rarity: #9aa0a6; }
.rarity-rare { --rarity: #4285f4; }
.rarity-epic { --rarity: #a142f4; }
.rarity-legendary { --rarity: #fbbc04; }

.result-xp { display: inline-block; font-size: 1.25rem; font-weight: 800; color: #fbbc04; }
.badge-chip {
    --rarity: #9aa0a6;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #fff;
    text-decoration: none;
    border: 1px solid var(--rarity);
    background: rgba(255, 255, 255, 0.06);
}
.badge-chip i { color: var(--rarity); }
.badge-chip:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* Set prepared by an organisation */
.set-organiser {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.9rem 0.35rem 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    max-width: 100%;
}
.set-organiser:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.set-organiser-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    flex-shrink: 0;
}
.set-organiser-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #1a1a2e;
    background: linear-gradient(135deg, #fbbc04, #f29900);
}
.set-organiser-label { display: block; font-size: 0.75rem; color: rgba(255, 255, 255, 0.6); line-height: 1.1; }

/* =====================================================================
   Arena hub: game selection cards (games/index.php)
   ===================================================================== */
.arena-game-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    padding: 1.75rem;
    border-radius: 24px;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(249, 200, 70, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.arena-game-card:hover,
a.arena-game-card:focus-visible {
    color: #fff;
    transform: translateY(-4px);
    border-color: rgba(249, 200, 70, 0.6);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.4);
}

.arena-game-daily {
    background:
        radial-gradient(circle at 85% 15%, rgba(249, 200, 70, 0.25), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(26, 115, 232, 0.3), transparent 50%),
        linear-gradient(145deg, #1a1a2e, #16213e);
}

.arena-game-conquest {
    background:
        radial-gradient(circle at 85% 15%, rgba(46, 204, 113, 0.25), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(231, 76, 60, 0.28), transparent 50%),
        linear-gradient(145deg, #14261c, #1c1f35);
}

.arena-game-card.is-locked {
    opacity: 0.85;
    cursor: default;
}

.arena-game-icon {
    position: absolute;
    right: -0.75rem;
    top: -0.75rem;
    font-size: 7rem;
    opacity: 0.12;
    pointer-events: none;
}

.arena-game-card h3 {
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.arena-game-status {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.arena-game-cta {
    margin-top: 0.75rem;
    font-weight: 700;
    color: var(--accent-color, #f9c846);
}

/* Quizzly Conquest statistics: tables on the dark cards */
.cq-stats-table { --bs-table-bg: transparent; --bs-table-color: #fff; --bs-table-border-color: rgba(255, 255, 255, 0.1); }
.cq-stats-table thead th { background: transparent !important; color: rgba(255, 255, 255, 0.6) !important; font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }

/* Conquest home: every field and button in the play cards one height, button text on one line */
.cq-play-forms .form-control,
.cq-play-forms .form-select,
.cq-play-forms .btn-modern-primary,
.cq-play-forms .btn-modern-outline {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
}
.cq-play-forms .form-control,
.cq-play-forms .form-select { padding-top: 0; padding-bottom: 0; line-height: 38px; }
.cq-play-forms .btn-modern-primary,
.cq-play-forms .btn-modern-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
    flex: none;
}

/* Conquest statistics page */
.cq-stats { --cq-good: #4ade80; --cq-fair: #f6c544; --cq-weak: #f87171; --cq-gold: #f6c544; }
.cq-stats .cq-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.6); font-weight: 600; }
.cq-stats .cq-card-title { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }
.cq-stats .cq-note { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); line-height: 1.45; }
.cq-rating-value { display: flex; align-items: center; gap: 0.6rem; margin: 0.15rem 0 0.6rem; }
.cq-rating-value > span:first-child { font-size: 3rem; font-weight: 800; line-height: 1; color: #fff; }
.cq-chip-soft { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.15); }
.cq-rating-place { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--cq-gold); }
.cq-progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); margin-bottom: 0.35rem; }
.cq-progress-label span { color: #fff; font-weight: 600; }
.cq-progress { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.cq-progress span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #c99a3f, var(--cq-gold)); }
.cq-trend { height: 64px; }

/* Four headline numbers */
.cq-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; height: 100%; }
@media (min-width: 768px) { .cq-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cq-kpi { padding: 1.2rem 1.1rem; display: flex; flex-direction: column; justify-content: flex-start; min-height: 140px; }
.cq-kpi > i { font-size: 1.4rem; color: var(--cq-gold); margin-bottom: 0.5rem; }
.cq-kpi-value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.cq-kpi-label { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); margin-top: 0.15rem; }
.cq-kpi-sub { font-size: 0.75rem; color: rgba(255, 255, 255, 0.5); margin-top: 0.25rem; }

/* Mode tabs and tiles */
.cq-mode-tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 12px; background: rgba(0, 0, 0, 0.25); margin-bottom: 1.25rem; flex-wrap: wrap; }
.cq-mode-tab { display: inline-flex; align-items: center; gap: 0.45rem; border: 0; border-radius: 9px; padding: 0.5rem 0.95rem; background: transparent; color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.cq-mode-tab:hover { color: #fff; }
.cq-mode-tab.active { background: rgba(246, 197, 68, 0.16); color: var(--cq-gold); box-shadow: inset 0 0 0 1px rgba(246, 197, 68, 0.45); }
.cq-mode-tab .cq-count { min-width: 1.6rem; padding: 0 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 0.75rem; line-height: 1.4rem; text-align: center; }
.cq-group-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.55); font-weight: 700; margin: 1.1rem 0 0.6rem; }
.cq-mode-panel .cq-group-title:first-child { margin-top: 0; }
.cq-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 0.6rem; }
.cq-stat { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.85rem; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); }
.cq-stat > i { width: 2.2rem; height: 2.2rem; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(246, 197, 68, 0.12); color: var(--cq-gold); font-size: 1.05rem; }
.cq-stat-value { font-size: 1.3rem; font-weight: 700; color: #fff; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cq-stat-label { font-size: 0.78rem; color: rgba(255, 255, 255, 0.65); line-height: 1.25; }
.cq-empty { display: flex; align-items: center; gap: 0.6rem; padding: 1rem; border-radius: 12px; background: rgba(255, 255, 255, 0.03); color: rgba(255, 255, 255, 0.6); font-size: 0.9rem; }
.cq-empty i { font-size: 1.2rem; color: rgba(255, 255, 255, 0.4); }

/* Accuracy per category */
.cq-cat { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0; }
.cq-cat + .cq-cat { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.cq-cat img { flex: none; width: 34px; height: 34px; }
.cq-cat-body { flex: 1; min-width: 0; }
.cq-cat-head { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; }
.cq-cat-name { color: #fff; font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-cat-value { font-weight: 700; font-size: 0.92rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cq-cat-value small { font-weight: 500; color: rgba(255, 255, 255, 0.5); margin-left: 0.25rem; }
.cq-bar-track { height: 9px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.cq-bar-track span { display: block; height: 100%; border-radius: 5px; }
.cq-stats .tone-good { color: var(--cq-good); }
.cq-stats .tone-fair { color: var(--cq-fair); }
.cq-stats .tone-weak { color: var(--cq-weak); }
.cq-bar-track span.tone-good { background: var(--cq-good); }
.cq-bar-track span.tone-fair { background: var(--cq-fair); }
.cq-bar-track span.tone-weak { background: var(--cq-weak); }

/* Recent matches */
.cq-recent { list-style: none; margin: 0; padding: 0; }
.cq-recent li { display: flex; align-items: center; gap: 0.85rem; padding: 0.65rem 0; }
.cq-recent li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.cq-medal { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; grid-auto-flow: column; font-weight: 800; font-size: 1.15rem; color: #1b1406; }
.cq-medal small { font-size: 0.65rem; font-weight: 600; opacity: 0.75; align-self: end; margin-bottom: 0.7rem; }
.cq-medal.gold { background: radial-gradient(circle at 35% 30%, #fff1b8, #f2c94c 55%, #a77a1f); }
.cq-medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c9d1dc 55%, #7d8795); }
.cq-medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd9b0, #d08a4e 55%, #8a5126); }
.cq-medal.plain { background: rgba(255, 255, 255, 0.1); color: #fff; }
.cq-recent-main { flex: 1; min-width: 0; }
.cq-recent-outcome { font-weight: 700; color: #fff; }
.cq-recent-outcome.outcome-won { color: var(--cq-good); }
.cq-recent-outcome.outcome-defeated { color: var(--cq-weak); }
.cq-recent-meta { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.cq-recent-num { text-align: right; min-width: 4.2rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.cq-recent-num small { display: block; font-size: 0.7rem; font-weight: 500; color: rgba(255, 255, 255, 0.5); }
.cq-replay { flex: none; }
@media (max-width: 575.98px) {
    .cq-recent li { flex-wrap: wrap; }
    .cq-recent-num { min-width: 3.5rem; }
    .cq-kpi { min-height: 120px; }
    .cq-kpi-value { font-size: 1.6rem; }
}
