:root {
    --bg: #f3f5f7;
    --panel: #ffffff;
    --text: #17212b;
    --muted: #65717d;
    --line: #dfe5ea;
    --brand: #1f6f5f;
    --brand-dark: #154e43;
    --accent: #e7f5ef;
    --danger: #b42318;
    --shadow: 0 12px 30px rgba(20, 34, 46, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.page { min-height: calc(100vh - 132px); padding: 34px 0 56px; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-wrap { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--text); font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; }
nav { display: flex; align-items: center; gap: 18px; }
nav a { color: #394653; font-weight: 650; }
.user-pill { padding: 6px 11px; background: #edf1f3; border-radius: 999px; font-size: .9rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 20px 0; font-size: .9rem; background: #fff; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.06; letter-spacing: -.045em; margin-bottom: 14px; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; }
.lead { font-size: 1.14rem; color: #4f5f6d; max-width: 670px; }
.subtle { color: var(--muted); }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--brand); font-size: .76rem; margin-bottom: 10px; }

.button {
    appearance: none;
    border: 1px solid var(--brand);
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    padding: 11px 17px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: .15s ease;
}
.button:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.button.secondary { background: #fff; color: var(--brand); }
.button.secondary:hover { background: var(--accent); }
.button.small { padding: 7px 11px; border-radius: 8px; font-size: .88rem; }
.button.danger { background: #fff; color: var(--danger); border-color: #e6b8b3; }
.button.danger:hover { background: #fff2f0; }
.button.full { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 50px; align-items: center; padding: 54px 0 62px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.coach-preview { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 26px; border-radius: 22px; transform: rotate(1deg); }
.coach-label { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 800; }
.coach-grade { font-size: 1.55rem; font-weight: 850; margin: 9px 0; }
.coach-grade.good { color: var(--brand); }
.mini-tip { background: var(--accent); padding: 13px 15px; border-radius: 10px; font-size: .92rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 6px 20px rgba(20, 34, 46, .04); }
.panel.narrow { width: min(520px, 100%); margin: 36px auto; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-title-row h2 { margin-bottom: 0; }
.section-gap { margin-top: 24px; }

.flash, .success-box, .error-box { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash.success, .success-box { background: #eaf7f1; color: #14543f; border: 1px solid #b7dfd0; }
.flash.error, .error-box { background: #fff0ee; color: #8e2118; border: 1px solid #efc0bb; }
.flash.info { background: #edf4ff; color: #174a87; border: 1px solid #c7dbf5; }

.stack-form { display: grid; gap: 16px; }
.stack-form label, .create-game-form label { display: grid; gap: 7px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #cbd4db; border-radius: 9px; padding: 10px 11px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 3px solid rgba(31, 111, 95, .14); border-color: var(--brand); }

.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.game-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 21px; }
.game-card.active { border-color: #a9d7c7; box-shadow: 0 8px 22px rgba(31, 111, 95, .08); }
.game-card.muted { opacity: .65; }
.game-card h2 { margin: 10px 0 5px; }
.game-card p { color: var(--muted); margin-bottom: 0; }
.game-icon { font-size: 2rem; }
.intro-grid { margin-bottom: 20px; }

.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.page-heading h1 { font-size: 2.25rem; margin-bottom: 8px; }
.lobby-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; }
.create-game-form { display: grid; gap: 18px; }
.toggle-row { grid-template-columns: 1fr auto !important; align-items: center; background: #f5f8f7; padding: 14px; border-radius: 11px; }
.toggle-row small { display: block; color: var(--muted); font-weight: 500; margin-top: 3px; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.match-list { display: grid; gap: 10px; }
.match-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #edf0f2; }
.match-row:last-child { border-bottom: 0; }
.match-row small { display: block; color: var(--muted); }
.empty-state { color: var(--muted); padding: 14px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #edf0f2; white-space: nowrap; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #edf1f3; font-size: .82rem; font-weight: 700; }
.status.active { background: #e8f7f0; color: #166047; }
.status.waiting { background: #fff6df; color: #805a08; }

.game-topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.game-topbar h1 { font-size: 2rem; margin: 7px 0 5px; }
.back-link { font-size: .9rem; font-weight: 700; }
.game-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 11px; font-weight: 700; font-size: .84rem; }
.badge.learning { color: var(--brand); border-color: #b9ddcf; background: var(--accent); }

.chess-layout { display: grid; grid-template-columns: minmax(420px, 720px) minmax(300px, 390px); align-items: start; justify-content: center; gap: 24px; }
.chess-layout.is-waiting { display: none; }
.board-column { width: 100%; }
.chess-board { width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); border: 8px solid #27343e; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); background: #27343e; }
.square { position: relative; border: 0; padding: 0; display: grid; place-items: center; aspect-ratio: 1; }
.square.light { background: #e7e2d6; }
.square.dark { background: #7b9a87; }
.square:hover { filter: brightness(1.04); }
.square.selected { box-shadow: inset 0 0 0 5px rgba(255, 211, 67, .9); }
.square.last-move::before { content: ''; position: absolute; inset: 0; background: rgba(255, 224, 82, .3); }
.square.move-target::after { content: ''; position: absolute; width: 24%; aspect-ratio: 1; border-radius: 50%; background: rgba(22, 50, 39, .34); }
.square.capture-target::after { content: ''; position: absolute; inset: 8%; border: 6px solid rgba(132, 32, 23, .52); border-radius: 50%; }
.square.in-check { background: #d77970; }
.piece { position: relative; z-index: 2; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", serif; font-size: clamp(2.1rem, 6.2vw, 4.8rem); line-height: 1; filter: drop-shadow(0 2px 1px rgba(0,0,0,.16)); }
.rank-label, .file-label { position: absolute; z-index: 3; font-size: clamp(.58rem, 1.2vw, .76rem); font-weight: 850; opacity: .72; pointer-events: none; }
.rank-label { top: 3px; left: 4px; }
.file-label { right: 4px; bottom: 2px; }
.square.light .rank-label, .square.light .file-label { color: #577363; }
.square.dark .rank-label, .square.dark .file-label { color: #edf2ee; }

.player-strip { display: flex; align-items: center; gap: 10px; padding: 10px 3px; }
.player-strip.opponent { margin-bottom: 3px; }
.player-strip small { display: block; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e6ece9; font-size: 1.3rem; }
.game-sidebar { display: grid; gap: 18px; position: sticky; top: 90px; }
.coach-panel { min-height: 315px; }
.connection { color: var(--brand); font-size: .78rem; font-weight: 750; }
.coach-content { margin-top: 18px; }
.coach-placeholder { text-align: center; color: var(--muted); padding: 25px 8px; }
.coach-orb { width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent); color: var(--brand); font-size: 1.5rem; font-weight: 850; }
.feedback-card { border-left: 4px solid #85919b; padding-left: 15px; }
.feedback-card.best, .feedback-card.good { border-color: #268563; }
.feedback-card.reasonable { border-color: #b58419; }
.feedback-card.inaccurate, .feedback-card.mistake { border-color: #bf4d42; }
.feedback-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 8px; }
.grade-dot { width: 10px; height: 10px; border-radius: 50%; background: #85919b; }
.best .grade-dot, .good .grade-dot { background: #268563; }
.reasonable .grade-dot { background: #b58419; }
.inaccurate .grade-dot, .mistake .grade-dot { background: #bf4d42; }
.feedback-card p { color: #40505c; }
.feedback-detail { font-size: .9rem; background: #f4f6f7; border-radius: 9px; padding: 11px; }
.better-move { margin-top: 13px; padding: 12px; border-radius: 10px; background: #eef7f3; }
.better-move span { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.better-move strong { display: block; color: var(--brand); font-size: 1.3rem; margin: 2px 0 5px; }
.better-move p { margin-bottom: 0; font-size: .9rem; }
.turn-indicator { font-size: .78rem; font-weight: 800; background: #eef1f3; border-radius: 999px; padding: 5px 9px; }
.turn-indicator.my-turn { color: #155b45; background: #e4f5ed; }
.game-message { color: var(--muted); margin: 18px 0 12px; min-height: 24px; }
.move-list { border: 1px solid var(--line); border-radius: 10px; height: 190px; overflow-y: auto; margin-bottom: 14px; background: #fafbfb; }
.move-row { display: grid; grid-template-columns: 35px 1fr 1fr; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #edf0f2; font-size: .9rem; }
.move-row span { color: var(--muted); }
.empty-moves { color: var(--muted); padding: 18px; text-align: center; }
.waiting-panel { text-align: center; padding: 50px 24px; }
.spinner { width: 38px; height: 38px; border: 4px solid #d8e2de; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .chess-layout { grid-template-columns: minmax(0, 650px); }
    .game-sidebar { position: static; grid-template-columns: 1fr 1fr; }
    .coach-panel { min-height: auto; }
}

@media (max-width: 720px) {
    .container { width: min(100% - 20px, 1180px); }
    .page { padding-top: 22px; }
    .nav-wrap { align-items: flex-start; padding: 13px 0; }
    nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .user-pill { display: none; }
    .hero { grid-template-columns: 1fr; gap: 25px; padding: 30px 0 42px; }
    .coach-preview { transform: none; }
    .lobby-layout { grid-template-columns: 1fr; }
    .game-topbar { align-items: flex-start; flex-direction: column; }
    .game-sidebar { grid-template-columns: 1fr; }
    .chess-board { border-width: 5px; }
    .piece { font-size: clamp(2rem, 11vw, 4rem); }
}

@media (max-width: 480px) {
    .game-grid { grid-template-columns: 1fr; }
    .panel { padding: 18px; }
    .brand { font-size: 1rem; }
    nav a { font-size: .88rem; }
}

/* Klondike patience */
.compact-panel { padding: 14px 18px; }
.inline-form { display: inline-flex; margin: 0; }
.solitaire-layout { display: grid; grid-template-columns: minmax(650px, 1fr) minmax(300px, 370px); gap: 24px; align-items: start; }
.solitaire-main { min-width: 0; }
.solitaire-toolbar { display: flex; align-items: center; gap: 28px; margin-bottom: 14px; }
.stat-line { display: grid; gap: 1px; min-width: 70px; }
.stat-line span { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.stat-line strong { font-size: 1.25rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.solitaire-sidebar { position: sticky; top: 90px; }
.solitaire-board { background: #2e735a; border: 8px solid #214d3d; border-radius: 14px; padding: 18px; box-shadow: var(--shadow); overflow-x: auto; min-height: 690px; }
.solitaire-top-row, .tableau-group { min-width: 690px; }
.solitaire-top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; margin-bottom: 22px; }
.pile-group, .foundation-group { display: flex; gap: 12px; }
.card-pile { position: relative; width: 84px; aspect-ratio: 5 / 7; padding: 0; border: 0; border-radius: 8px; background: transparent; flex: 0 0 auto; }
.card-pile:focus-visible, .tableau-card-button:focus-visible, .empty-tableau:focus-visible { outline: 4px solid rgba(255, 228, 93, .9); outline-offset: 2px; }
.playing-card { position: absolute; inset: 0; display: block; border-radius: 9px; border: 1px solid rgba(19, 31, 39, .34); box-shadow: 0 8px 16px rgba(0, 0, 0, .24), 0 2px 4px rgba(0, 0, 0, .2); overflow: hidden; user-select: none; transition: transform .14s ease, box-shadow .14s ease; }
.card-face { background: linear-gradient(145deg, #ffffff 0%, #fffdf7 62%, #f2eee5 100%); }
.card-face::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(73, 63, 45, .12); border-radius: 6px; pointer-events: none; }
.card-back { border: 4px solid #faf7ef; background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.08)), repeating-linear-gradient(45deg, #2f6fa4 0 7px, #255a89 7px 14px); display: grid; place-items: center; }
.card-back::before { content: ''; position: absolute; inset: 6px; border: 2px solid rgba(255,255,255,.76); border-radius: 4px; box-shadow: inset 0 0 0 2px rgba(23, 66, 103, .35); }
.card-back-mark { color: rgba(255,255,255,.94); font-size: .76rem; letter-spacing: .1em; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.35); z-index: 1; }
.red-card { color: #b9232e; }
.black-card { color: #111d27; }
.card-corner { position: absolute; display: grid; justify-items: center; line-height: .86; font-size: 1rem; font-weight: 800; z-index: 2; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.card-corner strong { font-size: 1.25rem; line-height: .9; }
.card-corner.top { top: 6px; left: 7px; }
.card-corner.bottom { right: 7px; bottom: 6px; transform: rotate(180deg); }
.card-center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.75rem; filter: drop-shadow(0 2px 1px rgba(0,0,0,.12)); }
.empty-pile { position: absolute; inset: 0; display: grid; place-items: center; border: 2px dashed rgba(255,255,255,.38); border-radius: 8px; color: rgba(255,255,255,.72); font-weight: 850; }
.empty-pile.faint { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.foundation-symbol { font-size: 2.1rem; background: rgba(255,255,255,.1); }
.recycle-symbol { font-size: 2rem; }
.pile-count { position: absolute; right: -6px; bottom: -6px; min-width: 25px; height: 25px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; background: #fff; color: #234d3e; font-size: .72rem; font-weight: 850; box-shadow: 0 2px 6px rgba(0,0,0,.24); z-index: 3; }
.tableau-group { display: grid; grid-template-columns: repeat(7, minmax(72px, 1fr)); gap: 12px; align-items: start; }
.tableau-pile { position: relative; min-height: 520px; border-radius: 8px; }
.tableau-card-button { position: absolute; top: calc(var(--card-index) * 34px); left: 0; width: 100%; aspect-ratio: 5 / 7; border: 0; padding: 0; background: transparent; z-index: calc(var(--card-index) + 1); }
.tableau-card-button:hover .playing-card, .waste-pile:hover .playing-card, .foundation-pile:hover .playing-card { transform: translateY(-3px); box-shadow: 0 11px 20px rgba(0,0,0,.28), 0 3px 6px rgba(0,0,0,.2); }
.empty-tableau { width: 100%; aspect-ratio: 5 / 7; border: 2px dashed rgba(255,255,255,.38); border-radius: 8px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.55); font-size: 2rem; font-weight: 900; }
.selected-card { box-shadow: 0 0 0 4px #ffd94f, 0 4px 9px rgba(0,0,0,.3); transform: translateY(-2px); }
.selected-pile .playing-card { box-shadow: 0 0 0 4px #ffd94f, 0 4px 9px rgba(0,0,0,.3); }
.hint-source .playing-card, .hint-source.playing-card, .hint-source .empty-pile { box-shadow: 0 0 0 5px #ffd94f, 0 4px 10px rgba(0,0,0,.35); }
.hint-target { box-shadow: inset 0 0 0 5px rgba(111, 230, 174, .95); border-radius: 10px; }
.error-text { color: var(--danger) !important; }
.rules-list p { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #edf0f2; color: #46535e; }
.rules-list p:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.completion-card { text-align: center; padding: 16px 4px; }
.completion-icon { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: #e7f5ef; color: var(--brand); font-size: 2rem; }

/* Voortgang */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.stat-card span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.stat-card strong { display: block; font-size: 2rem; margin-top: 4px; }
.progress-bars { display: grid; gap: 13px; }
.progress-row { display: grid; grid-template-columns: 125px 1fr 42px; align-items: center; gap: 12px; }
.progress-track { height: 11px; border-radius: 999px; background: #edf1f3; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--brand); min-width: 2px; }
.learning-note-list { display: grid; gap: 10px; }
.learning-note { padding: 13px 14px; border-left: 4px solid #87939e; border-radius: 8px; background: #f7f9fa; }
.learning-note.best, .learning-note.good { border-color: #268563; }
.learning-note.reasonable { border-color: #b58419; }
.learning-note.inaccurate, .learning-note.mistake { border-color: #bf4d42; }
.learning-note small { display: block; color: var(--muted); margin-top: 3px; }

@media (max-width: 1040px) {
    .solitaire-layout { grid-template-columns: 1fr; }
    .solitaire-sidebar { position: static; grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .solitaire-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
    .toolbar-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
    .solitaire-board { padding: 12px; min-height: 630px; }
    .solitaire-top-row, .tableau-group { min-width: 620px; }
    .card-pile { width: 74px; }
    .tableau-group { grid-template-columns: repeat(7, minmax(64px, 1fr)); gap: 9px; }
    .tableau-card-button { top: calc(var(--card-index) * 31px); }
    .solitaire-sidebar { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .progress-row { grid-template-columns: 105px 1fr 38px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.card-form { margin-top: 18px; }
.compact-toggle { padding: 11px !important; }
.status.finished { background: #e9f0ff; color: #254f91; }

/* MVP 3: internationaal dammen */
.three-active-games { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.open-lobbies { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.draughts-layout { display: grid; grid-template-columns: minmax(460px, 720px) minmax(300px, 390px); align-items: start; justify-content: center; gap: 24px; }
.draughts-layout.is-waiting { display: none; }
.draughts-board { width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(10, 1fr); border: 9px solid #51371f; border-radius: 9px; overflow: hidden; box-shadow: var(--shadow); background: #51371f; }
.draughts-square { position: relative; border: 0; padding: 0; aspect-ratio: 1; display: grid; place-items: center; }
.draughts-square.light { background: #ead9b9; cursor: default; }
.draughts-square.dark { background: #855d36; cursor: pointer; }
.draughts-square.dark:hover { filter: brightness(1.08); }
.draughts-square.last-move::after { content: ''; position: absolute; inset: 7%; border: 3px solid rgba(255, 224, 96, .56); border-radius: 8px; pointer-events: none; }
.draughts-square.legal-target::before { content: ''; width: 31%; height: 31%; border-radius: 50%; background: rgba(107, 235, 174, .88); box-shadow: 0 0 0 5px rgba(23, 74, 57, .24); z-index: 3; }
.draughts-square.selected-square { box-shadow: inset 0 0 0 5px #ffd84e; }
.draughts-square.hint-square { box-shadow: inset 0 0 0 5px rgba(255, 220, 55, .95); }
.draughts-board.capture-required { box-shadow: var(--shadow), 0 0 0 4px rgba(194, 77, 58, .34); }
.draughts-field-number { position: absolute; top: 3px; left: 4px; color: rgba(255,255,255,.57); font-size: clamp(.48rem, 1vw, .68rem); font-weight: 800; line-height: 1; z-index: 4; pointer-events: none; }
.draughts-piece { position: relative; width: 72%; height: 72%; border-radius: 50%; display: grid; place-items: center; z-index: 2; box-shadow: inset 0 -7px 0 rgba(0,0,0,.15), 0 4px 6px rgba(0,0,0,.35); }
.draughts-piece::before { content: ''; position: absolute; inset: 12%; border-radius: 50%; border: 2px solid rgba(255,255,255,.24); }
.white-piece { background: #f7f1e3; border: 2px solid #c7bda7; color: #6e573d; }
.black-piece { background: #262a2e; border: 2px solid #111315; color: #f2d071; }
.king-piece { box-shadow: inset 0 -7px 0 rgba(0,0,0,.18), inset 0 0 0 5px rgba(218, 172, 47, .73), 0 4px 6px rgba(0,0,0,.38); }
.king-piece span { position: relative; z-index: 2; font-size: clamp(.8rem, 2.1vw, 1.65rem); line-height: 1; }
.dam-avatar { font-size: 1.15rem; }
.piece-counts { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0; padding: 10px 12px; background: #f5f7f8; border-radius: 9px; }
.piece-counts span { color: var(--muted); font-size: .86rem; }
.piece-counts strong { color: var(--ink); }
.five-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1120px) {
    .draughts-layout { grid-template-columns: minmax(0, 690px); }
    .open-lobbies { grid-template-columns: 1fr; }
    .five-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .three-active-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .draughts-board { border-width: 5px; }
    .draughts-field-number { display: none; }
    .draughts-piece { width: 76%; height: 76%; }
    .five-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .three-active-games, .five-stats { grid-template-columns: 1fr; }
}

/* MVP 5: leerplatform en vier spellen */
.four-active-games { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.open-lobbies.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.six-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.poker-layout { display: grid; grid-template-columns: minmax(620px, 820px) minmax(300px, 390px); align-items: start; justify-content: center; gap: 24px; }
.poker-table-wrap { overflow: hidden; }
.poker-table { position: relative; min-height: 590px; border-radius: 46%; padding: 32px; background: radial-gradient(circle at center, #247654, #14503b 68%, #0a3326 100%); border: 14px solid #5f3d24; box-shadow: inset 0 0 0 5px rgba(255,255,255,.12), 0 18px 40px rgba(25,35,43,.22); display: grid; grid-template-rows: 1fr 1.2fr 1fr; align-items: center; color: #fff; }
.poker-seat { justify-self: center; min-width: 250px; text-align: center; display: grid; justify-items: center; gap: 7px; padding: 10px 18px; border-radius: 16px; background: rgba(6,35,26,.68); border: 1px solid rgba(255,255,255,.2); }
.poker-seat > span, .poker-seat > small { color: rgba(255,255,255,.82); }
.poker-center { display: grid; justify-items: center; gap: 14px; }
.pot-display { background: rgba(5,31,23,.72); padding: 8px 16px; border-radius: 999px; }
.poker-board, .poker-cards { display: flex; justify-content: center; gap: 9px; min-height: 96px; }
.poker-cards .playing-card, .poker-board .playing-card { position: relative; inset: auto; width: 66px; height: 92px; border-radius: 8px; background: #fffdf7; color: #18232b; display: grid; align-content: space-between; justify-items: start; padding: 8px; border: 1px solid rgba(0,0,0,.24); box-shadow: 0 5px 12px rgba(0,0,0,.28); font-style: normal; }
.poker-cards .playing-card b, .poker-board .playing-card b { font-size: 1.15rem; }
.poker-cards .playing-card em, .poker-board .playing-card em { font-size: 2rem; justify-self: center; font-style: normal; line-height: 1; }
.poker-cards .playing-card.red-card, .poker-board .playing-card.red-card { color: #b7282d; }
.poker-cards .playing-card.card-back { color: rgba(255,255,255,.9); background: repeating-linear-gradient(45deg, #2e5e91 0 8px, #224a76 8px 16px); place-items: center; font-size: 1.4rem; border: 4px solid #f2eee3; }
.card-slot { width: 66px; height: 92px; border: 2px dashed rgba(255,255,255,.28); border-radius: 8px; }
.phase-pill { padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .76rem; text-transform: uppercase; font-weight: 850; letter-spacing: .08em; }
.poker-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.raise-control { display: flex; gap: 8px; }
.raise-control input { width: 110px; }
.poker-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.poker-metrics span { padding: 9px; border-radius: 8px; background: #f0f4f5; color: #44515b; font-size: .82rem; }
.poker-metrics b { display: block; color: var(--ink); font-size: 1rem; }
.waiting-room { min-height: 420px; display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; }

@media (max-width: 1180px) {
    .poker-layout { grid-template-columns: minmax(0, 820px); }
    .open-lobbies.three-columns { grid-template-columns: 1fr; }
    .six-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 920px) {
    .four-active-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .poker-table { min-height: 500px; padding: 20px 10px; border-width: 8px; border-radius: 28%; }
    .poker-seat { min-width: 200px; }
    .poker-cards .playing-card, .poker-board .playing-card, .card-slot { width: 48px; height: 68px; padding: 5px; }
    .poker-cards .playing-card em, .poker-board .playing-card em { font-size: 1.35rem; }
    .poker-board, .poker-cards { gap: 5px; min-height: 70px; }
    .six-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .four-active-games, .six-stats { grid-template-columns: 1fr; }
    .poker-table { min-height: 455px; }
    .poker-seat { min-width: 175px; padding: 7px 10px; }
    .poker-actions { align-items: stretch; }
    .raise-control { width: 100%; }
    .raise-control input, .raise-control .button { flex: 1; }
}

/* MVP 5: leercentrum, ratings, uitdagingen en beheer */
.nav-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 850; vertical-align: middle; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-grid .panel h2 { margin-bottom: 8px; }
.feature-grid .panel p { color: var(--muted); margin-bottom: 0; }

.lobby-dashboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.dashboard-card { display: grid; gap: 3px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 18px; color: var(--text); box-shadow: 0 5px 16px rgba(20,34,46,.035); }
.dashboard-card:hover { color: var(--text); border-color: #a9d7c7; transform: translateY(-1px); }
.dashboard-card span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.dashboard-card strong { color: var(--brand); font-size: 1.65rem; line-height: 1.1; }
.dashboard-card small { color: var(--muted); }

.practice-summary { display: grid; grid-template-columns: minmax(300px, 2fr) repeat(3, minmax(130px, 1fr)); gap: 14px; }
.goal-card { box-shadow: none; }
.progress-track.large { height: 13px; margin: 18px 0 10px; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .65fr); gap: 22px; align-items: start; }
.exercise-panel { min-height: 420px; }
.exercise-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.badge.mistake, .badge.inaccurate { color: #8e2118; border-color: #efc0bb; background: #fff0ee; }
.answer-options { display: grid; gap: 12px; margin: 24px 0 18px; }
.answer-option { width: 100%; display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; text-align: left; border: 1px solid #ccd6dc; background: #fff; color: var(--text); border-radius: 12px; padding: 13px 15px; font-weight: 700; }
.answer-option span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #eef3f1; color: var(--brand); }
.answer-option:hover { border-color: var(--brand); background: #f6fbf9; transform: translateY(-1px); }
.text-link { display: inline-block; font-weight: 700; margin-top: 4px; }
.empty-state.generous { min-height: 340px; display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; }
.empty-state.generous p { max-width: 560px; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--brand); font-size: 2rem; font-weight: 900; }
.answer-result { border-left: 5px solid #268563; }
.answer-result.incorrect { border-left-color: #bf4d42; }
.answer-result.correct .eyebrow { color: #268563; }
.answer-result.incorrect .eyebrow { color: #a43a2f; }
.history-list { display: grid; }
.history-list article { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid #edf0f2; }
.history-list article:last-child { border-bottom: 0; }
.history-list p { color: var(--muted); margin: 2px 0 0; font-size: .9rem; }
.history-list small { color: var(--muted); }
.result-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.result-mark.correct { background: #eaf7f1; color: #166047; }
.result-mark.incorrect { background: #fff0ee; color: #a12e24; }

.rating-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rating-card { box-shadow: none; }
.dual-rating { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dual-rating > div { background: #f5f8f7; border-radius: 11px; padding: 13px; display: grid; gap: 2px; }
.dual-rating small, .dual-rating span { color: var(--muted); }
.dual-rating strong { font-size: 1.6rem; color: var(--brand); }
.filter-bar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.filter-bar label { display: grid; gap: 6px; min-width: 220px; font-weight: 700; }
.leaderboard-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .65fr); gap: 22px; align-items: start; }
.responsive-table { overflow-x: auto; }
.data-table th, .data-table td { padding: 12px 11px; }
.leaderboard-table tr.my-rank { background: #eef8f4; }
.rank-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #edf1f3; font-weight: 850; }
.rank-number.rank-1 { background: #fff2b8; color: #7a5a00; }
.rank-number.rank-2 { background: #e8edf0; color: #53616b; }
.rank-number.rank-3 { background: #f5dfcf; color: #7c4b2e; }
.match-history { display: grid; gap: 8px; }
.match-history article { display: grid; grid-template-columns: minmax(0,1fr) 70px minmax(0,1fr); align-items: center; gap: 14px; padding: 12px 14px; background: #f7f9fa; border-radius: 10px; }
.match-history article > div { display: flex; align-items: center; gap: 8px; }
.match-history article > div:last-child { justify-content: flex-end; }
.match-score { text-align: center; font-weight: 850; }
.rating-delta { font-size: .8rem; font-weight: 850; }
.rating-delta.positive { color: #166047; }
.rating-delta.negative { color: #a12e24; }

.challenge-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .6fr); gap: 22px; align-items: start; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin: 16px 0 10px; }
.player-list { display: grid; }
.player-list article { display: grid; grid-template-columns: 44px minmax(140px, .7fr) minmax(350px, 1.3fr); align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid #edf0f2; }
.player-list article:last-child { border-bottom: 0; }
.player-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--brand); font-weight: 850; }
.player-info { display: grid; }
.player-info small { color: var(--muted); }
.challenge-form { display: grid; grid-template-columns: minmax(110px, 1fr) auto auto; align-items: center; gap: 9px; }
.inline-check { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .9rem; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.two-column-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.challenge-list { display: grid; }
.challenge-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #edf0f2; }
.challenge-list article:last-child { border-bottom: 0; }
.challenge-list p { color: var(--muted); margin: 2px 0; }
.challenge-list small { color: var(--muted); }
.challenge-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.challenge-actions form { margin: 0; }

.profile-practice-number { font-size: 3.1rem; color: var(--brand); font-weight: 850; line-height: 1; margin-top: 24px; }
a.learning-note { display: block; color: var(--text); }
a.learning-note:hover { color: var(--text); background: #f8faf9; }
.seven-stats { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.inline-admin-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-admin-form label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.inline-admin-form input { width: 84px; }
.system-list { display: grid; gap: 7px; margin: 0 0 14px; }
.system-list div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0f2; padding-bottom: 7px; }
.system-list dt { color: var(--muted); }
.system-list dd { margin: 0; font-weight: 700; }
.compact-list { display: grid; }
.compact-list article { display: grid; grid-template-columns: minmax(160px, .6fr) minmax(150px, .7fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0f2; }
.compact-list small { color: var(--muted); }

@media (max-width: 1080px) {
    .site-header { position: static; }
    .nav-wrap { align-items: flex-start; padding: 12px 0; }
    nav { flex-wrap: wrap; justify-content: flex-end; gap: 9px 13px; }
    .lobby-dashboard { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .practice-summary { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .practice-summary .goal-card { grid-column: 1 / -1; }
    .seven-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (max-width: 850px) {
    .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .heading-actions { justify-content: flex-start; }
    .practice-layout, .leaderboard-layout, .challenge-layout, .two-column-panels { grid-template-columns: 1fr; }
    .rating-cards, .feature-grid { grid-template-columns: 1fr; }
    .player-list article { grid-template-columns: 44px 1fr; }
    .challenge-form { grid-column: 1 / -1; grid-template-columns: 1fr auto auto; padding-left: 57px; }
    .seven-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 620px) {
    .lobby-dashboard, .practice-summary { grid-template-columns: 1fr 1fr; }
    .practice-summary .goal-card { grid-column: 1 / -1; }
    .challenge-form { padding-left: 0; grid-template-columns: 1fr; }
    .challenge-list article { align-items: flex-start; flex-direction: column; }
    .challenge-actions { justify-content: flex-start; }
    .match-history article { grid-template-columns: 1fr; text-align: left; }
    .match-history article > div:last-child { justify-content: flex-start; }
    .match-score { text-align: left; }
    .history-list article { grid-template-columns: 35px 1fr; }
    .history-list article small { grid-column: 2; }
    .seven-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .compact-list article { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 430px) {
    .lobby-dashboard, .practice-summary, .seven-stats { grid-template-columns: 1fr; }
    .dual-rating { grid-template-columns: 1fr; }
    .search-form { grid-template-columns: 1fr; }
    .filter-bar label { min-width: 100%; }
}

/* MVP 5.1: dagelijkse reeks */
.streak-panel { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(430px, 1.4fr); gap: 26px; align-items: center; margin-bottom: 18px; background: linear-gradient(135deg, #fff8e7 0%, #ffffff 46%, #eef8f4 100%); border-color: #eadcb7; }
.streak-main { display: flex; align-items: center; gap: 18px; }
.streak-flame { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 22px; font-size: 2.55rem; background: linear-gradient(145deg, #fff0bb, #ffd46f); box-shadow: 0 10px 22px rgba(172, 112, 17, .2); }
.streak-number { margin-top: 2px; font-size: 2.65rem; line-height: 1; font-weight: 900; color: #26383c; }
.streak-number small { font-size: 1rem; color: var(--muted); font-weight: 800; }
.streak-main p { margin: 8px 0 0; color: #57636b; }
.streak-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.streak-details > div { min-height: 106px; padding: 15px; border-radius: 13px; border: 1px solid rgba(58, 86, 75, .12); background: rgba(255,255,255,.82); box-shadow: 0 5px 12px rgba(39, 61, 54, .07); }
.streak-details span, .streak-details small { display: block; }
.streak-details span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 850; }
.streak-details strong { display: block; margin: 7px 0 5px; font-size: 1.15rem; }
.streak-details small { color: #6b767d; line-height: 1.3; }

@media (max-width: 900px) {
    .streak-panel { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    .streak-details { grid-template-columns: 1fr; }
    .streak-main { align-items: flex-start; }
    .streak-flame { width: 62px; height: 62px; border-radius: 18px; font-size: 2rem; }
    .streak-number { font-size: 2.15rem; }
}

/* MVP 5.3: kaarten slepen en trek-1/trek-3 in patience */
.draggable-card { cursor: grab; }
.draggable-card:active { cursor: grabbing; }
.solitaire-dragging, .solitaire-dragging * { cursor: grabbing !important; }
.drag-source .playing-card, .drag-source.playing-card { opacity: .72; filter: saturate(.82); }
.tableau-pile.drag-target, .foundation-pile.drag-target {
    box-shadow: inset 0 0 0 5px rgba(111, 230, 174, .98), 0 0 0 3px rgba(26, 82, 62, .38);
    border-radius: 10px;
}
.tableau-pile.drag-target::after, .foundation-pile.drag-target::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px dashed rgba(255, 255, 255, .9);
    border-radius: 7px;
    pointer-events: none;
    z-index: 100;
}


/* Trek 3: toon de drie bovenste aflegkaarten als een kleine waaier. */
.waste-pile.draw-three-waste { width: 112px; }
.waste-fan-card { position: absolute; top: 0; bottom: 0; left: calc(var(--fan-index) * 14px); width: 84px; display: block; pointer-events: none; }
.waste-fan-card:last-child { z-index: 3; }
@media (max-width: 720px) {
    .waste-pile.draw-three-waste { width: 100px; }
    .waste-fan-card { width: 74px; left: calc(var(--fan-index) * 13px); }
}


/* MVP 5.4 playful refresh */
:root {
    --bg: radial-gradient(circle at top left, #fff7d7 0%, #f7fbff 28%, #f2f1ff 56%, #eefaf3 100%);
    --panel: rgba(255,255,255,.92);
    --brand: #7a38f5;
    --brand-dark: #5b21c9;
    --accent: #f1e8ff;
    --shadow: 0 18px 34px rgba(92, 40, 190, .10);
}
body { background: var(--bg); }
.site-header {
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(122, 56, 245, .12);
}
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    color: #44206f; font-size: 1.16rem;
}
.brand::before {
    content: '🎲'; font-size: 1.12rem;
}
nav a { color: #50396d; }
nav a:hover { color: #7a38f5; }
.user-pill { background: linear-gradient(135deg, #fff4d8, #f6ecff); color: #513768; }
.site-footer { background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.82)); }
.hero {
    background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.52));
    border: 1px solid rgba(122,56,245,.10);
    border-radius: 28px; padding: 42px; margin-top: 8px; box-shadow: var(--shadow);
}
.hero-actions .button:first-child { background: linear-gradient(135deg, #7a38f5, #ff5aa5); border-color: transparent; }
.hero-actions .button.secondary { border-color: rgba(122,56,245,.26); }
.coach-preview {
    background: linear-gradient(155deg, #fff, #fff5fb);
    border-color: rgba(255,90,165,.18);
    box-shadow: 0 18px 34px rgba(255, 90, 165, .10);
}
.coach-grade.good { color: #ff5aa5; }
.mini-tip { background: linear-gradient(135deg, #fff4c7, #ffe6f1); }
.dashboard-card {
    background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
    border: 1px solid rgba(122,56,245,.12);
    border-radius: 18px; padding: 18px 20px; display: block; color: inherit; box-shadow: var(--shadow);
}
.dashboard-card:nth-child(1) { background: linear-gradient(145deg, #eef8ff, #f8f4ff); }
.dashboard-card:nth-child(2) { background: linear-gradient(145deg, #fdf7df, #fff2fb); }
.dashboard-card:nth-child(3) { background: linear-gradient(145deg, #eefaf2, #f5f0ff); }
.dashboard-card:nth-child(4) { background: linear-gradient(145deg, #fff2e9, #fff7fb); }
.dashboard-card span { display:block; color:#66557f; font-weight:700; }
.dashboard-card strong { display:block; font-size:2rem; color:#40255f; margin:6px 0 3px; }
.playful-cards .game-card { border: 0; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.playful-cards .game-card::before { content:''; position:absolute; inset:0; opacity:.95; pointer-events:none; }
.playful-cards .chess-card::before { background: linear-gradient(160deg, rgba(122,56,245,.16), rgba(255,255,255,0) 55%); }
.playful-cards .patience-card::before { background: linear-gradient(160deg, rgba(255,90,165,.14), rgba(255,255,255,0) 55%); }
.playful-cards .draughts-card::before { background: linear-gradient(160deg, rgba(44,181,110,.16), rgba(255,255,255,0) 55%); }
.playful-cards .poker-card::before { background: linear-gradient(160deg, rgba(255,170,63,.18), rgba(255,255,255,0) 55%); }
.playful-cards .game-icon { width: 56px; height: 56px; display:grid; place-items:center; border-radius:16px; background: rgba(255,255,255,.72); box-shadow: 0 8px 16px rgba(0,0,0,.06); }
.playful-cards .card-form { position: relative; z-index:1; }
.page-heading, .panel { backdrop-filter: blur(7px); }
.button { border-color: transparent; background: linear-gradient(135deg, #7a38f5, #5a67ff); box-shadow: 0 10px 20px rgba(122,56,245,.18); }
.button.secondary { background: rgba(255,255,255,.9); color: #6a35da; border:1px solid rgba(122,56,245,.18); box-shadow:none; }
.button.secondary:hover { background: #f6efff; }
.badge.learning { background: linear-gradient(135deg, #f4edff, #ffe6f5); color:#6a2ccf; border-color: rgba(122,56,245,.18); }
.badge { border-color: rgba(122,56,245,.12); }
.game-badges-inline { margin-bottom: 10px; }
.open-lobbies .panel:nth-child(1) { background: linear-gradient(180deg, rgba(248,244,255,.94), rgba(255,255,255,.9)); }
.open-lobbies .panel:nth-child(2) { background: linear-gradient(180deg, rgba(239,252,244,.94), rgba(255,255,255,.9)); }
.open-lobbies .panel:nth-child(3) { background: linear-gradient(180deg, rgba(255,249,232,.94), rgba(255,255,255,.9)); }
.match-row { border-bottom-color: rgba(122,56,245,.10); }
.table-wrap table { background: rgba(255,255,255,.75); border-radius: 12px; overflow: hidden; }
.status.active { background: #e8f7f0; color: #136247; }
.status.waiting { background: #fff4d8; color: #855c11; }
.status.finished { background: #efeafe; color: #5f35c8; }
@media (max-width: 720px) {
  .hero { padding: 26px; border-radius: 22px; }
}

/* Frontpage illustrations MVP 5.4.2 */
.frontpage-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    gap: 34px;
    align-items: center;
}
.hero-copy { position: relative; z-index: 2; }
.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.hero-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.84);
    border: 1px solid rgba(122,56,245,.12);
    border-radius: 999px;
    padding: 10px 14px;
    color: #513768;
    font-weight: 700;
    box-shadow: 0 10px 18px rgba(122,56,245,.06);
}
.hero-visual-wrap {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-visual {
    width: min(100%, 620px);
    height: auto;
    display: block;
    filter: drop-shadow(0 22px 34px rgba(122,56,245,.15));
}
.floating-card {
    position: absolute;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(122,56,245,.12);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 18px 28px rgba(77,52,133,.10);
    backdrop-filter: blur(8px);
    max-width: 220px;
}
.floating-card strong {
    display: block;
    color: #452871;
    font-size: 1rem;
}
.floating-card span {
    display: block;
    color: #6e6782;
    font-size: .88rem;
    margin-top: 2px;
}
.floating-card-one { top: 24px; right: -4px; }
.floating-card-two { left: 12px; bottom: 14px; }
.frontpage-gallery {
    display: grid;
    gap: 18px;
}
.feature-showcase {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: center;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(122,56,245,.10);
    border-radius: 26px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.feature-showcase.reverse {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
}
.feature-showcase.reverse .showcase-media { order: 2; }
.feature-showcase.reverse .showcase-copy { order: 1; }
.showcase-media img {
    width: 100%;
    display: block;
    border-radius: 22px;
}
.showcase-copy h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 10px;
}
.showcase-copy p {
    color: #5f6576;
    font-size: 1.05rem;
    margin-bottom: 0;
}
.illustrated-grid {
    margin-top: 12px;
}
.illustrated-card {
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: 190px 1fr;
}
.illustrated-card > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.illustrated-card .card-body {
    padding: 18px 18px 20px;
}
.illustrated-card .game-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(122,56,245,.12), rgba(255,90,165,.12));
    box-shadow: 0 8px 16px rgba(122,56,245,.08);
    margin-bottom: 10px;
}
.playful-feature-grid .panel {
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.88));
}
@media (max-width: 980px) {
    .frontpage-hero,
    .feature-showcase,
    .feature-showcase.reverse {
        grid-template-columns: 1fr;
    }
    .feature-showcase.reverse .showcase-media,
    .feature-showcase.reverse .showcase-copy {
        order: initial;
    }
    .hero-visual-wrap {
        min-height: auto;
    }
    .floating-card-one { top: 10px; right: 10px; }
    .floating-card-two { left: 10px; bottom: 10px; }
}
@media (max-width: 720px) {
    .hero-highlights span {
        width: 100%;
        justify-content: center;
    }
    .illustrated-card {
        grid-template-rows: 160px 1fr;
    }
    .floating-card {
        position: static;
        max-width: none;
        margin-top: 12px;
    }
    .hero-visual-wrap {
        display: block;
    }
}

/* ===== MVP 6.0: sociaal, dagelijks, levels, replay en multiplayer-poker ===== */
nav { gap: 13px; }
nav a { position: relative; }
.level-pill {
    display: grid; justify-items: end; gap: 2px; padding: 11px 16px; border-radius: 16px;
    background: linear-gradient(135deg, #fff5c7, #f0e9ff); border: 1px solid rgba(122,56,245,.14);
    box-shadow: 0 12px 22px rgba(122,56,245,.08);
}
.level-pill span { color: #7551a3; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.level-pill strong { color: #44246d; font-size: 1.15rem; }
.six-dashboard-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.six-dashboard-cards .dashboard-card:nth-child(5) { background: linear-gradient(145deg, #eef7ff, #f4efff); }
.six-dashboard-cards .dashboard-card:nth-child(6) { background: linear-gradient(145deg, #fff5e7, #fff0f6); }
.multi-table-link { margin-top: 10px; position: relative; z-index: 2; }
.table-action-buttons { display: flex; gap: 6px; }
.replay-badge { color: #6b35da; }

/* Daily challenges */
.daily-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.daily-card {
    position: relative; overflow: hidden; border-radius: 24px; padding: 22px;
    background: rgba(255,255,255,.94); border: 1px solid rgba(122,56,245,.11); box-shadow: var(--shadow);
}
.daily-card::before { content:''; position:absolute; inset:0 0 auto 0; height:7px; background:#7a38f5; }
.daily-card.solitaire::before { background:#ff6ca8; }
.daily-card.draughts::before { background:#35b96c; }
.daily-card.poker::before { background:#f4a63c; }
.daily-card.correct { box-shadow: 0 18px 34px rgba(39,170,99,.13); }
.daily-card-heading { display:flex; gap:15px; align-items:flex-start; }
.daily-card-heading h2 { font-size:1.15rem; line-height:1.35; margin:3px 0 14px; }
.daily-card-heading span { color:var(--muted); font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; font-weight:850; }
.daily-icon { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; background:#f1e8ff; font-size:1.75rem; flex:0 0 auto; }
.daily-card.solitaire .daily-icon { background:#fff0f7; }
.daily-card.draughts .daily-icon { background:#eaf9f0; }
.daily-card.poker .daily-icon { background:#fff5e5; }
.daily-options { display:grid; gap:9px; }
.daily-options label { cursor:pointer; }
.daily-options label input { position:absolute; opacity:0; pointer-events:none; }
.daily-options label span { display:block; border:1px solid #e3e0ec; border-radius:12px; padding:11px 13px; background:rgba(255,255,255,.84); transition:.15s ease; }
.daily-options label input:checked + span { border-color:#7a38f5; box-shadow:0 0 0 3px rgba(122,56,245,.12); background:#f7f1ff; }
.daily-result { display:grid; gap:9px; }
.daily-result > strong { font-size:1.12rem; }
.daily-result.good > strong { color:#198255; }
.daily-result.wrong > strong { color:#9b5b0a; }
.daily-result small { color:#7a38f5; font-weight:850; }
.leader-mini-list { display:grid; gap:8px; }
.leader-mini-list > div { display:grid; grid-template-columns:36px 1fr auto auto; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid #eeeaf5; }
.leader-position { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#f1e9ff; color:#6632c6; font-weight:850; }
.daily-reward-panel { text-align:center; }
.daily-trophy { font-size:4rem; filter:drop-shadow(0 10px 12px rgba(240,167,48,.2)); }

/* Friends and notifications */
.friend-hero { display:grid; grid-template-columns:1fr minmax(320px,.8fr); gap:24px; align-items:center; background:linear-gradient(135deg,#f4edff,#effaf4); }
.friend-hero > div:first-child { display:grid; grid-template-columns:auto 1fr; column-gap:14px; align-items:center; }
.friend-hero > div:first-child p { grid-column:2; }
.friend-hero-icon { font-size:3rem; grid-row:1/3; }
.friend-search { margin:0; }
.friend-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.friend-card { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:13px; padding:14px; border:1px solid #e8e2f2; border-radius:16px; background:rgba(255,255,255,.82); }
.friend-card.request { background:linear-gradient(135deg,#fff8e9,#f8f2ff); }
.player-avatar.large { width:48px; height:48px; font-size:1.15rem; }
.friend-card small { display:block; color:var(--muted); }
.friend-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.friend-status { color:#268563; font-weight:800; }
.friend-status.waiting { color:#9b6a0a; }
.compact-list { display:grid; gap:8px; }
.compact-list > div { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid #edf0f2; }
.notification-list { display:grid; gap:8px; }
.notification-item { display:grid; grid-template-columns:auto 1fr; gap:14px; padding:15px; border-radius:16px; color:inherit; border:1px solid transparent; }
.notification-item:hover { color:inherit; background:#faf7ff; }
.notification-item.unread { background:linear-gradient(135deg,#f7f1ff,#fff8e8); border-color:rgba(122,56,245,.13); }
.notification-item p { margin:3px 0; color:#5e6471; }
.notification-item small { color:var(--muted); }
.notification-icon { width:46px; height:46px; border-radius:14px; display:grid; place-items:center; background:#fff; font-size:1.45rem; box-shadow:0 8px 16px rgba(0,0,0,.05); }

/* Profile level and badges */
.profile-level-panel { display:grid; grid-template-columns:auto 1fr auto; gap:20px; align-items:center; margin-bottom:18px; background:linear-gradient(135deg,#fff7d4,#f2eaff 55%,#edfbf3); }
.level-emblem { position:relative; width:84px; height:84px; display:grid; place-items:center; border-radius:26px; background:#fff; font-size:2.5rem; box-shadow:0 14px 24px rgba(122,56,245,.11); }
.level-emblem strong { position:absolute; right:-6px; bottom:-6px; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:#7a38f5; color:white; font-size:.95rem; }
.level-copy h2 { margin-bottom:4px; font-size:1.6rem; }
.level-copy p { color:var(--muted); margin-bottom:10px; }
.level-progress-track { height:12px; border-radius:999px; background:rgba(90,55,130,.12); overflow:hidden; }
.level-progress-track > div { height:100%; background:linear-gradient(90deg,#7a38f5,#ff5aa5,#ffbc46); border-radius:inherit; }
.badge-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:16px; }
.badge-card { display:grid; grid-template-columns:auto 1fr; gap:12px; padding:15px; border-radius:17px; background:linear-gradient(145deg,#fff,#faf7ff); border:1px solid #ebe5f4; }
.badge-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:16px; background:linear-gradient(135deg,#fff4c7,#f1e7ff); font-size:1.7rem; }
.badge-card p { margin:3px 0; color:#626879; font-size:.9rem; }
.badge-card small { color:var(--muted); }

/* Replay */
.replay-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,380px); gap:22px; align-items:start; }
.replay-stage { min-width:0; }
.replay-board { width:min(100%,680px); margin:0 auto; }
.replay-controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:8px; margin-top:18px; }
.replay-counter { display:flex; align-items:baseline; gap:4px; min-width:74px; justify-content:center; }
.replay-counter strong { font-size:1.5rem; color:#59329f; }
.replay-detail { margin-top:18px; padding-top:18px; border-top:1px solid #ece7f3; min-height:180px; }
.replay-action > span { color:var(--muted); text-transform:uppercase; letter-spacing:.08em; font-size:.75rem; font-weight:850; }
.replay-action h2 { font-size:1.7rem; margin:4px 0; }
.replay-sidebar { display:grid; gap:18px; position:sticky; top:90px; }
.replay-moments { display:grid; gap:8px; margin-top:14px; }
.replay-moment { display:grid; grid-template-columns:34px 1fr; gap:10px; width:100%; text-align:left; border:1px solid #e7e1f0; background:#fff; border-radius:12px; padding:10px; }
.replay-moment > span { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:#f0e9ff; color:#6734c9; font-weight:850; }
.replay-moment small { display:block; color:var(--muted); }
.replay-moment.mistake,.replay-moment.inaccurate { border-left:4px solid #cf5548; }
.replay-moment.best,.replay-moment.good { border-left:4px solid #2b9a68; }
.replay-visual-placeholder { min-height:360px; border-radius:22px; display:grid; place-items:center; align-content:center; text-align:center; background:radial-gradient(circle at top,#fff6cf,#f0eaff 58%,#eaf9f1); padding:30px; }
.replay-big-icon { font-size:6rem; filter:drop-shadow(0 18px 18px rgba(122,56,245,.13)); }

/* Frontpage expansion cards */
.portal-expansion-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.portal-expansion-card { display:grid; grid-template-columns:auto 1fr; gap:16px; padding:20px; border-radius:22px; background:rgba(255,255,255,.9); box-shadow:var(--shadow); border:1px solid rgba(122,56,245,.1); }
.portal-expansion-card h2 { font-size:1.3rem; margin-bottom:6px; }
.portal-expansion-card p { margin-bottom:0; color:#626879; }
.expansion-icon { width:62px; height:62px; border-radius:20px; display:grid; place-items:center; font-size:2rem; background:#f1e8ff; }
.daily-expansion .expansion-icon { background:#fff4c9; }
.social-expansion .expansion-icon { background:#e9f9ef; }
.poker-expansion .expansion-icon { background:#fff0e3; }
.replay-expansion .expansion-icon { background:#edf3ff; }

/* Multiplayer poker lobby */
.poker-room-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); gap:22px; align-items:start; }
.poker-room-list { display:grid; gap:10px; margin-top:14px; }
.poker-room-card { display:grid; grid-template-columns:auto 1fr auto; gap:14px; align-items:center; padding:14px; border-radius:17px; background:linear-gradient(135deg,#fffaf0,#fff,#f7f1ff); border:1px solid #ece5ef; }
.room-symbol { width:50px; height:50px; border-radius:15px; display:grid; place-items:center; color:#df5a37; background:#fff; font-size:1.7rem; box-shadow:0 8px 15px rgba(0,0,0,.05); }
.room-info span,.room-info small { display:block; color:var(--muted); }
.room-actions { min-width:130px; display:flex; justify-content:flex-end; }
.room-code-form { display:flex; gap:6px; }
.room-code-form input { width:120px; }
.create-table-panel { background:linear-gradient(160deg,#fff8db,#f5edff); }
.create-table-icon { font-size:3.5rem; }
.form-pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.form-pair label:last-child { align-content:start; }
.form-pair label:last-child input + input { margin-top:7px; }

/* Multiplayer poker table */
.multi-poker-layout { display:grid; grid-template-columns:minmax(680px,1fr) minmax(310px,370px); gap:22px; align-items:start; }
.multi-poker-main { min-width:0; }
.multi-poker-table { position:relative; width:100%; min-height:650px; border-radius:34px; background:radial-gradient(ellipse at center,#248a5f 0%,#126044 58%,#0c4432 100%); border:14px solid #5c3422; box-shadow:inset 0 0 0 7px #bf7b3c,var(--shadow); overflow:hidden; }
.multi-table-felt { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:55%; min-height:260px; border:2px solid rgba(255,255,255,.17); border-radius:50%; display:grid; align-content:center; justify-items:center; gap:14px; padding:30px; background:rgba(0,0,0,.05); }
.multi-pot { color:#fff8d1; font-size:.9rem; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.multi-pot strong { font-size:1.35rem; margin-left:6px; }
.multi-board { min-height:116px; }
.multi-seats { position:absolute; inset:0; }
.multi-seat { position:absolute; transform:translate(-50%,-50%); width:150px; min-height:112px; padding:10px; border-radius:18px; background:rgba(255,255,255,.94); box-shadow:0 12px 22px rgba(0,0,0,.22); text-align:center; border:3px solid transparent; transition:.18s ease; }
.multi-seat.own { border-color:#ffd85a; }
.multi-seat.active-turn { box-shadow:0 0 0 5px rgba(90,255,177,.5),0 15px 24px rgba(0,0,0,.24); }
.multi-seat.folded { opacity:.58; filter:grayscale(.6); }
.multi-seat > strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.seat-stack { display:block; color:#6a6573; font-size:.82rem; }
.seat-cards { display:flex; justify-content:center; gap:2px; min-height:42px; margin:5px 0; }
.multi-seat small { display:block; color:#5f5a68; font-weight:700; }
.multi-seat-badges { position:absolute; left:-8px; top:-8px; display:flex; gap:3px; }
.multi-seat-badges span { min-width:26px; height:26px; padding:0 5px; border-radius:50%; display:grid; place-items:center; background:#ffcf4e; color:#51350a; font-size:.66rem; font-weight:900; box-shadow:0 4px 8px rgba(0,0,0,.17); }
.mini-card { position:relative!important; inset:auto!important; width:32px!important; height:44px!important; border-radius:5px!important; display:inline-grid!important; place-items:center; font-size:.7rem; }
.mini-card b { font-size:.75rem; }
.mini-card em { font-style:normal; font-size:1rem; line-height:1; }
.mini-card.card-back { border-width:2px; }
.multi-actions { margin-top:16px; }
.between-hand-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.multi-poker-sidebar { display:grid; gap:18px; position:sticky; top:90px; }
.table-info-list { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:14px; }
.table-info-list > div { padding:10px; border-radius:12px; background:#f8f5fb; }
.table-info-list span { display:block; color:var(--muted); font-size:.72rem; text-transform:uppercase; font-weight:800; }
.join-code-box { margin-top:12px; padding:12px; border-radius:12px; background:#fff4cc; text-align:center; }
.join-code-box:empty { display:none; }
.join-code-box span { display:block; color:#77632c; font-size:.75rem; text-transform:uppercase; font-weight:800; }
.join-code-box strong { font-size:1.35rem; letter-spacing:.12em; }
.multi-move-list { height:250px; }

@media (max-width: 1180px) {
    .six-dashboard-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .multi-poker-layout { grid-template-columns:1fr; }
    .multi-poker-sidebar { position:static; grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
    .daily-grid,.portal-expansion-grid,.friend-grid,.badge-grid { grid-template-columns:1fr 1fr; }
    .replay-layout,.poker-room-layout { grid-template-columns:1fr; }
    .replay-sidebar { position:static; grid-template-columns:1fr 1fr; }
    .multi-poker-table { min-height:600px; }
}
@media (max-width: 760px) {
    .six-dashboard-cards,.daily-grid,.portal-expansion-grid,.friend-grid,.badge-grid { grid-template-columns:1fr; }
    .friend-hero,.profile-level-panel { grid-template-columns:1fr; }
    .profile-level-panel { text-align:center; }
    .level-emblem { margin:auto; }
    .replay-sidebar,.multi-poker-sidebar { grid-template-columns:1fr; }
    .multi-poker-table { min-height:720px; border-width:8px; }
    .multi-seat { width:118px; min-height:96px; padding:7px; }
    .multi-table-felt { width:60%; min-height:220px; }
    .poker-room-card { grid-template-columns:auto 1fr; }
    .room-actions { grid-column:1/-1; justify-content:stretch; }
    .room-actions form,.room-actions .button { width:100%; }
    .room-code-form { display:grid; grid-template-columns:1fr auto; }
    .room-code-form input { width:100%; }
}

/* ===== MVP 6.1: Spelacademie en verdiepingslagen ===== */
.split-buttons { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.text-link.centered { text-align:center; font-weight:750; }
.daily-deal-badge { background:linear-gradient(135deg,#fff4cb,#ffe4f0); color:#805612; border-color:#efd89a; }
.mini-links { display:flex; gap:10px; font-size:.9rem; font-weight:750; }
.knowledge-content { margin-top:14px; }
.knowledge-grid { display:grid; gap:10px; }
.knowledge-grid > div { padding:12px 13px; border-radius:13px; background:linear-gradient(135deg,#f8f5ff,#f5fbff); border:1px solid rgba(122,56,245,.1); }
.knowledge-grid span,.knowledge-grid small { display:block; }
.knowledge-grid span { color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; font-weight:850; }
.knowledge-grid strong { display:block; margin:3px 0; color:#42246d; }
.knowledge-grid small { color:#5f6674; line-height:1.4; }

.academy-heading { align-items:center; }
.academy-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.academy-stat { padding:18px; border-radius:18px; background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(248,245,255,.88)); border:1px solid rgba(122,56,245,.11); box-shadow:var(--shadow); }
.academy-stat span { display:block; color:var(--muted); font-weight:750; font-size:.82rem; }
.academy-stat strong { display:block; margin-top:4px; font-size:1.9rem; color:#442270; }
.academy-game-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.academy-game-card { position:relative; overflow:hidden; padding:22px; border-radius:24px; background:#fff; border:1px solid rgba(122,56,245,.1); box-shadow:var(--shadow); }
.academy-game-card::before { content:''; position:absolute; inset:0; opacity:.75; pointer-events:none; }
.academy-game-card.purple::before { background:linear-gradient(145deg,rgba(122,56,245,.15),transparent 55%); }
.academy-game-card.pink::before { background:linear-gradient(145deg,rgba(255,93,163,.14),transparent 55%); }
.academy-game-card.green::before { background:linear-gradient(145deg,rgba(39,190,111,.15),transparent 55%); }
.academy-game-card.orange::before { background:linear-gradient(145deg,rgba(255,163,62,.17),transparent 55%); }
.academy-game-card > * { position:relative; z-index:1; }
.academy-game-top { display:flex; align-items:center; gap:14px; }
.academy-game-icon { width:58px; height:58px; border-radius:18px; display:grid; place-items:center; font-size:2rem; background:rgba(255,255,255,.78); box-shadow:0 9px 18px rgba(0,0,0,.06); }
.academy-game-top span { color:var(--muted); font-weight:800; }
.academy-game-top h2 { margin:2px 0 0; font-size:1.7rem; }
.mastery-bar { height:10px; border-radius:999px; overflow:hidden; background:#ebe7f1; margin:14px 0 10px; }
.mastery-bar span,.mastery-bar i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#7a38f5,#ff5aa5); }
.academy-card-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:.84rem; }
.academy-skill-mini { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:16px 0; }
.academy-skill-mini div { display:flex; justify-content:space-between; padding:9px 10px; border-radius:11px; background:rgba(255,255,255,.72); }
.academy-skill-mini span { color:#625b70; font-size:.84rem; }
.academy-layout { display:grid; grid-template-columns:260px minmax(0,1fr); gap:22px; align-items:start; }
.academy-sidebar { position:sticky; top:90px; }
.academy-sidebar h2 { margin-bottom:12px; }
.academy-filter { display:flex; justify-content:space-between; gap:10px; padding:10px 11px; border-radius:11px; color:#51465f; font-weight:700; }
.academy-filter:hover,.academy-filter.active { background:linear-gradient(135deg,#f1e9ff,#fff1f7); color:#6a2ed0; }
.academy-filter strong { color:#7a38f5; }
.academy-side-stat { margin-top:20px; padding:14px; border-radius:14px; background:#f8f5ff; }
.academy-side-stat span,.academy-side-stat small { display:block; color:var(--muted); }
.academy-side-stat strong { display:block; font-size:1.8rem; color:#5830a8; }
.academy-main { min-width:0; }
.academy-question-nav { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px; }
.academy-number { width:36px; height:36px; border-radius:10px; display:grid; place-items:center; background:#f4f1f7; color:#51465f; font-weight:850; }
.academy-number.active,.academy-number:hover { background:linear-gradient(135deg,#7a38f5,#ff5aa5); color:#fff; }
.academy-question-card { padding:26px; }
.academy-question-header { display:flex; justify-content:space-between; gap:16px; align-items:start; }
.academy-question-header h2 { font-size:1.65rem; margin-top:8px; }
.academy-question-icon { width:58px; height:58px; border-radius:18px; display:grid; place-items:center; font-size:2rem; background:linear-gradient(135deg,#f2e9ff,#fff0f6); }
.difficulty,.skill-label { display:inline-flex; padding:5px 9px; border-radius:999px; font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; font-weight:850; margin-right:6px; }
.difficulty.beginner { background:#eaf8f0; color:#16704a; }
.difficulty.intermediate { background:#fff3d6; color:#8a5a00; }
.difficulty.advanced { background:#ffe9ed; color:#a62c49; }
.skill-label { background:#f0ebf8; color:#62458a; }
.academy-question-text { font-size:1.16rem; font-weight:700; color:#332b3d; margin:22px 0 16px; }
.academy-answer-form { display:grid; gap:10px; }
.academy-answer-form label { cursor:pointer; }
.academy-answer-form input { position:absolute; opacity:0; pointer-events:none; }
.academy-answer-form label span { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:14px; border:1px solid #ddd6e8; background:#fff; transition:.14s ease; }
.academy-answer-form label span b { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; background:#f2edf8; color:#6938b2; }
.academy-answer-form input:checked + span { border-color:#7a38f5; box-shadow:0 0 0 3px rgba(122,56,245,.12); background:#faf7ff; }
.academy-feedback { margin-top:18px; padding:16px; border-radius:15px; }
.academy-feedback.correct { background:#eaf8f1; border:1px solid #bce2cf; color:#145a3e; }
.academy-feedback.incorrect { background:#fff4e4; border:1px solid #efd3a4; color:#714b0b; }
.academy-feedback > strong { font-size:1.1rem; }
.academy-feedback > div { display:flex; gap:16px; font-weight:800; }
.academy-chess-board { width:min(100%,440px); aspect-ratio:1; display:grid; grid-template-columns:repeat(8,1fr); border:7px solid #3d2f48; border-radius:12px; overflow:hidden; margin:18px auto; }
.academy-chess-square { position:relative; display:grid; place-items:center; aspect-ratio:1; }
.academy-chess-square.light { background:#eee7d9; }
.academy-chess-square.dark { background:#8ba48d; }
.academy-chess-square span { font-family:"Segoe UI Symbol",serif; font-size:clamp(1.5rem,5vw,3.2rem); filter:drop-shadow(0 2px 1px rgba(0,0,0,.17)); }
.academy-chess-square small { position:absolute; right:2px; bottom:1px; font-size:.5rem; opacity:.45; }
.academy-draughts-board { width:min(100%,470px); aspect-ratio:1; display:grid; grid-template-columns:repeat(10,1fr); border:7px solid #3c3128; border-radius:12px; overflow:hidden; margin:18px auto; }
.academy-draughts-square { position:relative; aspect-ratio:1; display:grid; place-items:center; }
.academy-draughts-square.light { background:#e5d8bf; }
.academy-draughts-square.dark { background:#6f543d; }
.academy-draughts-square small { position:absolute; right:2px; bottom:0; font-size:.45rem; color:rgba(255,255,255,.55); }
.academy-draughts-piece { width:70%; aspect-ratio:1; border-radius:50%; box-shadow:inset 0 0 0 4px rgba(255,255,255,.25),0 3px 6px rgba(0,0,0,.3); }
.academy-draughts-piece.white { background:#f7f3e9; }
.academy-draughts-piece.black { background:#171717; }
.academy-draughts-piece.king::after { content:'♛'; display:grid; place-items:center; height:100%; color:#e0aa32; font-size:1rem; }
.academy-poker-scene { padding:18px; border-radius:22px; background:radial-gradient(circle at center,#278761,#145b43); color:#fff; margin:18px 0; }
.academy-poker-meta { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; }
.academy-poker-meta span { padding:7px 10px; border-radius:999px; background:rgba(255,255,255,.14); }
.academy-poker-row { display:flex; justify-content:center; align-items:center; gap:14px; margin-top:15px; }
.academy-poker-row > span { min-width:80px; text-align:right; font-weight:800; }
.academy-playing-cards { display:flex; gap:7px; min-height:74px; }
.mini-playing-card { width:50px; height:70px; border-radius:8px; background:#fff; color:#15171c; display:grid; place-items:center; align-content:center; box-shadow:0 6px 10px rgba(0,0,0,.22); }
.mini-playing-card.red { color:#c93445; }
.mini-playing-card b { font-size:1.2rem; }
.mini-playing-card em { font-size:1.5rem; font-style:normal; line-height:1; }
.pot-odds-formula { text-align:center; margin-top:14px; padding:9px; border-radius:12px; background:rgba(0,0,0,.13); }
.academy-solitaire-scene { min-height:230px; display:grid; grid-template-columns:repeat(7,1fr); gap:9px; padding:20px; border-radius:20px; background:#287257; margin:18px 0; }
.academy-sol-column { position:relative; min-height:190px; }
.academy-card-back,.academy-sol-column .mini-playing-card.large { position:absolute; left:0; width:100%; aspect-ratio:5/7; border-radius:8px; }
.academy-card-back { background:repeating-linear-gradient(45deg,#2f6fa4 0 6px,#255a89 6px 12px); border:3px solid #fff; }
.academy-sol-column .mini-playing-card.large { height:auto; min-height:105px; }
.academy-profile-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:16px; }
.academy-profile-grid > a { padding:14px; border-radius:15px; background:linear-gradient(145deg,#faf7ff,#fff); color:inherit; border:1px solid rgba(122,56,245,.1); }
.academy-profile-grid span,.academy-profile-grid small { display:block; }
.academy-profile-grid strong { display:block; font-size:1.55rem; color:#6031b4; margin-top:4px; }
.academy-profile-grid .mastery-bar { height:7px; margin:8px 0; }
.academy-profile-grid .mastery-bar i { display:block; }
.tools-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.tool-card h2 { font-size:1.55rem; }
.tool-input-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.tool-input-grid label { display:grid; gap:6px; font-weight:750; }
.tool-result { display:grid; gap:5px; margin-top:16px; padding:16px; border-radius:15px; background:linear-gradient(135deg,#f8f4ff,#fff7eb); }
.tool-result strong { font-size:1.25rem; }
.tool-result strong.positive { color:#16704a; }
.tool-result strong.negative { color:#b13a3f; }
.tool-result span,.tool-result small { display:block; color:#625d69; }
.range-groups { display:grid; gap:8px; }
.range-groups div { padding:10px 12px; border-radius:12px; background:#f8f5fb; }
.range-groups strong,.range-groups span { display:block; }
.lesson-list { padding-left:22px; }
.lesson-list li { margin-bottom:10px; }

@media (max-width:980px) {
    .academy-game-grid,.tools-grid { grid-template-columns:1fr; }
    .academy-layout { grid-template-columns:1fr; }
    .academy-sidebar { position:static; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
    .academy-sidebar h2,.academy-side-stat { grid-column:1/-1; }
    .academy-profile-grid { grid-template-columns:1fr 1fr; }
    .academy-overview { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:720px) {
    .academy-overview { grid-template-columns:1fr 1fr; }
    .academy-game-grid,.academy-profile-grid { grid-template-columns:1fr; }
    .academy-question-card { padding:18px; }
    .academy-question-header { align-items:center; }
    .academy-question-icon { width:46px; height:46px; }
    .academy-solitaire-scene { overflow-x:auto; min-width:620px; }
    .tool-input-grid { grid-template-columns:1fr; }
    .split-buttons { grid-template-columns:1fr; }
}

/* === MVP 6.2 enhancements === */
.fullscreen-toggle { white-space: nowrap; }

.piece { position: relative; z-index: 2; display:grid; place-items:center; width:100%; height:100%; }
.piece .piece-shadow,
.piece .piece-face { position:absolute; inset:0; display:grid; place-items:center; font-family:"Segoe UI Symbol","Noto Sans Symbols 2",serif; font-size:clamp(2.1rem,6.2vw,4.8rem); line-height:1; }
.piece .piece-shadow { transform: translate(3px, 5px); opacity:.35; filter: blur(.2px); }
.piece-white .piece-shadow { color: rgba(48,60,74,.4); }
.piece-white .piece-face { color:#fefefe; -webkit-text-stroke: 1.3px #41505e; text-shadow: 0 1px 0 #fff, 0 2px 0 #e3e9ef, 0 3px 0 #c7d1d9, 0 5px 10px rgba(0,0,0,.28); }
.piece-black .piece-shadow { color: rgba(10,14,19,.55); }
.piece-black .piece-face { color:#29313b; -webkit-text-stroke: 1.1px #0c1014; text-shadow: 0 1px 0 #626d78, 0 2px 0 #4a545f, 0 3px 0 #2b3138, 0 6px 11px rgba(0,0,0,.34); }

.mobile-game-picker { display:none; }
@media (max-width: 720px) {
  .mobile-game-picker { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:8px; margin: 10px 0 14px; position: sticky; top: 76px; z-index: 20; background: rgba(247,249,252,.92); backdrop-filter: blur(12px); padding: 10px; border-radius: 16px; box-shadow: var(--shadow); }
  .mobile-game-picker button { border:0; border-radius: 14px; background:#e9eef6; color:var(--ink); padding:10px 6px; font-size:.8rem; font-weight:700; }
  .mobile-game-picker button.active { background: linear-gradient(135deg, #7a38f5, #ff6a59); color:#fff; box-shadow: 0 8px 20px rgba(122,56,245,.25); }
  .mobile-game-card { display:none; }
  .mobile-game-card.mobile-active { display:block; }
}

.mobile-subtitle-bar { display:none; position:fixed; left:10px; right:10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); z-index: 10020; padding: 10px 14px; border-radius: 16px; background: rgba(13,19,31,.88); color:#fff; box-shadow: 0 14px 30px rgba(0,0,0,.28); backdrop-filter: blur(12px); }
.mobile-subtitle-label { font-size:.68rem; text-transform: uppercase; letter-spacing: .12em; color:#a9c0ff; margin-bottom:4px; }
.mobile-subtitle-text { display:grid; gap:2px; }
.mobile-subtitle-text strong { font-size:.94rem; line-height:1.25; }
.mobile-subtitle-text span { font-size:.8rem; color:#dce6ff; line-height:1.25; }
@media (max-width: 720px) {
  .mobile-subtitle-bar.is-visible { display:block; }
  .site-footer { padding-bottom: 82px; }
}

.celebration-overlay { position:fixed; inset:0; display:grid; place-items:center; pointer-events:none; z-index:10030; opacity:0; transition: opacity .22s ease; }
.celebration-overlay.visible { opacity:1; pointer-events:auto; }
.celebration-backdrop { position:absolute; inset:0; background: radial-gradient(circle at center, rgba(17,24,39,.15), rgba(11,18,32,.52)); }
.celebration-card { position:relative; z-index:2; min-width:min(92vw, 380px); text-align:center; background: rgba(255,255,255,.96); color:var(--ink); padding:22px 24px; border-radius:22px; box-shadow: 0 16px 38px rgba(21,34,55,.28); }
.celebration-card h2 { margin: 6px 0 8px; }
.celebration-card p { margin:0; color:var(--muted); }
.celebration-icon { font-size:2.7rem; }
.celebration-fireworks { position:absolute; top:9%; left:50%; transform:translateX(-50%); z-index:2; color:#fff6b0; font-size:clamp(1.5rem, 5vw, 2.4rem); text-shadow:0 0 12px rgba(255,230,120,.5); animation: popGlow 1.2s ease infinite alternate; }
.celebration-confetti-wrap { position:absolute; inset:0; overflow:hidden; }
.celebration-confetti { position:absolute; top:-10%; width:12px; height:24px; border-radius:3px; left:var(--x); animation: confettiFall var(--duration,3.5s) linear var(--delay, 0s) forwards; }
.celebration-confetti.confetti-1 { background:#ffcf4d; }
.celebration-confetti.confetti-2 { background:#7a38f5; }
.celebration-confetti.confetti-3 { background:#ff6a59; }
.celebration-confetti.confetti-4 { background:#2dd4bf; }
.celebration-confetti.confetti-5 { background:#60a5fa; }
.celebration-confetti.confetti-6 { background:#f472b6; }
@keyframes confettiFall { from { transform: translate3d(0, -10vh, 0) rotate(0deg); } to { transform: translate3d(-20px, 110vh, 0) rotate(660deg); } }
@keyframes popGlow { from { transform: translateX(-50%) scale(1); opacity:.8; } to { transform: translateX(-50%) scale(1.08); opacity:1; } }

body.fullscreen-game-active { background:#0a1018; overflow:hidden; }
body.fullscreen-game-active .site-header,
body.fullscreen-game-active .site-footer { display:none; }
body.fullscreen-game-active .page.container,
body.pseudo-fullscreen-active .page.container { width:100%; max-width:none; padding:0; }
body.fullscreen-game-active .game-topbar,
body.fullscreen-game-active .page-heading { margin:0; padding:10px 12px; position:sticky; top:0; z-index:10010; background:rgba(9,14,22,.78); backdrop-filter: blur(10px); color:#fff; }
body.fullscreen-game-active .game-topbar .subtle,
body.fullscreen-game-active .page-heading .subtle,
body.fullscreen-game-active .game-topbar .back-link { color:#eaf0ff; }
body.fullscreen-game-active #gameShell,
body.fullscreen-game-active #draughtsShell,
body.fullscreen-game-active #solitaireShell,
body.fullscreen-game-active #pokerShell,
body.fullscreen-game-active #multiPokerShell { min-height: calc(100dvh - 68px); padding: 12px 12px 86px; align-items:start; }
body.fullscreen-game-active .game-sidebar,
body.fullscreen-game-active .solitaire-sidebar,
body.fullscreen-game-active .multi-poker-sidebar { display:none !important; }
body.fullscreen-game-active .board-column,
body.fullscreen-game-active .solitaire-main,
body.fullscreen-game-active .poker-table-wrap,
body.fullscreen-game-active .multi-poker-main { width:100%; max-width:none; }
body.fullscreen-game-active .chess-layout,
body.fullscreen-game-active .draughts-layout,
body.fullscreen-game-active .poker-layout,
body.fullscreen-game-active .multi-poker-layout { grid-template-columns: 1fr; }
body.fullscreen-game-active .chess-board,
body.fullscreen-game-active .draughts-board { width:min(96vw, calc(100dvh - 172px)); margin:0 auto; }
body.fullscreen-game-active .solitaire-board { min-height: calc(100dvh - 220px); }
body.fullscreen-game-active .poker-table,
body.fullscreen-game-active .multi-poker-table { min-height: min(72dvh, 760px); }
@media (orientation: landscape) and (max-width: 920px) {
  body.fullscreen-game-active .chess-board,
  body.fullscreen-game-active .draughts-board { width:min(74vh, 90vw); }
  body.fullscreen-game-active .poker-table,
  body.fullscreen-game-active .multi-poker-table { min-height: 60dvh; }
}
@media (max-width: 720px) {
  body.fullscreen-game-active .game-topbar h1,
  body.fullscreen-game-active .page-heading h1 { font-size:1.35rem; }
  body.fullscreen-game-active .game-topbar .subtle,
  body.fullscreen-game-active .heading-actions a:not(.fullscreen-toggle),
  body.fullscreen-game-active .page-heading .subtle { display:none; }
  body.fullscreen-game-active .toolbar-actions .inline-form,
  body.fullscreen-game-active .toolbar-actions .button.small.secondary:not(.fullscreen-toggle) { display:none; }
  body.fullscreen-game-active .toolbar-actions { justify-content:flex-end; }
  body.fullscreen-game-active .solitaire-board { padding:10px; }
  body.fullscreen-game-active .solitaire-top-row,
  body.fullscreen-game-active .tableau-group { min-width: 600px; }
  body.fullscreen-game-active .game-message { margin-bottom: 10px; }
}

/* === MVP 6.3 SVG chess pieces, sounds and mobile navigation === */
.chess-piece-svg { width:88%; height:88%; object-fit:contain; display:block; user-select:none; pointer-events:none; transform:translateY(-1%); transition:transform .16s ease, filter .16s ease; }
.square:hover .chess-piece-svg { transform:translateY(-4%) scale(1.03); filter:brightness(1.04); }
.square.selected .chess-piece-svg { transform:translateY(-5%) scale(1.06); }
.academy-chess-piece-svg { width:82%; height:82%; object-fit:contain; filter:drop-shadow(0 3px 3px rgba(0,0,0,.22)); }

.nav-icon-button { appearance:none; border:0; background:#eef2f8; border-radius:999px; width:36px; height:36px; display:grid; place-items:center; cursor:pointer; color:var(--ink); }
.nav-icon-button:hover { background:#e2e8f3; }

.mobile-bottom-nav { display:none; }
@media (max-width:720px) {
  body { padding-bottom:76px; }
  .site-footer { padding-bottom:18px; }
  .mobile-bottom-nav { position:fixed; left:8px; right:8px; bottom:calc(env(safe-area-inset-bottom, 0px) + 7px); z-index:10010; height:62px; display:grid; grid-template-columns:repeat(5,1fr); gap:4px; padding:6px; border-radius:18px; background:rgba(255,255,255,.94); border:1px solid rgba(82,62,130,.12); box-shadow:0 16px 38px rgba(27,31,45,.23); backdrop-filter:blur(14px); }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button { appearance:none; border:0; background:transparent; color:#677085; border-radius:13px; display:grid; place-items:center; align-content:center; gap:1px; padding:3px; font:inherit; }
  .mobile-bottom-nav span { font-size:1.18rem; line-height:1; }
  .mobile-bottom-nav small { font-size:.64rem; font-weight:700; }
  .mobile-bottom-nav a.active { color:#6738dc; background:#f0eafe; }
  body.fullscreen-game-active .mobile-bottom-nav { display:none; }
  body:not(.fullscreen-game-active) .mobile-subtitle-bar { bottom:calc(env(safe-area-inset-bottom, 0px) + 76px); }
  .site-header nav .nav-icon-button { display:none; }
}

.fullscreen-floating-controls { display:none; position:fixed; top:calc(env(safe-area-inset-top, 0px) + 10px); right:10px; z-index:10025; gap:7px; }
.fullscreen-floating-controls.active { display:flex; }
.fullscreen-floating-controls button { width:40px; height:40px; border:0; border-radius:13px; background:rgba(13,19,31,.82); color:#fff; font-size:1rem; box-shadow:0 10px 22px rgba(0,0,0,.25); backdrop-filter:blur(10px); }
.fullscreen-orientation-toggle { display:none; }
@media (max-width:920px) { .fullscreen-orientation-toggle { display:block; } }

.square.last-move .chess-piece-svg { animation:pieceSettle .22s ease-out; }
@keyframes pieceSettle { from { transform:translateY(-12%) scale(1.08); opacity:.72; } to { transform:translateY(-1%) scale(1); opacity:1; } }

@media (max-width:720px) {
  .piece { filter:none; }
  .chess-piece-svg { width:92%; height:92%; }
  body.fullscreen-game-active .chess-piece-svg { width:94%; height:94%; }
}
.device-settings-panel { background:linear-gradient(135deg,#f8f5ff,#f0fbf7); }
.device-setting-buttons { display:flex; flex-wrap:wrap; gap:12px; margin-top:14px; }
.device-setting-buttons .button { min-width:150px; }
@media (max-width:520px) { .device-setting-buttons { display:grid; grid-template-columns:1fr 1fr; } .device-setting-buttons .button { min-width:0; } }
.fullscreen-context-actions { display:flex; gap:7px; }
.fullscreen-floating-controls button:disabled { opacity:.4; }

/* === MVP 6.3.1 mobile fullscreen hotfix === */
html.fullscreen-game-active,
body.fullscreen-game-active,
html.pseudo-fullscreen-active,
body.pseudo-fullscreen-active {
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  overflow:hidden !important;
  overscroll-behavior:none;
}

.game-target-fullscreen,
.game-target-fullscreen:fullscreen,
.game-target-fullscreen:-webkit-full-screen {
  box-sizing:border-box !important;
  width:100vw !important;
  width:var(--game-viewport-width, 100vw) !important;
  height:100vh !important;
  height:var(--game-viewport-height, 100dvh) !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  padding:calc(env(safe-area-inset-top, 0px) + 8px) 8px calc(env(safe-area-inset-bottom, 0px) + 84px) !important;
  border:0 !important;
  border-radius:0 !important;
  background:#0a1018 !important;
  color:#fff;
  overflow:auto !important;
  overscroll-behavior:contain;
  grid-template-columns:minmax(0, 1fr) !important;
  align-items:start !important;
  justify-content:center !important;
  gap:8px !important;
}

body.pseudo-fullscreen-active .game-target-fullscreen {
  position:fixed !important;
  inset:0 !important;
  z-index:10000 !important;
}

.game-target-fullscreen .game-sidebar,
.game-target-fullscreen .solitaire-sidebar,
.game-target-fullscreen .multi-poker-sidebar {
  display:none !important;
}

.game-target-fullscreen .board-column,
.game-target-fullscreen .solitaire-main,
.game-target-fullscreen .poker-table-wrap,
.game-target-fullscreen .multi-poker-main {
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  margin:0 auto !important;
}

.game-target-fullscreen .board-column {
  min-height:0 !important;
  display:grid !important;
  grid-template-rows:auto minmax(0, 1fr) auto !important;
  justify-items:center !important;
  align-content:start !important;
  gap:5px !important;
}

.game-target-fullscreen .player-strip {
  width:min(100%, 620px) !important;
  margin:0 auto !important;
  padding:5px 9px !important;
  min-height:36px !important;
  background:rgba(255,255,255,.92) !important;
  color:#152033 !important;
  border-radius:11px !important;
}

.game-target-fullscreen .player-strip .avatar {
  width:28px !important;
  height:28px !important;
  font-size:1rem !important;
}

.game-target-fullscreen .chess-board,
.game-target-fullscreen .draughts-board {
  width:min(calc(var(--game-viewport-width, 100vw) - 16px), calc(var(--game-viewport-height, 100dvh) - 110px)) !important;
  max-width:none !important;
  margin:0 auto !important;
  border-width:5px !important;
  box-shadow:none !important;
  flex:none !important;
}

.game-target-fullscreen .fullscreen-floating-controls {
  position:fixed !important;
  top:calc(env(safe-area-inset-top, 0px) + 7px) !important;
  right:7px !important;
  z-index:10040 !important;
}

.game-target-fullscreen .mobile-subtitle-bar {
  position:fixed !important;
  left:8px !important;
  right:8px !important;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 7px) !important;
  z-index:10035 !important;
  max-height:70px;
  overflow:hidden;
}

/* Patience: fit seven columns inside the phone instead of retaining a 620px canvas. */
.game-target-fullscreen.solitaire-layout {
  display:block !important;
}
.game-target-fullscreen .solitaire-toolbar {
  margin:0 0 6px !important;
  padding:5px 8px !important;
  gap:12px !important;
  min-height:38px;
  background:rgba(255,255,255,.94) !important;
}
.game-target-fullscreen .solitaire-toolbar .toolbar-actions {
  display:none !important;
}
.game-target-fullscreen .solitaire-board {
  width:100% !important;
  height:calc(var(--game-viewport-height, 100dvh) - 128px) !important;
  min-height:0 !important;
  overflow:auto !important;
  padding:7px !important;
  border-width:5px !important;
  border-radius:10px !important;
  box-shadow:none !important;
}
.game-target-fullscreen .solitaire-top-row,
.game-target-fullscreen .tableau-group {
  width:100% !important;
  min-width:0 !important;
}
.game-target-fullscreen .solitaire-top-row {
  gap:6px !important;
  margin-bottom:10px !important;
}
.game-target-fullscreen .pile-group,
.game-target-fullscreen .foundation-group {
  gap:4px !important;
}
.game-target-fullscreen .card-pile {
  width:clamp(39px, 11.2vw, 68px) !important;
}
.game-target-fullscreen .tableau-group {
  grid-template-columns:repeat(7, minmax(0, 1fr)) !important;
  gap:4px !important;
}
.game-target-fullscreen .tableau-pile {
  min-height:calc(var(--game-viewport-height, 100dvh) - 245px) !important;
}
.game-target-fullscreen .tableau-card-button {
  top:calc(var(--card-index) * clamp(20px, 5.8vw, 30px)) !important;
}
.game-target-fullscreen .card-corner {
  font-size:clamp(.55rem, 2.6vw, .9rem) !important;
}
.game-target-fullscreen .card-corner strong {
  font-size:clamp(.65rem, 3vw, 1rem) !important;
}
.game-target-fullscreen .card-center {
  font-size:clamp(1.25rem, 6vw, 2.2rem) !important;
}
.game-target-fullscreen #solitaireMessage {
  display:none !important;
}

/* Poker: use the entire width and keep actions reachable at the bottom. */
.game-target-fullscreen.poker-layout,
.game-target-fullscreen.multi-poker-layout {
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) !important;
}
.game-target-fullscreen .poker-table-wrap,
.game-target-fullscreen .multi-poker-main {
  padding:6px !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.game-target-fullscreen .poker-table,
.game-target-fullscreen .multi-poker-table {
  width:100% !important;
  min-height:calc(var(--game-viewport-height, 100dvh) - 190px) !important;
  max-height:none !important;
  margin:0 !important;
  border-width:7px !important;
  border-radius:24px !important;
}
.game-target-fullscreen .poker-actions,
.game-target-fullscreen .between-hand-actions {
  position:sticky;
  bottom:76px;
  z-index:20;
  padding:7px !important;
  margin:6px 0 0 !important;
  background:rgba(10,16,24,.9);
  border-radius:13px;
  backdrop-filter:blur(10px);
}
.game-target-fullscreen .game-message {
  margin:5px 0 !important;
}

@media (orientation:landscape) and (max-width:1024px) {
  .game-target-fullscreen .player-strip {
    display:none !important;
  }
  .game-target-fullscreen .chess-board,
  .game-target-fullscreen .draughts-board {
    width:min(calc(var(--game-viewport-width, 100vw) - 16px), calc(var(--game-viewport-height, 100dvh) - 16px)) !important;
  }
  .game-target-fullscreen .solitaire-toolbar {
    display:none !important;
  }
  .game-target-fullscreen .solitaire-board {
    height:calc(var(--game-viewport-height, 100dvh) - 92px) !important;
  }
  .game-target-fullscreen .card-pile {
    width:clamp(42px, 7.2vw, 66px) !important;
  }
  .game-target-fullscreen .tableau-card-button {
    top:calc(var(--card-index) * clamp(19px, 3.6vw, 28px)) !important;
  }
  .game-target-fullscreen .poker-table,
  .game-target-fullscreen .multi-poker-table {
    min-height:calc(var(--game-viewport-height, 100dvh) - 105px) !important;
  }
}

/* === MVP 6.4: resume, end screens and subtitle controls === */
.resume-game-banner {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  margin:16px 0 20px;
  padding:16px 18px;
  border-radius:20px;
  color:#fff;
  text-decoration:none;
  background:linear-gradient(135deg,#5132c7,#7a38f5 48%,#ff6a59);
  box-shadow:0 18px 34px rgba(92,55,190,.24);
}
.resume-game-banner:hover { transform:translateY(-2px); }
.resume-game-icon { width:46px; height:46px; border-radius:15px; display:grid; place-items:center; background:rgba(255,255,255,.18); font-size:1.2rem; }
.resume-game-banner span:nth-child(2) { display:grid; gap:2px; }
.resume-game-banner small { color:#e9e1ff; text-transform:uppercase; letter-spacing:.1em; font-weight:800; font-size:.68rem; }
.resume-game-banner strong { font-size:1.08rem; }
.resume-game-banner em { color:#f6efff; font-style:normal; font-size:.88rem; }
.resume-game-banner b { white-space:nowrap; }

.mobile-subtitle-bar { padding-right:48px; cursor:default; transition:max-height .2s ease, padding .2s ease; }
.mobile-subtitle-toggle { position:absolute; right:9px; top:9px; width:34px; height:34px; border:0; border-radius:10px; background:rgba(255,255,255,.14); color:#fff; font-size:1rem; }
.mobile-subtitle-bar.is-collapsed { max-height:48px !important; padding-top:8px; padding-bottom:8px; }
.mobile-subtitle-bar.is-collapsed .mobile-subtitle-label,
.mobile-subtitle-bar.is-collapsed .mobile-subtitle-text span { display:none; }
.mobile-subtitle-bar.is-collapsed .mobile-subtitle-text strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.game-end-panel {
  position:fixed;
  left:50%;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 18px);
  transform:translate(-50%, 24px);
  z-index:10045;
  width:min(92vw, 760px);
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:14px 18px;
  align-items:center;
  padding:20px;
  border-radius:24px;
  background:rgba(255,255,255,.97);
  color:var(--ink);
  box-shadow:0 24px 60px rgba(8,16,30,.38);
  border:1px solid rgba(122,56,245,.12);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
  backdrop-filter:blur(18px);
}
.game-end-panel.visible { opacity:1; pointer-events:auto; transform:translate(-50%,0); }
.game-end-close { position:absolute; top:9px; right:10px; width:34px; height:34px; border:0; border-radius:11px; background:#eef1f7; color:#526070; font-size:1.3rem; }
.game-end-icon { width:64px; height:64px; display:grid; place-items:center; border-radius:20px; background:linear-gradient(135deg,#f0e8ff,#fff2e8); font-size:2rem; }
.game-end-copy h2 { margin:2px 0 5px; font-size:1.55rem; }
.game-end-copy p { margin:0; color:var(--muted); }
.game-end-stats { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.game-end-stats div { padding:11px 13px; border-radius:15px; background:#f4f6fa; display:grid; gap:2px; }
.game-end-stats span { color:var(--muted); font-size:.76rem; }
.game-end-stats strong { font-size:1rem; }
.game-end-actions { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:9px; }
.game-end-actions .button { flex:1 1 130px; }

@media (max-width:720px) {
  .resume-game-banner { grid-template-columns:auto minmax(0,1fr); padding:14px; }
  .resume-game-banner b { grid-column:1/-1; text-align:center; padding-top:5px; }
  .game-end-panel { bottom:calc(env(safe-area-inset-bottom, 0px) + 72px); width:calc(100vw - 16px); max-height:70dvh; overflow:auto; padding:16px; border-radius:20px; }
  body.fullscreen-game-active .game-end-panel { bottom:calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .game-end-icon { width:52px; height:52px; font-size:1.65rem; }
  .game-end-copy h2 { font-size:1.25rem; }
  .game-end-stats { gap:6px; }
  .game-end-stats div { padding:9px; }
  .game-end-actions { display:grid; grid-template-columns:1fr 1fr; }
  .game-end-actions .button { width:100%; }
}

/* === MVP 6.5 onboarding, statistics and diagnostics === */
.onboarding-shell { max-width: 1040px; margin: 0 auto; display:grid; gap:22px; }
.onboarding-intro { text-align:center; padding: 18px 10px 0; }
.onboarding-intro h1 { font-size:clamp(2rem,5vw,3.3rem); margin:8px 0 10px; }
.onboarding-intro p { max-width:720px; margin:0 auto; color:var(--muted); font-size:1.06rem; }
.onboarding-steps { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:20px; }
.onboarding-steps span { padding:8px 12px; border-radius:999px; background:#ebeef5; color:#62697a; font-size:.82rem; font-weight:700; }
.onboarding-steps span.active { background:linear-gradient(135deg,#7a38f5,#ff6a59); color:#fff; }
.onboarding-form { display:grid; gap:28px; padding:clamp(18px,4vw,34px); }
.onboarding-form fieldset { border:0; padding:0; margin:0; display:grid; gap:14px; }
.onboarding-form legend { font-size:1.2rem; font-weight:800; margin-bottom:12px; }
.onboarding-form legend span { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#7a38f5; color:#fff; margin-right:8px; }
.onboarding-game-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.onboarding-difficulty-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.onboarding-choice { position:relative; cursor:pointer; }
.onboarding-choice input { position:absolute; opacity:0; pointer-events:none; }
.onboarding-choice .choice-content { height:100%; display:flex; flex-direction:column; gap:6px; padding:16px; border:2px solid #e3e7ef; border-radius:18px; background:#fff; transition:.18s ease; box-shadow:0 8px 18px rgba(41,49,65,.05); }
.onboarding-choice .choice-content b { font-size:2.2rem; }
.onboarding-choice .choice-content strong { font-size:1.05rem; }
.onboarding-choice .choice-content small { color:var(--muted); line-height:1.35; }
.onboarding-choice input:checked + .choice-content { border-color:#7a38f5; background:linear-gradient(180deg,#faf8ff,#f1ebff); box-shadow:0 12px 24px rgba(122,56,245,.14); transform:translateY(-2px); }
.onboarding-learning { border:2px solid #e3e7ef; border-radius:18px; padding:16px; background:#fafbfe; }
.daily-goal-picker { display:grid; gap:12px; padding:18px; border-radius:18px; background:#f5f2ff; }
.daily-goal-picker input { width:100%; accent-color:#7a38f5; }
.daily-goal-picker strong { font-size:1.05rem; }
.onboarding-actions { display:flex; gap:10px; flex-wrap:wrap; }

.stats-overview-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.stat-card small { display:block; margin-top:5px; color:var(--muted); }
.game-stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.game-stat-panel { overflow:hidden; position:relative; }
.game-stat-panel::after { content:""; position:absolute; width:150px; height:150px; border-radius:50%; right:-60px; top:-70px; opacity:.13; background:#7a38f5; }
.game-stat-panel.solitaire::after { background:#ff6a9d; }
.game-stat-panel.draughts::after { background:#2fb971; }
.game-stat-panel.poker::after { background:#f3a72f; }
.game-stat-heading { display:flex; align-items:center; gap:12px; }
.game-stat-heading > span { display:grid; place-items:center; width:54px; height:54px; border-radius:16px; background:#f0ebff; font-size:1.8rem; }
.game-stat-heading h2 { margin:0; }
.game-stat-heading small { color:var(--muted); }
.game-stat-numbers { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:20px 0; }
.game-stat-numbers div { background:#f5f7fb; padding:12px; border-radius:14px; }
.game-stat-numbers span { display:block; color:var(--muted); font-size:.78rem; }
.game-stat-numbers strong { display:block; margin-top:5px; font-size:1.35rem; }
.stat-progress { display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; font-size:.82rem; margin-bottom:16px; }
.stat-progress > div,.xp-source-list > div > div { height:9px; border-radius:999px; background:#e8ebf1; overflow:hidden; }
.stat-progress i,.xp-source-list i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#7a38f5,#ff6a59); }
.activity-chart { height:210px; display:grid; grid-template-columns:repeat(14,1fr); gap:7px; align-items:end; padding-top:14px; }
.activity-day { height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:7px; }
.activity-day i { width:100%; max-width:24px; min-height:5px; border-radius:8px 8px 3px 3px; background:linear-gradient(180deg,#ff7e67,#7a38f5); }
.activity-day span { color:var(--muted); font-size:.7rem; }
.xp-source-list { display:grid; gap:12px; }
.xp-source-list > div { display:grid; grid-template-columns:minmax(110px,.8fr) 1.3fr auto; gap:10px; align-items:center; }
.xp-source-list span { font-size:.86rem; }
.xp-source-list strong { font-size:.84rem; }
.personal-insight-panel { background:linear-gradient(135deg,#f4efff,#fff4e9); }

.diagnostic-summary { display:flex; align-items:center; gap:18px; }
.diagnostic-summary.all-good { border-color:rgba(36,174,96,.3); background:#f1fff7; }
.diagnostic-summary.has-errors { border-color:rgba(232,132,31,.35); background:#fff9ef; }
.diagnostic-icon { font-size:2.5rem; }
.diagnostic-summary h2 { margin:3px 0; }
.diagnostic-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.diagnostic-list { display:grid; gap:9px; }
.diagnostic-list > div { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border-radius:12px; background:#f5f7fa; }
.diagnostic-list > div > span { display:grid; place-items:center; flex:0 0 24px; height:24px; border-radius:50%; font-weight:800; }
.diagnostic-list .ok > span { background:#d9f8e5; color:#177d42; }
.diagnostic-list .failed > span { background:#ffe3d5; color:#ad4716; }
.diagnostic-list strong,.diagnostic-list small { display:block; }
.diagnostic-list small { color:var(--muted); margin-top:2px; word-break:break-word; }
.error-log-list { display:grid; gap:10px; }
.error-log-list article { padding:13px; border:1px solid #e2e6ed; border-radius:14px; background:#fafbfc; }
.error-log-list article > div { display:flex; flex-wrap:wrap; gap:9px; align-items:center; }
.error-log-list code { background:#ece8ff; padding:3px 7px; border-radius:7px; }
.error-log-list p { margin:8px 0 5px; word-break:break-word; }
.error-log-list small { color:var(--muted); }

@media (max-width: 900px) {
  .onboarding-game-grid,.stats-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .game-stat-numbers { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .onboarding-game-grid,.onboarding-difficulty-grid,.game-stat-grid,.diagnostic-grid { grid-template-columns:1fr; }
  .stats-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .onboarding-actions .button { width:100%; text-align:center; }
  .activity-chart { gap:4px; }
  .xp-source-list > div { grid-template-columns:1fr auto; }
  .xp-source-list > div > div { grid-column:1 / -1; order:3; }
}

/* MVP 6.5.1: mobile fullscreen overlay. The core sizing is also applied inline by game-ui.js. */
.mobile-game-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0a1018;
  isolation: isolate;
  contain: layout paint size;
}
.mobile-game-fullscreen-overlay .game-target-fullscreen {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
}

/* === MVP 6.6: tournaments, seasons and profile cosmetics === */
body.profile-theme-purple { --brand:#6f3be8; --brand-dark:#4f24b5; --accent:#f1ebff; }
body.profile-theme-ocean { --brand:#147ba3; --brand-dark:#0a5677; --accent:#e5f7ff; }
body.profile-theme-forest { --brand:#24794a; --brand-dark:#155331; --accent:#e9f8ee; }
body.profile-theme-sunset { --brand:#d95d39; --brand-dark:#a73c20; --accent:#fff0e8; }
.identity-pill { display:flex; align-items:center; gap:7px; padding:5px 10px; }
.identity-pill > b { width:27px; height:27px; display:grid; place-items:center; border-radius:50%; background:#fff; box-shadow:0 3px 9px rgba(0,0,0,.08); font-size:1rem; }
.identity-pill > span { display:grid; line-height:1.05; }
.identity-pill small { font-size:.6rem; color:var(--muted); margin-top:3px; }
.profile-heading { border-radius:24px; padding:24px; border:1px solid rgba(80,62,130,.12); }
.theme-preview-purple { background:linear-gradient(135deg,#f6f0ff,#fff); }
.theme-preview-ocean { background:linear-gradient(135deg,#e8f8ff,#fff); }
.theme-preview-forest { background:linear-gradient(135deg,#eaf8ee,#fff); }
.theme-preview-sunset { background:linear-gradient(135deg,#fff0e8,#fff7ef); }
.profile-heading-identity { display:flex; align-items:center; gap:18px; }
.profile-avatar-large { width:82px; height:82px; border-radius:25px; display:grid; place-items:center; font-size:2.8rem; background:#fff; box-shadow:0 12px 25px rgba(59,39,105,.12); }
.profile-title-line { font-weight:800; color:var(--brand); margin:-6px 0 4px; }
.cosmetic-fieldset { border:1px solid var(--line); border-radius:14px; padding:13px; }
.cosmetic-fieldset legend { padding:0 7px; color:var(--muted); font-size:.82rem; font-weight:800; }
.cosmetic-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.cosmetic-choice { position:relative; display:grid; place-items:center; gap:3px; padding:9px 5px; border:1px solid var(--line); border-radius:12px; cursor:pointer; background:#fff; }
.cosmetic-choice input { position:absolute; opacity:0; }
.cosmetic-choice span { font-size:1.75rem; }
.cosmetic-choice small { font-size:.68rem; text-align:center; color:var(--muted); }
.cosmetic-choice:has(input:checked) { border-color:var(--brand); background:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--brand) 15%, transparent); }
.cosmetic-choice.locked { opacity:.45; cursor:not-allowed; filter:grayscale(.7); }

.tournament-heading { align-items:end; }
.tournament-hero { display:grid; grid-template-columns:minmax(260px,.7fr) minmax(0,1.3fr); gap:28px; align-items:start; background:linear-gradient(135deg,#fff8dd,#fff,#f1edff); border-color:#eadfae; }
.tournament-hero > div { display:flex; gap:18px; align-items:flex-start; }
.tournament-trophy { font-size:4.2rem; filter:drop-shadow(0 9px 10px rgba(184,126,0,.18)); }
.tournament-create-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.tournament-create-form label { display:grid; gap:6px; color:var(--muted); font-size:.8rem; font-weight:750; }
.tournament-create-form .toggle-row { min-height:76px; }
.tournament-create-form .button { align-self:end; min-height:45px; }
.tournament-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.tournament-card { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:14px; padding:16px; border:1px solid var(--line); border-radius:16px; color:var(--text); background:#fff; transition:.16s ease; }
.tournament-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); color:var(--text); }
.tournament-card.active { border-color:#c9b2ff; background:#f8f4ff; }
.tournament-card.waiting { border-color:#d8e6dd; background:#f8fcfa; }
.tournament-card-icon,.tournament-list-icon { width:50px; height:50px; display:grid; place-items:center; border-radius:15px; font-size:1.65rem; background:var(--accent); color:var(--brand); }
.tournament-card span { color:var(--brand); font-size:.72rem; text-transform:uppercase; font-weight:850; letter-spacing:.08em; }
.tournament-card h3 { margin:2px 0 4px; }
.tournament-card p { margin:0; color:var(--muted); font-size:.85rem; }
.tournament-list { display:grid; gap:9px; }
.tournament-list article { display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:14px; }
.tournament-list article small { display:block; color:var(--muted); margin-top:3px; }
.tournament-list-actions { display:flex; gap:7px; align-items:center; }
.tournament-list-actions form { margin:0; }
.champion-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.champion-grid a { display:grid; text-align:center; gap:4px; padding:18px 12px; border:1px solid #eadfae; border-radius:16px; background:linear-gradient(180deg,#fffdf2,#fff); color:var(--text); }
.champion-grid span { font-size:2rem; }
.champion-grid small { color:var(--muted); }

.tournament-status-banner { display:flex; align-items:center; gap:18px; background:linear-gradient(135deg,#f7f3ff,#fff); }
.tournament-status-banner.finished { background:linear-gradient(135deg,#fff6cf,#fffdf4); border-color:#eadb8d; }
.tournament-status-banner.active { background:linear-gradient(135deg,#eef8ff,#fff); border-color:#b7dcec; }
.tournament-status-icon { font-size:3.5rem; }
.tournament-status-banner .join-code-box { margin-left:auto; min-width:190px; }
.participant-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.participant-grid article { display:flex; gap:10px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:13px; }
.participant-grid article.empty { opacity:.55; border-style:dashed; }
.participant-avatar { width:44px; height:44px; display:grid; place-items:center; border-radius:13px; background:var(--accent); font-size:1.45rem; }
.participant-grid small { display:block; color:var(--muted); }
.tournament-bracket-panel { overflow:hidden; }
.tournament-bracket { display:flex; align-items:stretch; gap:24px; overflow-x:auto; padding:8px 4px 18px; }
.bracket-round { min-width:260px; display:flex; flex-direction:column; justify-content:space-around; gap:18px; }
.bracket-round h3 { text-align:center; color:var(--brand); position:sticky; top:0; background:var(--panel); padding:7px; z-index:2; }
.bracket-match { border:1px solid var(--line); border-radius:15px; background:#fff; overflow:hidden; box-shadow:0 5px 15px rgba(20,34,46,.05); }
.bracket-match.active { border-color:#bda9f1; box-shadow:0 0 0 3px rgba(111,59,232,.08); }
.bracket-player { display:flex; justify-content:space-between; gap:8px; padding:11px 13px; border-bottom:1px solid var(--line); }
.bracket-player.winner { background:#ebf9ef; color:#18733b; font-weight:850; }
.bracket-match footer { padding:9px 12px; display:flex; justify-content:flex-end; color:var(--muted); font-size:.8rem; }
.tournament-resume { background:linear-gradient(135deg,#fff6cf,#fff); border-color:#e7d17b; }
.tournament-dashboard-card { background:linear-gradient(145deg,#fff7d7,#fff); }
.season-dashboard-card { background:linear-gradient(145deg,#f0eaff,#fff); }

.season-hero { display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:30px; align-items:center; padding:38px; border-radius:28px; color:#fff; background:radial-gradient(circle at 80% 20%,rgba(255,255,255,.22),transparent 25%),linear-gradient(135deg,#6d35d9,#df5b82,#f2a33c); box-shadow:0 18px 38px rgba(87,41,157,.22); }
.season-hero .eyebrow,.season-hero p { color:#fff; }
.season-hero p { max-width:680px; opacity:.92; }
.season-hero .button.secondary { border-color:#fff; background:rgba(255,255,255,.12); color:#fff; }
.season-medal { display:grid; place-items:center; text-align:center; background:rgba(255,255,255,.17); border:1px solid rgba(255,255,255,.35); border-radius:24px; padding:22px; backdrop-filter:blur(9px); }
.season-medal span { font-size:3rem; }
.season-medal strong { font-size:2.8rem; line-height:1; }
.season-medal small { margin-top:7px; }
.mission-list { display:grid; gap:10px; }
.mission-list a { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px; padding:13px; border:1px solid var(--line); border-radius:14px; color:var(--text); }
.mission-icon { width:44px; height:44px; display:grid; place-items:center; font-size:1.4rem; border-radius:13px; background:var(--accent); }
.mission-progress { height:7px; border-radius:999px; background:#edf0f3; overflow:hidden; margin:7px 0 4px; }
.mission-progress i { display:block; height:100%; background:linear-gradient(90deg,var(--brand),#ed7c54); border-radius:inherit; }
.mission-list small { color:var(--muted); }
.identity-cell { display:flex; align-items:center; gap:8px; }
.identity-cell b { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:var(--accent); }

@media (max-width: 980px) {
  .tournament-hero { grid-template-columns:1fr; }
  .champion-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .season-hero { grid-template-columns:1fr; }
  .season-medal { width:min(100%,280px); }
}
@media (max-width: 720px) {
  .mobile-bottom-nav { grid-template-columns:repeat(6,1fr); }
  .mobile-bottom-nav small { font-size:.57rem; }
  .identity-pill small { display:none; }
  .profile-heading { padding:17px; }
  .profile-heading-identity { align-items:flex-start; }
  .profile-avatar-large { width:62px; height:62px; border-radius:19px; font-size:2rem; }
  .cosmetic-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tournament-create-form { grid-template-columns:1fr 1fr; }
  .tournament-card-grid { grid-template-columns:1fr; }
  .tournament-list article { grid-template-columns:auto 1fr; }
  .tournament-list-actions { grid-column:1/-1; justify-content:flex-end; }
  .champion-grid { grid-template-columns:1fr 1fr; }
  .tournament-status-banner { align-items:flex-start; flex-wrap:wrap; }
  .tournament-status-banner .join-code-box { margin-left:0; width:100%; }
  .participant-grid { grid-template-columns:1fr; }
  .season-hero { padding:25px 20px; }
}
@media (max-width: 480px) {
  .tournament-create-form { grid-template-columns:1fr; }
  .champion-grid { grid-template-columns:1fr; }
  .season-medal { width:100%; }
}
.private-code-panel { display:flex; align-items:center; justify-content:space-between; gap:24px; background:linear-gradient(135deg,#f5f0ff,#fff); }
.private-code-panel p { margin:0; color:var(--muted); }
.private-code-panel form { display:flex; gap:9px; min-width:min(100%,390px); }
.private-code-panel input { flex:1; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.identity-avatar { font-size:1.5rem; }
@media (max-width:720px){.private-code-panel{align-items:stretch;flex-direction:column}.private-code-panel form{min-width:0;width:100%;flex-direction:column}}

/* === MVP 6.6.2: touch drag for patience in fullscreen === */
.game-target-fullscreen .solitaire-board .draggable-card,
.game-target-fullscreen .solitaire-board [data-role="waste"],
.game-target-fullscreen .solitaire-board [data-role="foundation"],
.game-target-fullscreen .solitaire-board [data-role="tableau-card"] {
  touch-action:none !important;
  -webkit-user-select:none !important;
  user-select:none !important;
  -webkit-user-drag:none !important;
}
body.solitaire-pointer-dragging {
  overflow:hidden !important;
  overscroll-behavior:none !important;
  touch-action:none !important;
}
.solitaire-pointer-ghost {
  position:fixed;
  left:0;
  top:0;
  width:clamp(44px, 12vw, 72px);
  height:clamp(64px, 17vw, 102px);
  z-index:2147483647;
  pointer-events:none;
  opacity:.94;
  filter:drop-shadow(0 12px 16px rgba(0,0,0,.35));
  will-change:transform;
}
.solitaire-pointer-ghost-card {
  position:absolute;
  inset:0;
  transform:translateY(calc(var(--ghost-index) * 18px));
}
.solitaire-pointer-ghost .playing-card {
  width:100% !important;
  height:100% !important;
  box-shadow:0 3px 8px rgba(0,0,0,.24) !important;
}
.game-target-fullscreen .solitaire-board .drag-source {
  opacity:.48 !important;
}
.game-target-fullscreen .solitaire-board .drag-target {
  outline:4px solid #ffe26a !important;
  outline-offset:2px !important;
  border-radius:10px;
  background:rgba(255,226,106,.18) !important;
}
