/* 絶対にAを押してください — Fable 5.2 版
   見た目の方針: 選挙の掲示物（紙・明朝・朱の判子）に、スーパーの POP シールが少しずつ侵食してくる。 */

:root {
  --paper: #f3efe4;
  --sheet: #fcfaf4;
  --ink: #1d1c1a;
  --muted: #6d675b;
  --line: #d6cfbd;
  --dot: rgba(60, 50, 30, .07);
  --red: #d63a2b;
  --blue: #2f4f9a;
  --gold: #f6c81e;
  --size: clamp(112px, 31vw, 156px); /* 投票ボタンの直径 */
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --gothic: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", Meiryo, system-ui, sans-serif;
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141416;
    --sheet: #1e1e22;
    --ink: #edebe6;
    --muted: #a39f95;
    --line: #3a3940;
    --dot: rgba(255, 255, 255, .04);
    --red: #e8503f;
    --blue: #5b7fd6;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--paper) radial-gradient(var(--dot) 1px, transparent 1.5px) 0 0 / 16px 16px;
  color: var(--ink);
  font-family: var(--gothic);
  line-height: 1.7;
}
.nb { display: inline-block; }
a { color: inherit; }

/* ---------- 上の帯 ---------- */
.masthead {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mast-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seal {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 2px solid var(--red); border-radius: 50%;
  color: var(--red);
  font: 800 11px/1 var(--mincho);
  rotate: -8deg;
}
.mast-name { font: 800 1.05rem/1.2 var(--mincho); letter-spacing: .08em; white-space: nowrap; }
.mast-motto {
  padding: 1px 6px 1px 9px;
  border: 1px solid currentColor;
  color: var(--muted);
  font-size: .68rem; letter-spacing: .22em; white-space: nowrap;
}
.sound-btn {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 700 .72rem/1.4 var(--gothic); white-space: nowrap;
  cursor: pointer;
}
.sound-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }

/* ---------- 紙 ---------- */
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px 28px; }
.sheet {
  position: relative;
  padding: clamp(18px, 4vw, 30px) clamp(12px, 4vw, 32px) clamp(16px, 3vw, 24px);
  border: 1px solid var(--line);
  border-top: 6px double var(--ink);
  background: var(--sheet);
  box-shadow: 0 14px 30px -20px rgba(0, 0, 0, .4);
  text-align: center;
}
.noscript { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--red); background: var(--sheet); font-size: .85rem; }
.practice {
  display: inline-block;
  margin: 0 0 12px;
  padding: 2px 12px;
  background: var(--gold); color: #1d1c1a;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
}
.premise {
  margin: 0 0 4px;
  color: var(--muted);
  font: 600 clamp(.86rem, 3.5vw, 1.02rem)/1.6 var(--mincho);
  letter-spacing: .04em;
}
.order {
  margin: 0 0 12px;
  padding-top: .3em;
  font: 800 clamp(1.5rem, 6.6vw, 2.5rem)/1.35 var(--mincho);
  letter-spacing: .03em;
}
.order em {
  font-style: normal;
  color: var(--red);
  -webkit-text-emphasis: filled sesame var(--red);
  text-emphasis: filled sesame var(--red);
}

.level {
  position: absolute; top: -.9em; right: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--sheet); color: var(--muted);
  font-size: .66rem; font-weight: 700; letter-spacing: .06em; line-height: 1.7; white-space: nowrap;
  visibility: hidden; opacity: 0;
  transition: opacity .3s;
}
.level.show { visibility: visible; opacity: 1; }
.lamps { display: inline-flex; gap: 3px; }
.lamps i { width: 9px; height: 9px; border-radius: 2px; background: var(--line); transition: background .3s; }
.lamps i.on { background: var(--red); }
.level-name { color: var(--red); }
.level-count b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 投票台 ---------- */
.arena {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  gap: clamp(30px, 11vw, 110px);
  /* Bがよける場所を確保する。背の低い画面では詰める */
  min-height: max(calc(var(--size) * 2.3), min(calc(var(--size) * 3), 400px, 50vh));
  margin: 4px 0 8px;
}
.slot { position: relative; flex: none; width: var(--size); height: var(--size); }
.socket {
  position: absolute; inset: 3%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, .3), rgba(0, 0, 0, .12));
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .35);
}
.plate {
  position: absolute; top: calc(100% + 16px); left: 50%;
  translate: -50% 0;
  min-width: 44px; padding: 0 12px;
  border: 1.5px solid var(--ink);
  background: var(--sheet);
  font: 800 .85rem/1.6 var(--mincho); letter-spacing: .1em;
}
/* ボタンを動かすための入れ物。位置は --tx / --ty で決める */
.mover {
  position: absolute; inset: 0; z-index: 5;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  transition: transform .2s cubic-bezier(.25, 1.5, .5, 1);
}
#moverA { z-index: 6; }
.mover.slow { transition: transform .9s cubic-bezier(.4, 0, .3, 1); }

