:root {
  --bg: #f5f1ea;
  --bg-deep: #eee6db;
  --surface: rgba(252, 251, 248, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-dark: rgba(34, 23, 12, 0.9);
  --text: #2f2923;
  --text-soft: #6e6257;
  --text-faint: #877b70;
  --line: rgba(231, 221, 208, 0.9);
  --line-strong: rgba(216, 199, 178, 0.95);
  --accent: #b8742f;
  --accent-strong: #9f6225;
  --accent-soft: rgba(244, 231, 215, 0.88);
  --accent-glow: rgba(184, 116, 47, 0.22);
  --success: #146f54;
  --success-soft: rgba(20, 111, 84, 0.14);
  --shadow-soft: 0 20px 60px rgba(70, 43, 16, 0.08);
  --shadow-medium: 0 28px 80px rgba(55, 33, 12, 0.14);
  --shadow-glow: 0 24px 70px rgba(201, 120, 45, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --ease: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable", "Bahnschrift", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.92), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(231, 187, 121, 0.22), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(193, 132, 71, 0.12), transparent 34%),
    linear-gradient(180deg, #fbf7f1 0%, #f3ede4 55%, #eee6db 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(310deg, rgba(201, 120, 45, 0.06), transparent 28%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  position: relative;
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 12px -16px auto;
  height: 480px;
  border-radius: 48px;
  background:
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.66), transparent 38%),
    linear-gradient(135deg, rgba(255, 244, 228, 0.72), rgba(255, 255, 255, 0.12));
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
}

.hero,
.viewer-panel,
.vote-panel,
.modal-content {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.hero::before,
.viewer-panel::before,
.vote-panel::before,
.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero {
  display: block;
  padding: 36px 42px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(252, 244, 232, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 40px;
  box-shadow: var(--shadow-medium);
}

.hero::before {
  background:
    linear-gradient(120deg, rgba(201, 120, 45, 0.12), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(201, 120, 45, 0.16), transparent 18%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: rgba(156, 89, 29, 0.45);
}

.hero h1,
.viewer-header h2,
.vote-intro h2,
.modal-header h2 {
  margin: 0;
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(3.2rem, 6vw, 6.2rem);
  text-wrap: balance;
}

.lead {
  max-width: 62ch;
  margin: 20px 0 0;
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--text-soft);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.hero-stat {
  min-width: 190px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 241, 232, 0.82));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.hero-stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-stat-value {
  display: block;
  color: var(--accent-strong);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.content {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.viewer-panel,
.vote-panel {
  padding: 32px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.68), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 250, 245, 0.76));
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 34px;
  box-shadow: var(--shadow-soft);
}

.viewer-panel::before {
  background:
    linear-gradient(135deg, rgba(201, 120, 45, 0.09), transparent 22%),
    radial-gradient(circle at 50% 0%, rgba(201, 120, 45, 0.08), transparent 28%);
}

.vote-panel::before {
  background:
    linear-gradient(180deg, rgba(201, 120, 45, 0.08), transparent 16%),
    radial-gradient(circle at 80% 10%, rgba(201, 120, 45, 0.08), transparent 24%);
}

.viewer-header,
.viewer-toolbar,
.final-actions,
.card-header,
.card-footer,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vote-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: end;
}

.viewer-header h2,
.vote-intro h2,
.modal-header h2 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  text-wrap: balance;
}

.viewer-meta {
  min-width: 240px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(125, 82, 33, 0.12);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  text-align: left;
}

.viewer-meta strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.98rem;
  font-weight: 800;
}

.viewer-meta strong::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e79d4b, #ba6d2a);
  box-shadow: 0 0 0 6px rgba(201, 120, 45, 0.1);
}

.viewer-meta span {
  display: block;
  color: var(--text-faint);
  line-height: 1.5;
}

.viewer-stage {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
}

.viewer-frame {
  position: relative;
  margin: 0;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 244, 237, 0.94));
  border: 1px solid rgba(125, 82, 33, 0.16);
  border-radius: 30px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 26px 80px rgba(75, 45, 15, 0.12);
  cursor: pointer;
}

.viewer-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgba(201, 120, 45, 0.14);
  pointer-events: none;
}

