/* ORDR — dark, minimal, mobile-first */
:root {
  --bg: #0e1118;
  --bg2: #151a26;
  --panel: #1a2030;
  --tile: #232b3f;
  --tile-hover: #2b3550;
  --green: #34a853;
  --green-dim: #1d3a28;
  --amber: #d9a521;
  --amber-dim: #3a3117;
  --slate: #3a4358;
  --text: #e8ebf4;
  --muted: #8b93a8;
  --accent: #5b8cff;
  --danger: #e35b5b;
  --radius: 14px;
  --maxw: 520px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #1b2235 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.45;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
main { width: 100%; max-width: var(--maxw); padding: 20px 16px 48px; flex: 1; }

/* ── header ── */
header {
  width: 100%; max-width: var(--maxw);
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 6px;
}
.logo { font-weight: 800; letter-spacing: 0.14em; font-size: 22px; user-select: none; }
.logo .arrow { color: var(--accent); }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel); color: var(--text); }

/* ── screens ── */
.screen { display: none; animation: fadein .25s ease; }
.screen.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── home ── */
.hero { text-align: center; margin: 14px 0 18px; }
.hero .tagline { color: var(--muted); font-size: 15px; margin-top: 6px; }
.hero .puzzle-no { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.hero h1 { font-size: 26px; font-weight: 800; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  background: var(--panel); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--muted);
}
.streak-pill b { color: var(--text); }

