:root {
  --wine-950: #320711;
  --wine-900: #480b17;
  --wine-800: #5d101d;
  --wine-700: #761727;
  --wine-600: #92293b;
  --wine-400: #bd6672;
  --gold-700: #9a7332;
  --gold-500: #c7a459;
  --gold-300: #e4cd94;
  --gold-100: #f4ead0;
  --ivory: #fffaf1;
  --paper: #fbf4e9;
  --paper-deep: #f2e6d4;
  --ink: #342328;
  --muted: #77656a;
  --success: #356d52;
  --line: rgba(117, 75, 52, .18);
  --shadow: 0 24px 70px rgba(25, 3, 9, .28);
  --serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% -10%, rgba(165, 66, 83, .48), transparent 34rem),
    linear-gradient(160deg, var(--wine-800) 0%, var(--wine-950) 58%, #24050c 100%);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: .28;
  background-image:
    linear-gradient(90deg, transparent 49.7%, rgba(255, 245, 220, .04) 50%, transparent 50.3%),
    radial-gradient(circle, rgba(255, 255, 255, .08) 0 1px, transparent 1.5px);
  background-size: 100% 100%, 28px 28px;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold-300);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  -webkit-user-drag: none;
}

.hidden {
  display: none !important;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.light-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  background: radial-gradient(circle, rgba(244, 220, 158, .18), transparent 68%);
}

.light-orb-one {
  width: 28rem;
  height: 28rem;
  top: 12%;
  left: -17rem;
}

.light-orb-two {
  width: 32rem;
  height: 32rem;
  right: -21rem;
  top: 48%;
}

.story-path {
  position: absolute;
  width: 42rem;
  height: 16rem;
  border: 1px solid rgba(229, 204, 145, .13);
  border-color: rgba(229, 204, 145, .13) transparent transparent;
  border-radius: 50%;
  transform: rotate(-24deg);
}

.story-path::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  top: -3px;
  left: 47%;
  border-radius: 50%;
  background: var(--gold-300);
  box-shadow: 0 0 18px rgba(229, 204, 145, .9);
}

.story-path-one {
  top: 21rem;
  left: -20rem;
}

.story-path-two {
  right: -24rem;
  bottom: 14rem;
  transform: rotate(156deg);
}

.page-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 12px calc(52px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  padding: 12px 12px 34px;
  text-align: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  top: 78px;
  width: clamp(42px, 13vw, 86px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}

.hero::before {
  left: 3%;
}

.hero::after {
  right: 3%;
  transform: scaleX(-1);
}

.hero-crest {
  width: 112px;
  height: 112px;
  margin: 0 auto 19px;
  padding: 4px;
  border: 1px solid rgba(229, 204, 145, .55);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(229, 204, 145, .05), 0 18px 42px rgba(16, 1, 5, .3);
}

.hero-crest img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.chapter-kicker,
.section-label {
  margin: 0;
  color: var(--gold-500);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  line-height: 1.5;
}

.hero h1 {
  margin: 9px auto 0;
  max-width: 620px;
  color: var(--ivory);
  font-size: clamp(35px, 9.7vw, 63px);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: .98;
  text-wrap: balance;
}

.hero h1 span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-300);
  font-size: .34em;
  font-style: italic;
  letter-spacing: .12em;
  line-height: 1.3;
}

.hero-copy {
  margin: 18px 0 0;
  color: rgba(255, 250, 241, .8);
  font-size: 13px;
  line-height: 1.9;
}

.period-ribbon {
  width: min(100%, 390px);
  margin: 22px auto 0;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid rgba(229, 204, 145, .35);
  border-bottom: 1px solid rgba(229, 204, 145, .35);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .12em;
}

.period-ribbon span {
  color: var(--gold-300);
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
}

.period-ribbon strong {
  font-weight: 600;
}

.book-panel {
  position: relative;
  color: var(--ink);
  border: 1px solid rgba(229, 204, 145, .72);
  border-radius: 3px 22px 3px 22px;
  background:
    linear-gradient(90deg, rgba(128, 81, 51, .035) 0, transparent 4%, transparent 96%, rgba(128, 81, 51, .035) 100%),
    var(--paper);
  box-shadow: var(--shadow), inset 0 0 0 5px rgba(255, 255, 255, .35);
}