.viewer-image-shell {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.viewer-image-shell::after {
  content: "Нажмите, чтобы открыть крупно";
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(22, 14, 8, 0.66);
  color: #fff8ef;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--ease), transform var(--ease);
  pointer-events: none;
}

.viewer-frame:hover .viewer-image-shell::after,
.viewer-frame:focus-visible .viewer-image-shell::after {
  opacity: 1;
  transform: translateY(0);
}

.viewer-frame img,
.transition-image {
  width: 100%;
  max-height: min(72vh, 800px);
  object-fit: contain;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(245, 236, 227, 0.66), rgba(255, 255, 255, 0.96));
  user-select: none;
  -webkit-user-drag: none;
}

.viewer-frame:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(184, 116, 47, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 26px 80px rgba(75, 45, 15, 0.12);
}

.viewer-nav,
.modal-nav-row {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 44px;
}

.viewer-nav {
  margin-top: 18px;
}

.modal-nav-row {
  width: min(220px, 100%);
  margin: 18px auto 0;
}

.transition-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: transform 240ms var(--ease), opacity 240ms var(--ease);
}

.viewer-image-shell.is-animating .transition-image.is-outgoing {
  transform: translateX(0);
  opacity: 1;
}

.viewer-image-shell.is-animating .transition-image.is-incoming {
  opacity: 0;
}

.viewer-image-shell.is-forward .transition-image.is-incoming {
  transform: translateX(56px);
}

.viewer-image-shell.is-forward .transition-image.is-outgoing {
  transform: translateX(0);
}

.viewer-image-shell.is-backward .transition-image.is-incoming {
  transform: translateX(-56px);
}

.viewer-image-shell.is-backward .transition-image.is-outgoing {
  transform: translateX(0);
}

.viewer-image-shell.is-active.is-forward .transition-image.is-outgoing {
  transform: translateX(-56px);
  opacity: 0;
}

.viewer-image-shell.is-active.is-forward .transition-image.is-incoming {
  transform: translateX(0);
  opacity: 1;
}

.viewer-image-shell.is-active.is-backward .transition-image.is-outgoing {
  transform: translateX(56px);
  opacity: 0;
}

.viewer-image-shell.is-active.is-backward .transition-image.is-incoming {
  transform: translateX(0);
  opacity: 1;
}

.is-hidden-during-transition {
  opacity: 0;
}

.nav-button,
.ghost-button,
.primary-button,
.toggle-button,
.modal-close {
  min-height: 48px;
  border-radius: 999px;
  transition:
    transform var(--ease),
    background-color var(--ease),
    border-color var(--ease),
    color var(--ease),
    opacity var(--ease),
    box-shadow var(--ease);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  min-width: 54px;
  height: 54px;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 0;
}

.nav-button::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  transition: transform var(--ease), opacity var(--ease);
}

#prevButton::before,
#modalPrevButton::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M11.75 4.5 6.25 10l5.5 5.5' stroke='%239f6225' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#nextButton::before,
#modalNextButton::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M8.25 4.5 13.75 10l-5.5 5.5' stroke='%239f6225' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav-button:hover,
.ghost-button:hover,
.primary-button:hover,
.toggle-button:hover,
.modal-close:hover {
  transform: translateY(-2px);
}

.nav-button:hover,
.modal-close:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.nav-button:hover::before,
.modal-nav:hover::before {
  transform: scale(1.06);
}

.nav-button:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.toggle-button:focus-visible,
.modal-close:focus-visible,
.preview-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(201, 120, 45, 0.18),
    0 16px 34px rgba(70, 43, 16, 0.14);
}

.nav-button:disabled {
  opacity: 0.36;
  cursor: default;
  box-shadow: none;
  transform: none;
  background: rgba(255, 255, 255, 0.68);
}

.nav-button:disabled::before {
  opacity: 0.42;
}

.viewer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-wrap::before {
  content: "Прогресс просмотра";
  color: var(--text-faint);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(43, 29, 12, 0.08), rgba(43, 29, 12, 0.03));
  border: 1px solid rgba(125, 82, 33, 0.12);
  border-radius: 999px;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #e39a4c, #bf6f28 52%, #8e4f1c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: width 260ms var(--ease);
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: -16px;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  transform: skewX(-20deg);
}

