:root {
    --primary: #059669;
    --primary-dark: #047857;
    --accent: #065f46;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #2c3e50;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.1);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--text);
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
    min-height: 100vh;
    line-height: 1.5;
}

/* ==============================
   Layout
   ============================== */
.hub-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.hub-header {
    text-align: center;
    color: #fff;
    padding: 24px 16px;
}

.hub-header h1 {
    margin: 0;
    font-size: 2.5rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.hub-header p {
    margin: 6px 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ==============================
   Main nav
   ============================== */
.hub-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
    background: #fff;
}

.nav-btn.active {
    background: var(--primary-dark);
    color: #fff;
}

/* ==============================
   Pages
   ============================== */
.games-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.game-page {
    display: none;
    padding: 28px;
}

.game-page.active {
    display: block;
}

.game-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.game-header-inline h2 {
    margin: 0;
    font-size: 1.75rem;
}

.back-btn {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: var(--border);
}

/* ==============================
   Home page — Interests
   ============================== */
.interests-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0 0 32px;
}

.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.interest-card {
    flex: 1 1 160px;
    max-width: 220px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 40px 16px 28px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.interest-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(5, 150, 105, 0.22);
    border-color: var(--primary);
}

.interest-icon {
    font-size: 4rem;
    line-height: 1;
    display: block;
    margin-bottom: 16px;
}

.interest-card h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.interest-card p {
    color: var(--muted);
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}

.games-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.game-card-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.game-card h3 {
    margin: 6px 0;
    font-size: 1.25rem;
}

.game-card p {
    color: var(--muted);
    margin: 0 0 14px;
}

.play-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.play-btn:hover {
    background: var(--primary-dark);
}

/* Stats */
.stats-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
}

.stats-section h3 {
    margin: 0 0 14px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ==============================
   Generic game content
   ============================== */
.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.game-content canvas {
    border: 3px solid var(--text);
    border-radius: 6px;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    box-shadow: var(--shadow-md);
    max-width: 100%;
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.canvas-controls button,
.sound-btn,
.restart-btn {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: var(--success);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.canvas-controls button:hover,
.sound-btn:hover,
.restart-btn:hover {
    background: #0ea371;
    transform: translateY(-1px);
}

.sound-btn.off {
    background: var(--danger);
}

/* ==============================
   Battle simulator
   ============================== */
.battle-content {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 420px);
    gap: 20px;
    align-items: start;
}

.battle-content .left-panel,
.battle-content .right-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.resources-bar {
    display: flex;
    gap: 10px;
    background: var(--bg);
    border-radius: 8px;
    padding: 10px;
    justify-content: space-around;
}

.resource {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.resource .icon {
    font-size: 1.2rem;
}

.resource .value {
    color: var(--primary-dark);
}

/* Inner tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 6px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 14px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--bg);
}

.tab-btn.active {
    color: var(--primary-dark);
    background: var(--bg);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-top: 0;
}

/* Buildings / units / upgrades */
.building-grid,
.units-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.building-item,
.unit-item,
.upgrade-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

.building-preview,
.unit-preview {
    font-size: 2rem;
    text-align: center;
}

.building-info,
.unit-info,
.upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.building-info .name,
.unit-info .name,
.upgrade-info .name {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}

.building-info .cost,
.unit-info .cost,
.upgrade-info .level {
    color: var(--warning);
    margin: 0;
    font-weight: 600;
}

.building-info .desc,
.unit-info .stats,
.upgrade-info .effect {
    color: var(--muted);
    margin: 0;
}

.select-btn,
.train-btn,
.upgrade-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.select-btn:hover,
.train-btn:hover,
.upgrade-btn:hover {
    background: var(--primary-dark);
}

.unit-item input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}

.unit-item {
    grid-template-columns: 48px 1fr 60px auto;
}

.army-status {
    display: flex;
    justify-content: space-around;
    background: var(--bg);
    padding: 10px;
    border-radius: 8px;
    margin-top: 12px;
    font-weight: 600;
}

.army-status p {
    margin: 0;
}

.upgrades-list {
    display: grid;
    gap: 10px;
}

/* Battle log */
.battle-log {
    background: #1f2937;
    color: #d1d5db;
    border-radius: 8px;
    padding: 14px;
    max-height: 320px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry {
    margin: 0 0 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #374151;
}

.log-entry:last-child {
    border-bottom: none;
}

/* ==============================
   World Cup Predictor
   ============================== */
.wc-content {
    align-items: stretch;
    gap: 18px;
}

.wc-champion-banner {
    background: linear-gradient(135deg, #f6c33c 0%, #e5a017 100%);
    color: #2a2008;
    border-radius: var(--radius);
    padding: 20px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 20px rgba(229, 160, 23, 0.35);
    border: 2px solid #c08a0a;
}

.wc-champion-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.75;
}

.wc-champion-flag {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    line-height: 1;
}

.wc-champion-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.wc-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 4px;
}

.wc-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    padding: 10px 14px;
    border-radius: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.wc-name-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.wc-name-row input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 160px;
    background: #fff;
    color: var(--text);
}

.wc-name-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.wc-shared-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff7d6;
    border: 1px solid #e5c76a;
    border-left: 4px solid #e5a017;
    border-radius: var(--radius);
    padding: 10px 14px;
    color: #6b4e00;
    font-size: 0.9rem;
}

.wc-shared-banner[hidden],
.wc-toast[hidden] {
    display: none !important;
}

.wc-shared-icon {
    font-size: 1.2rem;
}

.wc-shared-text {
    flex: 1;
}

.wc-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(30px);
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100;
    max-width: 90vw;
    text-align: center;
}

.wc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.wc-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.wc-btn:hover {
    background: var(--bg);
    transform: translateY(-1px);
    border-color: var(--primary);
}