.book-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(154, 115, 50, .16);
  border-radius: 1px 14px 1px 14px;
}

.book-panel > * {
  position: relative;
  z-index: 1;
}

#votePanel {
  padding: 25px 15px 21px;
}

.page-corner {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  overflow: hidden;
  pointer-events: none;
}

.page-corner::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 60px;
  height: 60px;
  transform: rotate(45deg);
  border: 1px solid rgba(154, 115, 50, .28);
  background: linear-gradient(135deg, var(--gold-100), var(--paper-deep));
  box-shadow: 0 5px 14px rgba(66, 34, 21, .12);
}

.section-heading {
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-number {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--wine-700);
  border: 1px solid rgba(154, 115, 50, .5);
  border-radius: 50%;
  font-size: 13px;
  font-style: italic;
}

.section-heading h2,
.progress-heading h3 {
  margin: 2px 0 0;
  color: var(--wine-800);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.25;
}

.compact-heading {
  padding: 0;
}

.compact-heading h2 {
  font-size: 22px;
}

.status-box {
  min-height: 61px;
  margin: 18px 3px 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--wine-800);
  white-space: pre-line;
  text-align: center;
  border: 1px solid rgba(117, 75, 52, .16);
  border-radius: 12px;
  background: rgba(255, 252, 246, .76);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
}

.status-box.error {
  color: #8b202d;
  border-color: rgba(139, 32, 45, .28);
  background: rgba(255, 239, 238, .78);
}

.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(118, 23, 39, .16);
  border-top-color: var(--wine-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.secondary-button {
  min-height: 42px;
  padding: 9px 18px;
  color: var(--wine-800);
  border: 1px solid rgba(118, 23, 39, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#retryButton {
  margin: 0 auto 15px;
  display: block;
}

.story-progress {
  margin: 15px 3px 20px;
  padding: 16px;
  border: 1px solid rgba(154, 115, 50, .3);
  border-radius: 2px 16px 2px 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(199, 164, 89, .12), transparent 44%),
    rgba(255, 253, 248, .78);
}

.progress-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.progress-heading h3 {
  font-size: 18px;
}

.progress-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--wine-800);
  white-space: nowrap;
}

.progress-count strong {
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.progress-count span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
}

.progress-track {
  height: 7px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(118, 23, 39, .1);
  box-shadow: inset 0 1px 2px rgba(52, 35, 40, .1);
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wine-700), var(--gold-500));
  transition: width .7s cubic-bezier(.2, .75, .25, 1);
}

.progress-meta {
  margin-top: 13px;
  display: grid;
  grid-template-columns: .78fr 1.4fr;
  gap: 8px;
}

.progress-meta p {
  margin: 0;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid rgba(199, 164, 89, .52);
  background: rgba(244, 234, 208, .25);
}

.progress-meta span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .09em;
}

.progress-meta strong {
  color: var(--wine-800);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.candidate-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.candidate-card {
  width: 100%;
  min-height: 132px;
  padding: 9px 11px 9px 9px;
  display: grid;
  grid-template-columns: 91px minmax(0, 1fr) 27px;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  border: 1px solid rgba(117, 75, 52, .2);
  border-radius: 2px 17px 2px 17px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, .86), rgba(249, 239, 224, .66)),
    var(--paper);
  box-shadow: 0 8px 24px rgba(62, 29, 28, .065);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.candidate-card:active:not(:disabled) {
  transform: scale(.992);
}

.candidate-card:disabled {
  cursor: default;
  opacity: .58;
}

.candidate-card.selected {
  border-color: rgba(118, 23, 39, .74);
  background:
    radial-gradient(circle at 96% 0, rgba(199, 164, 89, .2), transparent 36%),
    linear-gradient(105deg, #fffefa, #f8ead9);
  box-shadow: 0 13px 30px rgba(82, 19, 31, .15), inset 0 0 0 2px rgba(118, 23, 39, .05);
  transform: translateY(-1px);
}

.profile-frame {
  position: relative;
  width: 91px;
  height: 112px;
  overflow: hidden;
  border-radius: 1px 13px 1px 13px;
  background: #eee4dc;
}

.profile-frame::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 1px 9px 1px 9px;
}

