/* ============================================================
   しゃふらん -Shuffle Answer-（ぺげ No.01）
   投票用紙のメモ：白い紙に黒いフチ、ピンクの罫線。
   見せ場は「誰が書いたか」が出るスタンプの瞬間。
   ============================================================ */
:root {
  --pink: #c9507e;
  --pink-deep: #9c2f59;
  --pink-pale: #ffe3ec;
  --pink-pale2: #ffc9d9;
  --pink-paper: #fff6f9;
  --ink: #1a1a1a;
  --mint: #19b48c;
  --mint-deep: #0f8468;
  --gold: #ffd43a;
  --gold-deep: #d9a800;
  --purple: #7a3cf0;
  --purple-deep: #5a24c0;
  --paper: #ffffff;
  --sub: #6b5560;
  --line: #f0dde4;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-s: 3px 3px 0 var(--ink);
  --round: 16px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  --display: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif;
  --en: "Anton", "Dela Gothic One", Impact, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--pink-pale); }
body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--pink-pale);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
/* 紙の網点（角だけ。スクロールしても動かない固定の層） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--pink-pale2) 30%, transparent 33%);
  background-size: 13px 13px;
  -webkit-mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, .25) 30%, transparent 46%, transparent 62%, rgba(0, 0, 0, .3) 82%, #000 100%);
  mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, .25) 30%, transparent 46%, transparent 62%, rgba(0, 0, 0, .3) 82%, #000 100%);
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--mint-deep); outline-offset: 2px; }
.hidden { display: none !important; }
.center { text-align: center; }

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 14px calc(env(safe-area-inset-bottom) + 40px);
}
.scr { display: none; animation: fadein .25s ease; }
.scr.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 文字 ---------- */
.title-s { font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.note { font-size: 12.5px; color: var(--sub); line-height: 1.7; margin: 0; }
.note b { color: var(--pink-deep); }
.note.warn { color: var(--pink-deep); font-weight: 800; }
.note.ok { color: var(--mint-deep); font-weight: 800; }
h2.head {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  margin: 6px 0 14px;
  text-align: center;
  line-height: 1.45;
}

/* ---------- 上の帯（もどる・画面名） ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 10px;
}
.topbar .brand { font-weight: 800; font-size: 14px; }
.tag {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-family: var(--en);
  font-size: 15px;
  letter-spacing: .04em;
  padding: 3px 12px 2px;
  border-radius: 99px;
}
.tag--mint { background: var(--mint); }
.tag--gold { background: var(--gold); color: var(--ink); }
.mypoint { font-family: var(--display); font-size: 17px; color: var(--pink-deep); }

/* ---------- カード（白い紙） ---------- */
.card {
  background: var(--paper);
  border-radius: var(--round);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 16px;
}
.card--pale { background: var(--pink-paper); }
.card--mint { background: #e9fbf5; }
.card__title { font-size: 14px; font-weight: 800; margin: 0 0 8px; }

/* ---------- ボタン ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease, opacity .15s;
  margin: 12px 0 0;
  line-height: 1.35;
  text-align: center;
  color: #fff;
  background: var(--pink);
  box-shadow: 0 5px 0 var(--ink);
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn--white { color: var(--ink); background: #fff; }
.btn--mint { background: var(--mint); }
.btn--gold { color: var(--ink); background: var(--gold); }
.btn--purple { background: var(--purple); }
.btn--line { background: #06c755; }
.btn--x { background: #111; }
.btn--google { background: #fff; color: #1a1a1a; }
.btn--ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
  border-width: 2px;
  box-shadow: none;
  min-height: 46px;
  font-size: 15px;
}
.btn--ghost:active { transform: translateY(2px); box-shadow: none; }
.btn--small { width: auto; min-height: 42px; padding: 8px 18px; font-size: 14px; box-shadow: 0 3px 0 var(--ink); }
.btn--small:active { box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] {
  background: #ece2e6;
  color: #a1919a;
  box-shadow: 0 3px 0 #cdbcc4;
  pointer-events: none;
  transform: none;
}
.btn--attention { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.btn-link {
  display: inline-block;
  background: none;
  border: 0;
  color: var(--sub);
  text-decoration: underline;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
}
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.scr__foot { margin-top: 18px; }

/* ---------- タイトル画面 ---------- */
.hero { text-align: center; padding: 4px 0 2px; }
.hero__logo {
  width: 82%;
  margin: 0 auto;
  filter: drop-shadow(4px 5px 0 rgba(26, 26, 26, .9));
  animation: float 3.6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-.5deg); }
  50% { transform: translateY(-6px) rotate(.5deg); }
}
.hero__big {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.3;
  margin: 4px 0 0;
  color: var(--pink-deep);
}
.catch {
  text-align: center;
  margin: 10px 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
}
.catch span {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 5px 14px 7px;
  margin: 3px 0;
}
.catch span:first-child { transform: rotate(-2deg); }
.catch span:last-child { background: var(--pink); transform: rotate(1.5deg); border: 3px solid var(--ink); }
.hero__sub { text-align: center; font-size: 14px; font-weight: 800; margin: 8px 0 12px; }
.kv-wrap { margin: 0 0 14px; }
.kv { width: 100%; border-radius: 12px; border: 3px solid var(--ink); box-shadow: var(--shadow); }

