@font-face {
  font-family: 'Voxup Serif';
  src: url('/assets/fonts/shippori-mincho-b1-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Voxup Sans';
  src: url('/assets/fonts/noto-sans-jp-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Voxup Sans';
  src: url('/assets/fonts/noto-sans-jp-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Voxup Condensed';
  src: url('/assets/fonts/barlow-condensed-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --black-plum: #100b17;
  --stage-velvet: #2a0b1f;
  --deep-velvet: #4a112d;
  --antique-brass: #c49a52;
  --bright-brass: #e6c37a;
  --spotlight: #fff5dc;
  --paper: #f8f2e7;
  --status-teal: #3b7c8c;
  --rose: #bd3d64;
  --ink: #231a26;
  --muted: #766a76;
  --line: rgba(196, 154, 82, 0.32);
  --shadow: 0 28px 70px rgba(16, 11, 23, 0.28);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(196, 154, 82, 0.1), transparent 28rem),
    linear-gradient(180deg, var(--black-plum) 0 35rem, var(--paper) 35rem 100%);
  font-family: 'Voxup Sans', sans-serif;
  line-height: 1.7;
}

button, input { font: inherit; }

button { touch-action: manipulation; }

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  color: var(--black-plum);
  background: var(--spotlight);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.hero {
  position: relative;
  min-height: 35rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--spotlight);
  background:
    linear-gradient(90deg, rgba(83, 14, 43, 0.72), transparent 20% 80%, rgba(83, 14, 43, 0.72)),
    radial-gradient(ellipse at 50% 12%, rgba(255, 245, 220, 0.2), transparent 48%),
    var(--black-plum);
}

.hero::after {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--antique-brass), transparent);
}

.hero__content {
  position: relative;
  z-index: 3;
  width: min(100% - 40px, 1040px);
  padding: 76px 0 110px;
  text-align: center;
}

.hero__kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--antique-brass);
  font-family: 'Voxup Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.hero__title {
  display: flex;
  justify-content: center;
  gap: 0.18em;
  margin: 0;
  font-family: 'Voxup Condensed', 'Arial Narrow', sans-serif;
  font-size: clamp(5.4rem, 17vw, 12rem);
  font-weight: 800;
  line-height: 0.76;
  letter-spacing: -0.075em;
  text-shadow: 0 0 40px rgba(255, 245, 220, 0.16);
}

.hero__title span:last-child {
  color: var(--antique-brass);
  -webkit-text-stroke: 1px var(--bright-brass);
}