.profile-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.candidate-info {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 8px;
}

.candidate-chapter {
  color: var(--gold-700);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .17em;
}

.candidate-name {
  margin: 0;
  color: var(--wine-800);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .08em;
}

.candidate-hint {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.4;
}

.selection-mark {
  width: 25px;
  height: 25px;
  position: relative;
  border: 1.5px solid rgba(118, 23, 39, .34);
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
}

.selected .selection-mark {
  border-color: var(--wine-700);
  box-shadow: 0 0 0 4px rgba(118, 23, 39, .08);
}

.selected .selection-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--wine-700);
}

.vote-action {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 6;
  margin: 17px 0 0;
  padding: 7px;
  border: 1px solid rgba(199, 164, 89, .3);
  border-radius: 999px;
  background: rgba(251, 244, 233, .88);
  box-shadow: 0 9px 30px rgba(49, 7, 17, .16);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
}

.submit-button {
  width: 100%;
  min-height: 55px;
  padding: 10px 18px;
  color: var(--ivory);
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .08), transparent 25%, transparent 75%, rgba(255, 255, 255, .08)),
    linear-gradient(135deg, var(--wine-600), var(--wine-900));
  box-shadow: 0 10px 24px rgba(72, 11, 23, .25), inset 0 0 0 1px rgba(229, 204, 145, .24);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
}

.submit-button:active:not(:disabled) {
  transform: scale(.987);
}

.submit-button:disabled {
  opacity: .45;
  box-shadow: none;
  cursor: default;
}

.vote-note {
  margin: 14px 5px 0;
  color: var(--muted);
  text-align: center;
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.7;
}

.ornament-divider {
  margin: 28px 0 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ornament-divider::before,
.ornament-divider::after {
  content: "";
  width: min(31%, 140px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154, 115, 50, .5));
}

.ornament-divider::after {
  transform: scaleX(-1);
}

.ornament-divider span {
  width: 8px;
  height: 8px;
  margin: 0 11px;
  transform: rotate(45deg);
  border: 1px solid var(--gold-500);
  background: var(--paper);
}

.reward-section {
  padding: 0 4px 5px;
}

.reward-intro {
  margin: 12px 0 15px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
}

.reward-timeline {
  display: grid;
  gap: 9px;
}

.reward-item {
  position: relative;
  min-height: 76px;
  padding: 12px 10px 11px 59px;
  border: 1px solid rgba(117, 75, 52, .16);
  border-radius: 2px 13px 2px 13px;
  background: rgba(255, 253, 248, .7);
}

.reward-item::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 52px;
  bottom: -16px;
  width: 1px;
  background: rgba(154, 115, 50, .28);
}

.reward-item:last-child::before {
  display: none;
}

.reward-medallion {
  width: 37px;
  height: 37px;
  position: absolute;
  left: 11px;
  top: 13px;
  display: grid;
  place-items: center;
  color: var(--wine-800);
  border: 1px solid rgba(154, 115, 50, .54);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
}

.reward-copy {
  min-width: 0;
}

.reward-chapter {
  color: var(--gold-700);
  font-size: 9px;
  font-style: italic;
}

.reward-title-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reward-title-row h4 {
  margin: 0;
  color: var(--wine-800);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.reward-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--muted);
  border: 1px solid rgba(117, 75, 52, .16);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
}

.reward-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.55;
}

.reward-item.earned {
  border-color: rgba(154, 115, 50, .48);
  background:
    radial-gradient(circle at 100% 0, rgba(199, 164, 89, .17), transparent 45%),
    #fffdf8;
}

.reward-item.earned .reward-medallion {
  color: var(--ivory);
  border-color: var(--gold-500);
  background: linear-gradient(135deg, var(--wine-600), var(--wine-900));
  box-shadow: 0 5px 13px rgba(72, 11, 23, .18);
}

.reward-item.earned .reward-badge {
  color: var(--success);
  border-color: rgba(53, 109, 82, .3);
  background: rgba(53, 109, 82, .07);
}

