/* =============================================================================
   Coaster — trap. art submission platform
   style.css
   ============================================================================= */

/* =============================================================================
   DESIGN TOKENS — CSS Custom Properties
   All values derived from UX Design Specification
   ============================================================================= */

:root {
  /* Colours */
  --color-black: #000000;
  --color-white: #FFFFFF;
  --color-mid: #f0f0f0;
  --color-grey: #888888;
  --color-border: #cccccc;
  --color-error: #FF3B30;
  --color-success: #FFFFFF;
  --color-vote-up: #FFFFFF;
  --color-vote-down: #FFFFFF;

  /* Typography — family */
  --font-heading: 'Futura Bold Italic', sans-serif;
  --font-body: 'Acumin Pro Bold', sans-serif;

  /* Typography — size scale */
  --text-xl: clamp(1.75rem, 4vw, 2.5rem); /* Landing headline, confirmation hero */
  --text-lg: 1.5rem;                        /* Section headings, card titles */
  --text-md: 1.125rem;                      /* Body, form labels, button text */
  --text-sm: 0.875rem;                      /* Captions, timestamps, secondary info */
  --text-xs: 0.75rem;                       /* Fine print, character counts, OTP label */

  /* Typography — line height */
  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.4;
  --leading-relaxed: 1.5;

  /* Spacing */
  --spacing-base: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius */
  --radius-circle: 50%;
  --radius-card: 12px;
  --radius-input: 8px;

  /* Animation durations */
  --duration-reveal: 600ms;
  --duration-advance: 300ms;
  --duration-micro: 200ms;
}

/* =============================================================================
   FONTS — Self-hosted from trap_website/fonts/
   Path: ../fonts/ (one level up from coaster/)
   ============================================================================= */

@font-face {
  font-family: 'Futura Bold Italic';
  src: url('../fonts/Futura Bold Italic.otf') format('opentype');
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Acumin Pro Bold';
  src: url('../fonts/Acumin_Pro_Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px; /* rem base */
}

body {
  background: var(--color-white);
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: var(--text-md); /* min 16px prevents iOS Safari auto-zoom */
}

/* =============================================================================
   ACCESSIBILITY UTILITIES
   ============================================================================= */

.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;
}

/* Focus rings — black on light backgrounds */
:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* =============================================================================
   LAYOUT — Site header
   ============================================================================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4);
  display: flex;
  align-items: center;
}

.site-header__logo {
  height: 28px;
  width: auto;
  filter: invert(1);
}

/* =============================================================================
   STEP SYSTEM — Submission flow screen management
   Only .step--active is shown; goToStep() manages transitions
   ============================================================================= */

.step {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: var(--color-white);
}

.step--active {
  display: flex;
  flex-direction: column;
}

/* =============================================================================
   CIRCLE FRAME — Core visual component (used everywhere)
   Variants: --thumb (80px), --full (max 480px), --hero (280px)
   ============================================================================= */

.circle-frame {
  border-radius: var(--radius-circle);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--color-mid);
  flex-shrink: 0;
  box-shadow:
    6px 6px 0 rgba(0, 0, 0, 0.18),
    8px 14px 32px rgba(0, 0, 0, 0.28);
}

.circle-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.circle-frame--thumb {
  width: 80px;
  height: 80px;
}

.circle-frame--full {
  width: 100%;
  max-width: 480px;
}

.circle-frame--hero {
  width: 280px;
  height: 280px;
}