/* ---------- あそびかた ---------- */
.how .card__title { font-family: var(--display); font-weight: 400; font-size: 18px; }
.rules-lead {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.75;
  background: var(--pink-pale);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.rules-lead b { color: var(--pink-deep); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.steps li { position: relative; padding: 0 0 10px 34px; font-size: 14px; line-height: 1.65; }
.steps li::before {
  counter-increment: st;
  content: counter(st);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps b { display: block; font-size: 15px; }
.steps small { display: block; font-size: 13px; color: var(--sub); line-height: 1.6; margin-top: 2px; font-weight: 700; }
.pt-table { width: 100%; border-collapse: collapse; margin: 2px 0 10px; font-size: 13px; }
.pt-table th, .pt-table td { padding: 9px 3px; border-bottom: 2px dashed var(--line); vertical-align: top; text-align: left; }
.pt-table th { width: 96px; font-size: 14px; font-weight: 800; line-height: 1.45; }
.pt-table tr.hd th, .pt-table tr.hd td { font-size: 11.5px; color: var(--sub); padding: 2px 3px 4px; border-bottom-style: solid; }
.pt-table td { line-height: 1.55; font-weight: 800; }
.pt-table td small { display: block; font-size: 12px; color: var(--sub); font-weight: 700; margin-top: 2px; }
.rules-tip {
  font-size: 13px;
  line-height: 1.65;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 0 12px;
}
.rules-tip b {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 6px;
  margin-right: 6px;
}

/* ---------- プレミアムの紹介（トップ） ---------- */
.premium-card { display: flex; gap: 12px; align-items: center; }
.premium-card .mark {
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--purple);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.premium-card .mark b { font-family: var(--display); font-size: 26px; line-height: 1; }
.premium-card .mark small { font-size: 10.5px; font-weight: 800; }
.premium-card .txt { font-size: 13.5px; line-height: 1.65; }
.premium-card .price { color: var(--pink-deep); font-weight: 800; }

/* ---------- フッター ---------- */
.footer { text-align: center; padding: 10px 0 0; }
.footer a { color: var(--ink); font-size: 13px; margin: 0 8px; font-weight: 800; }
.legal { text-align: center; margin: 12px 0 0; line-height: 2; }
.legal a { color: var(--ink); font-size: 11.5px; margin: 0 6px; text-decoration: underline; font-weight: 500; }

/* ---------- 入力 ---------- */
label.lb, .lb { display: block; font-size: 14px; font-weight: 800; margin: 12px 0 6px; }
.card > .lb:first-child { margin-top: 0; }
input.tx, select.tx, textarea.tx {
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
select.tx {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
input.tx:focus, select.tx:focus, textarea.tx:focus { border-color: var(--pink); }
input.tx::placeholder, textarea.tx::placeholder { color: #c9b8c0; font-weight: 500; }
textarea.tx { min-height: 118px; resize: none; line-height: 1.8; border-radius: var(--round); }
input.code {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: .28em;
  text-align: center;
  padding-left: .28em;
  color: var(--pink-deep);
  text-transform: uppercase;
}
.counter { display: block; text-align: right; font-size: 12px; font-weight: 800; color: var(--sub); margin-top: 6px; }
.counter.is-over { color: var(--pink-deep); }

/* ---------- アイコンを選ぶ ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.icon-grid button {
  border: 3px solid transparent;
  border-radius: 16px;
  background: var(--pink-paper);
  padding: 4px;
  cursor: pointer;
  aspect-ratio: 1;
}
.icon-grid button img { width: 100%; border-radius: 12px; }
.icon-grid button.sel { border-color: var(--pink); background: var(--pink-pale); }

/* ---------- 待機室 ---------- */
.code-box {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
  margin: 0 0 16px;
  text-align: center;
}
.code-box__label { font-size: 12.5px; font-weight: 800; color: var(--sub); margin: 0; }
.room-code {
  font-family: var(--display);
  font-size: 44px;
  letter-spacing: .2em;
  padding-left: .2em;
  color: var(--pink-deep);
  margin: 2px 0 8px;
  line-height: 1.25;
}
.players { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pchip { position: relative; text-align: center; font-size: 12.5px; font-weight: 800; }
.pchip img { width: 88%; margin: 4px auto 3px; border-radius: 50%; border: 2px solid var(--ink); }
.pchip .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .host-tag {
  position: absolute;
  top: -2px;
  left: 0;
  background: var(--ink);
  color: var(--gold);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
}
.pchip.me .nm { color: var(--pink-deep); }
.pchip.empty { opacity: .45; }
.pchip.empty .slot {
  width: 88%;
  margin: 4px auto 3px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed var(--ink);
}
.wait-msg { text-align: center; font-weight: 800; font-size: 15px; margin: 14px 0 4px; line-height: 1.6; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- お題 ---------- */
.topic {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 26px 16px 16px;
  margin: 0 0 12px;
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(201, 80, 126, .16) 27px 28px) var(--pink-paper);
}
.topic__badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--pink);
  color: #fff;
  border: 3px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 16px;
  border-radius: 99px;
  white-space: nowrap;
}
.topic__text {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.55;
  margin: 0;
  text-align: center;
}

/* ---------- 投票の基準 ---------- */
.criterion {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--mint-deep);
  background: #e9fbf5;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 9px 14px;
  margin: 0 0 14px;
}

/* ---------- 待っています ---------- */
.waiting { text-align: center; padding: 22px 0 10px; }
.waiting__dots { display: inline-flex; gap: 10px; margin-bottom: 12px; }
.waiting__dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--pink);
  animation: bounce-dot 1.1s ease-in-out infinite;
}
.waiting__dots span:nth-child(2) { background: var(--gold); animation-delay: .15s; }
.waiting__dots span:nth-child(3) { background: var(--mint); animation-delay: .3s; }
@keyframes bounce-dot {
  0%, 60%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-12px) scale(1.12); }
}
.waiting__text { font-size: 16px; font-weight: 800; margin: 0; }
.progress {
  height: 16px;
  background: var(--pink-pale);
  border: 2px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--pink);
  transition: width .6s cubic-bezier(.34, 1.56, .64, 1);
}
.progress-label { text-align: center; font-size: 13px; font-weight: 800; margin: 8px 0 0; }

