:root {
  --bg: #fffaf2;
  --bg-soft: #fff2df;
  --surface: #ffffff;
  --surface-warm: #fff7ea;
  --text: #2f2a24;
  --muted: #6f675d;
  --line: #eadcc8;
  --primary: #ef7d4f;
  --primary-dark: #cf5f38;
  --accent: #2e9c88;
  --accent-soft: #dff5ef;
  --danger: #c44949;
  --shadow: 0 18px 45px rgba(90, 58, 24, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

button,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 250, 242, 0.94);
  border-bottom: 1px solid rgba(234, 220, 200, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--primary-dark);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow {
  width: min(760px, calc(100% - 32px));
}

.hero,
.page-hero {
  padding: clamp(44px, 9vw, 92px) 0;
}

.hero {
  background:
    linear-gradient(135deg, rgba(255, 244, 224, 0.96), rgba(230, 250, 244, 0.9)),
    var(--bg);
}

.page-hero {
  background: linear-gradient(135deg, var(--surface-warm), #e9f8f4);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.3rem);
  line-height: 1.12;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: 1.12rem;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.18rem);
}

.text-nowrap {
  white-space: nowrap;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.name-button:focus-visible {
  outline: 3px solid rgba(46, 156, 136, 0.35);
  outline-offset: 3px;
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(207, 95, 56, 0.22);
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: var(--accent-soft);
  color: #176d5f;
  border-color: rgba(46, 156, 136, 0.2);
}

.subtle {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
}

.hero-panel {
  min-height: 320px;
  border: 1px solid rgba(234, 220, 200, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mini-amida {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 320px;
  padding: 34px 42px;
}

.mini-amida span {
  justify-self: center;
  width: 7px;
  height: 100%;
  border-radius: 999px;
  background: #f3ad72;
}

.mini-amida .bar {
  position: absolute;
  left: 20%;
  width: 22%;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.mini-amida .b1 { top: 68px; left: 24%; }
.mini-amida .b2 { top: 122px; left: 47%; }
.mini-amida .b3 { top: 172px; left: 24%; }
.mini-amida .b4 { top: 218px; left: 47%; }
.mini-amida .b5 { top: 260px; left: 24%; }

.section {
  padding: clamp(44px, 8vw, 76px) 0;
}

.section-heading {
  margin-bottom: 22px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: block;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(90, 58, 24, 0.08);
  text-decoration: none;
}

.tool-card.ready {
  border-color: rgba(239, 125, 79, 0.35);
}

.tool-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.status {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ffe9dc;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.status.muted {
  background: #f0ede7;
  color: var(--muted);
}

.info-band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prose {
  max-width: 880px;
}

.prose p {
  color: var(--muted);
}

.home-faq {
  max-width: 880px;
}

.home-faq dl {
  margin: 14px 0 0;
}

.home-faq dt {
  margin-top: 14px;
  font-weight: 800;
}

.home-faq dt:first-of-type {
  margin-top: 0;
}

.home-faq dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.guide-section {
  background: var(--bg);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 38px;
}

.guide-grid article {
  min-width: 0;
}

.guide-grid p,
.simple-list {
  color: var(--muted);
}

.simple-list {
  margin: 12px 0 0;
  padding-left: 1.4em;
}

.simple-list li + li {
  margin-top: 6px;
}

.guide-grid h3 {
  margin: 18px 0 4px;
  font-size: 1rem;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.related-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer {
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
}

.amida-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.amida-3d-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(90, 58, 24, 0.08);
}

.input-panel {
  position: relative;
  padding: 18px;
}

.amida-promise {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.amida-promise span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(46, 156, 136, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e8f8f3, #fff7ea);
  color: #176d5f;
  font-size: 0.9rem;
  font-weight: 900;
}

.field + .field {
  margin-top: 18px;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: block;
  font-weight: 800;
}

.hint {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

textarea {
  width: 100%;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 156, 136, 0.16);
}

.form-message {
  min-height: 1.7em;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 800;
}

.form-message.ok {
  color: var(--accent);
}

.button-row .button {
  flex: 1 1 150px;
}

.result-panel {
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.result-header h2 {
  font-size: 1.45rem;
}

.canvas-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0 0;
  background: linear-gradient(#fffdf9, #fffaf2);
}

#amidaSvg {
  display: block;
  min-width: 100%;
  height: auto;
}

.amida-line {
  stroke: #d88b52;
  stroke-width: 5;
  stroke-linecap: round;
}

.amida-rung {
  stroke: #55a997;
  stroke-width: 5;
  stroke-linecap: round;
}

.amida-route {
  fill: none;
  stroke: #e95050;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.name-button rect {
  fill: #ffffff;
  stroke: #eadcc8;
  stroke-width: 1;
}

.name-button text {
  fill: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.name-button.active rect {
  fill: #ffe9dc;
  stroke: #ef7d4f;
  stroke-width: 2;
}

.result-label {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.selected-result {
  margin: 0;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #fffdf9;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.all-results {
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
}

.all-result-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-warm);
  color: var(--muted);
}

.all-result-item strong {
  color: var(--text);
}

.stage-panel {
  overflow: hidden;
  border: 1px solid rgba(234, 220, 200, 0.92);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(71, 47, 23, 0.14);
}

.stage-hud {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fffaf2, #edf9f5);
}

.stage-hud h2 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.stage-status {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  text-align: right;
}

.stage-viewport {
  position: relative;
  min-height: 360px;
  background:
    radial-gradient(circle at 52% 18%, rgba(255, 246, 188, 0.72), transparent 26%),
    linear-gradient(145deg, #fff2dd, #ddf7ef 52%, #fff7ed);
  isolation: isolate;
  overflow: hidden;
}

.stage-viewport::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 1;
}

#amidaCanvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: clamp(340px, 58vw, 560px);
}

.countdown {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(3.6rem, 14vw, 7rem);
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 12px 34px rgba(82, 54, 33, 0.35);
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.countdown.show {
  opacity: 1;
  transform: scale(1);
}

.spotlight-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  gap: 4px;
  max-width: 520px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px rgba(65, 44, 22, 0.16);
  backdrop-filter: blur(10px);
}

.spotlight-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.spotlight-card strong {
  color: var(--text);
  font-size: clamp(1.12rem, 4vw, 1.8rem);
  line-height: 1.25;
}

.result-burst {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 5;
  max-width: min(560px, calc(100% - 32px));
  padding: 18px 22px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary-dark);
  font-size: clamp(1.6rem, 7vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 20px 60px rgba(75, 50, 28, 0.2);
  transform: translate(-50%, -50%) scale(0.72);
}

.result-burst.show {
  animation: result-pop 1.55s ease forwards;
}

.result-burst.special {
  background: #fff3bf;
  color: #9b5b18;
  box-shadow: 0 20px 70px rgba(239, 125, 79, 0.28);
}

.progress-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid rgba(234, 220, 200, 0.9);
  border-bottom: 1px solid rgba(234, 220, 200, 0.9);
  background: #fffaf2;
  color: var(--muted);
  font-weight: 800;
}

#currentResult {
  color: var(--text);
  text-align: right;
}

.live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(234, 220, 200, 0.9);
  background: #fffdf9;
}

.live-actions .button {
  flex: 1 1 190px;
}

.final-results {
  padding: 18px;
  background: #fffdf9;
}

.final-results h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.final-results-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.final-result-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(234, 220, 200, 0.9);
  border-radius: var(--radius);
  background: #fff7ea;
}

.final-result-item strong,
.final-result-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.final-result-item span {
  color: var(--accent);
  font-weight: 900;
  text-align: right;
}

.final-result-item.special {
  border-color: rgba(239, 125, 79, 0.35);
  background: #fff1d2;
}

.final-result-item.special span {
  color: var(--primary-dark);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
  background: #fffdf9;
}

.stage-actions .button {
  flex: 1 1 170px;
}

@keyframes result-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72) rotate(-2deg);
  }
  24% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(1deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -52%) scale(0.94);
  }
}

