/* =====================================================================
   MARCUS APP v3 — Design System
   Palette joyeuse et reposante pour un enfant de 7 ans
   Type : Playpen Sans (loaded via <link> in index.html)
   ===================================================================== */

:root {
  /* ===== Typography ===== */
  --font-display: 'Playpen Sans', 'Comic Sans MS', 'Trebuchet MS', system-ui, sans-serif;
  --font-mono: 'Courier New', ui-monospace, monospace;

  /* ===== Colors — Neutrals (warm, cozy) ===== */
  --bg: #FFF6E9;
  --bg-tint: #FFFDF7;
  --panel: #FFFFFF;
  --ink: #2F3B5C;
  --muted: #8C8AA3;
  --divider: #F2E8D5;

  /* ===== Colors — Level palette (cool → warm progression) ===== */
  --niv1: #7BD3C5;        /* Découverte — mint */
  --niv1-soft: #E4F6F3;
  --niv1-deep: #2F8C7E;
  --niv2: #F5C46B;        /* Consolidation — honey */
  --niv2-soft: #FCE9C9;
  --niv2-deep: #9F6D00;
  --niv3: #F08977;        /* Maîtrise — coral */
  --niv3-soft: #FBD5CE;
  --niv3-deep: #B84A35;

  /* ===== Colors — Semantic ===== */
  --ok: #6FBE8F;
  --ok-soft: #E1F2E7;
  --ko: #F08977;          /* alias of niv3 */
  --ko-soft: #FBD5CE;
  --warn: var(--niv2);
  --star: #F8C760;

  /* ===== Colors — Operators ===== */
  --plus: #6FBE8F;
  --minus: #6FA1D4;

  /* ===== Shape ===== */
  --radius: 24px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  /* ===== Elevation ===== */
  --shadow: 0 6px 24px rgba(47, 59, 92, 0.08);
  --shadow-lift: 0 12px 36px rgba(47, 59, 92, 0.12);
  --shadow-deep: 0 20px 60px rgba(47, 59, 92, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-display);
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding: 24px 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 920px; margin: 0 auto; }

header { text-align: center; margin-bottom: 16px; }
header h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 700; margin: 0; letter-spacing: -0.5px; }
header p { margin: 0; color: var(--muted); font-size: 15px; }

/* ===== Screens ===== */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel { background: var(--panel); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin-top: 16px; }

/* ===== Connection error ===== */
.conn-error { background: var(--ko-soft); border-left: 6px solid var(--ko); padding: 20px; border-radius: var(--radius-sm); }
.conn-error h3 { margin: 0 0 8px; color: var(--niv3-deep); }
.conn-error code { background: #fff; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.conn-error pre { background: #fff; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }

/* ===== Welcome / Profile selection ===== */
.home-welcome { padding: 36px 28px; }
.welcome-title { text-align: center; margin: 0 0 6px; font-size: clamp(22px, 4vw, 28px); font-weight: 700; }
.welcome-sub { text-align: center; margin: 0 auto 8px; color: var(--muted); max-width: 480px; }

.profiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-top: 24px; }
.profile-card { background: var(--panel); border: 4px solid transparent; border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .15s ease; }
.profile-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.profile-card:active { transform: translateY(-2px); }
.profile-card.child { border-color: var(--niv1); }
.profile-card.child:hover { background: linear-gradient(180deg, var(--panel), var(--niv1-soft)); }
.profile-card.parent { border-color: var(--niv3); }
.profile-card.parent:hover { background: linear-gradient(180deg, var(--panel), var(--niv3-soft)); }
.profile-card .avatar { font-size: 76px; line-height: 1; transition: transform .25s ease; }
.profile-card:hover .avatar { transform: scale(1.06) rotate(-3deg); }
.profile-card .name { font-size: 22px; font-weight: 700; margin-top: 8px; }
.profile-card .role { font-size: 14px; color: var(--muted); margin-top: 4px; }
.profile-card.new { border-style: dashed; border-color: var(--muted); opacity: 0.85; }
.profile-card.new:hover { opacity: 1; background: var(--bg-tint); border-color: var(--niv2); }
.profile-card.new .avatar { color: var(--muted); }
.profile-card.new:hover .avatar { color: var(--niv2-deep); }