.wc-btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.wc-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.wc-btn-ghost {
    background: transparent;
}

.wc-btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.wc-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wc-section-title {
    margin: 4px 0 0;
    font-size: 1.15rem;
}

.wc-section-hint {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.wc-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.wc-group-card {
    background: var(--surface);
    border: 2px solid #c7cbe0;
    border-top: 5px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(5, 150, 105, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wc-group-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(5, 150, 105, 0.15);
    transform: translateY(-1px);
}

.wc-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.wc-group-letter {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

.wc-group-actions {
    display: flex;
    gap: 6px;
}

.wc-matches {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-match {
    display: grid;
    grid-template-columns: 1fr 40px 12px 40px 1fr;
    gap: 6px;
    align-items: center;
    padding: 5px 4px;
    border-radius: 6px;
}

.wc-match:hover {
    background: var(--bg);
}

.wc-team {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-team-a { justify-content: flex-end; text-align: right; }
.wc-team-b { justify-content: flex-start; text-align: left; }

.wc-flag {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.wc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
}

.wc-shirt {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.wc-standings td .wc-badge {
    margin-right: 4px;
    vertical-align: middle;
}

.wc-champ-emoji {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wc-champ-jersey .wc-shirt {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
}

.wc-vs {
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.wc-score-input {
    width: 100%;
    padding: 5px 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    background: #fff;
    color: var(--text);
    -moz-appearance: textfield;
}

.wc-score-input::-webkit-outer-spin-button,
.wc-score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wc-score-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.wc-standings {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 6px;
}

.wc-standings th,
.wc-standings td {
    padding: 4px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.wc-standings th {
    background: var(--bg);
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.wc-standings td:nth-child(2) {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.wc-standings tr.advance td {
    background: rgba(46, 204, 113, 0.1);
    font-weight: 600;
}

.wc-standings tr.third td {
    background: rgba(241, 196, 15, 0.1);
}

/* ----- Knockouts ----- */
.wc-knockouts {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 2px 14px;
    scrollbar-width: thin;
}

.wc-knockout-empty {
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    width: 100%;
}

.wc-round {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    flex-shrink: 0;
    justify-content: space-around;
}

.wc-round-title {
    margin: 0 0 6px;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: center;
    font-weight: 700;
}

.wc-round-matches {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: space-around;
    flex: 1;
}

.wc-ko-match {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.wc-ko-team {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    font-size: 0.85rem;
    color: var(--text);
    min-height: 36px;
}

.wc-ko-team:last-child { border-bottom: none; }

.wc-ko-team:not(:disabled):hover {
    background: rgba(5, 150, 105, 0.08);
}

.wc-ko-team:disabled {
    cursor: default;
    color: var(--muted);
    background: var(--bg);
}

.wc-ko-team.wc-ko-picked {
    background: rgba(46, 204, 113, 0.18);
    font-weight: 700;
    color: #1b6b41;
}

.wc-ko-flag { font-size: 1rem; }

.wc-ko-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-ko-group {
    font-size: 0.65rem;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
    flex-shrink: 0;
}

.wc-ko-empty {
    color: var(--muted);
    font-style: italic;
}

/* Final round gets a gold flourish */
.wc-round:last-child .wc-ko-match {
    border: 2px solid #e5a017;
    box-shadow: 0 4px 14px rgba(229, 160, 23, 0.25);
}

.wc-source {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin: 6px 0 0;
    font-style: italic;
}

@media (max-width: 640px) {
    .wc-match {
        grid-template-columns: 1fr 36px 10px 36px 1fr;
        gap: 4px;
    }
    .wc-team {
        font-size: 0.8rem;
    }
}

/* ==============================
   School Bus Tracker
   ============================== */
.bus-content {
    align-items: stretch;
    gap: 16px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.bus-route-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
    color: #fff;
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.bus-route-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.bus-route-info {
    flex: 1;
}

.bus-route-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.bus-route-op {
    margin: 4px 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.bus-status-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 18px;
    align-items: center;
}

.bus-status-card[data-kind="pending"] { border-left-color: var(--success); }
.bus-status-card[data-kind="passed"]  { border-left-color: var(--warning); }
.bus-status-card[data-kind="complete"] { border-left-color: var(--muted); }
.bus-status-card[data-kind="off"]     { border-left-color: var(--primary); background: #f9fafc; }

.bus-status-time {
    grid-row: 1 / span 2;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.bus-status-main {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.bus-status-sub {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 2px;
}

.bus-stop-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: var(--bg);
    padding: 12px 14px;
    border-radius: 8px;
}

.bus-stop-picker-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bus-stop-picker-row label {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bus-stop-picker select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
}

@media (max-width: 520px) {
    .bus-stop-picker {
        grid-template-columns: 1fr;
    }
}

.bus-journey {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.bus-journey-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--text);
}

.bus-timeline {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    position: relative;
}

.bus-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 16px;
    bottom: 16px;
    width: 3px;
    background: var(--border);
    border-radius: 2px;
}

.bus-stop {
    display: grid;
    grid-template-columns: 34px 72px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    position: relative;
    color: var(--text);
}

.bus-stop-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid var(--surface);
    outline: 2px solid var(--border);
    margin-left: 4px;
    z-index: 1;
    transition: background 0.25s ease, outline-color 0.25s ease, transform 0.2s ease;
}

.bus-stop.passed .bus-stop-dot {
    background: var(--muted);
    outline-color: var(--muted);
}

.bus-stop.passed {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: rgba(107, 114, 128, 0.35);
}

.bus-stop.current .bus-stop-dot {
    background: var(--success);
    outline-color: var(--success);
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18);
    animation: bus-pulse 1.6s ease-in-out infinite;
}

.bus-stop.current .bus-stop-time,
.bus-stop.current .bus-stop-name {
    color: var(--success);
    font-weight: 700;
}

.bus-stop.upcoming .bus-stop-dot {
    background: var(--primary);
    outline-color: var(--primary);
}

.bus-stop.my-stop {
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.1), transparent);
    border-radius: 6px;
    padding-left: 6px;
    margin-left: -6px;
}

.bus-stop.my-stop .bus-stop-badge::before {
    content: 'My stop';
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.bus-stop-time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-dark);
}

.bus-stop.passed .bus-stop-time {
    color: var(--muted);
}

.bus-stop-name {
    font-size: 0.95rem;
}

@keyframes bus-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18); }
    50%      { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.08); }
}

.bus-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 4px 0 0;
    font-style: italic;
}

/* ----- Train board ----- */
.trains-section {
    background: #0b2230;
    color: #e8eef3;
    border-radius: var(--radius);
    padding: 16px 18px 14px;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
}

.trains-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.trains-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #e8eef3;
    letter-spacing: 0.3px;
}

.trains-refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e8eef3;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.trains-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.trains-status {
    color: #8ea4b5;
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.trains-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.train-row {
    display: grid;
    grid-template-columns: 120px 1fr 70px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #2ecc71;
    transition: background 0.2s ease;
}

.train-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.train-row.cancelled {
    border-left-color: #e74c3c;
    opacity: 0.75;
}

.train-time-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-variant-numeric: tabular-nums;
}

.train-std {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.train-std.strike {
    text-decoration: line-through;
    color: #8ea4b5;
}

.train-etd {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.train-etd.ontime { color: #2ecc71; }
.train-etd.delayed { color: #f39c12; }
.train-etd.cancelled { color: #e74c3c; }

.train-info-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.train-dest {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.train-operator {
    font-size: 0.8rem;
    color: #8ea4b5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.train-plat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 60px;
}

.train-plat-label {
    font-size: 0.65rem;
    color: #8ea4b5;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.train-plat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffd166;
    line-height: 1.1;
}

.trains-source {
    color: #6b8294;
    font-size: 0.75rem;
    text-align: center;
    margin: 10px 0 0;
    font-style: italic;
}

@media (max-width: 520px) {
    .train-row {
        grid-template-columns: 90px 1fr 54px;
        gap: 8px;
        padding: 8px 10px;
    }
    .train-std { font-size: 1.15rem; }
    .train-plat-value { font-size: 1.05rem; }
}

@media (max-width: 520px) {
    .bus-stop {
        grid-template-columns: 30px 60px 1fr;
    }
    .bus-stop-badge {
        grid-column: 1 / -1;
        padding-left: 40px;
    }
    .bus-status-time {
        font-size: 2rem;
    }
    .bus-route-header {
        flex-wrap: wrap;
    }
}

/* ==============================
   Match 3
   ============================== */
.match3-content {
    align-items: stretch;
    gap: 18px;
}

.match3-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px;
}

.match3-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 14px;
    min-width: 80px;
}

.match3-stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.match3-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.match3-restart {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.match3-restart:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.match3-board-wrap {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.match3-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    background: #2b3e50;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    aspect-ratio: 1 / 1;
    position: relative;
}

.gem {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.2s ease, box-shadow 0.15s ease;
}

.gem:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.06);
}

.gem.selected {
    background: rgba(5, 150, 105, 0.55);
    transform: scale(1.12);
    box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.gem.clearing {
    animation: gem-explode 0.22s ease-out forwards;
    z-index: 2;
}

.gem.bounce {
    animation: gem-bounce 0.22s ease-in-out;
}

.gem.empty {
    opacity: 0;
    pointer-events: none;
}

@keyframes gem-explode {
    0%   { transform: scale(1);   opacity: 1;   filter: brightness(1); }
    15%  { transform: scale(1.8); opacity: 1;   filter: brightness(3) saturate(2); }
    50%  { transform: scale(1.4); opacity: 0.7; filter: brightness(2); }
    100% { transform: scale(0);   opacity: 0;   filter: brightness(1); }
}

.gem-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: particle-fly linear forwards;
    z-index: 20;
}

@keyframes particle-fly {
    0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
    70%  { opacity: 0.8; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

.gem-shockwave {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    border: 3px solid;
    animation: shockwave 0.42s ease-out forwards;
    z-index: 15;
}

@keyframes shockwave {
    0%   { transform: scale(0.4); opacity: 0.9; }
    100% { transform: scale(2.6); opacity: 0; }
}

@keyframes gem-bounce {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.match3-board.dropping .gem {
    animation: gem-drop 0.22s ease-out;
}

@keyframes gem-drop {
    0%   { transform: translateY(-14px); opacity: 0.3; }
    100% { transform: translateY(0);     opacity: 1; }
}

.match3-overlay {
    position: absolute;
    inset: 0;
    display: none;
    background: rgba(30, 40, 55, 0.85);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.match3-overlay.show {
    display: flex;
    animation: m3-fade 0.3s ease-out;
}

.match3-overlay-inner {
    background: #fff;
    padding: 28px 36px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 80%;
}

.match3-overlay-inner h3 {
    margin: 0 0 10px;
    font-size: 1.6rem;
}

.match3-overlay-inner p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 1rem;
}

@keyframes m3-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.match3-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 4px 0 0;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ==============================
   Info content (history / football / gaming)
   ============================== */
.info-content {
    align-items: stretch;
}

.info-section h3 {
    margin: 0 0 18px;
    font-size: 1.4rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 58px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.timeline-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}

.timeline-content h4 {
    margin: 0 0 6px;
}

.timeline-content p {
    margin: 0;
    color: var(--muted);
}

/* Info grid (football) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.info-card h4 {
    margin: 0 0 10px;
}

.info-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.info-card li {
    margin: 4px 0;
}

/* Gaming page */
.gaming-categories,
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.gaming-category,
.platform-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gaming-category:hover,
.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.gaming-category h4,
.platform-card h4 {
    margin: 0 0 8px;
}

.gaming-category p,
.platform-card p {
    margin: 0;
    color: var(--muted);
}

.gaming-platforms h3 {
    margin-top: 10px;
}

/* ==============================
   Quiz
   ============================== */
.quiz-intro {
    text-align: center;
    color: var(--muted);
    font-size: 1rem;
    margin: 0 0 24px;
}

.quiz-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-bottom: 28px;
}

.quiz-topic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 22px 28px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    min-width: 110px;
    color: var(--text);
}

.quiz-topic-card:hover { border-color: var(--primary); transform: translateY(-2px); }

.quiz-topic-card.selected {
    border-color: var(--primary);
    background: rgba(5, 150, 105, 0.1);
}

.quiz-topic-icon { font-size: 2.2rem; line-height: 1; }

.quiz-difficulty-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.diff-btn {
    padding: 10px 28px;
    border: 2px solid var(--border);
    border-radius: 30px;
    background: var(--bg);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.diff-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.quiz-start-btn {
    display: block;
    margin: 0 auto;
    padding: 14px 40px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.quiz-start-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Active quiz */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 600;
}

.quiz-progress-track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.35s ease;
    width: 0%;
}

.quiz-question-box {
    background: var(--bg);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    min-height: 90px;
    display: flex;
    align-items: center;
}

.quiz-question-box p {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
}

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

.quiz-option-btn {
    padding: 14px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    line-height: 1.35;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.quiz-option-btn:not(:disabled):hover {
    border-color: var(--primary);
    background: rgba(5, 150, 105, 0.06);
    transform: translateY(-1px);
}

.quiz-option-btn.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    font-weight: 700;
}

.quiz-option-btn.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    color: #7f1d1d;
}

.quiz-next-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 36px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.quiz-next-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Results */
.quiz-results-box {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.quiz-result-emoji { font-size: 5rem; line-height: 1; }

.quiz-result-score {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.quiz-result-msg { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.quiz-result-meta { color: var(--muted); font-size: 0.9rem; }

.quiz-result-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.quiz-back-btn {
    padding: 12px 28px;
    border: 2px solid var(--border);
    border-radius: 30px;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.quiz-back-btn:hover { border-color: var(--primary); background: var(--bg); }

@media (max-width: 520px) {
    .quiz-options { grid-template-columns: 1fr; }
    .quiz-topic-card { padding: 16px 20px; min-width: 90px; }
}

/* ==============================
   Footer
   ============================== */
.hub-footer {
    text-align: center;
    color: #fff;
    padding: 20px 10px;
    opacity: 0.85;
}

.hub-footer p {
    margin: 0;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 768px) {
    .hub-header h1 {
        font-size: 2rem;
    }

    .battle-content {
        grid-template-columns: 1fr;
    }

    .game-page {
        padding: 18px;
    }

    .game-header-inline h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .hub-wrapper {
        padding: 16px 10px 30px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .building-item,
    .unit-item,
    .upgrade-item {
        grid-template-columns: 40px 1fr;
    }

    .building-item .select-btn,
    .upgrade-item .upgrade-btn {
        grid-column: 1 / -1;
    }

    .unit-item {
        grid-template-columns: 40px 1fr 60px auto;
    }
}

/* ==============================
   2048
   ============================== */
.g2048-content { align-items: stretch; gap: 14px; max-width: 520px; margin: 0 auto; width: 100%; }
.g2048-hud {
    display: flex; gap: 10px; justify-content: center; align-items: center;
    background: var(--bg); padding: 12px; border-radius: var(--radius);
}
.g2048-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 0 16px; min-width: 80px;
}
.g2048-stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.g2048-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }
.g2048-restart, .snake-restart, .mines-restart, .chess-restart, .sol-restart {
    background: var(--primary); color: #fff; border: none; padding: 10px 16px;
    border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
    transition: background 0.2s ease;
}
.g2048-restart:hover, .snake-restart:hover, .mines-restart:hover, .chess-restart:hover, .sol-restart:hover {
    background: var(--primary-dark);
}

.g2048-board-wrap { position: relative; aspect-ratio: 1; }
.g2048-board {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    background: #bbada0; padding: 8px; border-radius: 10px; aspect-ratio: 1;
    box-shadow: var(--shadow-md);
}
.g2048-tile {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    background: rgba(238, 228, 218, 0.35); border-radius: 6px;
    font-size: clamp(1.2rem, 5vw, 2.4rem); font-weight: 800; color: #776e65;
    transition: background 0.15s ease, color 0.15s ease;
}
.g2048-tile.v-2    { background: #eee4da; }
.g2048-tile.v-4    { background: #ede0c8; }
.g2048-tile.v-8    { background: #f2b179; color: #fff; }
.g2048-tile.v-16   { background: #f59563; color: #fff; }
.g2048-tile.v-32   { background: #f67c5f; color: #fff; }
.g2048-tile.v-64   { background: #f65e3b; color: #fff; }
.g2048-tile.v-128  { background: #edcf72; color: #fff; font-size: clamp(1.1rem, 4.5vw, 2.2rem); }
.g2048-tile.v-256  { background: #edcc61; color: #fff; font-size: clamp(1.1rem, 4.5vw, 2.2rem); }
.g2048-tile.v-512  { background: #edc850; color: #fff; font-size: clamp(1.1rem, 4.5vw, 2.2rem); }
.g2048-tile.v-1024 { background: #edc53f; color: #fff; font-size: clamp(1rem, 4vw, 1.9rem); }
.g2048-tile.v-2048 { background: #edc22e; color: #fff; font-size: clamp(1rem, 4vw, 1.9rem); }

.g2048-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(238, 228, 218, 0.85); border-radius: 10px; z-index: 5;
}
.g2048-overlay[hidden] { display: none; }
.g2048-overlay-inner { text-align: center; padding: 24px; }
.g2048-overlay-inner h3 { margin: 0 0 10px; font-size: 2rem; color: #776e65; }
.g2048-overlay-inner p { margin: 0 0 16px; color: #776e65; }
.g2048-hint { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ==============================
   Snake
   ============================== */
.snake-content { align-items: center; gap: 14px; }
.snake-hud {
    display: flex; gap: 10px; justify-content: center; align-items: center;
    background: var(--bg); padding: 12px; border-radius: var(--radius); width: 100%; max-width: 400px;
}
.snake-stat { display: flex; flex-direction: column; align-items: center; padding: 0 14px; min-width: 70px; }
.snake-stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.snake-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); }
#snakeCanvas {
    border: 3px solid #0f172a; border-radius: 8px;
    box-shadow: var(--shadow-md); max-width: 100%;
}
.snake-hint { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ==============================
   Minesweeper
   ============================== */
.mines-content { align-items: stretch; gap: 14px; max-width: 720px; margin: 0 auto; width: 100%; }
.mines-hud {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
    background: var(--bg); padding: 12px; border-radius: var(--radius);
}
.mines-stat { display: flex; flex-direction: column; align-items: center; padding: 0 10px; min-width: 70px; }
.mines-stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mines-stat-value { font-size: 1.3rem; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.mines-select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; font-size: 0.9rem; cursor: pointer;
}
.mines-board {
    display: grid; gap: 2px; padding: 6px;
    background: #9aa5ad; border-radius: 8px; box-shadow: var(--shadow-sm);
    overflow: auto; max-width: 100%;
}
.mines-cell {
    aspect-ratio: 1; min-width: 24px; min-height: 24px;
    background: #d0d7de; border: 2px outset #eaeef2; border-radius: 2px;
    cursor: pointer; font-weight: 800; font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.mines-cell.revealed {
    background: #eef2f6; border: 1px solid #c9d1d9; cursor: default;
}
.mines-cell.mine { background: #fca5a5; }
.mines-cell.n1 { color: #1e40af; }
.mines-cell.n2 { color: #166534; }
.mines-cell.n3 { color: #991b1b; }
.mines-cell.n4 { color: #3730a3; }
.mines-cell.n5 { color: #7c2d12; }
.mines-cell.n6 { color: #0e7490; }
.mines-cell.n7 { color: #000; }
.mines-cell.n8 { color: #6b7280; }
.mines-banner {
    grid-column: 1 / -1; margin-top: 8px; padding: 10px 14px;
    background: var(--surface); border-radius: 6px; text-align: center;
    font-weight: 700;
}
.mines-banner.won { background: #d1fae5; color: #065f46; }
.mines-banner.lost { background: #fee2e2; color: #991b1b; }
.mines-hint { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ==============================
   Chess
   ============================== */
.chess-content { align-items: stretch; gap: 14px; max-width: 520px; margin: 0 auto; width: 100%; }
.chess-hud {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
    background: var(--bg); padding: 12px; border-radius: var(--radius);
}
.chess-status {
    font-weight: 700; color: var(--primary-dark); flex: 1;
    min-width: 140px; text-align: center;
}
.chess-hint { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ==============================
   Solitaire
   ============================== */
.solitaire-content { align-items: stretch; gap: 14px; }
.sol-hud {
    display: flex; gap: 10px; justify-content: center; align-items: center;
    background: var(--bg); padding: 12px; border-radius: var(--radius);
}
.sol-stat { display: flex; flex-direction: column; align-items: center; padding: 0 14px; min-width: 70px; }
.sol-stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.sol-stat-value { font-size: 1.3rem; font-weight: 700; color: var(--primary-dark); }

.sol-table {
    display: flex; flex-direction: column; gap: 20px;
    background: #0f5132; padding: 16px; border-radius: 10px;
    overflow-x: auto;
}
.sol-row { display: flex; gap: 10px; }
.sol-tableau-row { align-items: flex-start; min-height: 400px; }
.sol-pile {
    min-width: 64px; min-height: 96px;
    display: flex; flex-direction: column;
}
.sol-column { flex: 1; }
.sol-spacer { flex: 1; min-width: 10px; }

.sol-card {
    width: 64px; height: 96px; border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    justify-content: space-between; padding: 6px 8px;
    font-weight: 800; cursor: pointer;
    user-select: none; position: relative;
    flex-shrink: 0;
}
.sol-card.back {
    background: repeating-linear-gradient(45deg, #1e3a8a, #1e3a8a 6px, #1e40af 6px, #1e40af 12px);
    border: 2px solid #fff;
    cursor: pointer;
}
.sol-card.face {
    background: #fff; border: 1px solid #ccc;
}
.sol-card.face.red { color: #dc2626; }
.sol-card.face.black { color: #111827; }
.sol-card.selected {
    outline: 3px solid #facc15;
    outline-offset: 2px;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.6);
}
.sol-rank { font-size: 1rem; }
.sol-suit { font-size: 1.6rem; text-align: right; }

.sol-empty {
    width: 64px; height: 96px; border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.4); font-size: 1.5rem; cursor: pointer;
}
.sol-empty.foundation-slot { font-size: 2rem; }

.sol-hint { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0; }

@media (max-width: 520px) {
    .sol-card, .sol-empty { width: 48px; height: 72px; }
    .sol-rank { font-size: 0.85rem; }
    .sol-suit { font-size: 1.2rem; }
}

/* ==============================
   Europe 1939 (WW2 grand strategy)
   ============================== */
.ww2-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}
.ww2-hud {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    background: var(--bg); padding: 10px 14px; border-radius: var(--radius);
}
.ww2-hud .ww2-label {
    font-size: 0.75rem; color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.6px; margin-right: 4px;
}
.ww2-hud .ww2-value {
    font-weight: 700; color: var(--primary-dark); margin-right: 12px;
}
.ww2-turn-info, .ww2-nation-info { display: flex; align-items: center; }
.ww2-btn {
    padding: 8px 14px; border: none; border-radius: 6px;
    background: var(--primary); color: #fff;
    font-weight: 700; cursor: pointer; font-size: 0.9rem;
    transition: background 0.2s;
}
.ww2-btn:hover { background: var(--primary-dark); }
.ww2-new-game { background: var(--muted); }
.ww2-new-game:hover { background: #4b5563; }

.ww2-map-wrap {
    background: #0e2540; border-radius: var(--radius);
    padding: 8px; overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}
#ww2-map {
    width: 100%; height: auto; display: block;
    font-family: var(--font-family);
}
.ww2-terr {
    cursor: pointer;
    transition: fill 0.15s, stroke-width 0.15s;
}
.ww2-terr:hover { filter: brightness(1.2); }
.ww2-terr.selected {
    stroke: #fbbf24 !important; stroke-width: 3 !important;
    filter: brightness(1.15);
}
.ww2-label-text {
    font-size: 11px; font-weight: 700;
    fill: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
    paint-order: stroke; stroke: rgba(0,0,0,0.8); stroke-width: 2.5px;
}
.ww2-unit-count {
    font-size: 10px; font-weight: 700;
    fill: #fde68a;
    paint-order: stroke; stroke: rgba(0,0,0,0.9); stroke-width: 2.5px;
}

.ww2-sidebar {
    background: var(--surface); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow-sm);
    min-height: 200px;
    font-size: 0.9rem;
}
.ww2-sb-title { margin: 0 0 10px; color: var(--primary-dark); font-size: 1.2rem; }
.ww2-sb-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; border-bottom: 1px dashed var(--border);
}
.ww2-sb-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ww2-sb-value { font-weight: 700; color: var(--text); }
.ww2-sb-section {
    margin-top: 12px; font-size: 0.75rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700;
}
.ww2-sb-units { list-style: none; margin: 6px 0; padding: 0; }
.ww2-sb-units li { padding: 3px 0; }
.ww2-sb-units .ww2-none { color: var(--muted); font-style: italic; }
.ww2-sb-adj { margin: 6px 0 0; font-size: 0.85rem; color: var(--text); line-height: 1.4; }
.ww2-hint { margin: 0; color: var(--muted); font-style: italic; }

.ww2-log-wrap {
    grid-column: 1 / -1;
    background: var(--surface); border-radius: var(--radius);
    padding: 10px 14px; box-shadow: var(--shadow-sm);
    max-height: 140px; overflow-y: auto;
}
.ww2-log-wrap h3 {
    margin: 0 0 6px; color: var(--primary-dark);
    font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.6px;
}
.ww2-log { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.ww2-log li {
    padding: 3px 0; border-bottom: 1px dashed var(--border);
    color: var(--text);
}
.ww2-log li:last-child { border-bottom: none; }

@media (max-width: 900px) {
    .ww2-content { grid-template-columns: 1fr; }
    .ww2-sidebar { min-height: auto; }
}

/* ==============================
   Premier League Manager
   ============================== */
.plm-content {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    font-size: 0.92rem;
}

/* Team select */
.plm-select { text-align: center; padding: 10px 0; }
.plm-select-h { margin: 4px 0 4px; color: var(--primary-dark); font-size: 1.6rem; }
.plm-select-sub { margin: 0 0 22px; color: var(--muted); font-size: 0.95rem; }
.plm-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}
.plm-team-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 12px;
    border: none; border-radius: 8px;
    cursor: pointer; text-align: left;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s, box-shadow 0.12s;
    font-family: inherit;
    min-height: 68px;
}
.plm-team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plm-team-name { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.plm-team-meta { font-size: 0.75rem; opacity: 0.85; }

/* Dashboard */
.plm-dashboard { display: flex; flex-direction: column; gap: 14px; }
.plm-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.plm-hdr-small { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.85; }
.plm-hdr-name { font-size: 1.3rem; font-weight: 800; }
.plm-hdr-right { text-align: right; }

.plm-next-match {
    background: var(--surface); padding: 14px 18px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.plm-next-match h3 {
    margin: 0 0 10px; color: var(--primary-dark);
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.7px;
}
.plm-next-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.plm-big {
    font-size: 1.8rem; font-weight: 800;
    padding: 4px 14px; border-radius: 6px;
    background: var(--bg);
}
.plm-venue { font-size: 1.1rem; color: var(--muted); font-weight: 700; }
.plm-play-btn {
    margin-left: auto;
    padding: 10px 18px; border: none; border-radius: 6px;
    background: var(--primary); color: #fff;
    font-weight: 700; cursor: pointer; font-size: 0.95rem;
    transition: background 0.15s;
}
.plm-play-btn:hover { background: var(--primary-dark); }
.plm-next-sub { margin-top: 6px; color: var(--muted); font-size: 0.85rem; }

.plm-grid {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px;
}
.plm-col {
    background: var(--surface); padding: 12px 14px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.plm-col h3 {
    margin: 0 0 8px; color: var(--primary-dark);
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.7px;
}

/* League table */
.plm-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.plm-table th {
    text-align: left; padding: 5px 6px;
    font-weight: 700; color: var(--muted);
    border-bottom: 2px solid var(--border);
    font-size: 0.7rem; text-transform: uppercase;
}
.plm-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.plm-table tr.pos-cl td:first-child { border-left: 3px solid #10b981; }
.plm-table tr.pos-eur td:first-child { border-left: 3px solid #3b82f6; }
.plm-table tr.pos-rel td:first-child { border-left: 3px solid #ef4444; }
.plm-table tr.me {
    background: #fef3c7; font-weight: 700;
}
.plm-tbl-pos { font-weight: 700; color: var(--text); width: 22px; text-align: center; }
.plm-tbl-team { display: flex; align-items: center; gap: 6px; }
.plm-tbl-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Squad */
.plm-squad { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.plm-squad td { padding: 4px 6px; border-bottom: 1px dashed var(--border); }
.plm-sq-pos {
    width: 34px; text-align: center; font-weight: 800; font-size: 0.72rem;
    border-radius: 4px; padding: 2px 4px !important;
    color: #fff;
}
.plm-sq-pos.pos-GK  { background: #f59e0b; }
.plm-sq-pos.pos-DEF { background: #3b82f6; }
.plm-sq-pos.pos-MID { background: #10b981; }
.plm-sq-pos.pos-FWD { background: #ef4444; }
.plm-sq-name { flex: 1; }
.plm-sq-rating { width: 40px; text-align: center; font-weight: 700; color: var(--primary-dark); }
.plm-sq-goals  { width: 50px; text-align: right; color: var(--primary-dark); }

.plm-footer {
    display: flex; justify-content: flex-end; padding: 0;
}
.plm-reset-btn {
    padding: 8px 14px; border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.plm-reset-btn:hover { background: var(--bg); color: var(--text); }

/* Match result */
.plm-match {
    background: var(--surface); padding: 18px 20px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 10px;
}
.plm-match-title {
    margin: 0; text-align: center; font-size: 1.8rem; font-weight: 800;
    color: var(--primary-dark);
}
.plm-score {
    background: var(--primary); color: #fff;
    padding: 2px 12px; border-radius: 6px; margin: 0 8px;
}
.plm-match-verdict { margin: 0; text-align: center; font-size: 1.1rem; font-weight: 700; }
.plm-timeline {
    list-style: none; padding: 0; margin: 10px 0;
    max-height: 360px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg);
}
.plm-ev {
    padding: 6px 12px; border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.plm-ev:last-child { border-bottom: none; }
.plm-ev.ev-goal { background: #ecfccb; font-weight: 600; }
.plm-ev.ev-ht   { background: var(--bg); font-weight: 700; color: var(--primary-dark); }
.plm-ev.ev-ft   { background: var(--bg); font-weight: 700; color: var(--primary-dark); border-top: 2px solid var(--primary); }
.plm-ev.ev-red  { background: #fee2e2; color: #991b1b; font-weight: 600; }
.plm-ev.ev-kickoff { background: var(--bg); font-weight: 600; }

/* Season end */
.plm-season-end {
    background: var(--surface); padding: 22px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    text-align: center;
}
.plm-season-end h2 { margin: 0 0 10px; color: var(--primary-dark); }
.plm-verdict-big { font-size: 1.2rem; font-weight: 700; margin: 12px 0 18px; }
.plm-season-end .plm-play-btn { margin: 20px 10px 0; }

@media (max-width: 760px) {
    .plm-grid { grid-template-columns: 1fr; }
    .plm-big { font-size: 1.4rem; padding: 4px 10px; }
    .plm-play-btn { margin-left: 0; width: 100%; }
}

/* ==============================
   PL Manager — Pick XI screen
   ============================== */
.plm-pickxi { display: flex; flex-direction: column; gap: 12px; }
.plm-pickxi-hdr {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.plm-pickxi-hdr .plm-reset-btn {
    background: rgba(255,255,255,0.15); color: inherit; border: 1px solid rgba(255,255,255,0.3);
}
.plm-pickxi-hdr .plm-reset-btn:hover { background: rgba(255,255,255,0.25); color: inherit; }

.plm-pickxi-controls {
    background: var(--surface); padding: 12px 14px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}
.plm-form-label {
    display: flex; align-items: center; gap: 8px; font-weight: 700;
    color: var(--text); font-size: 0.85rem;
}
.plm-form-label select {
    padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg); font-weight: 700; cursor: pointer;
    font-family: inherit; font-size: 0.9rem;
}
.plm-form-desc { margin: 0; color: var(--muted); font-size: 0.85rem; font-style: italic; flex: 1; min-width: 200px; }
.plm-pickxi-actions { display: flex; gap: 8px; margin-left: auto; }
.plm-pickxi-actions .plm-play-btn[disabled] {
    background: var(--muted); cursor: not-allowed; opacity: 0.7;
}
.plm-pickxi-actions .plm-play-btn[disabled]:hover { background: var(--muted); }

.plm-pickxi-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

/* XI slots (left column) */
.plm-xi-row { margin-bottom: 10px; }
.plm-xi-row-label {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
    font-size: 0.8rem; color: var(--muted);
}
.plm-xi-count { font-weight: 700; color: var(--text); }
.plm-xi-slots {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.plm-xi-slot { flex: 0 0 auto; }
.plm-xi-slot.empty {
    padding: 8px 12px; border: 2px dashed var(--border);
    color: var(--muted); border-radius: 6px;
    font-size: 0.8rem; font-weight: 700;
}
.plm-xi-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); cursor: pointer; font-family: inherit;
    font-size: 0.85rem;
    transition: background 0.12s;
}
.plm-xi-btn:hover { background: #fee2e2; border-color: #ef4444; }
.plm-xi-rating {
    background: var(--primary); color: #fff; padding: 1px 6px;
    border-radius: 4px; font-weight: 700; font-size: 0.75rem;
}
.plm-xi-name { font-weight: 600; }
.plm-xi-remove { color: #ef4444; font-weight: 700; font-size: 0.9rem; margin-left: 4px; }

/* Squad picker table (right column) */
.plm-squad-picker tr { cursor: pointer; }
.plm-squad-picker tr:hover { background: #f0fdf4; }
.plm-squad-picker tr.picked { background: #ecfccb; }
.plm-squad-picker tr.picked:hover { background: #fee2e2; }
.plm-squad-picker tr.full { opacity: 0.45; cursor: not-allowed; }
.plm-squad-picker tr.full:hover { background: transparent; }
.plm-squad-picker tr.unavailable,
.plm-squad tr.unavailable {
    opacity: 0.45;
    text-decoration: line-through;
}
.plm-squad-picker tr.unavailable { cursor: not-allowed; }
.plm-squad-picker tr.unavailable:hover { background: transparent; }

/* Player status badges (yellows / reds / suspensions / injuries) */
.plm-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    font-size: 0.7rem; font-weight: 700;
    border-radius: 4px;
    vertical-align: middle;
}
.plm-badge.badge-yel { background: #fef3c7; color: #78350f; }
.plm-badge.badge-red { background: #fee2e2; color: #991b1b; }
.plm-badge.badge-sus { background: #e5e7eb; color: #1f2937; }
.plm-badge.badge-inj { background: #fed7aa; color: #7c2d12; }

/* Match timeline styling for the new event types */
.plm-ev.ev-injury { background: #ffedd5; color: #7c2d12; font-weight: 600; }
.plm-ev.ev-ban    { background: #e5e7eb; color: #111827; font-weight: 700; border-top: 1px dashed var(--border); }
.plm-squad-action {
    text-align: center; font-weight: 700; font-size: 1.1rem;
    width: 24px; color: var(--primary);
}
.plm-squad-picker tr.picked .plm-squad-action { color: #ef4444; }

@media (max-width: 860px) {
    .plm-pickxi-grid { grid-template-columns: 1fr; }
    .plm-pickxi-actions { width: 100%; margin-left: 0; }
}

/* ===== Transfer Window ===== */
.plm-transfer { display: flex; flex-direction: column; gap: 0; }
.plm-transfer-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.plm-transfer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plm-transfer-section h3 { font-size: 1rem; margin: 0 0 6px; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plm-transfer-hint { font-size: 0.8rem; color: var(--muted); margin: 0 0 8px; }
.plm-transfer-scroll { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.plm-transfer-scroll table { width: 100%; }
.plm-transfer-news { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.plm-transfer-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.plm-budget-chip { background: #d1fae5; color: #065f46; padding: 2px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; }
.plm-fa-unaffordable { opacity: 0.45; }
.plm-xfer-btn { padding: 4px 10px; border: none; border-radius: 5px; font-size: 0.78rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.plm-buy-btn  { background: #10b981; color: #fff; }
.plm-buy-btn:hover  { background: #059669; }
.plm-sell-btn { background: #ef4444; color: #fff; }
.plm-sell-btn:hover { background: #dc2626; }
.plm-xfer-price { font-size: 0.8rem; color: var(--muted); }
.plm-transfer-log { list-style: none; padding: 0; margin: 0; max-height: 160px; overflow-y: auto; }
.plm-transfer-log li { padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 0.82rem; }
.plm-transfer-log li:last-child { border-bottom: none; }
.plm-jan-hint { background: #dbeafe; color: #1e3a8a; border-radius: 6px; padding: 8px 12px; font-size: 0.88rem; font-weight: 600; margin: 8px 0; }

/* Prize money / season end */
.plm-prize-box { background: linear-gradient(135deg, #fef3c7, #fde68a); border: 2px solid #f59e0b; border-radius: 10px; padding: 16px 20px; margin: 12px 0; text-align: center; }
.plm-prize-pos { font-size: 1rem; color: #78350f; font-weight: 700; }
.plm-prize-amount { font-size: 1.8rem; font-weight: 900; color: #92400e; }
.plm-prize-sub { font-size: 0.85rem; color: #78350f; margin-top: 4px; }
.plm-prize-details { margin: 10px 0; font-size: 0.88rem; }
.plm-prize-details summary { cursor: pointer; color: var(--primary-dark); font-weight: 600; }
.plm-prize-details tr.me { background: #eff6ff; font-weight: 700; }

@media (max-width: 700px) {
    .plm-transfer-cols { grid-template-columns: 1fr; }
}

/* Transfer market — club badge & filters */
.plm-market-club {
    display: inline-block; font-size: 0.68rem; font-weight: 700;
    padding: 1px 5px; border-radius: 4px; vertical-align: middle;
    line-height: 1.4; white-space: nowrap;
}
.plm-transfer-filters {
    display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.plm-transfer-filters select {
    flex: 1; min-width: 120px; padding: 5px 8px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 0.82rem; background: var(--card-bg); color: var(--text);
    cursor: pointer;
}
/* Division sections on team-select screen */
.plm-div-section { margin-bottom: 28px; }
.plm-div-header {
    font-size: 1rem; font-weight: 700; color: var(--primary-dark);
    border-bottom: 2px solid var(--primary); padding-bottom: 6px; margin: 0 0 12px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
/* Promotion/relegation summary box */
.plm-promo-box {
    background: #f0fdf4; border: 1px solid #6ee7b7; border-radius: 8px;
    padding: 12px 16px; margin: 14px 0; font-size: 0.9rem; line-height: 1.8;
}
.plm-promo-box p { margin: 0; }
/* Cup status strip on dashboard */
.plm-cup-status {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
    padding: 8px 14px; margin: 0 0 14px; font-size: 0.84rem;
    display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
}
.plm-cup-you { color: #065f46; font-weight: 700; }
/* Cup winner box at season end */
.plm-cup-won-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a); border: 2px solid #f59e0b;
    border-radius: 8px; padding: 12px 16px; margin: 10px 0;
    font-size: 1rem; font-weight: 700; color: #92400e;
}
.plm-cup-result-line {
    font-size: 0.87rem; color: var(--muted); margin: 6px 0;
}