/* Shimmer loading placeholder for circle frames */
.circle-frame--loading {
  background: linear-gradient(
    90deg,
    var(--color-mid) 25%,
    #d8d8d8 50%,
    var(--color-mid) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================================================
   BUTTON SYSTEM — Three-tier hierarchy
   Primary: full-width black fill white text (one per screen)
   Secondary: white border transparent
   Tertiary: plain text link
   ============================================================================= */

.btn {
  display: block;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  text-align: center;
  border-radius: var(--radius-input);
  min-height: 44px; /* WCAG touch target */
  transition: opacity var(--duration-micro);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--color-black);
  color: var(--color-white);
}

.btn--secondary {
  background: transparent;
  color: var(--color-black);
  border: 1px solid var(--color-black);
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: var(--space-2);
}

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

.btn--tertiary {
  background: transparent;
  color: var(--color-grey);
  text-decoration: underline;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  width: auto;
  padding: var(--space-2) 0;
}

/* =============================================================================
   UTILITY
   ============================================================================= */

.is-hidden {
  display: none !important;
}

/* =============================================================================
   CAMERA STEP
   ============================================================================= */

.step--camera {
  justify-content: center;
  align-items: center;
  padding: 80px var(--space-5) var(--space-6);
  text-align: center;
}

/* Trigger state */
.camera-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  max-width: 400px;
}

.camera-trigger__copy {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

/* Viewfinder state */
.camera-viewfinder {
  position: fixed;
  inset: 0;
  background: var(--color-black);
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-instruction {
  position: absolute;
  bottom: 130px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-white);
  pointer-events: none;
  margin: 0;
}

.camera-shutter {
  position: absolute;
  bottom: var(--space-7);
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: var(--radius-circle);
  background: var(--color-white);
  border: 4px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

/* Error state */
.camera-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 400px;
}

.camera-error__msg {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

/* =============================================================================
   CROP STEP — circular crop selection over the captured photo
   ============================================================================= */

.step--crop {
  flex-direction: column;
  padding: 0;
}

.crop-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--color-white);
  min-height: 0; /* allow flex shrink */
  touch-action: none;
  cursor: grab;
}

.crop-wrap:active {
  cursor: grabbing;
}

.crop-img {
  position: absolute;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  will-change: transform;
}

.crop-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.crop-svg--active {
  opacity: 0.5;
}


.crop-footer {
  flex-shrink: 0;
  padding: var(--space-4) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-white);
}

.crop-instruction {
  font-size: var(--text-xs);
  color: var(--color-grey);
  text-align: center;
  margin: 0;
}

/* =============================================================================
   PROCESSING STEP
   ============================================================================= */

.step--processing {
  justify-content: center;
  align-items: center;
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.processing-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.processing-spinner {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg); /* start arc at top */
}

@keyframes processing-arc {
  0%   { stroke-dashoffset: 283; }
  100% { stroke-dashoffset: 0; }
}

.processing-spinner__arc {
  animation: processing-arc 2s linear infinite;
}

.processing-copy {
  font-size: var(--text-sm);
  color: var(--color-grey);
  margin: 0;
}

.processing-reveal {
  width: 100%;
  max-width: 480px;
  padding: 0 var(--space-5);
}

@keyframes reveal-scale {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.processing-reveal--animating {
  animation: reveal-scale 600ms ease-out forwards;
}

.processing-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  max-width: 400px;
  width: 100%;
}

.processing-error__msg {
  font-size: var(--text-sm);
  color: var(--color-grey);
  margin: 0;
}

/* =============================================================================
   LANDING STEP
   ============================================================================= */

.step--landing {
  justify-content: center;
  align-items: center;
  padding: 80px var(--space-5) var(--space-6); /* 80px clears fixed header */
  text-align: center;
}

.landing__content {
  width: 100%;
  max-width: 400px;
}

.landing__mobile {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.landing__headline {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  color: var(--color-black);
  margin-bottom: var(--space-6);
}

/* Desktop gate — hidden on mobile, shown at ≥768px */
.landing__desktop-msg {
  display: none;
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--color-grey);
}

@media (min-width: 768px) {
  .landing__mobile {
    display: none;
  }
  .landing__desktop-msg {
    display: block;
  }
}

/* =============================================================================
   FLOATING SUBMIT BUTTON
   ============================================================================= */

.fab-submit {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-5);
  z-index: 200;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f5f0eb;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  color: var(--color-black);
  box-shadow:
    6px 6px 0 rgba(0, 0, 0, 0.18),
    8px 12px 32px rgba(0, 0, 0, 0.28);
  transition: transform 120ms ease, box-shadow 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-submit:active {
  transform: translate(3px, 3px);
  box-shadow:
    3px 3px 0 rgba(0, 0, 0, 0.18),
    4px 6px 16px rgba(0, 0, 0, 0.22);
}