.reward-asset-link {
  margin-top: 8px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  color: var(--ivory);
  text-decoration: none;
  border-radius: 999px;
  background: var(--wine-800);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
}

.completion-view {
  animation: pageReveal .55s cubic-bezier(.2, .75, .22, 1) both;
  transform-origin: left center;
}

@keyframes pageReveal {
  from { opacity: 0; transform: perspective(900px) rotateY(4deg) translateY(10px); }
  to { opacity: 1; transform: perspective(900px) rotateY(0) translateY(0); }
}

body.completion-mode .hero {
  padding-bottom: 20px;
}

body.completion-mode .hero-copy,
body.completion-mode .period-ribbon {
  display: none;
}

body.completion-mode .hero-crest {
  width: 76px;
  height: 76px;
  margin-bottom: 13px;
}

body.completion-mode .hero h1 {
  font-size: 30px;
}

.completion-card {
  overflow: hidden;
}

.completion-chapter-label {
  padding: 15px 16px 11px;
  color: var(--gold-700);
  text-align: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
}

.completion-media {
  min-height: 240px;
  padding: 8px 8px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 25%, #fff 0%, #fff 45%, var(--paper-deep) 100%);
}

.completion-photo {
  width: 100%;
  height: auto;
  max-height: min(59svh, 600px);
  display: block;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 2px 14px 0 0;
  opacity: 0;
  transition: opacity .3s ease;
}

.completion-photo.loaded {
  opacity: 1;
}

.photo-loader {
  position: absolute;
  top: 27%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--wine-700);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .07em;
}

.completion-summary {
  padding: 18px 16px 20px;
  text-align: center;
  border-top: 1px solid rgba(117, 75, 52, .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(251, 244, 233, .9));
}

.completion-finalist {
  margin: 0;
  color: var(--gold-700);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .17em;
}

.completion-name {
  margin: 5px 0 12px;
  color: var(--wine-800);
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 500;
  line-height: 1.1;
}

.success-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-family: var(--sans);
  font-size: 13px;
}

.success-mark span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--success);
  font-size: 12px;
}

.completion-progress {
  margin: 15px auto 0;
  width: min(100%, 390px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(154, 115, 50, .3);
  border-bottom: 1px solid rgba(154, 115, 50, .3);
}

.completion-progress p {
  margin: 0;
  padding: 11px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.completion-progress p + p {
  border-left: 1px solid rgba(154, 115, 50, .22);
}

.completion-progress span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .08em;
}

.completion-progress strong {
  color: var(--wine-800);
  font-size: 18px;
  font-weight: 500;
}

.completion-next {
  margin: 12px 0 0;
  color: var(--wine-700);
  font-size: 13px;
  line-height: 1.55;
}

.vote-time {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 8px;
}

.new-reward-panel,
.completion-rewards,
.share-section {
  margin-top: 15px;
  padding: 23px 19px;
}

.new-reward-panel {
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% -15%, rgba(199, 164, 89, .24), transparent 48%),
    var(--paper);
}

.new-reward-panel h3,
.share-section h3 {
  margin: 5px 0 12px;
  color: var(--wine-800);
  font-size: 22px;
  font-weight: 500;
}

.new-reward-chip {
  margin: 6px 4px 0;
  padding: 9px 13px;
  display: inline-flex;
  color: var(--wine-800);
  border: 1px solid rgba(154, 115, 50, .42);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
}

.image-reward-unlock {
  margin-top: 14px;
  padding: 18px 13px 16px;
  border: 1px solid rgba(154, 115, 50, .44);
  border-radius: 3px 22px 3px 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(232, 203, 128, .24), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(253, 247, 235, .93));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .55), 0 14px 34px rgba(72, 11, 23, .12);
}

.image-reward-unlock-chapter {
  margin: 0 0 5px;
  color: var(--gold-700);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
}

.image-reward-unlock h4 {
  margin: 0;
  color: var(--wine-900);
  font-size: clamp(21px, 6vw, 27px);
  font-weight: 500;
}

.image-reward-unlock-message {
  margin: 9px auto 14px;
  max-width: 31em;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.75;
}