.viewer-actions,
.final-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.ghost-button,
.toggle-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid rgba(125, 82, 33, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: 0 14px 30px rgba(58, 37, 15, 0.05);
}

#openModalButton::before,
#resetButton::before {
  margin-right: 10px;
  font-size: 1rem;
}

#openModalButton::before {
  content: "⊕";
}

#resetButton::before {
  content: "⟲";
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #d88a3b, #a85d22);
  box-shadow: var(--shadow-glow);
}

.vote-panel {
  animation: panelReveal 420ms var(--ease);
}

.vote-panel:focus {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(184, 116, 47, 0.14),
    var(--shadow-soft);
}

.vote-panel.is-hidden,
.final-choice.is-hidden,
.modal.is-hidden {
  display: none;
}

.vote-intro {
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(125, 82, 33, 0.12);
}

.vote-status {
  align-self: start;
  margin: 0;
  padding: 18px 20px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 243, 236, 0.9));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 700;
}

.vote-banner {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-soft);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.vote-banner.is-hidden {
  display: none;
}

.vote-banner.is-success {
  border-color: rgba(20, 111, 84, 0.2);
  background: rgba(20, 111, 84, 0.09);
  color: var(--success);
}

.vote-banner.is-warning {
  border-color: rgba(184, 116, 47, 0.24);
  background: rgba(244, 231, 215, 0.92);
  color: var(--accent-strong);
}

.vote-banner.is-error {
  border-color: rgba(176, 78, 56, 0.24);
  background: rgba(176, 78, 56, 0.09);
  color: #93432f;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.selection-card {
  position: relative;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(252, 247, 240, 0.82));
  border: 1px solid rgba(125, 82, 33, 0.12);
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 46px rgba(66, 40, 14, 0.07);
  transition:
    transform var(--ease),
    border-color var(--ease),
    box-shadow var(--ease),
    background-color var(--ease),
    opacity var(--ease);
}

.selection-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(201, 120, 45, 0.08), transparent 26%);
  opacity: 0;
  transition: opacity var(--ease);
  pointer-events: none;
}

.selection-card:hover {
  transform: translateY(-6px);
  border-color: rgba(125, 82, 33, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 28px 54px rgba(66, 40, 14, 0.12);
}

.selection-card:hover::before {
  opacity: 1;
}

.selection-card.selected {
  background:
    linear-gradient(180deg, rgba(255, 249, 241, 0.98), rgba(255, 244, 229, 0.94));
  border-color: rgba(184, 116, 47, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 0 1px rgba(184, 116, 47, 0.2),
    0 24px 56px rgba(184, 116, 47, 0.22);
}

.selection-card.selected::before {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(201, 120, 45, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(201, 120, 45, 0.18), transparent 22%);
}

.selection-card.locked:not(.selected) {
  opacity: 0.62;
  filter: saturate(0.88);
}

.card-header {
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244, 231, 215, 1), rgba(236, 216, 191, 0.72));
  color: var(--accent-strong);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.selection-card.selected .badge {
  background: linear-gradient(180deg, rgba(197, 128, 64, 0.18), rgba(184, 116, 47, 0.12));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(184, 116, 47, 0.14);
}

.selection-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(35, 24, 13, 0.05);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.selection-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(95, 85, 74, 0.5);
}

.selection-card.selected .selection-state {
  background: rgba(184, 116, 47, 0.12);
  color: var(--accent-strong);
}

.selection-card.selected .selection-state::before {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(184, 116, 47, 0.12);
}

.preview-button {
  position: relative;
  width: 100%;
  margin-top: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
}

.preview-button::after {
  content: "Открыть крупно";
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(20, 13, 7, 0.68);
  color: #fff7ef;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--ease), transform var(--ease);
}

.selection-card:hover .preview-button::after,
.preview-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.preview-button img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 22px;
  border: 1px solid rgba(34, 23, 12, 0.08);
  box-shadow: 0 12px 34px rgba(65, 38, 10, 0.1);
  transition: transform var(--ease), filter var(--ease), box-shadow var(--ease);
}