/* =============================================================================
   FEED VIEW — Public feed sections
   ============================================================================= */

.feed-view {
  padding-top: 80px; /* Clear fixed header */
  padding-bottom: var(--space-8);
}

.feed-header {
  padding: var(--space-5) var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.feed-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--color-black);
  margin: 0;
}

.feed-header__tagline {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-grey);
  margin: 0;
}

.feed-header__count {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-black);
  margin: 0;
  font-weight: 600;
}

.feed-section {
  padding: var(--space-6) var(--space-4) var(--space-5);
}

.feed-section__heading {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-black);
  margin-bottom: var(--space-4);
}

/* 2-col mobile, 4-col desktop */
.feed-section__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .feed-section__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
  }

  .feed-section__grid .circle-frame--thumb {
    width: 160px;
    height: 160px;
  }
}

.feed-section__empty {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

/* =============================================================================
   REDUCED MOTION — Disable all animations when requested
   ============================================================================= */

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

  .circle-frame--loading {
    animation: none;
    background: var(--color-mid);
  }
}

/* =============================================================================
   RESPONSIVE — Mobile-first, single breakpoint at 768px
   Submission flow: mobile only (desktop shows grab-your-phone message)
   Feed: responsive
   ============================================================================= */

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }
}

/* =============================================================================
   REVEAL STEP (Story 2.3) — Image confirmation before form
   ============================================================================= */

.step--reveal {
  justify-content: center;
  align-items: center;
  padding: var(--space-6) var(--space-5);
}

.reveal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  max-width: 480px;
}

/* Override thumb size for reveal step — larger for quality check */
.step--reveal .circle-frame--thumb {
  width: 160px;
  height: 160px;
}

/* Reset button styles for thumbnail tap trigger */
.reveal-thumb-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
}

.reveal-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  width: 100%;
}

.reveal-checkbox {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--color-black);
  margin-top: 2px;
}

.reveal-checkbox-label {
  font-size: var(--text-sm);
  color: var(--color-grey);
  line-height: 1.4;
}

/* Lightbox overlay */
.reveal-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 100;
  cursor: pointer;
}

/* =============================================================================
   FORM STEP (Story 2.4) — Submission details form
   ============================================================================= */

.step--form {
  justify-content: flex-start;
  align-items: center;
  padding: 80px var(--space-5) var(--space-6);
  overflow-y: auto;
}

.form-content {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-heading {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-black);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

.form-label__optional {
  color: var(--color-grey);
}

.form-label__cta {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-grey);
  margin-top: var(--space-1);
}

.form-input {
  display: block;
  width: 100%;
  padding: var(--space-4);
  background: var(--color-mid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: var(--text-md); /* ≥16px — prevents iOS Safari auto-zoom */
  min-height: 44px;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-black);
}

.form-input--error {
  border-color: var(--color-error);
}

/* Instagram @ prefix wrapper */
.form-instagram-wrapper {
  display: flex;
  align-items: center;
  background: var(--color-mid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  overflow: hidden;
}

.form-instagram-wrapper:focus-within {
  border-color: var(--color-black);
}

.form-instagram-wrapper.form-input--error {
  border-color: var(--color-error);
}

.form-instagram-prefix {
  padding: var(--space-4) 0 var(--space-4) var(--space-4);
  color: var(--color-grey);
  font-family: var(--font-body);
  font-size: var(--text-md);
  user-select: none;
  flex-shrink: 0;
}

.form-instagram-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: var(--text-md);
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  min-width: 0;
}

.form-instagram-input:focus {
  outline: none;
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
}

.form-char-count {
  font-size: var(--text-xs);
  color: var(--color-grey);
  text-align: right;
}

.form-privacy {
  font-size: var(--text-xs);
  color: var(--color-grey);
  line-height: var(--leading-relaxed);
}

.form-privacy a {
  color: var(--color-grey);
  text-decoration: underline;
}