/* ---------- 投票する（回答のメモ） ---------- */
.answer-list { display: flex; flex-direction: column; gap: 12px; }
.answer-card {
  position: relative;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-s);
  padding: 14px 16px;
  cursor: pointer;
  background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(201, 80, 126, .13) 25px 26px) var(--paper);
  transition: transform .12s ease, box-shadow .12s ease;
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.answer-card:active { transform: translateY(2px); box-shadow: 1px 1px 0 var(--ink); }
.answer-card.sel {
  background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(25, 180, 140, .16) 25px 26px) #e9fbf5;
  box-shadow: 0 0 0 3px #bdf0e2, var(--shadow);
  transform: translateY(-2px);
}
.answer-card.sel::after {
  content: "これ！";
  position: absolute;
  top: -12px;
  right: -6px;
  background: var(--mint);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 10px;
  transform: rotate(4deg);
}
.answer-card.mine {
  background: #f6f1f3;
  border-style: dashed;
  color: #8d7b83;
  cursor: not-allowed;
  box-shadow: none;
  padding-top: 32px;
}
.answer-card.mine::after {
  content: "じぶんの回答";
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #a1919a;
  border-radius: 99px;
  padding: 1px 10px;
}
.answer-list > *:nth-child(2) { animation-delay: .06s; }
.answer-list > *:nth-child(3) { animation-delay: .12s; }
.answer-list > *:nth-child(4) { animation-delay: .18s; }
.answer-list > *:nth-child(5) { animation-delay: .24s; }
.answer-list > *:nth-child(6) { animation-delay: .3s; }
.answer-list > *:nth-child(7) { animation-delay: .36s; }
.answer-list > *:nth-child(8) { animation-delay: .42s; }