.coming-soon .page-hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
}

/* ===== Maze (amidakuji) page ===== */
.maze-page {
  background:
    radial-gradient(circle at 80% -10%, rgba(255, 235, 190, 0.60), transparent 55%),
    radial-gradient(circle at -10% 120%, rgba(255, 215, 154, 0.45), transparent 55%),
    linear-gradient(180deg, #fffdf7, #fff0ce 70%, #fff8ea);
  color: #3a2a18;
}

.maze-header {
  min-height: 74px;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid rgba(212, 168, 110, 0.28);
  padding: 12px clamp(18px, 3vw, 32px);
  box-shadow: 0 10px 24px rgba(119, 75, 30, 0.06);
}

.maze-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  color: #3f2615;
  font-weight: 950;
}

.maze-brand-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd12e, #ff8a00);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(239, 125, 79, 0.25);
}

.maze-nav {
  gap: 8px;
}

.maze-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(212, 168, 110, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #6e4a1e;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.maze-nav-pill:hover {
  background: #fff1da;
  border-color: rgba(212, 168, 110, 0.55);
  transform: translateY(-1px);
}

.maze-nav-pill .dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fde2bb;
  color: #ad5a1a;
  font-size: 0.78rem;
  line-height: 1;
}

.maze-main {
  padding: 0 0 24px;
}

.maze-shell {
  display: grid;
  grid-template-columns: minmax(300px, 354px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 22px);
  align-items: start;
  width: min(1488px, calc(100% - 24px));
  margin: clamp(14px, 2vw, 20px) auto 0;
}

.maze-sidebar {
  display: grid;
  gap: 10px;
}

.maze-card {
  padding: 18px 18px 14px;
  border: 1px solid rgba(217, 174, 111, 0.38);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.90);
  box-shadow: 0 12px 28px rgba(142, 90, 39, 0.10);
  backdrop-filter: blur(4px);
}

.maze-card + .maze-card {
  margin-top: 0;
}

.maze-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.maze-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #5b321b;
  font-weight: 950;
}

.maze-card-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #ffffff;
}

.maze-card-icon.people { background: linear-gradient(135deg, #ff9d37, #d85625); }
.maze-card-icon.flag { background: linear-gradient(135deg, #ff7b32, #d63a2c); }
.maze-card-icon.gear { background: linear-gradient(135deg, #7b4d28, #4f321d); }

.maze-card-hint {
  margin: 0 0 12px;
  color: #68472e;
  font-size: 0.92rem;
}

.maze-card textarea {
  width: 100%;
  min-height: 128px;
  padding: 12px 14px;
  border: 1px solid rgba(202, 158, 96, 0.46);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #3a2a18;
  font-size: 1rem;
  resize: vertical;
}

.maze-card textarea:focus {
  border-color: #ef7d4f;
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 125, 79, 0.18);
}

.maze-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.maze-count {
  color: #1877c9;
  font-size: 0.95rem;
  font-weight: 900;
}

.maze-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(212, 168, 110, 0.4);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.85);
  color: #7a5633;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.maze-chip:hover {
  background: #fff6e2;
}

.maze-speed {
  display: grid;
  gap: 8px;
}

.maze-speed-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #6e4a1e;
}

.maze-speed-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.maze-speed-option {
  position: relative;
  display: block;
}

/* The native radio stays focusable but invisible, stretched over the pill so
   the whole chip is clickable. */
.maze-speed-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.maze-speed-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 2px solid #f0dcb8;
  background: #fff7ea;
  color: #8a6534;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.maze-speed-option:hover .maze-speed-pill {
  border-color: #e9b878;
}

.maze-speed-option input:checked + .maze-speed-pill {
  border-color: #e66a12;
  background: linear-gradient(180deg, #ff912b, #ff690d);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(228, 91, 12, 0.3);
}

.maze-speed-option input:focus-visible + .maze-speed-pill {
  outline: 3px solid rgba(230, 106, 18, 0.45);
  outline-offset: 2px;
}

.maze-start-button {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 94px;
  justify-content: center;
  padding: 20px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #ff912b, #ff690d);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 16px 30px rgba(228, 91, 12, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.maze-start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 36px rgba(217, 95, 50, 0.36);
}

.maze-start-button:active {
  transform: translateY(0);
}

.maze-start-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.95rem;
}

.maze-start-text {
  display: grid;
  gap: 2px;
}

.maze-start-text strong {
  font-size: 1.55rem;
  letter-spacing: 0.03em;
}

.maze-start-text small {
  opacity: 0.92;
  font-size: 0.78rem;
  font-weight: 700;
}

.maze-clear-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(212, 168, 110, 0.45);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
  color: #6e4a1e;
  cursor: pointer;
  font-weight: 800;
}

.maze-clear-button:hover {
  background: #fff6e2;
}

.maze-sample-link {
  margin-top: 2px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: #af7530;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-message {
  min-height: 1.4em;
  margin: 0 4px;
  color: #c44949;
  font-weight: 800;
  font-size: 0.92rem;
}

.form-message.ok {
  color: #2e9c88;
}

/* Stage */
.maze-stage {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(116, 68, 26, 0.32);
  background: #0c1726;
  box-shadow: 0 22px 56px rgba(76, 47, 19, 0.22);
  aspect-ratio: 1.08 / 1;
  min-height: min(760px, calc(100vh - 108px));
  isolation: isolate;
}

#amidaCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.maze-three-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.maze-stage.has-three #amidaCanvas {
  opacity: 0;
}

/* Pre-start: the whole shared amida board, drawn large over the dimmed 3D so
   it is obvious this is one amida diagram everyone will walk. */
.amida-board-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, rgba(10, 20, 34, 0.86), rgba(10, 20, 34, 0.74));
  transition: opacity 0.45s ease;
}

.amida-board-head {
  text-align: center;
  color: #ffffff;
  pointer-events: none;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.amida-board-title {
  margin: 0;
  font-size: clamp(1.45rem, 3.2vw, 2.5rem);
  letter-spacing: 0.04em;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 3px 0 rgba(27, 74, 128, 0.55), 0 8px 22px rgba(0, 0, 0, 0.35);
}

.amida-board-label {
  margin: 6px 0 0;
  font-weight: 900;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  color: #ffe07a;
}

.amida-board-sub {
  margin: 3px 0 0;
  font-weight: 700;
  font-size: clamp(0.78rem, 1.4vw, 1rem);
  color: #eaf3ff;
}

.amida-board-canvas {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.maze-stage.is-running .amida-board-overlay {
  opacity: 0;
  pointer-events: none;
}

.sparkle {
  display: inline-block;
  color: #ffe179;
  font-size: 0.7em;
  text-shadow: 0 0 18px rgba(255, 224, 117, 0.85);
  animation: sparkle-pulse 2.4s ease-in-out infinite;
}

.sparkle.right {
  animation-delay: -1.2s;
}

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.92) rotate(-4deg); }
  50% { opacity: 1; transform: scale(1.08) rotate(4deg); }
}