.pb {
  position: absolute; inset: 0;
  padding: 0; border: 0; border-radius: 50%;
  background: linear-gradient(160deg, #4a4a50, #1c1c20);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .35), inset 0 -3px 6px rgba(0, 0, 0, .5), 0 6px 14px rgba(0, 0, 0, .28);
  color: #fff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
.pb:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
.pb .cap {
  position: absolute; inset: 9%;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, var(--hi), var(--mid) 48%, var(--lo) 100%);
  box-shadow:
    0 calc(var(--size) * .055) 0 var(--edge),
    0 calc(var(--size) * .1) calc(var(--size) * .09) rgba(0, 0, 0, .4),
    inset 0 2px 3px rgba(255, 255, 255, .45);
  transform: translateY(calc(var(--size) * -.045));
  transition: transform .07s, box-shadow .07s;
}
.pb:active .cap, .pb.pressed .cap {
  transform: translateY(0);
  box-shadow: 0 1px 0 var(--edge), 0 2px 4px rgba(0, 0, 0, .4), inset 0 2px 3px rgba(255, 255, 255, .3);
}
.pb .letter {
  font: 900 calc(var(--size) * .44)/1 var(--display);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  pointer-events: none;
}
.pb-a { --hi: #ff9079; --mid: #e2412f; --lo: #b8281a; --edge: #8c1c12; }
.pb-b { --hi: #86a6ea; --mid: #3558a8; --lo: #24407f; --edge: #182c5c; touch-action: none; }

body:not([data-stage="intro"]) .pb-a { animation: invite 1.8s ease-in-out infinite; }
@keyframes invite { 50% { scale: 1.045; } }
.pb-b.panting { animation: pant .55s ease-in-out infinite; }
@keyframes pant { 50% { scale: .955; } }

/* 吹き出し */
.bubble {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  translate: -50% 0;
  padding: 3px 10px;
  border: 1.5px solid var(--ink); border-radius: 12px;
  background: var(--sheet); color: var(--ink);
  font-size: .76rem; font-weight: 700; white-space: nowrap;
  pointer-events: none;
  animation: pop .3s cubic-bezier(.2, 1.7, .4, 1) both;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border: solid var(--ink); border-width: 0 1.5px 1.5px 0;
  background: var(--sheet);
  rotate: 45deg;
}
@keyframes pop { from { scale: 0; opacity: 0; } }

.tag-b {
  position: absolute; top: -3%; right: -12%;
  padding: 0 7px;
  background: #5a5a5a; color: #fff;
  font-size: .62rem; font-weight: 700; letter-spacing: .06em; line-height: 1.7;
  rotate: 10deg;
  pointer-events: none;
}

/* ---------- Aに貼られていく POP シール ---------- */
.stickers { position: absolute; inset: 0; pointer-events: none; font-size: calc(var(--size) * .1); }
.sticker {
  position: absolute;
  font-weight: 900; line-height: 1.15; text-align: center; white-space: nowrap;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .28));
  animation: pop .38s cubic-bezier(.2, 1.7, .4, 1) both;
}
.st-1 { top: -24%; right: -27%; width: 5.2em; height: 5.2em; display: grid; place-items: center; background: var(--gold); color: #c1121f; font-size: 1.08em; rotate: 12deg; }
.st-2 { top: -9%; left: -30%; padding: .3em .8em; border: 2px solid var(--gold); border-radius: 99px; background: #c1121f; color: #fff; rotate: -11deg; }
.st-3 { bottom: -2%; left: -32%; padding: .25em .6em; background: var(--gold); color: #1d1c1a; rotate: 7deg; }
.st-4 { bottom: -15%; right: -24%; width: 4.6em; height: 4.6em; display: grid; place-items: center; border: 3px solid #c1121f; border-radius: 50%; background: #fff; color: #c1121f; font-size: .92em; white-space: normal; rotate: -9deg; }
.st-5 { top: 39%; right: -33%; padding: .25em .6em; background: #1f6f43; color: #fff; font-size: .92em; rotate: -5deg; }
.st-6 { top: 31%; left: -31%; padding: .25em .6em; background: #1d1c1a; color: var(--gold); font-size: .92em; rotate: 5deg; }
.st-7 { bottom: -9%; left: 50%; translate: -50% 0; padding: .3em .8em; border: 1.5px dashed #1d1c1a; background: #fffdf2; color: #1d1c1a; font-family: var(--mincho); rotate: -2deg; }

/* ---------- Bの貼り紙 ---------- */
.signs { position: absolute; inset: 0; pointer-events: none; }
.sign {
  --rot: -5deg;
  position: absolute; left: 50%; top: 50%;
  width: 122%; min-height: 70%;
  translate: -50% -50%; rotate: var(--rot);
  display: grid; place-content: center; gap: 2px;
  padding: 8% 4%;
  border: 1px solid rgba(0, 0, 0, .2);
  background: #fffdf5; color: #1d1c1a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  font-weight: 900; font-size: calc(var(--size) * .2); line-height: 1.15; text-align: center;
  pointer-events: auto;
}
.sign small { display: block; font-size: .42em; font-weight: 700; }
.sign::before, .sign::after {
  content: ""; position: absolute; top: -7px;
  width: 30%; height: 15px;
  background: rgba(238, 222, 160, .88);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}
.sign::before { left: -6%; rotate: -32deg; }
.sign::after { right: -6%; rotate: 32deg; }
.sign.slap { animation: slap .28s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes slap { from { scale: 1.9; opacity: 0; rotate: calc(var(--rot) + 16deg); } }
.sign.peel { animation: peel .5s ease-in forwards; pointer-events: none; }
@keyframes peel { to { translate: -10% -210%; rotate: 55deg; opacity: 0; } }

.s-broken { color: #c1121f; }
.s-broken small { color: #1d1c1a; }
.s-adjust { --rot: 4deg; border: 6px solid transparent; background: linear-gradient(var(--gold), var(--gold)) padding-box, repeating-linear-gradient(-45deg, #1d1c1a 0 8px, var(--gold) 8px 16px) border-box; }
.s-paint { --rot: -3deg; color: #1f6f43; border: 3px solid #1f6f43; font-size: calc(var(--size) * .17); }
.s-bear { --rot: 6deg; background: var(--gold); border: 3px solid #1d1c1a; font-size: calc(var(--size) * .16); }
.s-bear .bear { display: block; font-size: 1.6em; line-height: 1.1; }
.s-plea {
  --rot: -2deg;
  background: repeating-linear-gradient(#fffdf5 0 1.45em, #b9cbe6 1.45em calc(1.45em + 1px));
  font-family: "Yu Kyokasho", "YuKyokasho", "Hiragino Maru Gothic ProN", "Klee", var(--mincho);
  font-weight: 600; font-size: calc(var(--size) * .135); line-height: 1.45;
}
.s-plea small { font-size: .7em; text-align: right; }

/* ---------- 長押し ---------- */
.pb-b .ring {
  position: absolute; inset: -8%;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p, 0) * 1turn), rgba(128, 128, 128, .32) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
body[data-stage="hold"] .pb-b .ring { opacity: 1; }
.pb-b.holding .letter { font-size: calc(var(--size) * .4); animation: tremble .09s linear infinite; }
@keyframes tremble {
  25% { translate: calc(var(--amp, 1px) * -1) var(--amp, 1px); }
  75% { translate: var(--amp, 1px) calc(var(--amp, 1px) * -1); }
}

/* ---------- 停電 ---------- */
.blackout {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(circle calc(var(--size) * .85) at var(--mx, -999px) var(--my, -999px),
    rgba(4, 5, 10, 0) 0%, rgba(4, 5, 10, .5) 55%, rgba(4, 5, 10, .985) 100%);
  pointer-events: none;
  animation: flicker .55s steps(1);
}
.blackout.off { opacity: 0; transition: opacity .5s; }
@keyframes flicker { 0% { opacity: 0; } 15% { opacity: 1; } 30% { opacity: .2; } 45% { opacity: 1; } 60% { opacity: .5; } 75% { opacity: 1; } }
body.is-dark #moverA { z-index: 60; }
body.is-dark .pb-a { box-shadow: 0 0 calc(var(--size) * .3) calc(var(--size) * .08) rgba(255, 120, 90, .75), 0 0 calc(var(--size) * .9) calc(var(--size) * .3) rgba(255, 120, 90, .28); }
body.is-dark .announce { z-index: 60; border-color: #4a4a52; background: #0c0d12; color: #f0eee8; }
body.is-dark .announce-tag { background: #f0eee8; color: #0c0d12; }
body.is-dark .level { border-color: #4a4a52; background: #0c0d12; color: #a8a6a0; }
body.is-dark .level-count b { color: #f0eee8; }
body.is-dark .lamps i:not(.on) { background: #3a3a42; }
.sneeze {
  position: fixed; z-index: 60;
  translate: -50% -100%;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(240, 238, 232, .92); color: #14151a;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
  pointer-events: none;
  animation: sneeze 1s ease-out both;
}
@keyframes sneeze {
  0% { opacity: 0; scale: .4; }
  18% { opacity: 1; scale: 1.1; }
  70% { opacity: 1; scale: 1; }
  100% { opacity: 0; translate: -50% -150%; }
}

/* ---------- 場内アナウンス ---------- */
.announce {
  position: relative;
  max-width: 34em; min-height: 5.4em;
  margin: 18px auto 0;
  padding: 15px 14px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: .92rem; line-height: 1.65; text-align: left;
}
.announce-tag {
  position: absolute; top: -.85em; left: 12px;
  padding: 0 8px;
  background: var(--ink); color: var(--sheet);
  font-size: .66rem; font-weight: 700; letter-spacing: .14em; line-height: 1.7;
}
.announce.flash .announce-text { display: block; animation: say .35s ease-out; }
@keyframes say { from { opacity: 0; translate: 0 5px; } }

/* ---------- ボタン類 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 4px;
  padding: 12px 22px;
  border: 1.5px solid var(--ink); border-radius: 4px;
  background: var(--ink); color: var(--sheet);
  font: 700 .95rem/1.4 var(--gothic); text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn small { font-size: .72em; font-weight: 600; }
.btn-a { border-color: var(--red); background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-small { padding: 6px 14px; font-size: .8rem; }
.btn-link {
  padding: 6px 4px;
  border: 0; background: none; color: var(--muted);
  font: 500 .78rem/1.4 var(--gothic); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:disabled { opacity: .4; cursor: default; }
.btn:focus-visible, .btn-link:focus-visible, .sound-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- ダイアログ ---------- */
.dlg {
  width: 100%; max-width: min(92vw, 430px);
  padding: 0; border: 0;
  background: transparent; color: var(--ink);
  overflow: visible;
}
.dlg::backdrop { background: rgba(18, 16, 12, .6); }
.dlg-paper {
  position: relative;
  padding: 26px 22px 20px;
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink); outline-offset: -6px;
  background: var(--sheet);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  text-align: center;
}
.dlg[open] .dlg-paper { animation: dlg-in .22s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes dlg-in { from { scale: .9; opacity: 0; } }
.dlg-kicker { margin: 0 0 6px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .3em; }
.dlg h2 { margin: 0 0 8px; font: 800 1.2rem/1.5 var(--mincho); }
.dlg p { margin: 0 0 4px; font-size: .92rem; }
.dlg-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.dlg-actions .btn { min-width: 14em; }

.form-paper { text-align: left; }
.form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.form-head h2 { margin: 0; }
.hanko-row { display: flex; flex: none; border: 1px solid var(--ink); }
.hanko-box { display: flex; flex-direction: column; width: 46px; }
.hanko-box + .hanko-box { border-left: 1px solid var(--ink); }
.hanko-role { border-bottom: 1px solid var(--ink); font-size: .62rem; line-height: 1.7; text-align: center; }
.hanko { height: 44px; display: grid; place-items: center; }
.hanko.on::before {
  content: attr(data-mark);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 2px solid var(--red); border-radius: 50%;
  color: var(--red);
  font: 800 .95rem/1 var(--mincho);
  rotate: -9deg;
  animation: stamp .22s cubic-bezier(.2, 1.4, .4, 1);
}
.hanko.small.on::before { font-size: .7rem; rotate: 12deg; }
@keyframes stamp { from { scale: 2.6; opacity: 0; } }
.form-field { margin: 0 0 10px; padding: 8px 12px 10px; border: 1px solid var(--line); }
.form-field legend { padding: 0 6px; font-size: .78rem; font-weight: 700; }
.form-field.shake { animation: shake .3s; }
@keyframes shake { 20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
.opt { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .92rem; cursor: pointer; }
.opt input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.form-msg { min-height: 3.2em; margin: 0; font-size: .82rem; line-height: 1.6; }
.form-msg.err { color: var(--red); font-weight: 700; }
.form-paper .dlg-actions { margin-top: 6px; }
.reject-stamp {
  position: absolute; left: 50%; top: 44%;
  translate: -50% -50%; rotate: -14deg;
  padding: 0 .35em;
  border: 5px double var(--red); border-radius: 8px;
  color: var(--red);
  font: 900 clamp(3.2rem, 17vw, 4.6rem)/1.25 var(--mincho); letter-spacing: .12em; white-space: nowrap;
  opacity: .88;
  pointer-events: none;
  animation: stamp .25s cubic-bezier(.2, 1.4, .4, 1);
}

/* ---------- 結果 ---------- */
.result { animation: rise .45s ease-out; }
@keyframes rise { from { opacity: 0; translate: 0 10px; } }
.result-kicker { margin: 0 0 16px; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .2em; }
.ballot {
  display: flex; align-items: center; gap: clamp(14px, 4vw, 24px);
  max-width: 34em; margin: 0 auto 20px;
  text-align: left;
}
.ballot-stamp {
  flex: none;
  width: clamp(84px, 24vw, 116px); aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red); color: #fff;
  box-shadow: inset 0 0 0 4px var(--sheet), 0 0 0 3px var(--red);
  font: 900 clamp(3rem, 13vw, 4.2rem)/1 var(--display);
  rotate: -8deg;
  animation: stamp .4s cubic-bezier(.2, 1.4, .4, 1) .15s both;
}
.result.is-b .ballot-stamp { background: var(--blue); box-shadow: inset 0 0 0 4px var(--sheet), 0 0 0 3px var(--blue); }
.ballot-label { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
.ballot h2 { margin: 2px 0 6px; font: 800 clamp(1.3rem, 5.4vw, 1.75rem)/1.35 var(--mincho); outline: none; }
.ballot-desc { margin: 0; font-size: .9rem; line-height: 1.7; }

.notice { max-width: 34em; margin: 0 auto 16px; padding: 10px 14px; border-left: 4px solid var(--red); background: var(--paper); font-size: .85rem; text-align: left; }
.notice p { margin: 0 0 8px; }

.tally { max-width: 34em; margin: 0 auto; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.tally-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 800 1.05rem/1.4 var(--mincho); letter-spacing: .1em; }
.tokaku { padding: 1px 8px; border-radius: 2px; background: var(--red); color: #fff; font: 800 .68rem/1.7 var(--gothic); letter-spacing: .08em; rotate: -3deg; }
.row { display: grid; grid-template-columns: 1.4em 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; }
.row-name { font: 900 1.25rem/1 var(--display); }
.row-a .row-name { color: var(--red); }
.row-b .row-name { color: var(--blue); }
.bar { height: 22px; border: 1px solid var(--line); border-radius: 0 4px 4px 0; background: var(--paper); overflow: hidden; }
.fill { display: block; width: 0; height: 100%; border-radius: 0 3px 3px 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.row-a .fill { background: var(--red); }
.row-b .fill { background: var(--blue); }
.row-num { min-width: 7em; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-num b { font-size: 1.2rem; }
.unit { margin-left: 2px; font-size: .74rem; }
.row-num small { display: inline-block; min-width: 3.9em; color: var(--muted); font-size: .74rem; }
.tally-meta { margin: 12px 0 0; font-size: .85rem; }
.tally-meta b { font-variant-numeric: tabular-nums; }
.tally-comment { margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--line); background: var(--paper); font-size: .88rem; }
.tally-comment::before { content: "選管コメント"; display: block; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .14em; }
.tally-note { margin: 8px 0 0; color: var(--muted); font-size: .72rem; }
.tally .notice { margin-top: 12px; }

.mine {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 34em; margin: 20px auto 0; padding: 14px 0 0;
  border-top: 1px solid var(--line);
}
.mine div { min-width: 0; }
.mine dt { color: var(--muted); font-size: .68rem; font-weight: 700; line-height: 1.4; }
.mine dd { margin: 2px 0 0; font: 800 1.02rem/1.4 var(--mincho); }

.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* ---------- 下 ---------- */
.foot { padding: 0 16px 24px; color: var(--muted); font-size: .74rem; text-align: center; }
.foot p { margin: 0 0 4px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; }
.foot-credit { opacity: .8; }

.confetti { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; pointer-events: none; }

@media (max-width: 480px) {
  .level-label, .level-name { display: none; }
}
@media (max-width: 400px) {
  .mast-motto { display: none; }
  .row-num { min-width: 6.2em; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-a, .pb-b.panting, .pb-b.holding .letter { animation: none !important; }
  .mover, .mover.slow { transition-duration: .01s; }
  .blackout { animation: none; }
}