/* =============================================================================
   OTP STEP (Story 2.5) — 6-digit code verification
   ============================================================================= */

.step--otp {
  justify-content: center;
  align-items: center;
  padding: 80px var(--space-5) var(--space-6);
  text-align: center;
}

.otp-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  max-width: 400px;
}

.otp-label {
  font-size: var(--text-sm);
  color: var(--color-grey);
  line-height: var(--leading-normal);
}

.otp-input {
  width: 200px;
  text-align: center;
  font-size: var(--text-xl);
  font-family: monospace;
  letter-spacing: 0.2em;
  padding: var(--space-4);
  background: var(--color-mid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-black);
  caret-color: var(--color-black);
  min-height: 44px;
}

.otp-input:focus {
  outline: none;
  border-color: var(--color-black);
}

.otp-input--error {
  border-color: var(--color-error);
}

.otp-error {
  font-size: var(--text-sm);
  color: var(--color-error);
}

.otp-resend-confirm {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

/* =============================================================================
   CONFIRMATION STEP (Story 2.5) — Share screen
   ============================================================================= */

.step--confirmation {
  justify-content: center;
  align-items: center;
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.confirmation-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  max-width: 400px;
}

.confirmation-heading {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  color: var(--color-black);
}

.confirmation-sub {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

.confirmation-url {
  font-size: var(--text-xs);
  color: var(--color-grey);
  word-break: break-all;
}

/* Toast — fixed overlay, auto-hidden after 2s via JS */
.confirmation-toast {
  position: fixed;
  top: var(--space-7);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-input);
  z-index: 200;
  white-space: nowrap;
}

/* =============================================================================
   SHARE TOAST (Story 2.6) — persistent overlay after submission success
   ============================================================================= */

.share-toast {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--color-black);
  color: var(--color-white);
  padding: var(--space-6) var(--space-5) var(--space-7);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.share-toast__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  background: none;
  border: none;
  font-size: var(--text-lg);
  color: var(--color-grey);
  cursor: pointer;
  line-height: 1;
  padding: var(--space-1);
}

.share-toast__heading {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin: 0;
}

.share-toast__sub {
  font-size: var(--text-sm);
  color: var(--color-grey);
  margin: 0;
}

.share-toast__url {
  font-size: var(--text-xs);
  word-break: break-all;
  color: var(--color-grey);
  margin: 0;
}

/* =============================================================================
   COASTER CARD — Feed thumbnail card (Story 3.1)
   ============================================================================= */

.coaster-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.coaster-card__rating {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-grey);
  text-align: center;
  margin: 0;
  letter-spacing: 0.03em;
}

.coaster-card__rating--positive { color: #4caf50; }
.coaster-card__rating--negative { color: var(--color-error); }

.coaster-card__name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-black);
  text-align: center;
  margin: 0;
}

.coaster-card__instagram {
  font-size: var(--text-xs);
  color: var(--color-grey);
  text-decoration: none;
  text-align: center;
}

/* =============================================================================
   VOTE BUTTONS — shared by feed cards (3.3), voting feed (3.2), featured (3.4)
   ============================================================================= */

.coaster-card__votes {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-1);
}

.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: border-color 150ms, background 150ms;
}

.vote-btn:hover {
  border-color: var(--color-black);
}

.vote-btn--up.vote-btn--voted {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.15);
}

.vote-btn--down.vote-btn--voted {
  border-color: var(--color-error);
  background: rgba(255, 59, 48, 0.15);
}

.vote-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =============================================================================
   VOTING FEED OVERLAY (Story 3.2)
   Full-screen sequential voting experience shown after submission.
   ============================================================================= */

.voting-feed {
  position: fixed;
  inset: 0;
  background: var(--color-white);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  overflow: hidden;
}

.voting-feed.is-hidden {
  display: none;
}

.voting-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 480px;
  will-change: transform, opacity;
  transition: transform 300ms ease, opacity 300ms ease;
}

.voting-card.is-exiting {
  transform: translateX(-100%);
  opacity: 0;
}

.voting-card__score-wrap {
  position: relative;
  display: inline-block;
}