/* During the run: a small live copy of the SAME shared board, so the 3D walk
   reads as moving through an amida diagram (constant grid, only route differs). */
.amida-minimap {
  position: absolute;
  top: 22px;
  left: 22px;
  width: min(208px, 30%);
  border-radius: 16px;
  background: rgba(14, 22, 34, 0.82);
  border: 1px solid rgba(255, 220, 150, 0.32);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.34);
  color: #fff4e0;
  z-index: 6;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  backdrop-filter: blur(6px);
}

.amida-minimap header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  color: #ffd98a;
  border-bottom: 1px solid rgba(255, 220, 150, 0.22);
}

.amida-minimap header > span:first-child {
  white-space: nowrap;
  flex: 0 0 auto;
}

.amida-minimap-now {
  font-size: 0.78rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, #ff9d3c, #ef6f3a);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amida-minimap-now:empty {
  display: none;
}

.amida-minimap-canvas {
  display: block;
  width: 100%;
  height: 132px;
}

.amida-minimap-caption {
  margin: 0;
  padding: 7px 12px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f0e6d4;
}

.maze-stage.is-running .amida-minimap {
  opacity: 1;
}

/* Pre-start, let the board be the focus: the step panel and hint bar only
   appear once a walker is actually moving. */
.maze-stage:not(.is-running) .maze-progress,
.maze-stage:not(.is-running) .maze-hint-bar {
  opacity: 0;
  visibility: hidden;
}

.maze-progress {
  position: absolute;
  top: 22px;
  right: 22px;
  width: min(208px, 28%);
  padding: 0;
  border-radius: 16px;
  background: rgba(255, 255, 250, 0.94);
  border: 1px solid rgba(218, 194, 142, 0.55);
  box-shadow: 0 18px 34px rgba(40, 22, 8, 0.26);
  color: #4a341c;
  z-index: 6;
  backdrop-filter: blur(8px);
}

.maze-progress header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(214, 189, 130, 0.45);
  border-radius: 13px 13px 0 0;
  background: linear-gradient(180deg, #e8ffd8, #f6fff0);
  color: #17853a;
  font-size: 0.95rem;
  font-weight: 900;
}

.maze-progress header span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.maze-progress header span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2e9c88;
  box-shadow: 0 0 10px rgba(46, 156, 136, 0.7);
}

/* Prominent "whose turn is it now" banner at the top of the progress card. */
.maze-progress-now {
  margin: 10px 14px 4px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff3df, #ffe6c6);
  border: 1px solid rgba(239, 125, 58, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.maze-progress-now:not(.active) {
  display: none;
}

.maze-progress-now-count {
  font-size: 0.74rem;
  font-weight: 800;
  color: #a8704a;
  letter-spacing: 0.02em;
}

.maze-progress-now-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #7a4a1e;
}

.maze-progress-now-name strong {
  font-size: 1.2rem;
  font-weight: 900;
  color: #d2541a;
}

.maze-progress-now-dot {
  color: #ef6f3a;
  font-size: 0.78rem;
}

.maze-progress-caption {
  margin: 14px 18px 6px;
  color: #6e563b;
  font-size: 0.85rem;
}

.maze-progress-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  justify-content: center;
  margin: 8px 18px 10px;
}

.maze-progress-number strong {
  font-size: 3rem;
  color: #5a331e;
  font-weight: 900;
}

.maze-progress-number .slash {
  color: #5a331e;
  font-size: 2rem;
}

.maze-progress-number span {
  font-size: 1.15rem;
  font-weight: 800;
  color: #6e4a1e;
}

.maze-progress-unit {
  margin-left: 4px;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: #8b6a44 !important;
}

.maze-progress-bar {
  height: 18px;
  margin: 0 18px 14px;
  border-radius: 999px;
  background: rgba(212, 168, 110, 0.25);
  overflow: hidden;
}

.maze-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #48b135, #7edb69);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.maze-progress-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid rgba(214, 189, 130, 0.45);
  font-size: 0.88rem;
  color: #6e4a1e;
  line-height: 1.3;
  word-break: keep-all;
}

.maze-progress-avatar {
  flex: 0 0 28px;
}

.maze-hint-bar {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  width: min(620px, calc(100% - 80px));
  min-height: 62px;
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.92);
  border: 1px solid rgba(255, 232, 178, 0.85);
  color: #4a2d18;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.55vw, 1.1rem);
  box-shadow: 0 18px 34px rgba(34, 22, 12, 0.28);
  backdrop-filter: blur(10px);
  z-index: 6;
  max-width: calc(100% - 30px);
  text-align: center;
}

.maze-hint-icon {
  font-size: 1.65rem;
}

.maze-stage-controls {
  position: absolute;
  left: 50%;
  bottom: 122px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 7;
}

.maze-pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #6e4a1e;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 6px 18px rgba(40, 22, 8, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.maze-pill-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(40, 22, 8, 0.22);
}

.maze-pill-button.primary {
  background: linear-gradient(135deg, #ffa455, #ef7d4f);
  color: #ffffff;
  border-color: transparent;
}

.maze-pill-button.subtle {
  background: rgba(255, 255, 255, 0.85);
  color: #6e4a1e;
  border-color: rgba(212, 168, 110, 0.4);
}

.maze-burst {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 5;
  max-width: min(540px, calc(100% - 36px));
  padding: 18px 26px;
  border-radius: 18px;
  background: rgba(255, 248, 224, 0.97);
  color: #c45418;
  font-weight: 900;
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  text-align: center;
  letter-spacing: 0.04em;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
}

.maze-burst.show {
  animation: maze-burst-pop 1.8s ease forwards;
}

.maze-burst.special {
  background: linear-gradient(135deg, #fff3bf, #ffd05a);
  color: #9b3d0d;
}

@keyframes maze-burst-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(0.95); }
}

/* Results section */
.maze-results-shell {
  width: min(1380px, calc(100% - 24px));
  margin: 22px auto 0;
  padding: 20px;
  border: 1px solid rgba(212, 168, 110, 0.35);
  border-radius: 22px;
  background: linear-gradient(180deg, #fffaef, #fff3df);
  box-shadow: 0 18px 40px rgba(143, 86, 36, 0.12);
}

.maze-results-shell .wrap {
  width: 100%;
  margin: 0;
}

.maze-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.maze-results-head h2 {
  margin: 0;
  color: #6e4a1e;
}

.maze-results-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.maze-results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.maze-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 110, 0.35);
  background: #ffffff;
}

.maze-result-item strong {
  color: #6e4a1e;
}

.maze-result-item span {
  color: #2e9c88;
  font-weight: 900;
}

.maze-result-item.special {
  background: linear-gradient(135deg, #fff3bf, #ffe28b);
  border-color: rgba(231, 162, 30, 0.5);
}

.maze-result-item.special span {
  color: #9b3d0d;
}

/* Info section */
.maze-info {
  padding: clamp(36px, 6vw, 60px) 0;
}

.maze-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.maze-info-grid article {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(212, 168, 110, 0.32);
}

.maze-info-grid h2 {
  margin: 0 0 8px;
  color: #6e4a1e;
  font-size: 1.2rem;
}

.maze-info-grid p {
  color: #8b6a44;
  margin: 6px 0 0;
}

.maze-info-grid .simple-list {
  color: #8b6a44;
}

.maze-faq-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(212, 168, 110, 0.32);
}

.maze-faq-card h2 {
  margin: 0 0 10px;
  color: #6e4a1e;
  font-size: 1.2rem;
}

.maze-faq-card dl {
  margin: 0;
}