.image-reward-unlock-frame {
  position: relative;
  width: min(100%, 330px);
  margin: 0 auto;
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(154, 115, 50, .42);
  border-radius: 2px 16px 2px 16px;
  background: #fffaf1;
  box-shadow: 0 12px 28px rgba(72, 11, 23, .17);
}

.image-reward-unlock-frame::before,
.image-reward-unlock-frame::after {
  content: '';
  position: absolute;
  z-index: 1;
  width: 38px;
  height: 38px;
  pointer-events: none;
}

.image-reward-unlock-frame::before {
  top: 2px;
  left: 2px;
  border-top: 1px solid var(--gold-500);
  border-left: 1px solid var(--gold-500);
}

.image-reward-unlock-frame::after {
  right: 2px;
  bottom: 2px;
  border-right: 1px solid var(--gold-500);
  border-bottom: 1px solid var(--gold-500);
}

.image-reward-unlock-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1px 11px 1px 11px;
}

.image-reward-unlock-button {
  width: min(100%, 330px);
  min-height: 50px;
  margin: 15px auto 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  text-decoration: none;
  border: 1px solid rgba(229, 204, 145, .48);
  border-radius: 2px 14px 2px 14px;
  background: linear-gradient(135deg, var(--wine-700), var(--wine-900));
  box-shadow: 0 8px 20px rgba(72, 11, 23, .2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
}

.image-reward-unlock-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.6;
}

.reward-candidate-label {
  color: var(--wine-700) !important;
  font-weight: 700;
}

.share-section {
  text-align: center;
}

.share-hint {
  margin: -4px 0 16px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.share-button {
  min-height: 48px;
  color: #fff;
  border: 0;
  border-radius: 2px 12px 2px 12px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.share-x { background: #181517; }
.share-instagram { background: linear-gradient(135deg, #d78641, #bd3f72 54%, #5943a2); }
.share-line { background: #14a94c; }

.share-copy {
  margin: 13px 0 10px;
  padding: 12px;
  color: var(--ink);
  white-space: pre-line;
  text-align: left;
  border: 1px solid rgba(154, 115, 50, .3);
  border-radius: 2px 12px 2px 12px;
  background: rgba(255, 255, 255, .62);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
}

.site-footer {
  padding: 35px 10px 5px;
  text-align: center;
}

.site-footer span {
  width: 34px;
  height: 1px;
  margin: 0 auto 14px;
  display: block;
  background: var(--gold-500);
}

.site-footer p {
  margin: 0;
  color: var(--gold-300);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .18em;
}

.site-footer small {
  margin-top: 5px;
  display: block;
  color: rgba(255, 250, 241, .5);
  font-size: 10px;
  font-style: italic;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translate(-50%, 16px);
  width: min(calc(100% - 28px), 430px);
  padding: 12px 15px;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(229, 204, 145, .24);
  border-radius: 12px;
  background: rgba(52, 7, 17, .95);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 560px) {
  .page-shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  #votePanel {
    padding: 33px 28px 28px;
  }

  .candidate-card {
    min-height: 150px;
    grid-template-columns: 110px minmax(0, 1fr) 30px;
    gap: 17px;
    padding: 11px;
  }

  .profile-frame {
    width: 110px;
    height: 132px;
  }

  .candidate-name {
    font-size: 28px;
  }

  .reward-item {
    padding-right: 15px;
  }
}

@media (max-width: 360px) {
  .page-shell {
    padding-left: 7px;
    padding-right: 7px;
  }

  #votePanel {
    padding-left: 11px;
    padding-right: 11px;
  }

  .candidate-card {
    grid-template-columns: 80px minmax(0, 1fr) 23px;
    gap: 8px;
    padding-left: 7px;
  }

  .profile-frame {
    width: 80px;
    height: 103px;
  }

  .progress-meta {
    grid-template-columns: 1fr;
  }
}

.offshots-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.offshots-photo {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d5c3a2;
  border-radius: 8px;
  background: #fffaf1;
  color: #74142f;
  text-align: center;
  text-decoration: none;
}

.offshots-photo img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #f3eadc;
}

.offshots-photo span {
  padding: 12px 5px;
  font-size: 12px;
  line-height: 1.6;
}

.offshots-photo:focus-visible {
  outline: 3px solid #74142f;
  outline-offset: 3px;
}

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