/* ===== Forms ===== */
.form { display: grid; gap: 14px; max-width: 420px; margin: 0 auto; }
.form label { font-weight: 600; font-size: 14px; }
.form input, .form select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--divider); font-family: inherit; font-size: 16px; background: var(--bg-tint); transition: border-color .15s, background .15s; color: var(--ink); }
.form input:focus, .form select:focus { outline: none; border-color: var(--niv1); background: white; }
.form input.invalid, .form select.invalid { border-color: var(--ko); background: var(--ko-soft); }
.form .field-error { color: var(--niv3-deep); font-size: 13px; min-height: 18px; margin-top: 2px; font-weight: 600; }

.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-grid .a { font-size: 30px; padding: 10px; text-align: center; border: 2px solid transparent; border-radius: 12px; cursor: pointer; background: var(--bg); transition: transform .1s; }
.avatar-grid .a:hover { transform: scale(1.08); }
.avatar-grid .a.selected { border-color: var(--niv1); background: var(--niv1-soft); }

/* ===== Buttons ===== */
.btn { background: var(--ink); color: white; border: none; padding: 13px 26px; border-radius: var(--radius-pill); font-size: 17px; font-weight: 700; cursor: pointer; font-family: inherit; box-shadow: var(--shadow); transition: transform .15s cubic-bezier(.25,.5,.4,1.1), box-shadow .18s ease, background .15s ease; letter-spacing: -0.2px; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); box-shadow: var(--shadow); }
.btn.primary { background: var(--niv1); color: #11423B; }
.btn.warn { background: var(--niv2); color: #5a3d00; }
.btn.danger { background: var(--niv3); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--bg-tint); transform: none; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; justify-content: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* form hint (helper text under a label) */
.form-hint { margin: -8px 0 8px; font-size: 13px; color: var(--muted); font-weight: 400; }

/* ===== Game header ===== */
.scorebar { display: flex; justify-content: center; gap: 12px; margin: 12px 0 20px; flex-wrap: wrap; }
.badge { background: var(--panel); border-radius: var(--radius-pill); padding: 8px 16px; box-shadow: var(--shadow); font-weight: 700; font-size: 15px; }

/* ===== Levels ===== */
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 24px; }
.level-card { background: var(--panel); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s cubic-bezier(.25,.5,.4,1.1), box-shadow .2s, background .2s; text-align: center; border: 4px solid transparent; position: relative; overflow: hidden; }
.level-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.level-card:active { transform: translateY(-2px) scale(0.99); }
.level-card .emoji { font-size: 56px; line-height: 1; transition: transform .3s cubic-bezier(.25,.5,.4,1.4); display: inline-block; }
.level-card:hover .emoji { transform: scale(1.1) rotate(-4deg); }
.level-card h2 { margin: 8px 0 4px; font-size: 26px; font-weight: 700; }
.level-card .subtitle { color: var(--muted); margin: 0 0 12px; }
.level-card .range { display: inline-block; padding: 6px 14px; border-radius: var(--radius-pill); font-weight: 700; font-size: 14px; }
.level-card.l1 { border-color: var(--niv1); }
.level-card.l1:hover { background: linear-gradient(180deg, var(--panel) 60%, var(--niv1-soft)); }
.level-card.l1 .range { background: var(--niv1-soft); color: var(--niv1-deep); }
.level-card.l2 { border-color: var(--niv2); }
.level-card.l2:hover { background: linear-gradient(180deg, var(--panel) 60%, var(--niv2-soft)); }
.level-card.l2 .range { background: var(--niv2-soft); color: var(--niv2-deep); }
.level-card.l3 { border-color: var(--niv3); }
.level-card.l3:hover { background: linear-gradient(180deg, var(--panel) 60%, var(--niv3-soft)); }
.level-card.l3 .range { background: var(--niv3-soft); color: var(--niv3-deep); }

/* ===== Operation selection ===== */
.ops-select { display: flex; justify-content: center; gap: 16px; margin: 24px 0; flex-wrap: wrap; }
.op-btn { background: var(--panel); border: 3px solid var(--divider); border-radius: var(--radius); padding: 18px 28px; font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); color: var(--ink); font-family: inherit; transition: transform .15s cubic-bezier(.25,.5,.4,1.1), box-shadow .15s, border-color .15s, background .15s; }
.op-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.op-btn:active { transform: translateY(-1px) scale(0.97); }
.op-btn .sign { font-size: 36px; display: block; line-height: 1; margin-bottom: 4px; font-weight: 700; transition: transform .25s cubic-bezier(.25,.5,.4,1.4); }
.op-btn:hover .sign { transform: scale(1.12); }
.op-btn.plus { border-color: var(--plus); }
.op-btn.plus:hover { background: var(--ok-soft); }
.op-btn.plus .sign { color: var(--plus); }
.op-btn.minus { border-color: var(--minus); }
.op-btn.minus:hover { background: #E5EEF7; }
.op-btn.minus .sign { color: var(--minus); }
.op-btn.mixed { border-color: var(--niv2); }
.op-btn.mixed:hover { background: var(--niv2-soft); }
.op-btn.mixed .sign { color: var(--ink); }

/* ===== Game ===== */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.topbar .pill { background: var(--bg); border-radius: var(--radius-pill); padding: 6px 14px; font-size: 14px; font-weight: 700; }

/* Streak pill : grows visually as the child chains correct answers */
.streak-pill { display: none; background: var(--niv2-soft); color: var(--niv2-deep); border: 2px solid var(--niv2); animation: streakPop .4s cubic-bezier(.34,1.4,.64,1) both; }
.streak-pill.visible { display: inline-block; }
@keyframes streakPop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.progress { height: 12px; background: var(--bg); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 18px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--niv1), var(--niv2), var(--niv3)); transition: width .4s ease; width: 0%; }