/* ---------- 結果発表 ---------- */
.result-card {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-s);
  padding: 14px 16px;
  background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(201, 80, 126, .13) 25px 26px) var(--paper);
  overflow: hidden;
}
.result-card--top {
  background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(217, 168, 0, .18) 25px 26px) #fffbe8;
  box-shadow: var(--shadow);
}
.result-card__answer {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.result-card__reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed var(--line);
  opacity: 0;
  transform: translateY(10px) scale(.86);
}
.result-card.is-revealed .result-card__reveal { animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: translateY(10px) scale(1.3); }
  60% { opacity: 1; transform: translateY(-2px) scale(.94); }
  100% { opacity: 1; transform: none; }
}
.result-card__avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  overflow: hidden;
  display: block;
}
.result-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.result-card__author { font-weight: 800; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-card__votes {
  margin-left: auto;
  flex: none;
  background: var(--mint);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 800;
  padding: 3px 11px;
  white-space: nowrap;
}
.result-card__votes.is-zero { background: #e2d6db; color: var(--sub); }
.result-card__voters {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--sub);
  margin: 9px 0 0;
  opacity: 0;
  transform: translateY(8px);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.result-card.is-revealed .result-card__voters { animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) .12s forwards; }
.result-card__voters b { color: var(--pink-deep); font-weight: 800; }

/* ---------- 順位 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-s);
  padding: 10px 14px;
  animation: slide-in .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
.rank-row__no {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #eadfe3;
  color: var(--sub);
  font-family: var(--display);
  font-size: 15px;
}
.rank-row__no.is-tied { font-size: 12px; }
.rank-row__avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  overflow: hidden;
  display: block;
}
.rank-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-row__name { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row__score { flex: none; font-family: var(--display); font-size: 18px; color: var(--pink-deep); }
.rank-row--1 { background: #fffbe8; box-shadow: var(--shadow); }
.rank-row--1 .rank-row__no { background: var(--gold); color: var(--ink); }
.rank-row--2 .rank-row__no { background: var(--mint); color: #fff; }
.rank-row--3 .rank-row__no { background: var(--purple); color: #fff; }
.rank-list > *:nth-child(2) { animation-delay: .07s; }
.rank-list > *:nth-child(3) { animation-delay: .14s; }
.rank-list > *:nth-child(4) { animation-delay: .21s; }
.rank-list > *:nth-child(5) { animation-delay: .28s; }
.rank-list > *:nth-child(6) { animation-delay: .35s; }
.rank-list > *:nth-child(7) { animation-delay: .42s; }
.rank-list > *:nth-child(8) { animation-delay: .49s; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }

/* ---------- 最終結果 ---------- */
.final-head { text-align: center; margin: 4px 0 14px; }
.final-head .ja {
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  margin: 0;
  color: var(--pink-deep);
}
.final-head .en {
  font-family: var(--en);
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--sub);
  margin: 2px 0 0;
}

/* ---------- 紙吹雪 ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  animation: fall 2.6s linear forwards;
}
.confetti i:nth-child(4n+1) { background: var(--pink); }
.confetti i:nth-child(4n+2) { background: var(--gold); }
.confetti i:nth-child(4n+3) { background: var(--mint); }
.confetti i:nth-child(4n) { background: var(--purple); border-radius: 50%; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(106vh) rotate(680deg); opacity: 0; }
}

/* ---------- お知らせ ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  transform: translate(-50%, 200%);
  background: rgba(26, 26, 26, .94);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 99px;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s;
  max-width: 92vw;
  text-align: center;
  line-height: 1.6;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .25s ease, opacity .25s ease; }
#toast.error { background: var(--pink-deep); }
#toast.ok { background: var(--mint-deep); }

/* ---------- 読み込み中 ---------- */
#loading {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 227, 236, .82);
  z-index: 95;
}
#loading.show { display: flex; }
#loading .spinner {
  width: 46px;
  height: 46px;
  border: 5px solid #fff;
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- プレミアム（ログイン・購入） ---------- */
#premium-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  padding: 16px;
  overflow-y: auto;
}
#premium-modal.show { display: flex; }
.gate__card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  max-width: 400px;
  width: 100%;
  margin: auto;
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
}
.gate__mark {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--purple);
  color: #fff;
  font-family: var(--display);
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate__title { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 12px 0 8px; }
.gate__text { font-size: 13.5px; line-height: 1.75; font-weight: 700; margin: 0 0 12px; }
.pack-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.pack-list li {
  position: relative;
  font-size: 14px;
  font-weight: 800;
  padding: 9px 0 9px 20px;
  border-bottom: 2px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pack-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--purple);
}
.pack-list li span { flex: none; font-size: 12px; font-weight: 700; color: var(--sub); }
.pack-price { font-family: var(--display); font-size: 32px; color: var(--pink-deep); margin: 14px 0 2px; }
.pack-price span { font-family: var(--font); font-size: 14px; font-weight: 800; color: var(--sub); margin-left: 3px; }
.gate__foot { margin-top: 18px; }

/* ---------- 画面が小さいとき ---------- */
@media (max-width: 360px) {
  .catch { font-size: 21px; }
  .topic__text { font-size: 18px; }
  .room-code { font-size: 38px; }
  .answer-card { font-size: 15px; }
  .players, .icon-grid { gap: 6px; }
}

/* ---------- 動きを減らす設定の人へ ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@keyframes pop {
  0% { opacity: 0; transform: scale(.88); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

.av-emoji { font-size: 1.4em; line-height: 1; }

/* カードや案内文の中のリンク（ブラウザの青いままにしない） */
.note a, .gate__card a { color: var(--pink-deep); text-decoration: underline; font-weight: 700; }
.gate__card .note { margin: 8px 0 0; }
.gate__card .pack-list { margin-bottom: 4px; }
