/* app.css: page structure */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Chamekunglu: one white canvas and orange masthead on every route. */
:root {
 --site-ink:#292725; --site-muted:#736c66; --site-accent:#ea650d;
 --site-accent-dark:#b84405; --site-accent-soft:#fff0e5;
 --site-paper:#fff; --site-surface:#fff; --site-line:#e9e4df;
 --site-shadow:0 4px 20px rgb(49 33 20 / 4%);
 --bs-primary:#c44b05; --bs-primary-rgb:196,75,5; --bs-link-color:#b84405;
}
* { box-sizing:border-box; }
html,body { margin:0; min-height:100%; background:#fff; }
body { color:var(--site-ink); font-family:'Segoe UI',Arial,sans-serif; font-size:1rem; line-height:1.5; }
a { color:var(--site-accent-dark); text-underline-offset:3px; }
button,input,select,textarea { font:inherit; accent-color:var(--site-accent-dark); }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid #ab4006; outline-offset:4px; }
.site-frame { display:flex; min-height:100vh; flex-direction:column; background:#fff; }
.site-header { position:relative; z-index:20; display:flex; align-items:center; gap:clamp(12px,2.4vw,36px); width:100%; min-height:80px; margin:0; padding:0 clamp(18px,3vw,48px) 0 0; background:linear-gradient(105deg,#ff9d36 0%,#dc690d 38%,#c34604 100%); }
.brand-navigation { display:contents; }
.site-brand { display:flex; align-items:center; gap:20px; align-self:stretch; flex-shrink:0; margin-right:auto; color:#fff; text-decoration:none; font-size:1.2rem; font-weight:800; letter-spacing:-.035em; }
.site-brand:hover { color:#fff; }
.brand-mark { position:relative; display:grid; place-items:center; isolation:isolate; width:96px; min-height:80px; overflow:hidden; flex-shrink:0; }
.brand-mark::before { content:""; position:absolute; z-index:-1; width:124px; height:124px; border-radius:50%; left:-29px; top:-23px; background:linear-gradient(135deg,#ffb14d,#e76a12); }
.brand-mark img { display:block; width:74px; height:auto; transform:translateX(-6px); }
.primary-navigation { display:flex; align-items:center; gap:clamp(8px,1.7vw,26px); }
.primary-navigation a,.site-header .account-button { display:inline-flex; align-items:center; justify-content:center; position:relative; min-height:44px; padding:8px 2px; border:0; border-radius:0; color:white; background:transparent; font-size:1rem; font-weight:750; text-decoration:none; white-space:nowrap; cursor:pointer; line-height:1.4; }
.primary-navigation a:hover,.site-header .account-button:hover { color:#fff; background:transparent; text-decoration:underline; text-underline-offset:7px; }
.primary-navigation a.active::after { content:""; position:absolute; height:3px; left:2px; right:2px; bottom:2px; background:white; border-radius:4px; }
.site-header :is(a,button):focus-visible { outline:2px solid white; outline-offset:3px; }
.account-bar { display:flex; align-items:center; gap:16px; flex-shrink:0; padding:0; margin:0; border:0; background:transparent; }
.account-bar form { margin:0; display:flex; }
.site-main { flex:1; min-width:0; width:100%; background:white; }
.site-main .content,.site-content { width:min(1480px,100%); margin:0 auto; padding:clamp(24px,3vw,48px) clamp(16px,3vw,44px); background:white; }
.site-main h1,.site-main h2,.site-main h3 { color:var(--site-ink); }
.skip-link { position:fixed; top:8px; left:12px; z-index:100; transform:translateY(-160%); padding:12px 18px; border-radius:8px; background:white; color:#a73d00; font-weight:700; }
.skip-link:focus { transform:translateY(0); }
@media(max-width:900px) {
 .site-header { flex-wrap:wrap; gap:0 16px; padding-right:20px; }
 .site-brand { min-height:72px; }
 .brand-mark { min-height:72px; width:82px; }
 .primary-navigation { order:3; width:100%; justify-content:center; gap:clamp(24px,7vw,70px); padding:3px 0 10px 20px; }
 .account-bar { margin-left:auto; }
}
@media(max-width:480px) {
 .site-header { padding-right:12px; column-gap:8px; }
 .site-brand { font-size:1rem; gap:8px; min-height:66px; }
 .brand-mark { width:60px; min-height:66px; }
 .brand-mark::before { width:88px; height:88px; left:-28px; top:-12px; }
 .brand-mark img { width:51px; transform:translateX(-4px); }
 .account-bar { gap:10px; }
 .site-header .account-button { font-size:.875rem; }
 .primary-navigation { gap:24px; padding:0 0 9px 12px; }
 .primary-navigation a { font-size:.9375rem; }
}
/* accounts.css: page structure */
/* Account content uses the same site shell, typography and controls as the dashboard. */
.account-shell{--ink:#293b30;--muted:#647365;--accent:#315d43;--line:#dde3d7;color:var(--ink);max-width:1320px;margin:0 auto;padding:1.5rem;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:none}
.account-shell:has(.access-grid){max-width:640px;margin:0}
.access-grid{display:block}.access-form{padding:.25rem}.access-eyebrow{font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;font-weight:800;color:#557248}
.account-shell h1{font-size:clamp(1.8rem,3vw,2.4rem);font-weight:800;letter-spacing:-.045em;margin:.4rem 0 .8rem}.account-shell h2{font-size:1.4rem;font-weight:750}.account-shell h3{font-size:1.1rem;font-weight:700}
.access-intro{color:var(--muted);font-size:.9rem;line-height:1.7;margin-bottom:1.5rem}.access-field{margin-bottom:1.2rem}.access-field label,.account-shell .form-label{display:block;font-size:.8rem;font-weight:750;color:#4d5d50;margin-bottom:.45rem}.access-field input,.account-shell .form-control{width:100%;padding:.7rem .8rem;border:1px solid #cbd5c9;border-radius:8px;background:#fbfcf9;color:var(--ink);font-size:.9rem;min-height:44px}.access-field small{display:block;color:var(--muted);font-size:.75rem;line-height:1.6;margin-top:.45rem}.text-danger{font-size:.8rem}.access-field .text-danger{display:block;margin-top:.3rem}
.access-options{display:flex;justify-content:space-between;flex-wrap:wrap;gap:1rem;font-size:.8rem;margin:.5rem 0 1.5rem}.access-options label{display:flex;align-items:center;gap:.5rem}.account-shell a{color:var(--accent);text-underline-offset:3px}.access-submit,.account-shell .btn-primary{background:var(--accent);color:white;border:1px solid var(--accent);border-radius:8px;min-height:44px;padding:.7rem 1rem;font-size:.9rem;font-weight:700}.access-submit{width:100%;display:flex;justify-content:space-between}.access-submit:hover,.account-shell .btn-primary:hover{background:#244a33}.account-shell :is(input,button,a):focus-visible{outline:3px solid #b77527;outline-offset:3px}.access-footer{border-top:1px solid var(--line);padding-top:1.2rem;margin-top:1.5rem;font-size:.85rem}.access-footer p{margin-bottom:.7rem}.access-secondary{font-size:.8rem}.access-notice{background:#edf3e4;border:1px solid #dce4d0;border-radius:10px;padding:1rem;line-height:1.7;margin:1rem 0;font-size:.9rem}.account-shell .nav-pills .nav-link.active{background:#315d43;color:#fff}.account-shell .nav-pills .nav-link{border-radius:8px}.account-shell .row{row-gap:1rem}.account-shell .btn-danger{border-radius:8px}
.manage-heading{border-bottom:1px solid var(--line);padding-bottom:1.2rem;margin-bottom:1.5rem}.manage-heading p{color:var(--muted);font-size:.9rem;margin-bottom:0}.manage-grid{display:grid;grid-template-columns:200px minmax(0,1fr);gap:2rem}.manage-nav .nav{gap:.4rem}.manage-nav .nav-link{padding:.8rem 1rem;font-size:.85rem;font-weight:650}.manage-panel{min-width:0}.manage-panel>.row{margin-top:1rem}.manage-panel .col-md-6{width:100%;max-width:600px}.manage-panel h3{margin-top:0}.manage-panel .form-floating{margin-bottom:1rem}.manage-panel .form-floating>.form-control{padding-top:1.625rem;padding-bottom:.625rem}.manage-panel .btn{min-height:44px}.manage-panel .form-floating>label{color:var(--muted)}
@media(max-width:760px){.manage-grid{grid-template-columns:1fr;gap:1.5rem}.manage-nav .nav{flex-direction:row!important;flex-wrap:wrap}.manage-nav{border-bottom:1px solid var(--line);padding-bottom:1rem}}
@media(max-width:640px){.account-shell{padding:1.1rem}.account-shell:has(.access-grid){max-width:none}.account-shell h1{font-size:1.8rem}}
.profile-form{max-width:600px;margin-top:1rem}

/* Daily game and leaderboard: shared cream surfaces, orange actions. */
.site-main .rank-site { --ink:var(--site-ink); --muted:var(--site-muted); color:var(--site-ink); background:transparent; min-height:0; font-family:inherit; }
.rank-main { max-width:none; margin:0; padding:0; }
.rank-intro,.page-hero { position:relative; isolation:isolate; overflow:hidden; padding:32px; margin-bottom:24px; border-radius:18px; background:linear-gradient(115deg,#ff780b,#ffad40); color:white; }
.site-main :is(.rank-intro,.page-hero) h1 { color:white; font-size:clamp(2rem,4vw,3.4rem); font-weight:850; letter-spacing:-.045em; margin:12px 0; max-width:75%; line-height:1.08; }
.rank-intro p,.page-hero p { max-width:68%; font-size:1rem; line-height:1.5; margin:0 0 20px; }
.page-eyebrow { display:inline-block; padding:6px 12px; border-radius:30px; background:#fff2d9; color:#713408; font-size:.76rem; font-weight:750; }
.hero-mascot { position:absolute; z-index:-1; width:310px; height:310px; border-radius:50%; background:linear-gradient(135deg,#ffb340,#ff8c12); right:-35px; top:-55px; transform:rotate(9deg); }
.hero-mascot img { width:82%; height:auto; position:absolute; left:9%; top:30%; }
.site-button,.rank-submit { display:inline-flex; align-items:center; justify-content:center; gap:12px; padding:12px 22px; min-height:46px; border:1px solid #ec6507; border-radius:12px; color:white; background:linear-gradient(#ff8218,#ef5d00); font:700 .9rem/1.4 inherit; font-weight:700; text-decoration:none; box-shadow:0 3px 7px #9b490b18; }
.site-button:hover,.rank-submit:hover:not(:disabled) { color:white; filter:brightness(.96); }
.site-button--light { background:var(--site-paper); color:#4e2913; border-color:#fff6e9; }
.site-button--light:hover { color:#4e2913; }
.rank-submit:disabled { opacity:.5; cursor:not-allowed; }
.site-main .rank-site .rank-columns { display:block; }
.site-main .rank-site .rank-board { background:var(--site-surface); border:1px solid var(--site-line); border-radius:18px; padding:24px; box-shadow:var(--site-shadow); }
.rank-question-options { display:grid; grid-template-columns:minmax(240px,.85fr) minmax(0,1.5fr); gap:28px; margin-bottom:22px; align-items:center; }
.rank-question h2 { font-size:clamp(1.4rem,2.2vw,2rem); font-weight:800; letter-spacing:-.035em; line-height:1.15; margin:0 0 10px; }
.rank-question p,.rank-small,.score-explanation,.scores-footer { color:var(--site-muted); font-size:.85rem; line-height:1.55; }
.rank-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(105px,1fr)); gap:8px; }
.rank-option { border:1px solid var(--site-line); border-radius:9px; min-height:44px; padding:8px 10px; color:var(--site-ink); background:var(--site-paper); font-size:.85rem; font-weight:650; overflow-wrap:anywhere; }
.rank-option:hover:not(:disabled) { background:var(--site-accent-soft); border-color:var(--site-accent); }
.rank-option-selected { opacity:.45; }
.rank-row-heading { font-size:.85rem; font-weight:750; margin:0 0 12px; }
.rank-playhead { display:flex; justify-content:space-between; gap:10px; font-size:.75rem; font-weight:700; color:var(--site-muted); margin:20px 0 12px; }
.rank-score-strip { display:flex; flex-wrap:wrap; gap:12px 24px; align-items:center; justify-content:space-between; padding:14px 18px; background:var(--site-accent-soft); border-radius:12px; }
.rank-score-strip strong { font-size:1.5rem; }
.rank-score-strip strong span,.rank-score-strip>span { font-size:.8rem; }
.score-explanation { margin-top:10px; }
.score-explanation p { margin-top:8px; }
.rank-attempt-columns { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:16px; align-items:start; }
.rank-order-panel,.rank-attempt-column { min-width:0; }
.rank-attempt-column { padding:14px; border:1px solid var(--site-line); background:var(--site-paper); border-radius:12px; }
.rank-selection,.rank-feedback-row { display:grid; gap:7px; }
.rank-slot,.rank-feedback-slot { display:flex; align-items:center; gap:7px; min-height:46px; padding:5px 9px; border:1px solid var(--site-line); border-radius:10px; background:var(--site-paper); box-shadow:0 2px 3px #4a2b0710; }
.rank-slot-empty { border-style:dashed; box-shadow:none; color:var(--site-muted); font-size:.85rem; }
.site-main .rank-site .rank-position,.rank-badge { display:inline-grid; place-items:center; width:25px; height:25px; flex:0 0 25px; border-radius:50%; color:#693c21; background:#f5e6d6; font-size:.8rem; font-weight:750; }
.rank-slot-item { flex:1; min-width:0; background:none; border:0; text-align:left; color:var(--site-ink); font-weight:650; font-size:.86rem; padding:5px 0; }
.rank-slot-shift { border:0; background:#ffead5; border-radius:5px; color:#9b4004; min-width:26px; height:32px; }
.rank-slot-shift:disabled { opacity:.3; }
.rank-slot-lock { font-size:.7rem; }
.rank-slot-locked,.rank-feedback-slot.correct { background:#e8f1dc; border-color:#d6e7c4; }
.rank-feedback-slot.incorrect { background:#fff0e7; border-color:#f2d7c4; }
.rank-feedback-slot strong { flex:1; font-size:.85rem; overflow-wrap:anywhere; }
.rank-feedback-arrow { font-weight:800; color:#a04c15; }
.correct .rank-feedback-arrow { color:#2e741c; }
.rank-small { margin:12px 0; }
.rank-message { font-size:.85rem; color:#8f4008; margin:12px 0; }
.rank-order-panel>.rank-submit,.rank-result>.rank-submit { width:100%; }
.rank-result { margin-top:24px; padding:24px; border:1px solid var(--site-line); border-radius:14px; background:var(--site-paper); }
.result-score { font-size:2.4rem; font-weight:800; color:#2e651e; }
.result-score span { font-size:1rem; }
.rank-result-icon { display:none; }
.rank-result h2 { font-size:1.7rem; font-weight:800; }
.rank-result ol { padding-left:24px; }
.rank-result li { padding:9px 4px; border-bottom:1px solid var(--site-line); }
.rank-result li span { float:right; color:var(--site-muted); margin-left:14px; }
.rank-source { display:inline-block; margin:10px 0 20px; color:var(--site-accent-dark); }
.rank-result textarea { display:block; width:100%; padding:12px; }
.scores-summary { display:flex; flex-wrap:wrap; gap:16px 32px; padding:18px; margin-bottom:22px; border:1px solid var(--site-line); border-radius:12px; background:var(--site-surface); color:var(--site-muted); font-size:.85rem; }
.scores-summary strong { color:var(--site-ink); font-size:1.2rem; }
.scores-table-wrap { overflow-x:auto; border:1px solid var(--site-line); border-radius:14px; background:var(--site-surface); }
.scores-table { width:100%; min-width:560px; border-collapse:collapse; }
.scores-table :is(th,td) { padding:16px 20px; border-bottom:1px solid var(--site-line); }
.scores-table thead { background:var(--site-accent-soft); font-size:.8rem; }
.scores-table caption { padding:14px 20px; color:var(--site-muted); font-size:.8rem; }
.scores-points { font-size:1.25rem; font-weight:800; }
.scores-you { background:#fff2df; }
.scores-you small { padding:3px 7px; border-radius:12px; color:#934209; background:#ffdfb6; }
.status-pill { display:inline-block; padding:4px 10px; border-radius:20px; background:#f5e6d6; color:#755037; font-size:.78rem; }
.status-pill--success { background:#e5f0d9; color:#356c23; }
.scores-footer { margin-top:24px; }
.site-empty { padding:40px 24px; text-align:center; border:1px dashed var(--site-line); border-radius:14px; }
.site-alert { padding:14px 18px; margin:15px 0; border:1px solid #efbc98; border-radius:10px; background:#fff0df; color:#8a3500; }
.profile-form { max-width:620px; }
.profile-form small { display:block; color:var(--site-muted); line-height:1.5; }
/* Compact game counters share the options heading instead of a separate strip. */
.rank-options-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; margin-bottom:12px; }
.rank-options-heading .rank-row-heading { margin:0; }
.rank-counters { display:flex; flex-wrap:wrap; gap:6px 14px; color:var(--site-muted); font-size:.78rem; }
.rank-counters strong { color:var(--site-ink); }
/* Slightly denser choices and selected ranking, retaining readable type. */
.rank-option { min-height:36px; padding:5px 10px; }

.rank-slot { min-height:38px; padding:3px 9px; }
.rank-slot-item { padding:2px 0; }
.rank-slot-shift { height:28px; }

/* Read down the first half, then down the second half. DOM order stays 1..N. */
.rank-list-split { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(var(--rank-rows),auto); grid-auto-flow:column; column-gap:14px; }
.rank-attempt-columns-split { grid-template-columns:repeat(auto-fit,minmax(min(100%,480px),1fr)); }
.rank-list-split .rank-slot { min-width:0; }
.rank-list-split .rank-slot-item { overflow-wrap:anywhere; }
@media(max-width:480px) {
 .rank-list-split { column-gap:6px; }
 .rank-list-split .rank-slot { flex-wrap:wrap; gap:4px; padding:5px; }
 .rank-list-split .rank-slot-item { flex-basis:calc(100% - 38px); }
 .rank-list-split .rank-slot-shift:first-of-type { margin-left:auto; }
}

.rank-question .rank-submit-question {
    width:min(100%, 220px);
    min-height:32px;
    justify-content:center;
    gap:8px;
    margin-top:10px;
    padding:5px 12px;
    border-radius:8px;
    font-size:.75rem;
}
.rank-question .rank-submit-question>span { font-size:1rem; }
.rank-order-panel { padding:14px; }
.rank-order-panel>.rank-row-heading { margin-top:0; }
.rank-feedback-pending { background:var(--site-paper); border-color:var(--site-line); color:var(--site-ink); }
.rank-feedback-revealing { animation-duration:180ms; animation-fill-mode:both; animation-timing-function:ease-out; }
.rank-feedback-revealing.correct { animation-name:rank-feedback-reveal-correct; }
.rank-feedback-revealing.incorrect { animation-name:rank-feedback-reveal-incorrect; }
@keyframes rank-feedback-reveal-correct {
    0% { opacity:.65; transform:scale(.94); background:var(--site-paper); border-color:var(--site-line); }
    100% { opacity:1; transform:scale(1); background:#e8f1dc; border-color:#d6e7c4; }
}
@keyframes rank-feedback-reveal-incorrect {
    0% { opacity:.65; transform:scale(.94); background:var(--site-paper); border-color:var(--site-line); }
    100% { opacity:1; transform:scale(1); background:#fff0e7; border-color:#f2d7c4; }
}

@media(prefers-reduced-motion:reduce) {
    .rank-feedback-revealing { animation-duration:80ms; }
}

/* Shared surfaces and controls: white cards, restrained orange accents. */
.site-main .account-shell { --ink:var(--site-ink); --muted:var(--site-muted); --accent:var(--site-accent-dark); --line:var(--site-line); background:white; border-color:var(--site-line); border-radius:16px; box-shadow:var(--site-shadow); padding:clamp(22px,4vw,40px); }
.site-main .account-shell:has(.access-grid) { max-width:560px; margin:12px auto; }
.account-shell .form-control,.access-field input,.account-shell .form-select { border:1px solid #d7d0c9; background:#fff; color:var(--site-ink); font-size:1rem; }
.access-field label,.account-shell .form-label,.access-options,.access-footer,.manage-nav .nav-link { font-size:.9375rem; }
.access-field small,.access-secondary,.text-danger { font-size:.875rem; }
.account-shell :is(.access-submit,.btn-primary),.site-button,.rank-submit { background:#c34b06; border-color:#c34b06; color:white; min-height:44px; font-size:.9375rem; }
.account-shell :is(.access-submit,.btn-primary):hover,.site-button:hover,.rank-submit:hover:not(:disabled) { background:#a83e02; border-color:#a83e02; color:#fff; }
.account-shell .nav-pills .nav-link.active { background:#c34b06; }
.account-shell .nav-pills .nav-link:not(.active) { color:var(--site-accent-dark); }
.access-field label,.access-eyebrow { color:var(--site-ink); }
.access-notice { background:var(--site-accent-soft); border-color:#f6d5bb; }
.site-main .rank-site { --green:var(--site-accent-dark); }
.site-main .rank-site .rank-board { padding:clamp(16px,2.2vw,30px); border-color:var(--site-line); box-shadow:none; }
.rank-question h2 { font-size:clamp(1.45rem,2.2vw,2rem); line-height:1.25; }
.rank-question p,.rank-counters,.rank-row-heading,.rank-message,.rank-small { font-size:.875rem; }
.rank-option { min-height:44px; background:#fff; font-size:.9375rem; border-color:#e5dbd2; }
.rank-option:hover:not(:disabled) { background:#fff2e8; }
.rank-option-selected { opacity:.5; }
.rank-slot,.rank-feedback-slot { min-height:44px; box-shadow:none; }
.rank-slot-item,.rank-feedback-slot strong { font-size:.9375rem; }
.rank-slot-shift { min-width:30px; min-height:32px; }
.rank-attempt-column { background:#fff; }
.rank-question .rank-submit-question { min-height:44px; padding:10px 18px; font-size:.9375rem; width:auto; margin-top:18px; }
.rank-submit>span,.access-submit>span { display:none; }
.rank-source { font-size:.875rem; }
.scores-table thead { background:#fff2e8; font-size:.875rem; }
.scores-page h1 { font-size:clamp(1.8rem,3vw,2.4rem); font-weight:800; letter-spacing:-.035em; }
.page-description { color:var(--site-muted); margin:8px 0 28px; }
.site-empty { border-style:solid; background:white; padding:clamp(24px,5vw,64px); }
.site-empty h2 { font-weight:750; }
.site-main .color-editor { background:#fff; border-color:var(--site-line); box-shadow:var(--site-shadow); }
.site-main .color-editor .controls { background:#fff; box-shadow:none; }
.site-main .character-canvas { box-shadow:none; }
.site-main .color-editor :is(.preset-title,.color-picker-row,.slider-row) { font-size:.9375rem; }
@media(max-width:760px) { .rank-question-options { grid-template-columns:1fr; gap:24px; } }
@media(max-width:480px) { .rank-attempt-columns { grid-template-columns:1fr; } .rank-result { padding:16px; } .rank-list-split { grid-template-columns:1fr; grid-template-rows:none; grid-auto-flow:row; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; } }

/* Twenty choices remain readable, including long country names. */
.rank-options { grid-template-columns:repeat(5,minmax(0,1fr)); }
@media(max-width:1100px) { .rank-options { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:760px) { .rank-options { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:480px) { .rank-options { grid-template-columns:repeat(2,minmax(0,1fr)); } }


.data-credits { padding:16px 24px; text-align:center; font-size:.875rem; color:var(--site-muted); }

/* Rank It: insertion game */
.placement-game { max-width:760px; margin:0 auto; padding:28px 16px 48px; }
.placement-game h1 { font-size:clamp(1.4rem,4vw,2rem); margin:8px 0; }
.placement-eyebrow { color:#a94708; font-size:.8rem; font-weight:800; letter-spacing:.08em; }
.placement-stats { display:flex; flex-wrap:wrap; gap:12px 24px; padding:16px 0; border-bottom:1px solid #f2e3d7; }
.placement-stats strong { font-size:1.35rem; color:#ad4508; }
.placement-current { position:sticky; top:0; z-index:2; background:#fff5e9; border:1px solid #ffd2a1; border-radius:16px; padding:16px 20px; margin:20px 0 0; box-shadow:0 4px 14px #7138000d; }
.placement-current p { font-size:.85rem; margin:0 0 6px; color:#814619; }
.placement-current h2 { font-size:1.3rem; margin:0 0 6px; overflow-wrap:anywhere; }
.placement-current span { font-size:.85rem; font-weight:700; }
.placement-message { min-height:1.6em; margin:16px 0; line-height:1.5; }
.placement-list { display:flex; flex-direction:column; gap:8px; }
.placement-slot { width:100%; min-height:44px; border:1px dashed #ed9c55; border-radius:10px; background:#fffaf5; color:#914008; font:inherit; font-size:.9rem; cursor:pointer; }
.placement-slot:hover:not(:disabled) { background:#ffe7ce; border-style:solid; }
.placement-slot:disabled { opacity:.5; cursor:default; }
.placement-slot:focus-visible { outline:3px solid #a94406; outline-offset:2px; }
.placement-item { display:flex; align-items:center; gap:12px; border:1px solid #eadfd7; padding:16px; border-radius:12px; background:#fff; overflow-wrap:anywhere; }
.placement-item strong { flex:1; min-width:0; }
.placement-number { color:#a26b45; min-width:24px; font-size:.8rem; }
.placement-value { font-size:.85rem; color:#765235; text-align:right; }
.placement-result { border:1px solid #f5c99e; border-radius:16px; padding:20px; margin:0 0 24px; background:#fff8f1; }
.placement-result h2 { font-size:1.3rem; }
.placement-result .rank-source { display:block; margin-bottom:16px; }
.placement-result textarea { display:block; width:100%; margin-top:8px; }
@media(max-width:480px) { .placement-game {padding:20px 8px 32px;} .placement-item {padding:12px;gap:8px;flex-wrap:wrap;} .placement-value {width:100%;text-align:left;padding-left:32px;} }

/* Compact placement board and short move feedback. */
.placement-game { max-width:1060px; padding:12px 12px 28px; }
.placement-game h1 {font-size:clamp(1.15rem,3vw,1.55rem); margin:4px 0;}
.placement-game .rank-question > p {margin:4px 0;}
.placement-eyebrow {font-size:.72rem;}
.placement-stats {padding:8px 0;gap:6px 20px;font-size:.88rem;}
.placement-stats strong {font-size:1.15rem;}
.placement-workspace {display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);align-items:start;gap:24px;margin-top:12px;}
.placement-controls {position:sticky;top:12px;min-width:0;}
.placement-current {position:static;margin:0;padding:12px 14px;border-radius:12px;}
.placement-current p {font-size:.76rem;margin:0 0 4px;}
.placement-current h2 {font-size:1.12rem;margin:0 0 4px;}
.placement-current span {font-size:.8rem;}
.placement-message {margin:8px 0;min-height:1.4em;font-size:.86rem;line-height:1.4;border-radius:10px;}
.placement-message:empty {display:none;}
.placement-list {gap:2px;}
.placement-item {padding:8px 12px;border-radius:8px;min-height:40px;font-size:.9rem;}
.placement-slot {font-size:.78rem;border-radius:7px;min-height:44px;border-color:transparent;background:transparent;color:#a14c13;}
.placement-slot span {display:inline-block;margin-right:4px;}
.placement-slot:hover:not(:disabled),.placement-slot:focus-visible {border-color:#ed9c55;background:#fff2e4;}
.placement-feedback-success,.placement-feedback-retry,.placement-feedback-lost {display:flex;align-items:center;gap:8px;padding:10px;animation:placement-feedback-in .25s ease-out;}
.placement-feedback-success {background:#e9f7ed;color:#176736;}
.placement-feedback-retry {background:#fff0d5;color:#834809;}
.placement-feedback-lost {background:#ffeded;color:#a12525;}
.placement-feedback-icon {flex:none;font-size:1rem;font-weight:800;}
.placement-item-added {animation:placement-insert .65s ease-out;}
.placement-slot-wrong:disabled {opacity:1;color:#a12525;background:#ffeded;border-color:#e79c9c;animation:placement-shake .4s ease-in-out;}
.placement-score-pop [data-testid="score"] {display:inline-block;animation:placement-pop .5s ease-out;color:#176736;}
.placement-life-pulse [data-testid="lives"] {display:inline-block;animation:placement-shake .4s ease-in-out;color:#b52626;}
@keyframes placement-insert {0% {transform:scale(.97);background:#bce9c9;box-shadow:0 0 0 3px #9edcb5;} 100% {transform:scale(1);background:#fff;box-shadow:0 0 0 0 transparent;} }
@keyframes placement-shake {0%,100% {transform:translateX(0);} 25% {transform:translateX(-4px);} 50% {transform:translateX(4px);} 75% {transform:translateX(-2px);} }
@keyframes placement-pop {0%,100% {transform:scale(1);} 40% {transform:scale(1.3);} }
@keyframes placement-feedback-in {from {opacity:.3;transform:translateY(4px);} to {opacity:1;transform:translateY(0);} }
@media(max-width:700px) {
 .placement-game {padding:8px 4px 24px;}
 .placement-workspace {grid-template-columns:1fr;gap:4px;margin-top:8px;}
 .placement-controls {top:0;z-index:2;background:#fff;padding-bottom:2px;}
 .placement-current {padding:8px 10px;}
 .placement-current h2 {font-size:1rem;}
 .placement-stats {gap:4px 12px;font-size:.78rem;}
 .placement-stats strong {font-size:1rem;}
 .placement-message {margin:4px 0;font-size:.8rem;}
 .placement-item {padding:6px 10px;}
}
@media(prefers-reduced-motion:reduce) {
 .placement-item-added,.placement-slot-wrong,.placement-feedback-success,.placement-feedback-retry,.placement-feedback-lost,
 .placement-score-pop [data-testid="score"],.placement-life-pulse [data-testid="lives"] {animation:none!important;}
}

/* Dense desktop order: keep the entire game summary beside the list. */
@media (min-width:701px) {
 .site-main .content:has(.placement-game) {padding-top:12px;}
 .placement-game {display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);grid-template-rows:auto auto 1fr;grid-template-areas:"question list" "stats list" "controls list";column-gap:24px;row-gap:8px;align-items:start;max-width:1200px;padding-top:4px;}
 .placement-game > .rank-question {grid-area:question;}
 .placement-game h1 {font-size:1.2rem;line-height:1.3;}
 .placement-game > .placement-stats {grid-area:stats;gap:6px 12px;}
 .placement-workspace {display:contents;}
 .placement-controls {grid-area:controls;}
 .placement-list {grid-area:list;gap:0;min-width:0;}
 .placement-item {min-height:30px;padding:3px 10px;font-size:.875rem;line-height:1.4;border-radius:5px;}
}
/* Fine pointers get thin insertion strips; touch devices retain 44px targets. */
@media (min-width:701px) and (pointer:fine) {
 .placement-slot {min-height:18px;height:18px;padding:0 8px;line-height:16px;font-size:.65rem;border-radius:3px;position:relative;}
 .placement-slot::before,.placement-slot::after {content:"";position:absolute;top:50%;width:calc(50% - 44px);height:1px;background:#f4dec9;}
 .placement-slot::before {left:0;}
 .placement-slot::after {right:0;}
 .placement-slot:hover:not(:disabled),.placement-slot:focus-visible {background:#ffe4c7;border-color:#e69343;}
}

/* Reveal years for placed movies; missed items appear only in the final review. */
.placement-year {flex:none;font-variant-numeric:tabular-nums;color:#765235;font-size:.85rem;margin-left:auto;}
.placement-item-missed {background:#fff0f0;border-color:#e8b0b0;color:#a12525;}
.placement-item-missed .placement-value,.placement-item-missed .placement-number {color:#a12525;}
.placement-missed-label {flex:none;font-size:.7rem;font-weight:700;border:1px solid #e8b0b0;border-radius:4px;padding:1px 5px;}