.question-block { text-align: center; padding: 24px 0; }
.question-text { font-size: clamp(36px, 8vw, 64px); font-weight: 700; letter-spacing: 1px; margin: 0; }
.question-text .op { padding: 0 8px; }
.question-text .op-plus { color: var(--plus); }
.question-text .op-minus { color: var(--minus); }
.question-text input.answer { width: 120px; font-size: inherit; font-family: inherit; text-align: center; border: 3px dashed var(--muted); border-radius: 18px; padding: 4px 10px; background: var(--bg); color: var(--ink); font-weight: 700; }
.question-text input.answer:focus { outline: none; border-color: var(--niv1); background: var(--niv1-soft); }
.question-text input.answer.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); animation: successPulse .55s cubic-bezier(.34,1.4,.64,1) both; }
.question-text input.answer.ko { border-color: var(--ko); background: var(--ko-soft); color: var(--niv3-deep); animation: shake .35s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes successPulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ===== Visuals ===== */
.visual { margin: 24px auto; max-width: 600px; min-height: 120px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; }
.ten-frame-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.ten-frame { display: inline-grid; grid-template-columns: repeat(5, 36px); gap: 4px; padding: 8px; background: var(--bg-tint); border: 3px solid var(--ink); border-radius: 14px; }
.ten-frame .cell { width: 36px; height: 36px; background: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.ten-frame .cell.filled { background: var(--niv1); color: white; }
.ten-frame.l2 .cell.filled { background: var(--niv2); }
.ten-frame.l3 .cell.filled { background: var(--niv3); }

.number-bond { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.nb-top { width: 90px; height: 90px; border-radius: 50%; background: var(--niv1-soft); border: 3px solid var(--niv1); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; }
.nb-lines { width: 200px; height: 50px; position: relative; }
.nb-lines::before, .nb-lines::after { content: ''; position: absolute; top: -4px; height: 64px; width: 4px; background: var(--ink); transform-origin: top; }
.nb-lines::before { left: calc(50% - 2px); transform: rotate(-32deg); }
.nb-lines::after { left: calc(50% - 2px); transform: rotate(32deg); }
.nb-bottom { display: flex; gap: 70px; }
.nb-bottom .nb-part { width: 80px; height: 80px; border-radius: 50%; background: white; border: 3px solid var(--niv1); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; }
.number-bond.l2 .nb-top, .number-bond.l2 .nb-part { border-color: var(--niv2); }
.number-bond.l2 .nb-top { background: var(--niv2-soft); }
.number-bond.l3 .nb-top, .number-bond.l3 .nb-part { border-color: var(--niv3); }
.number-bond.l3 .nb-top { background: var(--niv3-soft); }

.base10 { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; justify-content: center; }
.b10-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.b10-group .label { font-size: 13px; color: var(--muted); font-weight: 700; }
.b10-tens { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; min-height: 100px; align-items: flex-end; }
.b10-ten { width: 18px; height: 100px; background: var(--niv3); border-radius: 4px; }
.b10-units { display: grid; grid-template-columns: repeat(3, 18px); gap: 4px; }
.b10-unit { width: 18px; height: 18px; background: var(--niv3); border-radius: 4px; }
.b10-sign { font-size: 36px; font-weight: 700; padding: 0 4px; align-self: center; }

.posed { display: inline-block; font-family: var(--font-mono); font-size: 44px; line-height: 1.2; font-weight: 700; text-align: right; background: var(--bg); padding: 18px 28px; border-radius: 16px; }
.posed .row { display: block; }
.posed .row.bar { border-top: 4px solid var(--ink); padding-top: 4px; min-width: 140px; }

.feedback { text-align: center; margin-top: 16px; min-height: 32px; font-size: 20px; font-weight: 700; }
.feedback.ok { color: var(--ok); }
.feedback.ko { color: var(--niv3-deep); }

.hint { background: var(--niv2-soft); border-left: 5px solid var(--niv2); padding: 12px 16px; border-radius: 12px; margin-top: 12px; font-size: 15px; display: none; text-align: left; }
.hint.visible { display: block; }
.hint strong { color: var(--niv2-deep); }

.confetti { position: fixed; top: -10px; width: 10px; height: 10px; pointer-events: none; z-index: 999; border-radius: 50%; }

/* "+ ⭐" qui flotte vers le haut quand l'enfant trouve la bonne réponse */
.float-points {
  position: fixed; transform: translate(-50%, 0);
  font-weight: 700; font-size: 20px; color: var(--star);
  text-shadow: 0 2px 6px rgba(0,0,0,0.12);
  pointer-events: none; z-index: 1000;
  animation: floatUp .9s cubic-bezier(.25,.5,.4,1) forwards;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -80px) scale(1); }
}

/* ===== Results ===== */
.results { text-align: center; padding: 24px; }
.results .big-emoji { font-size: 100px; line-height: 1; display: inline-block; animation: emojiEntrance .6s cubic-bezier(.25,.5,.4,1.3) both; }
@keyframes emojiEntrance {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.results h2 { font-size: 32px; margin: 8px 0; font-weight: 700; }
.result-encourage { max-width: 480px; margin: 0 auto 12px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.results .score-large { font-size: 56px; font-weight: 700; color: var(--niv1-deep); margin: 12px 0; }
.results .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 18px 0; }
.results .stat { background: var(--bg); border-radius: var(--radius-sm); padding: 14px; }
.results .stat .v { font-size: 26px; font-weight: 700; }
.results .stat .l { font-size: 13px; color: var(--muted); }

/* ===== Dashboard ===== */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 18px 0; }
.dash-stat { background: var(--panel); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow); }
.dash-stat .v { font-size: 32px; font-weight: 700; color: var(--ink); }
.dash-stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.dash-chart { background: var(--panel); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.dash-chart h3 { margin: 0 0 12px; font-weight: 700; }

.failed-list { background: var(--panel); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow); }
.failed-list .item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.failed-list .item:last-child { border-bottom: none; }
.failed-list .q { font-family: var(--font-mono); font-size: 18px; font-weight: 700; }
.failed-list .meta { color: var(--muted); font-size: 13px; }