.selection-card:hover .preview-button img,
.preview-button:focus-visible img {
  transform: scale(1.025);
  filter: saturate(1.04) contrast(1.01);
  box-shadow: 0 20px 44px rgba(65, 38, 10, 0.16);
}

.card-footer {
  margin-top: 16px;
}

.card-footer p {
  margin: 0;
  max-width: 26ch;
  color: var(--text-faint);
  font-size: 0.93rem;
  line-height: 1.5;
}

.toggle-button {
  min-width: 136px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.toggle-button:hover {
  box-shadow: 0 14px 32px rgba(66, 40, 14, 0.08);
}

.toggle-button.is-active {
  border-color: rgba(184, 116, 47, 0.34);
  background: linear-gradient(180deg, rgba(201, 120, 45, 0.14), rgba(201, 120, 45, 0.08));
  color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(184, 116, 47, 0.14);
}

.toggle-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.final-choice {
  margin-top: 28px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(201, 120, 45, 0.18);
  background:
    radial-gradient(circle at top right, rgba(201, 120, 45, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(255, 244, 233, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 24px 50px rgba(201, 120, 45, 0.12);
  animation: panelReveal 340ms var(--ease);
}

.final-choice p {
  margin: 0;
}

#finalChoiceText {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  color: var(--text);
}

.copy-feedback {
  margin-top: 14px;
  color: var(--success);
  min-height: 1.3em;
  font-weight: 700;
}

.vote-feedback {
  margin-top: 14px;
  min-height: 1.3em;
  color: var(--accent-strong);
  font-weight: 700;
}

.ghost-button:disabled,
.primary-button:disabled,
.toggle-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(201, 120, 45, 0.16), transparent 26%),
    rgba(18, 13, 9, 0.78);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: min(1320px, calc(100% - 28px));
  margin: 18px auto;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(28, 20, 13, 0.96), rgba(17, 13, 9, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 34px;
  color: #fff8ef;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.36);
  animation: modalReveal 240ms var(--ease);
}

.modal-content::before {
  background:
    linear-gradient(135deg, rgba(247, 184, 141, 0.08), transparent 22%),
    radial-gradient(circle at top right, rgba(201, 120, 45, 0.14), transparent 18%);
}

.modal-header {
  padding-right: 64px;
}

.modal-header .section-kicker {
  color: #f0b078;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 52px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.7rem;
}

.modal-stage {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
}

.modal-stage img {
  width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.modal-nav {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff8ef;
}

.modal-nav::before {
  filter: brightness(1.18);
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1120px) {
  .vote-intro {
    grid-template-columns: 1fr;
  }

  .viewer-stage,
  .modal-stage {
    grid-template-columns: 1fr;
  }

  .viewer-frame {
    order: -1;
  }

  .nav-button,
  .modal-nav {
    width: 54px;
    min-width: 54px;
    height: 54px;
  }

  .viewer-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-button-inline {
    display: none;
  }

  .viewer-nav,
  .modal-nav-row {
    display: flex;
  }

  #prevButton,
  #nextButton,
  #modalPrevButton,
  #modalNextButton {
    width: 60px;
    min-width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }

  #prevButton,
  #modalPrevButton {
  }

  #nextButton,
  #modalNextButton {
  }

  .viewer-nav,
  .modal-nav-row {
    justify-content: center;
    gap: 48px;
  }

  .nav-button:active,
  .modal-nav:active {
    transform: scale(0.96);
    background: rgba(240, 236, 231, 0.98);
  }

  .nav-button:disabled:active,
  .modal-nav:disabled:active {
    transform: none;
    background: rgba(255, 255, 255, 0.68);
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    padding-top: 18px;
    padding-bottom: 36px;
  }

  .hero,
  .viewer-panel,
  .vote-panel,
  .modal-content {
    padding: 22px;
    border-radius: 26px;
  }

  .hero h1 {
    max-width: 9ch;
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .hero-stat {
    width: 100%;
  }

  .viewer-header,
  .viewer-toolbar,
  .final-actions,
  .card-footer,
  .modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer-meta,
  .vote-status {
    min-width: 0;
    width: 100%;
  }

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

  .card-footer p {
    max-width: none;
  }

  .toggle-button,
  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