.maze-faq-card dt {
  font-weight: 800;
  margin-top: 12px;
  color: #6e4a1e;
}

.maze-faq-card dt:first-of-type {
  margin-top: 0;
}

.maze-faq-card dd {
  margin: 4px 0 0;
  color: #8b6a44;
}

/* Responsive */
@media (max-width: 980px) {
  .maze-shell {
    grid-template-columns: 1fr;
  }

  .maze-stage {
    min-height: 420px;
  }

  .maze-progress {
    width: min(220px, 44%);
    padding: 0;
  }

  .maze-progress-number strong {
    font-size: 1.6rem;
  }
}

@media (max-width: 640px) {
  .maze-header {
    flex-direction: row;
    align-items: center;
  }

  .maze-nav {
    gap: 4px;
  }

  .maze-nav-pill {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .maze-stage {
    aspect-ratio: 4 / 5;
    min-height: 380px;
    border-radius: 18px;
  }

  .amida-board-overlay {
    padding: 12px 12px 14px;
  }

  .amida-board-title {
    font-size: 1.5rem;
  }

  .amida-minimap {
    top: 10px;
    left: 10px;
    width: min(146px, 42%);
  }

  .amida-minimap header {
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  .amida-minimap-canvas {
    height: 104px;
  }

  .amida-minimap-caption {
    padding: 5px 10px 7px;
    font-size: 0.66rem;
  }

  .maze-progress {
    top: 10px;
    right: 10px;
    width: min(150px, 42%);
  }

  .maze-progress header {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .maze-progress-caption {
    margin: 8px 12px 2px;
    font-size: 0.72rem;
  }

  .maze-progress-number {
    margin: 2px 12px 6px;
  }

  .maze-progress-number strong {
    font-size: 1.4rem;
  }

  .maze-progress-bar {
    height: 12px;
    margin: 0 12px 8px;
  }

  .maze-progress-status {
    padding: 8px 12px;
    font-size: 0.76rem;
  }

  .maze-hint-bar {
    bottom: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 0;
  }

  .maze-stage-controls {
    bottom: 108px;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .amida-layout,
  .amida-3d-layout {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 240px;
  }

  .mini-amida {
    height: 260px;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-nav {
    width: 100%;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 150px;
  }

  .result-header {
    display: block;
  }

  .stage-hud {
    display: block;
  }

  .stage-status {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  #amidaCanvas {
    height: 380px;
  }

  .spotlight-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 12px;
  }

  .progress-strip,
  .final-result-item {
    display: grid;
  }

  #currentResult {
    text-align: left;
  }

  .final-results-list {
    grid-template-columns: 1fr;
  }

  .button-row {
    gap: 8px;
  }

  .button-row .button,
  .stage-actions .button,
  .live-actions .button,
  .hero-actions .button {
    flex-basis: 100%;
    width: 100%;
  }
}

/* ===================================================================
   RABBIT ROULY — roulette page. All rules scoped to .roulette-page /
   .rr-* so amidakuji and other pages are unaffected.
   =================================================================== */
.roulette-page {
  background:
    radial-gradient(1200px 600px at 50% -120px, #fff6e6, transparent),
    linear-gradient(180deg, #fffaf2, #fdf3e6);
  min-height: 100vh;
}

/* ---- Header ---- */
.rr-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(14px, 3vw, 32px);
  background: rgba(255, 252, 246, 0.92);
  border-bottom: 1px solid rgba(234, 220, 200, 0.8);
  backdrop-filter: blur(10px);
}
.rr-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 auto; }
.rr-logo-mark { font-size: 1.5rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.12)); }
.rr-logo-text { font-weight: 900; letter-spacing: 0.02em; color: #3a2a1c; font-size: 1.12rem; }
.rr-logo-text span { color: var(--primary); }
.rr-nav { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; }
.rr-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-weight: 800; font-size: 0.95rem; white-space: nowrap; cursor: pointer; text-decoration: none;
}
.rr-nav-link span { font-size: 0.9em; }
.rr-nav-link:hover { background: #fff0e2; color: var(--primary-dark); }
.rr-nav-link.is-active { color: var(--primary-dark); }
.rr-nav-link.is-active::after {
  content: ""; position: relative;
}
.rr-nav-link.is-active { box-shadow: inset 0 -3px 0 var(--primary); border-radius: 6px; }
.rr-header-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.rr-header-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: #5a4a3a;
  font-weight: 800; font-size: 0.9rem; cursor: pointer;
}
.rr-header-btn:hover { background: #fff6ec; }
.rr-header-btn.icon-only { padding: 8px 11px; }
.rr-header-btn.is-on { background: #fff0d8; color: var(--primary-dark); border-color: rgba(239,125,79,0.4); }

/* ---- Layout ---- */
.rr-main { padding: clamp(16px, 3vw, 30px) clamp(12px, 3vw, 32px) 0; }
.rr-shell {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr) 324px;
  gap: 20px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}
.rr-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.rr-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(90, 58, 24, 0.10);
  padding: 18px;
}
.rr-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rr-card-head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 1.12rem; }
.rr-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; font-size: 0.95rem;
  background: linear-gradient(135deg, #ff9d37, #ef6f3c); color: #fff;
}
.rr-ico.gear { background: linear-gradient(135deg, #8d7a63, #5b4a36); }
.rr-ico.trophy { background: linear-gradient(135deg, #ffcf3f, #ff9d37); }
.rr-ico.clock { background: linear-gradient(135deg, #6db1e6, #4a90e2); }
.rr-ico.mask { background: linear-gradient(135deg, #b07ee0, #8e6fd0); }
.rr-card-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.rr-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 4px 12px; border-radius: 999px;
  background: #ffe1e8; color: #e0436a; font-weight: 900; font-size: 0.88rem;
}

/* ---- Candidate list ---- */
.rr-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.rr-add-row input {
  flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fffdf9; color: var(--text);
}
.rr-add-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,156,136,0.16); }
.rr-add-btn {
  flex: 0 0 auto; min-height: 46px; padding: 10px 18px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #ff6f91, #f2415f); color: #fff; font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 16px rgba(242, 65, 95, 0.3);
}
.rr-add-btn:hover { filter: brightness(1.05); }
.rr-cand-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.rr-cand-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf9;
}
.rr-cand-item.dragging { opacity: 0.5; }
.rr-cand-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(239,125,79,0.25); }
.rr-cand-handle { cursor: grab; color: #c3b8a6; font-size: 1.05rem; flex: 0 0 auto; }
.rr-cand-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.rr-cand-name { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-cand-del {
  flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: #f3ece2; color: #9a8a76; font-weight: 900; cursor: pointer;
}
.rr-cand-del:hover { background: #ffe0e0; color: #d4534f; }
.rr-cand-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.rr-card-foot { display: flex; gap: 8px; }
.rr-chip {
  flex: 1 1 0; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-warm); color: var(--primary-dark);
  font-weight: 800; font-size: 0.9rem; cursor: pointer;
}
.rr-chip:hover { background: #ffe9d6; }

/* ---- Settings ---- */
.rr-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rr-field label { font-weight: 800; }
.rr-field select {
  min-height: 44px; min-width: 130px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #fffdf9; font-weight: 700; cursor: pointer;
}
.rr-template-btn {
  width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px dashed rgba(239,125,79,0.5); border-radius: 12px; background: #fff7ee; color: var(--primary-dark);
  font-weight: 800; cursor: pointer;
}
.rr-template-btn:hover { background: #fff0e0; }
.rr-template-menu { display: grid; gap: 6px; margin-top: 10px; }
.rr-template-item {
  min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font-weight: 700; text-align: left; cursor: pointer;
}
.rr-template-item:hover { background: #fff6ec; border-color: rgba(239,125,79,0.4); }

/* ---- Center ---- */
.rr-col-center { align-items: center; gap: 14px; }
.rr-title-block { text-align: center; }
.rr-title { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 900; color: #2f2a24; }
.rr-title .spark { color: #ff6f91; font-size: 0.55em; vertical-align: middle; margin: 0 0.2em; }
.rr-subtitle { margin: 4px 0 0; color: #ff7a59; font-weight: 800; font-size: clamp(0.95rem, 2vw, 1.15rem); }

.rr-wheel-block { position: relative; width: 100%; display: flex; justify-content: center; }
.rr-wheel-wrap {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  padding: 16px;                         /* wood frame thickness */
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 64%, rgba(0,0,0,0.12) 66%, transparent 68%),
    linear-gradient(145deg, #a06a3a, #6f4423 55%, #4f3019);
  box-shadow: 0 18px 40px rgba(80, 48, 18, 0.32), inset 0 0 0 4px rgba(255, 215, 150, 0.35);
}
.rr-wheel-wrap canvas { display: block; width: 100%; height: 100%; border-radius: 50%; }
.rr-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 46px; z-index: 5;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}
.rr-pointer::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; rotate: 45deg;
  background: radial-gradient(circle at 35% 30%, #ffe79a, #f5b522 55%, #d68f12);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}
.rr-pointer::after {
  content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px; border-radius: 50%; background: #8a5a12;
}
.rr-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 17%; max-width: 92px; aspect-ratio: 1/1; border-radius: 50%; z-index: 4;
  background: radial-gradient(circle at 35% 30%, #fff2c4, #f5c43a 55%, #d6951a);
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(80, 48, 18, 0.4);
}

/* ---- Mascot ---- */
.rr-mascot {
  position: absolute; left: -8px; bottom: -6px; width: clamp(130px, 22%, 188px); z-index: 6;
  pointer-events: none;
  transition: transform 0.2s ease;
}
.rr-rabbit { width: 100%; height: auto; filter: drop-shadow(0 8px 12px rgba(80,48,18,0.25)); }
.rr-rabbit-img { width: 100%; height: auto; display: block; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(80,48,18,0.25)); }
.rr-mascot.is-mischief { animation: rr-wiggle 0.5s ease; }
@keyframes rr-wiggle {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-7deg) translateY(-4px); }
  75% { transform: rotate(7deg) translateY(-4px); }
}
.rr-bubble {
  position: absolute; top: -18px; right: -28px;
  display: grid; padding: 8px 14px; border-radius: 14px; background: #fff;
  border: 2px solid #ffd1a0; box-shadow: 0 6px 14px rgba(80,48,18,0.18);
  text-align: center; line-height: 1.2; opacity: 0; transform: scale(0.7); transition: opacity 0.2s ease, transform 0.2s ease;
}
/* The bubble appears ONLY during a mischief event (.is-pop), never just because
   the toggle is ON or while spinning normally. */
.rr-bubble::after {
  content: ""; position: absolute; bottom: -8px; left: 24px;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid #fff;
}
.rr-bubble-1 { font-weight: 900; color: #3a2a1c; font-size: 0.85rem; }
.rr-bubble-2 { font-weight: 900; color: #e0436a; font-size: 0.95rem; }
.rr-bubble.is-pop { animation: rr-bubble-pop 0.5s ease; opacity: 1; transform: scale(1); }
@keyframes rr-bubble-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---- Start button ---- */
.rr-start-block { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rr-start {
  width: min(100%, 360px); min-height: 72px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 999px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #ff9f43, #f47a1f);
  box-shadow: 0 14px 30px rgba(244, 122, 31, 0.4);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.rr-start:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(244, 122, 31, 0.48); }
.rr-start:active:not(:disabled) { transform: translateY(0); }
.rr-start:disabled { filter: grayscale(0.4); opacity: 0.55; cursor: not-allowed; }
.rr-start-ico { font-size: 1.3rem; }
.rr-start-text { font-size: 1.7rem; font-weight: 900; letter-spacing: 0.04em; }
.rr-start.is-spinning .rr-start-text::after { content: " 🌀"; }
.rr-start-hint { margin: 0; color: var(--muted); font-size: 0.88rem; font-weight: 700; }

/* ---- Result ---- */
.rr-result-card {
  position: relative; text-align: center; padding: 20px 16px 14px;
  border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #fff8ee, #fff);
  overflow: hidden;
}
.rr-result-card.has-result { border-color: rgba(239,125,79,0.5); box-shadow: 0 0 0 3px rgba(255,209,63,0.4), 0 12px 26px rgba(207,95,56,0.16); }
.rr-result-label { margin: 0; color: var(--muted); font-weight: 800; font-size: 0.95rem; }
.rr-result-name {
  margin: 6px 0 4px; font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 900; color: #e23b46;
  overflow-wrap: anywhere; line-height: 1.15;
}
.rr-result-card.is-pop .rr-result-name { animation: rr-pop 0.5s ease; }
@keyframes rr-pop { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); } }
.rr-result-rabbit { width: 96px; height: 96px; margin: 2px auto 0; display: block; }
.rr-result-rabbit-img { width: 96px; height: 96px; object-fit: contain; margin: 2px auto 0; display: block; }
.rr-result-card.has-result .rr-result-rabbit,
.rr-result-card.has-result .rr-result-rabbit-img { animation: rr-bounce 0.6s ease; }
@keyframes rr-bounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
.rr-spark { position: absolute; color: #ffcf3f; font-size: 1.2rem; opacity: 0; }
.rr-result-card.has-result .rr-spark { animation: rr-spark 1.2s ease infinite; }
.rr-spark.s1 { top: 14px; left: 22px; }
.rr-spark.s2 { top: 18px; right: 26px; animation-delay: 0.4s; }
@keyframes rr-spark { 0%,100% { opacity: 0; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.1); } }
.rr-save-btn {
  width: 100%; margin-top: 12px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #5a4a3a; font-weight: 800; cursor: pointer;
}
.rr-save-btn:hover { background: #fff6ec; }

/* ---- History ---- */
.rr-link-btn { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; font-size: 0.9rem; }
.rr-link-btn:hover { text-decoration: underline; }
.rr-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rr-history-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-warm); }
.rr-history-rank { flex: 0 0 24px; text-align: center; font-size: 1rem; color: #b6a892; }
.rr-history-name { flex: 1 1 auto; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-history-time { flex: 0 0 auto; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.rr-history-empty { color: var(--muted); font-size: 0.9rem; background: transparent !important; }

/* ---- Mischief card ---- */
.rr-rare {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #ffd23f, #ff9d37); color: #7a3b00; font-weight: 900; font-size: 0.76rem;
}
.rr-mischief-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rr-mischief-desc { margin: 0; color: var(--muted); font-size: 0.9rem; }
.rr-mischief-desc small { color: #a89a86; font-size: 0.78rem; }
.rr-switch { position: relative; flex: 0 0 auto; display: inline-block; width: 56px; height: 30px; cursor: pointer; }
.rr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rr-switch-track { position: absolute; inset: 0; border-radius: 999px; background: #d8cfbf; transition: background 0.2s ease; }
.rr-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s ease; }
.rr-switch input:checked + .rr-switch-track { background: linear-gradient(135deg, #b07ee0, #8e6fd0); }
.rr-switch input:checked + .rr-switch-track::after { transform: translateX(26px); }
.rr-switch input:focus-visible + .rr-switch-track { outline: 3px solid rgba(142,111,208,0.4); outline-offset: 2px; }

/* ---- Confetti ---- */
.rr-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.rr-confetti-piece { position: absolute; top: -8%; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: rr-confetti-fall 1.5s ease-in forwards; }
@keyframes rr-confetti-fall { 0% { transform: translateY(-10%) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(320px) rotate(540deg); opacity: 0; } }

/* ---- Lower info ---- */
.rr-info { padding: clamp(32px, 6vw, 64px) 0 10px; }
.rr-info .wrap + .wrap { margin-top: clamp(28px, 5vw, 48px); }
.rr-faq dl { margin: 14px 0 0; }
.rr-faq dt { margin-top: 14px; font-weight: 800; }
.rr-faq dt:first-child { margin-top: 0; }
.rr-faq dd { margin: 4px 0 0; color: var(--muted); }

/* ---- Toast ---- */
.rr-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  z-index: 60; max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 999px; background: rgba(47, 42, 36, 0.94); color: #fff;
  font-weight: 800; font-size: 0.92rem; box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.rr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Responsive: stack to one column and reorder ---- */
@media (max-width: 1080px) {
  .rr-shell { display: flex; flex-direction: column; max-width: 620px; }
  .rr-col { display: contents; }
  .rr-title-block { order: 1; }
  .rr-wheel-block { order: 2; }
  .rr-start-block { order: 3; }
  .rr-candidates { order: 4; }
  .rr-result { order: 5; }
  .rr-history { order: 6; }
  .rr-settings { order: 7; }
  .rr-mischief { order: 8; }
  .rr-mascot { width: 120px; }
}

@media (max-width: 760px) {
  .rr-nav { order: 3; width: 100%; margin: 0; }
  .rr-header { flex-wrap: wrap; }
  .rr-header-actions { margin-left: auto; }
}

@media (max-width: 560px) {
  .rr-card { padding: 14px; border-radius: 14px; }
  .rr-start { min-height: 64px; }
  .rr-start-text { font-size: 1.4rem; }
  .rr-mascot { width: 92px; left: -4px; }
  .rr-bubble { right: -14px; top: -10px; }
  .rr-header-btn { padding: 8px 10px; font-size: 0.82rem; }
  .rr-logo-text { font-size: 1rem; }
}

/* ============================================================
   KUJI — paper-draw lottery page. All rules scoped to .kuji-page
   / .kuji-* so they never touch amidakuji or roulette.
   ============================================================ */
.kuji-main { padding: clamp(16px, 3vw, 30px) clamp(12px, 3vw, 24px) 0; }

.kuji-shell {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr) minmax(290px, 340px);
  grid-template-areas: "left center right";
  gap: 18px;
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  align-items: start;
}
.kuji-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kuji-col-left { grid-area: left; }
.kuji-col-center { grid-area: center; align-items: center; text-align: center; }
.kuji-col-right { grid-area: right; }

/* ----- Cards ----- */
.kuji-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(90, 58, 24, 0.08);
}
.kuji-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.kuji-card-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.1rem;
}
.kuji-ico { font-size: 1.1em; }
.kuji-badge {
  background: #fff0e2;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}
.kuji-badge.subtle { background: var(--accent-soft); color: #1f8a76; }
.kuji-card-sub { margin: 0 0 10px; color: var(--muted); font-size: 0.88rem; }

.kuji-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--text);
  line-height: 1.7;
}
.kuji-card textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(239, 125, 79, 0.18);
}

.kuji-card-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kuji-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.kuji-chip:hover { background: #fff0e2; }

.kuji-message { margin: 10px 0 0; font-size: 0.85rem; font-weight: 700; min-height: 1.2em; color: var(--muted); }
.kuji-message.error { color: var(--danger); }
.kuji-message.ok { color: #1f8a76; }

.kuji-field { display: grid; gap: 5px; margin-bottom: 12px; }
.kuji-field label { font-size: 0.85rem; font-weight: 800; color: #6e4a1e; }
.kuji-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.kuji-field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(239, 125, 79, 0.18); }

.kuji-build-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 52px;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff924a, #ef6a35);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.08rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(228, 91, 12, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.kuji-build-button:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(228, 91, 12, 0.34); }
.kuji-build-button:active { transform: translateY(0); }

/* ----- Center: title + box + draw ----- */
.kuji-title-block { margin-bottom: 6px; }
.kuji-title {
  margin: 0;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 900;
  color: #d2541a;
  letter-spacing: 0.02em;
}
.kuji-title .spark { color: #ffc23a; font-size: 0.7em; }
.kuji-lead { margin: 8px auto 0; max-width: 540px; color: var(--muted); font-size: 0.95rem; }

.kuji-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 300px;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}

/* The box */
.kuji-box {
  position: relative;
  width: 240px;
  height: 184px;
  transform-origin: 50% 90%;
}
.kuji-box.is-disabled { filter: grayscale(0.35) opacity(0.85); }
.kuji-box.is-shaking { animation: kuji-shake 0.48s ease-in-out; }

.kuji-box-back {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #5b0f0f, #7a1717 55%, #8c1d1d);
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.kuji-box-papers {
  position: absolute;
  left: 0; right: 0;
  top: 24px;
  height: 56px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.kuji-stage.is-ready .kuji-box-papers { opacity: 1; }
.kuji-box-papers span {
  width: 18px;
  height: 46px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #fffdf3, #f3e7c4);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}
.kuji-box-papers span:nth-child(odd) { transform: translateY(3px) rotate(-4deg); }
.kuji-box-papers span:nth-child(even) { transform: translateY(-2px) rotate(3deg); }

.kuji-box-front {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 122px;
  border-radius: 4px 4px 16px 16px;
  background: linear-gradient(180deg, #e23b30, #c92a23 70%, #b3231d);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 16px 28px rgba(120, 20, 16, 0.4);
  border: 1px solid #a81f1a;
  z-index: 3;
  overflow: hidden;
}
.kuji-box-slot {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 12px;
  border-radius: 999px;
  background: #5a0c0a;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6);
}
.kuji-box-label {
  position: absolute;
  top: 46px;
  left: 0; right: 0;
  text-align: center;
  color: #ffe7a8;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

/* The drawn paper (rises + flips) */
.kuji-paper {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 156px;
  height: 100px;
  margin-left: -78px;
  opacity: 0;
  transform: translateY(8px);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  z-index: 2;
}
.kuji-paper.is-out { opacity: 1; transform: translateY(-128px); z-index: 9; }
.kuji-paper.no-anim, .kuji-paper.no-anim .kuji-paper-flip { transition: none !important; }

.kuji-paper-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
}
.kuji-paper.is-open .kuji-paper-flip { transform: rotateY(180deg); }

.kuji-paper-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #e7d9b4;
  box-shadow: 0 10px 20px rgba(80, 50, 20, 0.28);
  text-align: center;
  word-break: break-word;
}
.kuji-paper-front {
  background: linear-gradient(180deg, #fffef8, #f6ecd0);
  color: #c98a1e;
  font-size: 2.4rem;
  font-weight: 900;
}
.kuji-paper-back {
  background: linear-gradient(180deg, #fffdf2, #fff2c9);
  color: #c0381d;
  font-weight: 900;
  font-size: 1.3rem;
  transform: rotateY(180deg);
}

/* Confetti */
.kuji-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.kuji-confetti-bit {
  position: absolute;
  top: 16%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: kuji-confetti-fall 1.3s ease-in forwards;
}

.kuji-remaining {
  margin: 4px 0 2px;
  font-weight: 800;
  color: #7a4a1e;
  font-size: 0.95rem;
  min-height: 1.2em;
}
.kuji-remaining.is-empty { color: var(--danger); }

.kuji-draw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  min-height: 64px;
  margin: 6px auto 4px;
  padding: 14px 26px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff924a, #ef6a35);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(228, 91, 12, 0.34);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.kuji-draw-button:hover { transform: translateY(-2px); box-shadow: 0 18px 30px rgba(228, 91, 12, 0.4); }
.kuji-draw-button:active { transform: translateY(0); }
.kuji-draw-button:disabled { filter: grayscale(0.5); opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
.kuji-draw-ico { font-size: 1.3em; }
.kuji-draw-hint { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; }

/* ----- Right: result + history ----- */
.kuji-result-box {
  position: relative;
  border-radius: 14px;
  border: 1px dashed rgba(239, 125, 79, 0.5);
  background: linear-gradient(180deg, #fff8ee, #fff1dd);
  padding: 18px 14px;
  text-align: center;
}
.kuji-result-box.is-pop { animation: kuji-pop 0.5s ease; }
.kuji-result-label { margin: 0; font-size: 0.9rem; font-weight: 800; color: #a8704a; }
.kuji-result-name {
  margin: 6px 0 2px;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 900;
  color: #c0381d;
  word-break: break-word;
}
.kuji-result-sub { margin: 0; font-size: 0.9rem; font-weight: 700; color: #7a4a1e; min-height: 1.2em; }
.kuji-result-actions { display: flex; gap: 8px; margin-top: 12px; }
.kuji-pill {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, filter 0.12s;
}
.kuji-pill:hover { transform: translateY(-1px); background: #fff6ec; }
.kuji-pill.primary { background: linear-gradient(135deg, #ffa455, #ef7d4f); color: #fff; border-color: transparent; }
.kuji-pill:disabled { filter: grayscale(0.4); opacity: 0.55; cursor: not-allowed; transform: none; }

.kuji-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kuji-history-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
}
.kuji-history-empty { justify-content: center; color: var(--muted); font-size: 0.88rem; }
.kuji-history-time { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.kuji-history-name { font-weight: 800; color: var(--text); word-break: break-word; }

/* ----- Lower content ----- */
.kuji-info { padding-top: clamp(28px, 6vw, 56px); }
.kuji-faq { margin-top: 8px; }
.kuji-faq h2 { margin-bottom: 8px; }
.kuji-faq dl { margin: 0; }
.kuji-faq dt { font-weight: 800; margin-top: 12px; }
.kuji-faq dd { margin: 4px 0 0; color: var(--muted); }

/* ----- Toast ----- */
.kuji-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: #2f2a24;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
}
.kuji-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes kuji-shake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  18% { transform: translateX(-6px) rotate(-2.4deg); }
  38% { transform: translateX(6px) rotate(2.4deg); }
  58% { transform: translateX(-5px) rotate(-1.8deg); }
  78% { transform: translateX(4px) rotate(1.4deg); }
}
@keyframes kuji-confetti-fall {
  0% { opacity: 0; transform: translateY(-24px) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(240px) rotate(560deg); }
}
@keyframes kuji-pop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ----- Responsive ----- */
@media (max-width: 980px) {
  .kuji-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "center" "left" "right";
    width: min(560px, calc(100% - 24px));
  }
}
@media (max-width: 560px) {
  .kuji-stage { height: 280px; }
  .kuji-box { width: 218px; height: 172px; }
  .kuji-box-front { height: 116px; }
  .kuji-box-label { font-size: 1.35rem; top: 42px; }
  .kuji-draw-button { font-size: 1.2rem; min-height: 60px; }
  .kuji-card { padding: 14px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .kuji-box.is-shaking, .kuji-box.is-swapping { animation: none; }
  .kuji-paper, .kuji-paper-flip { transition-duration: 0.2s; }
  .kuji-confetti-bit { animation-duration: 0.6s; }
}

/* ----- すり替えチャンス (swap-chance gimmick) ----- */
.kuji-swap-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 125, 79, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff4e9, #ffeede);
}
.kuji-swap-label { display: grid; gap: 2px; min-width: 0; }
.kuji-swap-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  color: #c0381d;
  font-size: 0.92rem;
}
.kuji-swap-desc { color: var(--muted); font-size: 0.76rem; line-height: 1.5; }

/* Toggle switch */
.kuji-switch { position: relative; flex: 0 0 auto; width: 52px; height: 30px; cursor: pointer; }
.kuji-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.kuji-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d9ccb8;
  transition: background 0.2s ease;
}
.kuji-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.kuji-switch input:checked + .kuji-switch-track { background: linear-gradient(135deg, #ff9d3c, #ef6f3a); }
.kuji-switch input:checked + .kuji-switch-track::after { transform: translateX(22px); }
.kuji-switch input:focus-visible + .kuji-switch-track { outline: 3px solid rgba(239, 125, 79, 0.45); outline-offset: 2px; }

/* Decoy peek (the slip almost shows the first candidate before pulling back) */
.kuji-paper.is-peek .kuji-paper-flip { transform: rotateY(118deg); }

/* Stronger "gata-gata" shake while the box swaps the slip */
.kuji-box.is-swapping { animation: kuji-shake-hard 0.44s ease-in-out; }
@keyframes kuji-shake-hard {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  12% { transform: translateX(-10px) rotate(-4deg); }
  28% { transform: translateX(10px) rotate(4deg); }
  44% { transform: translateX(-9px) rotate(-3.4deg); }
  60% { transform: translateX(9px) rotate(3deg); }
  76% { transform: translateX(-6px) rotate(-2deg); }
  90% { transform: translateX(5px) rotate(1.6deg); }
}

/* The box's speech bubble ("あれ？" / "すり替え!?") */
.kuji-swap-bubble {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, 6px) scale(0.85);
  z-index: 12;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #ef6f3a;
  color: #c0381d;
  font-weight: 900;
  font-size: 1.05rem;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(120, 40, 16, 0.28);
  opacity: 0;
  pointer-events: none;
}
.kuji-swap-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #ef6f3a;
}
.kuji-swap-bubble.show { animation: kuji-bubble-pop 0.5s ease forwards; }
@keyframes kuji-bubble-pop {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.85); }
  35% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* History "すり替え" tag */
.kuji-history-swap {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #ffe1cf;
  color: #c0381d;
  font-size: 0.7rem;
  font-weight: 900;
}

/* ============================================================
   JUNBAN — order / draft-announcement page. All rules scoped to
   .junban-page / .junban-* so they never touch the other tools.
   ============================================================ */
.junban-main { padding: clamp(16px, 3vw, 30px) clamp(12px, 3vw, 24px) 0; }

.junban-shell {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr) minmax(290px, 340px);
  grid-template-areas: "left center right";
  gap: 18px;
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  align-items: start;
}
.junban-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.junban-col-left { grid-area: left; }
.junban-col-center { grid-area: center; align-items: center; text-align: center; }
.junban-col-right { grid-area: right; }

/* ----- Cards ----- */
.junban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(40, 60, 90, 0.08);
}
.junban-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.junban-card-head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.1rem; }
.junban-ico { font-size: 1.1em; }
.junban-badge {
  background: #e7f0fb;
  color: #2767ad;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}
.junban-badge.subtle { background: #eef4fb; color: #4d6f96; }
.junban-card-sub { margin: 0 0 10px; color: var(--muted); font-size: 0.88rem; }

.junban-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--text);
  line-height: 1.7;
}
.junban-card textarea:focus { outline: none; border-color: #3f8ad8; box-shadow: 0 0 0 3px rgba(63, 138, 216, 0.18); }

.junban-card-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.junban-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.junban-chip:hover { background: #fff0e2; }

.junban-decide-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 52px;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff924a, #ef6a35);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.08rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(228, 91, 12, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.junban-decide-button:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(228, 91, 12, 0.34); }
.junban-decide-button:active { transform: translateY(0); }

.junban-message { margin: 10px 0 0; font-size: 0.85rem; font-weight: 700; min-height: 1.2em; color: var(--muted); }
.junban-message.error { color: var(--danger); }
.junban-message.ok { color: #1f8a76; }

/* Draft toggle */
.junban-swap-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(63, 138, 216, 0.3);
  border-radius: 12px;
  background: linear-gradient(135deg, #eef5fd, #e6f0fb);
}
.junban-swap-label { display: grid; gap: 2px; min-width: 0; }
.junban-swap-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: #2767ad; font-size: 0.92rem; }
.junban-swap-desc { color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.junban-switch { position: relative; flex: 0 0 auto; width: 52px; height: 30px; cursor: pointer; }
.junban-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.junban-switch-track { position: absolute; inset: 0; border-radius: 999px; background: #cdd5df; transition: background 0.2s ease; }
.junban-switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.junban-switch input:checked + .junban-switch-track { background: linear-gradient(135deg, #4a9ae4, #2f7fd1); }
.junban-switch input:checked + .junban-switch-track::after { transform: translateX(22px); }
.junban-switch input:focus-visible + .junban-switch-track { outline: 3px solid rgba(63, 138, 216, 0.45); outline-offset: 2px; }

/* ----- Center: title + stage + announce ----- */
.junban-title-block { margin-bottom: 6px; }
.junban-title { margin: 0; font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 900; color: #2767ad; letter-spacing: 0.02em; }
.junban-title .spark { color: #ffc23a; font-size: 0.7em; }
.junban-lead { margin: 8px auto 0; max-width: 540px; color: var(--muted); font-size: 0.95rem; }

.junban-stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 10px auto 0;
  padding: 26px 20px 28px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1e3a5f, #2b5184 55%, #34639d);
  color: #fff;
  box-shadow: 0 18px 40px rgba(30, 58, 95, 0.32);
  overflow: hidden;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.junban-stage-rank {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffe7a8;
}
.junban-stage-rank.is-gold { color: #ffd24a; text-shadow: 0 0 16px rgba(255, 200, 60, 0.6); }
.junban-stage-rank.is-silver { color: #e3e8ef; text-shadow: 0 0 14px rgba(220, 228, 238, 0.5); }
.junban-stage-rank.is-bronze { color: #f0a967; text-shadow: 0 0 14px rgba(220, 150, 90, 0.5); }
.junban-stage-name {
  margin: 0;
  font-size: clamp(1.9rem, 5.5vw, 2.9rem);
  font-weight: 900;
  line-height: 1.2;
  word-break: break-word;
  animation: junban-name-pop 0.45s ease;
}
.junban-stage-progress { margin: 10px 0 0; font-size: 0.85rem; font-weight: 700; color: rgba(255, 255, 255, 0.78); }

.junban-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.junban-confetti-bit {
  position: absolute;
  top: 14%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: junban-confetti-fall 1.3s ease-in forwards;
}

.junban-announce-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  min-height: 60px;
  margin: 14px auto 4px;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff924a, #ef6a35);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.22rem;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(228, 91, 12, 0.32);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.junban-announce-button:hover { transform: translateY(-2px); box-shadow: 0 18px 30px rgba(228, 91, 12, 0.4); }
.junban-announce-button:active { transform: translateY(0); }
.junban-announce-button:disabled { filter: grayscale(0.4); opacity: 0.6; cursor: not-allowed; box-shadow: none; transform: none; }
.junban-announce-ico { font-size: 1.15em; }
.junban-stage-status { margin: 6px 0 0; color: var(--muted); font-size: 0.84rem; }

/* ----- Right: result list ----- */
.junban-result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.junban-result-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.junban-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
}
.junban-rank-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e7f0fb;
  color: #2767ad;
  font-weight: 900;
  font-size: 0.95rem;
}
.junban-result-item.is-gold { background: linear-gradient(135deg, #fff6da, #ffeaad); border-color: #f0cf6a; }
.junban-result-item.is-silver { background: linear-gradient(135deg, #f6f8fb, #e7ecf3); border-color: #cdd5df; }
.junban-result-item.is-bronze { background: linear-gradient(135deg, #fdeedd, #f6dcc0); border-color: #e0b083; }
.junban-result-item.is-gold .junban-rank-badge,
.junban-result-item.is-silver .junban-rank-badge,
.junban-result-item.is-bronze .junban-rank-badge { background: rgba(255, 255, 255, 0.7); font-size: 1.05rem; }
.junban-rank-name { font-weight: 800; color: var(--text); word-break: break-word; flex: 1; }
.junban-rank-num { flex: 0 0 auto; color: var(--muted); font-size: 0.8rem; font-weight: 700; }

/* Unrevealed slot (during 1番から / 最後から発表) */
.junban-result-item.is-pending { background: #f3f1ec; border-style: dashed; opacity: 0.7; }
.junban-result-item.is-pending .junban-rank-badge { background: #e3ddd2; color: #9a9183; }
.junban-result-item.is-pending .junban-rank-name { color: var(--muted); font-weight: 700; }

.junban-setting-note { margin: 10px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }

.junban-result-actions { display: flex; gap: 8px; margin-top: 12px; }
.junban-pill {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, filter 0.12s;
}
.junban-pill:hover { transform: translateY(-1px); background: #fff6ec; }
.junban-pill.primary { background: linear-gradient(135deg, #ffa455, #ef7d4f); color: #fff; border-color: transparent; }
.junban-pill:disabled { filter: grayscale(0.4); opacity: 0.55; cursor: not-allowed; transform: none; }

/* ----- Lower content ----- */
.junban-info { padding-top: clamp(28px, 6vw, 56px); }
.junban-faq { margin-top: 8px; }
.junban-faq h2 { margin-bottom: 8px; }
.junban-faq dl { margin: 0; }
.junban-faq dt { font-weight: 800; margin-top: 12px; }
.junban-faq dd { margin: 4px 0 0; color: var(--muted); }

/* ----- Toast ----- */
.junban-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: #2f2a24;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
}
.junban-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes junban-name-pop {
  0% { opacity: 0; transform: scale(0.8); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes junban-confetti-fall {
  0% { opacity: 0; transform: translateY(-24px) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(240px) rotate(560deg); }
}
@media (prefers-reduced-motion: reduce) {
  .junban-stage-name { animation: none; }
  .junban-confetti-bit { animation-duration: 0.6s; }
}

/* ----- Responsive ----- */
@media (max-width: 980px) {
  .junban-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "center" "left" "right";
    width: min(560px, calc(100% - 24px));
  }
}
@media (max-width: 560px) {
  .junban-stage { padding: 22px 16px 24px; min-height: 168px; }
  .junban-announce-button { font-size: 1.12rem; min-height: 56px; }
  .junban-card { padding: 14px; border-radius: 14px; }
}