/* ===== PIN input ===== */
.pin-input { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.pin-input input { width: 50px; height: 60px; font-size: 30px; text-align: center; border: 2px solid var(--divider); border-radius: 14px; font-family: inherit; font-weight: 700; background: var(--bg-tint); color: var(--ink); }
.pin-input input:focus { outline: none; border-color: var(--niv3); background: white; }

/* ===== Profile management ===== */
.manage-panel { margin-top: 20px; background: var(--panel); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow); }
.manage-panel h3 { margin: 0 0 12px; font-weight: 700; }
.manage-list { display: grid; gap: 10px; }
.manage-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--bg); border-radius: 14px; }
.manage-row .av { font-size: 32px; line-height: 1; }
.manage-row .meta { flex: 1; min-width: 0; }
.manage-row .meta .nm { font-weight: 700; font-size: 17px; }
.manage-row .meta .sub { font-size: 13px; color: var(--muted); }
.manage-row .me-tag { background: var(--niv1-soft); color: var(--niv1-deep); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); }
.icon-btn { background: transparent; border: 2px solid transparent; border-radius: 12px; padding: 8px 12px; font-size: 18px; cursor: pointer; font-family: inherit; color: var(--niv3-deep); transition: background .15s, border-color .15s; }
.icon-btn:hover:not(:disabled) { border-color: var(--ko); background: var(--ko-soft); }
.icon-btn:disabled { color: var(--muted); cursor: not-allowed; opacity: .5; }