.voting-card__score {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--color-mid);
  color: var(--color-black);
  font-size: var(--text-xs);
  font-family: var(--font-body);
  padding: 2px var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  pointer-events: none;
}

.voting-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  color: var(--color-black);
  margin: 0;
  text-align: center;
}

.voting-card__instagram {
  font-size: var(--text-sm);
  color: var(--color-grey);
  text-decoration: none;
  text-align: center;
}

.voting-card__votes {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  justify-content: center;
}

/* Larger vote buttons in the full-screen voting context */
.voting-card__votes .vote-btn {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  border-width: 2px;
}

.voting-feed__end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.voting-feed__end-message {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-black);
  margin: 0;
}

/* =============================================================================
   FEATURED COASTER — Share-link landing (Story 3.4)
   ============================================================================= */

.featured-coaster {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
}

.featured-coaster__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-2);
}

.featured-coaster__score-wrap {
  position: relative;
  display: inline-block;
}

.featured-coaster__score {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--color-mid);
  color: var(--color-black);
  font-size: var(--text-xs);
  font-family: var(--font-body);
  padding: 2px var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  pointer-events: none;
}

.featured-coaster__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-black);
  margin: 0;
  text-align: center;
}

.featured-coaster__instagram {
  font-size: var(--text-sm);
  color: var(--color-grey);
  text-decoration: none;
  text-align: center;
}

.featured-coaster__votes {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  justify-content: center;
}

/* =============================================================================
   COASTER MODAL — Full-size view with voting (opens on card tap)
   ============================================================================= */

.coaster-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.coaster-modal__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 400px;
  position: relative;
}

.coaster-modal__close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: var(--color-grey);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: var(--space-1);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.coaster-modal__close:hover {
  color: var(--color-black);
}

.coaster-modal__circle {
  width: 260px;
  height: 260px;
  margin-top: var(--space-6);
}

@media (min-width: 480px) {
  .coaster-modal__circle {
    width: 340px;
    height: 340px;
  }
}

.coaster-modal__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-black);
  text-align: center;
  margin: 0;
}

.coaster-modal__instagram {
  font-size: var(--text-sm);
  color: var(--color-grey);
  text-decoration: none;
  text-align: center;
}

.coaster-modal__votes {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  justify-content: center;
}

.coaster-modal__votes .vote-btn {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  border-width: 2px;
}

.coaster-modal .btn--secondary {
  color: var(--color-white);
  border-color: var(--color-white);
}

/* =============================================================================
   SHARE MODAL
   ============================================================================= */

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.share-modal.is-hidden { display: none; }

.share-modal__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 60px;
  gap: 20px;
}

.share-modal__step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.share-modal__close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  font-family: var(--font-body);
}

.share-modal__heading {
  font-family: var(--font-heading);
  font-size: clamp(22px, 7vw, 32px);
  color: #fff;
  text-align: center;
  margin: 0;
}

.share-modal__sub {
  font-family: var(--font-body);
  font-size: 15px;
  color: #ccc;
  text-align: center;
  margin: 0;
  max-width: 300px;
}

.share-modal__url {
  font-family: var(--font-body);
  font-size: 13px;
  color: #aaa;
  word-break: break-all;
  text-align: center;
  background: #111;
  padding: 14px 16px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.share-modal__preview-wrap {
  width: 100%;
  max-width: 260px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-modal__preview {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(255,255,255,0.08);
  display: none;
}

.share-modal__preview-loading {
  font-family: var(--font-body);
  font-size: 14px;
  color: #666;
  text-align: center;
  margin: 0;
}

.share-modal__download {
  text-decoration: none;
}

.share-modal .btn--primary {
  background: var(--color-white);
  color: var(--color-black);
}

.share-modal .btn--secondary {
  color: var(--color-white);
  border-color: var(--color-white);
}

.share-modal .btn--tertiary {
  color: #aaa;
}

.share-modal__instructions {
  font-family: var(--font-body);
  font-size: 15px;
  color: #bbb;
  padding-left: 20px;
  align-self: flex-start;
  line-height: 2;
  margin: 0;
}