.mode-grid { display: flex; flex-direction: column; gap: 12px; }
.mode-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--panel); border: 1px solid #232a3d; border-radius: var(--radius);
  padding: 16px 18px; transition: transform .12s, border-color .15s, background .15s;
}
.mode-card:hover { border-color: var(--accent); background: #1d2437; transform: translateY(-1px); }
.mode-card .emoji { font-size: 28px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--bg2); border-radius: 12px; flex-shrink: 0; }
.mode-card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mode-card .name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-card .desc { color: var(--muted); font-size: 13.5px; margin-top: 0; }
.mode-card .go { color: #aab3c7; font-size: 20px; }
.mode-card .badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px;
  background: var(--bg2); color: var(--accent); text-transform: uppercase;
}
.mode-card .badge.done { background: var(--green-dim); color: #6fd08d; }
.mode-card .streak-note { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.home-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.archive-bar {
  display: flex; align-items: center; gap: 10px; margin-top: 4px;
  background: var(--panel); border: 1px solid #232a3d; border-radius: var(--radius);
  padding: 10px 14px;
}
.archive-bar .ab-label { font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.archive-bar input[type="date"] {
  flex: 1; background: var(--bg2); border: 1px solid #2a3346; border-radius: 9px;
  color: var(--text); padding: 8px 10px; font: inherit; color-scheme: dark;
}
.home-foot .countdown { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── play scene ── */
.play-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.play-head .back { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.play-head .back:hover { color: var(--text); }
.dim-chip {
  background: var(--panel); border: 1px solid #232a3d; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.question-box { margin: 6px 0 14px; }
.question-box h2 { font-size: 19px; font-weight: 750; line-height: 1.35; }
.question-box .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.qmeta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.qmeta .attempts b { color: var(--text); }
.diff { letter-spacing: 2px; color: var(--amber); }
.tier-chip {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em;
  padding: 2px 9px; border-radius: 999px; border: 1px solid; vertical-align: middle;
}
.tier-chip.t1 { color: #6fd08d; border-color: #34a853; background: rgba(52, 168, 83, 0.12); }
.tier-chip.t2 { color: var(--amber); border-color: var(--amber); background: rgba(217, 165, 33, 0.12); }
.tier-chip.t3 { color: #e0863d; border-color: #e0863d; background: rgba(224, 134, 61, 0.12); }
.tier-chip.t4 { color: #ef8a8a; border-color: #e35b5b; background: rgba(227, 91, 91, 0.13); }
.tier-chip.t5 { color: #c99aec; border-color: #b06adb; background: rgba(176, 106, 219, 0.14); }
.tier-hint { font-size: 11px; color: var(--muted); }

/* tiles */
.tile-list { display: flex; flex-direction: column; gap: 9px; margin: 8px 0 18px; }
.tile {
  position: relative; display: flex; align-items: center; gap: 12px;
  background: var(--tile); border-radius: var(--radius); padding: 14px 14px;
  border: 2px solid transparent; user-select: none; touch-action: none;
  transition: background .15s, border-color .15s, box-shadow .15s, opacity .15s;
  min-height: 58px;
}
.tile:not(.locked):hover { background: var(--tile-hover); }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18); }
.tile.dragging { opacity: 0.85; transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,0.45); z-index: 5; }
.tile.locked { background: var(--green-dim); cursor: default; }
.tile.locked .rank { background: var(--green); color: #08130b; }
.tile .rank {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: #323c58; color: var(--text);
}
.tile .grip {
  color: #556179; font-size: 15px; letter-spacing: 1px; flex-shrink: 0;
  cursor: grab; user-select: none; padding: 4px 2px;
}
.tile.dragging .grip { cursor: grabbing; }
.tile.locked .grip { display: none; }
@media (hover: hover) { .tile:hover .grip { color: #8b93a8; } }
.tile .tname { flex: 1; font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.tile .tname .nm { overflow-wrap: anywhere; }
.tile .tval { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.tile .updown { display: flex; flex-direction: column; gap: 3px; opacity: 0.55; transition: opacity .12s; flex-shrink: 0; }
.tile:hover .updown, .tile:focus-within .updown, .tile.selected .updown { opacity: 1; }
@media (hover: none) { .tile .updown { opacity: 1; } }
.updown button {
  width: 32px; height: 26px; border-radius: 7px; background: #323c58;
  display: grid; place-items: center; font-size: 12px; color: var(--text);
}
.updown button:disabled { opacity: 0.25; }
.tile.feedback-green { background: var(--green-dim); border-color: var(--green); }
.tile.feedback-green .rank { background: var(--green); color: #08130b; }
.tile.feedback-amber { background: var(--amber-dim); border-color: var(--amber); }
.tile.feedback-amber .rank { background: var(--amber); color: #1c1607; }
.tile.feedback-slate { background: #171223; border-color: #a86b6b; }
.tile.feedback-slate .rank { background: #7c5560; }
.tile.feedback-green .tval, .tile.feedback-amber .tval, .tile.feedback-slate .tval { color: #c9d0e2; }
.tile.feedback-green, .tile.feedback-amber, .tile.feedback-slate { animation: tileflip .5s ease backwards; }
@keyframes tileflip {
  0% { transform: rotateX(-88deg); opacity: 0.3; }
  62% { transform: rotateX(9deg); opacity: 1; }
  100% { transform: none; }
}
.tile:not(.locked) { cursor: grab; }
.tile.locked { cursor: default; }
.tile.ghost { opacity: 0.28; border-style: dashed; }
.drag-clone {
  position: fixed; z-index: 70; pointer-events: none; margin: 0;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  border-color: var(--accent); background: var(--tile-hover);
  cursor: grabbing;
}
.drag-clone .updown { display: none; }
.tile-list { perspective: 900px; position: relative; }
.insert-line {
  position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 8px rgba(91, 140, 255, 0.6);
  pointer-events: none;
}
.tile.dragging .updown { opacity: 1; }
.tile.settling { animation: settleDrop .28s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes settleDrop {
  0% { transform: scale(1.045); box-shadow: 0 18px 44px rgba(0,0,0,.6); }
  55% { transform: scale(0.985) translateY(3px); }
  100% { transform: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-placeholder, .hp-fill, .surv-feedback { animation: none !important; transition: none !important; }
}
.tile-placeholder {
  border: 2px dashed #3d4a6b; border-radius: var(--radius);
  background: rgba(91, 140, 255, 0.07);
  animation: phPulse 1.2s ease-in-out infinite;
}
@keyframes phPulse {
  0%, 100% { border-color: #3d4a6b; background: rgba(91, 140, 255, 0.06); }
  50% { border-color: #5b8cff; background: rgba(91, 140, 255, 0.13); }
}
.tile .locknote { font-size: 14px; flex-shrink: 0; margin-left: auto; font-weight: 600; }
.tile.locked .updown { display: none; }

.play-actions { display: flex; gap: 10px; }
.btn {
  flex: 1; border-radius: 12px; padding: 14px 16px; font-weight: 750; font-size: 15.5px;
  background: var(--cta, #3e6ee0); color: #fff; transition: filter .12s, transform .05s;
  text-align: center;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.99); }
.btn.secondary { background: var(--panel); color: var(--muted); border: 1px solid #232a3d; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.hintline { text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; min-height: 18px; }
.hintline b { color: var(--text); }

/* ── results ── */
.result-hero { text-align: center; margin: 18px 0 8px; }
.result-hero .score-ring {
  width: 130px; height: 130px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; font-weight: 800;
  background:
    radial-gradient(closest-side, var(--bg) 79%, transparent 80% 100%),
    conic-gradient(var(--green) calc(var(--pct) * 1%), #262e45 0);
}
.result-hero .verdict { font-size: 16px; color: var(--muted); }
.result-hero .verdict b { color: var(--text); font-size: 18px; }
.result-hero .flawless { color: #6fd08d; }
.grid-row { display: flex; justify-content: center; gap: 4px; margin: 10px 0 4px; }
.grid-row span { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; font-weight: 700; }

/* round chips (5-round day summary) */
.grid-rows-wrap { display: flex; flex-direction: column; gap: 4px; align-items: center; margin: 10px 0 4px; }
.grid-row.chips { flex-wrap: wrap; gap: 8px; }
.rchip {
  width: 52px; height: 56px; border-radius: 12px; border: 1px solid #232a3d;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--panel); transition: transform .1s, border-color .15s;
}
.rchip:hover { transform: translateY(-2px); border-color: var(--accent); }
.rchip .rn { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.rchip .rs { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rchip.feedback-green { background: var(--green-dim); border-color: var(--green); }
.rchip.feedback-green .rs { color: #6fd08d; }
.rchip.feedback-amber { background: var(--amber-dim); border-color: var(--amber); }
.rchip.feedback-amber .rs { color: var(--amber); }
.rchip.feedback-slate { background: var(--bg2); border-color: var(--slate); }
.rchip.feedback-slate .rs { color: var(--muted); }

.chart-panel { background: var(--panel); border: 1px solid #232a3d; border-radius: var(--radius); padding: 16px 16px 8px; margin: 16px 0; }
.chart-panel h3 { font-size: 14px; color: var(--muted); font-weight: 650; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.07em; }
.chart-svg { width: 100%; height: auto; display: block; }
.fact-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.fact {
  background: var(--panel); border: 1px solid #232a3d; border-radius: 12px;
  padding: 11px 14px; font-size: 13.5px; color: var(--muted);
}
.fact b { color: var(--text); display: block; font-size: 14px; margin-bottom: 2px; }
.fact .fv { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

.result-actions { display: flex; gap: 10px; margin-top: 14px; }
.next-links { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.next-links a {
  text-align: center; padding: 11px; border-radius: 10px; color: var(--muted); font-size: 14px;
  background: var(--bg2); text-decoration: none; transition: color .12s, background .12s;
}
.next-links a:hover { color: var(--text); background: var(--panel); }
.countdown-box { text-align: center; margin-top: 20px; color: var(--muted); font-size: 13px; }
.countdown-box .cd { font-size: 19px; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ── survival ── */
.surv-bar { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.hp-wrap { flex: 1; }
.hp-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.hp-label b { color: var(--text); font-variant-numeric: tabular-nums; }
.hp-track { height: 12px; border-radius: 999px; background: #232a3d; overflow: hidden; }
.hp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--danger), #e3915b); transition: width .45s ease; }
.hp-fill.healthy { background: linear-gradient(90deg, #2f9e5f, #6fd08d); }
.hp-wrap.hit .hp-fill { animation: hpHit .6s ease; }
@keyframes hpHit { 0%, 100% { filter: none; } 30% { filter: brightness(2.1) saturate(1.7); } }
.timer {
  font-weight: 800; font-size: 21px; font-variant-numeric: tabular-nums;
  background: var(--panel); border: 1px solid #2c3650; border-radius: 10px;
  padding: 6px 12px; min-width: 92px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.timer .t-icon { font-size: 15px; }
.timer .t-unit { font-size: 12px; color: var(--muted); font-weight: 700; }
.timer.low { color: var(--danger); animation: pulse 1s infinite; }
.timer.low .t-unit { color: var(--danger); }
@keyframes pulse { 50% { opacity: 0.55; } }
.surv-count { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.surv-count b { color: var(--text); font-size: 15px; }
.surv-feedback {
  background: var(--panel); border: 1px solid #232a3d; border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; color: var(--muted); margin-bottom: 12px;
}
.surv-feedback b { color: var(--text); }
.surv-feedback.timeout {
  border-color: var(--danger); background: rgba(227, 91, 91, 0.12); color: #f0c2c2;
  animation: fbshake .4s ease;
}
.surv-feedback.timeout b { color: #ffb9b9; }
@keyframes fbshake { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
.hp-wrap.dead .hp-track { background: rgba(227, 91, 91, 0.28); }
.dmg-flash { animation: dmg .5s ease; }
@keyframes dmg { 0% { background: rgba(227, 91, 91, 0.25); } 100% { background: var(--panel); } }

/* ── modals ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8, 10, 16, 0.72); z-index: 40;
  display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border-radius: 20px 20px 0 0; width: 100%; max-width: var(--maxw);
  padding: 22px 20px 30px; max-height: 84vh; overflow-y: auto;
  animation: slideup .22s ease;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (min-width: 560px) {
  .modal-overlay.open { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; }
}
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.howto-step { display: flex; gap: 14px; margin-bottom: 16px; }
.howto-step .num {
  width: 30px; height: 30px; border-radius: 9px; background: var(--panel); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0; font-size: 14px;
}
.howto-step p { font-size: 14px; color: var(--muted); }
.howto-step p b { color: var(--text); }
.legend { display: flex; gap: 10px; margin: 10px 0 16px; }
.legend .leg { flex: 1; text-align: center; background: var(--panel); border-radius: 10px; padding: 10px 6px; font-size: 12px; color: var(--muted); }
.legend .leg .sq { width: 26px; height: 26px; border-radius: 7px; margin: 0 auto 6px; }
.sq.g { background: var(--green); } .sq.a { background: var(--amber); } .sq.s { background: #a86b6b; }
.modal .close-row { display: flex; margin-top: 8px; }

/* stats modal */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 18px; }
.stat { background: var(--panel); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 800; }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.hist { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin: 8px 0 4px; }
.hist .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; gap: 3px; }
.hist .bar { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.hist .lbl { font-size: 10.5px; color: var(--muted); }
.modal .mode-tabs { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
.mode-tabs button {
  padding: 6px 12px; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 650;
}
.mode-tabs button.on { background: var(--accent); color: #fff; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #262e45; color: var(--text); padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* done state banner on play screens */
.done-note {
  text-align: center; background: var(--panel); border: 1px solid #232a3d; border-radius: 12px;
  padding: 14px; color: var(--muted); font-size: 14px; margin-top: 14px;
}
.done-note b { color: var(--text); }

/* ───────── scale board ───────── */
.scale-wrap { margin: 6px 0 4px; user-select: none; }
.scale-canvas { position: relative; height: 120px; touch-action: none; cursor: grab; }
.scale-canvas:active { cursor: grabbing; }
.scale-axis { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: linear-gradient(90deg, #2a3346, #3d4a6b, #2a3346); }
.scale-tick { position: absolute; top: 0; bottom: 0; width: 0; }
.scale-tick .tick-line { position: absolute; top: 50%; height: 12px; width: 2px; margin-top: -6px; margin-left: -1px; background: #333d55; border-radius: 1px; }
.scale-tick .tick-lbl { position: absolute; top: calc(50% + 10px); left: 0; transform: translateX(-50%); font-size: 10.5px; color: #aab3c7; font-variant-numeric: tabular-nums; white-space: nowrap; }
.locked-in .scale-axis { background: linear-gradient(90deg, #2a3346, #4a5570, #2a3346); }
.locked-in { filter: brightness(0.94) saturate(1.08); }
.timer.critical { animation: pulse .45s infinite; }
.scale-errors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scale-tokens { position: relative; height: 190px; margin-top: 2px; }
.token {
  position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 5px;
  background: var(--tile); border: 2px solid #323c58; border-radius: 999px;
  padding: 4px 10px 4px 6px; font-size: 12px; font-weight: 650; white-space: nowrap;
  cursor: grab; touch-action: none; z-index: 2; transition: background .15s, border-color .15s;
}
.token:hover { background: var(--tile-hover); }
.token.lane0 { top: 2px; }
.token.lane1 { top: 46px; }
.token.lane2 { top: 90px; }
.token.lane3 { top: 134px; }
.token .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.token.dragging { border-color: var(--accent); box-shadow: 0 10px 26px rgba(0,0,0,.5); cursor: grabbing; z-index: 10; transform: translateX(-50%) scale(1.05); }
.token:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.token.locked { cursor: default; }
.token.feedback-green { background: var(--green-dim); border-color: var(--green); }
.token.feedback-green .dot { background: var(--green); }
.token.feedback-amber { background: var(--amber-dim); border-color: var(--amber); }
.token.feedback-amber .dot { background: var(--amber); }
.token.feedback-orange { background: rgba(224, 134, 61, 0.14); border-color: #e0863d; }
.token.feedback-orange .dot { background: #e0863d; }
.token.feedback-slate { background: #171223; border-color: #a86b6b; }
.token.feedback-slate .dot { background: #a86b6b; }
.token::after { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 12px; background: #323c58; }
.rchip.feedback-orange { background: rgba(224, 134, 61, 0.14); border-color: #e0863d; }
.rchip.feedback-orange .rs { color: #e0863d; }
.sq.o, .rchip.feedback-orange .rs { background: #e0863d; }

.token .chev { color: #5b8cff; font-size: 13px; font-weight: 800; flex-shrink: 0; opacity: 0.9; }
.token.locked .chev { display: none; }
.scale-caption { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.scale-caption b { color: #c7cde0; }
.token.wiggle { animation: tokenWiggle .9s ease; }
@keyframes tokenWiggle {
  0%, 100% { transform: translateX(-50%); }
  20% { transform: translateX(calc(-50% - 5px)); }
  40% { transform: translateX(calc(-50% + 5px)); }
  60% { transform: translateX(calc(-50% - 3px)); }
  80% { transform: translateX(calc(-50% + 3px)); }
}
@media (prefers-reduced-motion: reduce) { .token.wiggle { animation: none; } }

/* community distribution panel */
.comm-panel { background: var(--panel); border: 1px solid #232a3d; border-radius: var(--radius); padding: 15px 16px 13px; margin: 8px 0 0; }
.comm-panel h3 { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; display: flex; align-items: center; gap: 8px; font-weight: 650; }
.sim-tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--bg2); color: var(--muted); border: 1px solid #2a3346; text-transform: none; letter-spacing: 0; }
.comm-bars { display: flex; align-items: flex-end; gap: 5px; height: 92px; margin: 14px 0 4px; position: relative; }
.comm-bar { flex: 1; background: #3d4a6b; border-radius: 4px 4px 0 0; min-height: 2%; position: relative; }
.comm-bar.you { background: var(--green); box-shadow: 0 0 14px rgba(52, 168, 83, 0.35); }
.comm-bar .cv { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comm-bar.you .cv { color: #6fd08d; font-weight: 700; }
.comm-avg { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 2px dashed var(--amber); opacity: 0.75; }
.comm-labels { display: flex; gap: 5px; }
.comm-labels span { flex: 1; text-align: center; font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comm-panel[data-cols="10"] .comm-labels span:nth-child(even) { visibility: hidden; }
.comm-stats { display: flex; gap: 8px; margin-top: 12px; }
.comm-stats .cs { flex: 1; background: var(--bg2); border-radius: 10px; padding: 9px 4px 7px; text-align: center; }
.comm-stats .cs b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.comm-stats .cs span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

footer {
  width: 100%; max-width: var(--maxw); text-align: center;
  color: #8b93a8; font-size: 12px; padding: 8px 16px 22px;
}
footer a { color: var(--muted); text-decoration: none; }