/* ===== Modal ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(47, 59, 92, 0.55); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-backdrop.visible { display: flex; animation: fadeIn .2s ease; }
.modal { background: var(--panel); border-radius: var(--radius); padding: 24px; max-width: 460px; width: 100%; box-shadow: var(--shadow-deep); }
.modal h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.modal p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.modal .target { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.modal .target .av { font-size: 36px; }
.modal .target .nm { font-weight: 700; font-size: 18px; }
.modal .target .sub { font-size: 13px; color: var(--muted); }
.modal .impact { background: var(--niv2-soft); border-left: 4px solid var(--niv2); padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.modal .impact strong { color: var(--niv2-deep); }
.modal label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 6px; }
.modal input.confirm-name { width: 100%; padding: 12px; border-radius: 12px; border: 2px solid var(--divider); font-family: inherit; font-size: 16px; background: var(--bg-tint); color: var(--ink); }
.modal input.confirm-name:focus { outline: none; border-color: var(--ko); background: white; }

/* ===== Toast ===== */
.toast-stack { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast { background: var(--ink); color: white; padding: 12px 22px; border-radius: var(--radius-pill); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-deep); animation: toastIn .25s ease; max-width: 90vw; }
.toast.ok { background: var(--ok); color: #19432B; }
.toast.ko { background: var(--ko); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== Accessibility ===== */
:focus-visible { outline: 3px solid var(--niv1); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 4px; }

/* Honor user preference: cut animations to a barely-there hint */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .profile-card:hover, .level-card:hover, .btn:hover:not(:disabled) {
    transform: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
  body { padding: 12px 8px; }
  .panel { padding: 18px; }
}