.hero__statement {
  margin: 34px 0 26px;
  font-family: 'Voxup Serif', serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.event-facts {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  width: fit-content;
  border: 1px solid rgba(196, 154, 82, 0.45);
  border-radius: 999px;
  background: rgba(16, 11, 23, 0.62);
  backdrop-filter: blur(12px);
}

.event-facts div {
  min-width: 150px;
  padding: 12px 22px 11px;
}

.event-facts div + div { border-left: 1px solid rgba(196, 154, 82, 0.3); }
.event-facts dt { color: var(--antique-brass); font: 700 0.65rem/1 'Voxup Condensed', sans-serif; letter-spacing: 0.18em; }
.event-facts dd { margin: 5px 0 0; font: 600 0.9rem/1.3 'Voxup Sans', sans-serif; }

.hero__beam {
  position: absolute;
  z-index: 1;
  top: -40px;
  width: 20%;
  height: 115%;
  opacity: 0.34;
  transform-origin: top center;
  background: linear-gradient(180deg, rgba(255, 245, 220, 0.8), rgba(255, 245, 220, 0.03) 75%, transparent);
  clip-path: polygon(48% 0, 52% 0, 100% 100%, 0 100%);
  filter: blur(8px);
}

.hero__beam--left { left: 14%; transform: rotate(-10deg); }
.hero__beam--center { left: 40%; width: 22%; opacity: 0.23; }
.hero__beam--right { right: 14%; transform: rotate(10deg); }

.hero__curtain {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 23%;
  background: repeating-linear-gradient(90deg, #240815 0 11%, #58122f 28%, #2a0819 46%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.hero__curtain--left { left: -12%; border-radius: 0 0 80% 0; transform: skewX(-3deg); }
.hero__curtain--right { right: -12%; border-radius: 0 0 0 80%; transform: skewX(3deg); }

.main-shell {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  width: min(100% - 32px, 1180px);
  margin: -70px auto 80px;
  align-items: start;
}

.vote-panel,
.guide-panel {
  background: rgba(255, 253, 248, 0.98);
  border: 1px solid rgba(196, 154, 82, 0.42);
  box-shadow: var(--shadow);
}

.vote-panel { padding: clamp(24px, 4vw, 52px); border-radius: var(--radius-lg); }
.guide-panel { position: sticky; top: 24px; padding: 30px 26px; border-radius: var(--radius-md); }

.panel-heading,
.selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h2,
.selection-heading h3,
.state-view h3,
.guide-panel h2,
.review-dialog h2 {
  margin: 0;
  font-family: 'Voxup Serif', serif;
  line-height: 1.35;
}

.panel-heading h2 { font-size: clamp(1.55rem, 4vw, 2.35rem); }

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  background: #efe9e3;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.live-status__dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.live-status[data-state='open'] { color: #fff; background: var(--rose); }
.live-status[data-state='open'] .live-status__dot { animation: pulse 1.45s ease-in-out infinite; }
.live-status[data-state='complete'] { color: #fff; background: var(--status-teal); }

.round-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 30px 0 34px;
  padding: 0;
  list-style: none;
}

.round-progress li {
  position: relative;
  min-height: 56px;
  padding: 11px 14px;
  color: var(--muted);
  background: #f1ece7;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 0.76rem;
}

.round-progress strong { display: block; color: var(--ink); font-size: 0.9rem; }
.round-progress li[data-status='open'] { color: var(--deep-velvet); background: #fff7e7; border-color: var(--antique-brass); }
.round-progress li[data-status='closed'] { color: #356975; background: #e6f0f0; }
.round-progress li[data-status='open']::after { content: '受付中'; position: absolute; top: 8px; right: 10px; color: var(--rose); font-weight: 800; }

.notice {
  margin: 0 0 22px;
  padding: 13px 16px;
  color: #294f58;
  background: #edf6f6;
  border-left: 4px solid var(--status-teal);
  border-radius: 8px;
  font-size: 0.9rem;
}

.notice--error { color: #7b213f; background: #fff0f3; border-left-color: var(--rose); }

.state-view { padding: clamp(28px, 6vw, 58px) 12px 22px; text-align: center; }
.state-view__label { margin: 0 0 8px; color: var(--antique-brass); font: 700 0.74rem/1 'Voxup Condensed', sans-serif; letter-spacing: 0.22em; }
.state-view h3 { font-size: clamp(1.35rem, 4vw, 2rem); }
.state-view > p:not(.state-view__label):not(.microcopy) { max-width: 580px; margin: 14px auto 24px; color: var(--muted); }

.waiting-stage { display: flex; justify-content: center; gap: 22px; height: 88px; margin-bottom: 18px; overflow: hidden; }
.waiting-stage span { width: 42px; background: linear-gradient(180deg, rgba(196, 154, 82, 0.05), rgba(196, 154, 82, 0.45)); clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); transform-origin: top center; }
.waiting-stage span:first-child { transform: rotate(-12deg); }
.waiting-stage span:last-child { transform: rotate(12deg); }

.button {
  min-height: 48px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:focus-visible, .candidate-card:focus-visible, input:focus-visible, .dialog-close:focus-visible { outline: 3px solid #6eb6c5; outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: 0.42; }
.button--primary { color: var(--spotlight); background: linear-gradient(135deg, #431029, #160b19); box-shadow: 0 10px 24px rgba(42, 11, 31, 0.24); }
.button--secondary { color: var(--stage-velvet); background: transparent; border-color: var(--antique-brass); }

.microcopy { margin: 15px auto 0; color: var(--muted); font-size: 0.76rem; }

.name-field {
  max-width: 560px;
  margin: 0 auto 34px;
  padding: 20px;
  background: #f6f0e9;
  border-radius: 15px;
}

.name-field label { display: block; margin-bottom: 7px; font-weight: 800; }
.name-field input { width: 100%; min-height: 50px; padding: 10px 14px; color: var(--ink); background: #fff; border: 1px solid #cabfc4; border-radius: 9px; font-size: 1rem; }
.name-field p { margin: 7px 0 0; color: var(--muted); font-size: 0.76rem; }

.selection-heading { margin-bottom: 18px; }
.selection-count { flex: 0 0 auto; min-width: 98px; padding: 9px 13px; color: var(--deep-velvet); background: #f4e7d2; border-radius: 999px; text-align: center; font-weight: 800; }
.selection-count[data-complete='true'] { color: #fff; background: var(--status-teal); }

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

.candidate-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #e8e0da;
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  isolation: isolate;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.candidate-card:hover { transform: translateY(-3px); }
.candidate-card::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: -70% 10% 36%;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 0, rgba(255, 245, 220, 0.9), rgba(230, 195, 122, 0.24) 46%, transparent 70%);
  transform: scaleY(0.7);
  transform-origin: top;
  pointer-events: none;
  transition: opacity 220ms ease, transform 300ms ease;
}

.candidate-card[aria-pressed='true'] {
  border-color: var(--bright-brass);
  box-shadow: 0 0 0 3px rgba(196, 154, 82, 0.18), 0 14px 30px rgba(42, 11, 31, 0.24);
  transform: translateY(-4px);
}

.candidate-card[aria-pressed='true']::before { opacity: 1; transform: scaleY(1); }

.candidate-card__visual { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: linear-gradient(145deg, #362333, #8c5c69); }
.candidate-card__visual img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.86) contrast(1.03); }
.candidate-card__monogram { display: grid; place-items: center; width: 100%; height: 100%; color: rgba(255, 245, 220, 0.9); font: 700 clamp(3rem, 7vw, 5rem)/1 'Voxup Serif', serif; }
.candidate-card__check { position: absolute; z-index: 3; top: 9px; right: 9px; display: grid; place-items: center; width: 30px; height: 30px; color: var(--black-plum); background: var(--spotlight); border: 2px solid var(--antique-brass); border-radius: 50%; opacity: 0; transform: scale(0.75); transition: 180ms ease; }
.candidate-card[aria-pressed='true'] .candidate-card__check { opacity: 1; transform: scale(1); }
.candidate-card__name { position: relative; z-index: 4; display: block; min-height: 50px; padding: 12px 10px; color: var(--spotlight); background: var(--black-plum); font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.vote-actions { display: grid; justify-items: center; gap: 20px; margin-top: 30px; }
.turnstile-container { min-height: 66px; }

.receipt-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 18px; color: var(--spotlight); background: var(--status-teal); border-radius: 50%; font-size: 2rem; }
.submitted-candidates, .review-candidates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 540px; margin: 24px auto; }
.submitted-candidates div, .review-candidates div { padding: 16px 8px; color: var(--spotlight); background: var(--black-plum); border: 1px solid var(--antique-brass); border-radius: 12px; font-weight: 800; }
.receipt-detail { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 520px; margin: 22px auto 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.receipt-detail div { padding: 14px; }
.receipt-detail div + div { border-left: 1px solid var(--line); }
.receipt-detail dt { color: var(--muted); font-size: 0.68rem; }
.receipt-detail dd { margin: 2px 0 0; font-family: 'Voxup Condensed', sans-serif; font-weight: 800; }

.guide-panel h2 { font-size: 1.45rem; }
.guide-list { margin: 26px 0 30px; padding: 0; list-style: none; }
.guide-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.guide-list li:last-child { border-bottom: 1px solid var(--line); }
.guide-list li > span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--spotlight); background: var(--stage-velvet); border-radius: 50%; font: 700 1rem/1 'Voxup Condensed', sans-serif; }
.guide-list strong { display: block; font-size: 0.9rem; }
.guide-list p { margin: 3px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }
.privacy-note { padding: 18px; color: #574953; background: #f3ece5; border-radius: 12px; font-size: 0.72rem; line-height: 1.65; }
.privacy-note strong { color: var(--deep-velvet); font-size: 0.78rem; }
.privacy-note p { margin: 5px 0 0; }

.footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px max(20px, calc((100% - 1180px) / 2)); color: rgba(255, 245, 220, 0.64); background: var(--black-plum); border-top: 1px solid rgba(196, 154, 82, 0.25); font-size: 0.76rem; }
.footer p { margin: 0; }
.footer a { color: var(--spotlight); }

.review-dialog { width: min(92vw, 680px); padding: 0; color: var(--ink); background: var(--spotlight); border: 1px solid var(--antique-brass); border-radius: 22px; box-shadow: 0 34px 100px rgba(0, 0, 0, 0.5); }
.review-dialog::backdrop { background: rgba(10, 5, 12, 0.78); backdrop-filter: blur(5px); }
.review-dialog__body { position: relative; padding: clamp(26px, 5vw, 46px); text-align: center; }
.review-dialog__body > p:not(.eyebrow) { color: var(--muted); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 1.6rem; cursor: pointer; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-top: 24px; }

.sp-only { display: none; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
}

@media (max-width: 900px) {
  .main-shell { grid-template-columns: 1fr; }
  .guide-panel { position: static; }
}

@media (max-width: 640px) {
  body { background: linear-gradient(180deg, var(--black-plum) 0 29rem, var(--paper) 29rem 100%); }
  .hero { min-height: 29rem; }
  .hero__content { padding: 58px 0 94px; }
  .hero__title { font-size: clamp(5rem, 25vw, 7.5rem); }
  .hero__statement { font-size: 1.1rem; }
  .event-facts { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; border-radius: 18px; }
  .event-facts div { min-width: 0; padding: 10px 8px; }
  .event-facts div + div { border-left: 1px solid rgba(196, 154, 82, 0.3); }
  .event-facts div:last-child { grid-column: 1 / -1; border-top: 1px solid rgba(196, 154, 82, 0.3); border-left: 0; }
  .hero__curtain { width: 28%; }
  .main-shell { width: min(100% - 20px, 1180px); margin-top: -58px; }
  .vote-panel { padding: 24px 16px; border-radius: 20px; }
  .panel-heading { align-items: flex-start; }
  .panel-heading h2 { font-size: 1.42rem; }
  .live-status { padding: 7px 10px; font-size: 0.7rem; }
  .round-progress { gap: 6px; margin: 24px 0; }
  .round-progress li { min-height: 52px; padding: 8px; font-size: 0.64rem; }
  .round-progress strong { font-size: 0.76rem; }
  .round-progress li[data-status='open']::after { position: static; display: block; }
  .selection-heading { align-items: flex-end; }
  .selection-heading h3 { font-size: 1.15rem; }
  .selection-count { min-width: 78px; padding: 7px 9px; font-size: 0.78rem; }
  .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .candidate-card__name { min-height: 46px; padding: 10px 6px; font-size: 0.9rem; }
  .submitted-candidates, .review-candidates { gap: 6px; }
  .submitted-candidates div, .review-candidates div { padding: 12px 4px; font-size: 0.78rem; }
  .receipt-detail { grid-template-columns: 1fr; }
  .receipt-detail div + div { border-top: 1px solid var(--line); border-left: 0; }
  .dialog-actions { grid-template-columns: 1fr; }
  .footer { display: block; text-align: center; }
  .footer p + p { margin-top: 6px; }
  .sp-only { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
