/* H5-first participant experience. Desktop remains defined in styles.css. */
@media (max-width: 600px) {
  html {
    scroll-behavior: smooth;
  }

  body {
    min-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .grain {
    opacity: .11;
  }

  .topbar {
    height: 58px;
    padding: 0 15px;
    background: rgba(244, 234, 216, .88);
    backdrop-filter: blur(14px);
  }

  .brand {
    gap: 8px;
    font-size: 13px;
    letter-spacing: .08em;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .brand small {
    font-size: 7px;
    letter-spacing: .2em;
  }

  .admin-link {
    color: var(--muted);
    font-size: 10px;
  }

  .admin-link span {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    font-size: 13px;
  }

  .stage {
    display: flex;
    min-height: calc(100dvh - 58px);
    flex-direction: column;
    gap: 0;
    padding: 13px 0 calc(18px + env(safe-area-inset-bottom));
    text-align: left;
  }

  .stage::before {
    position: fixed;
    bottom: -4vw;
    font-size: 42vw;
  }

  .intro {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 15px;
  }

  .eyebrow {
    gap: 7px;
    margin: 0;
    font-size: 8px;
    letter-spacing: .2em;
  }

  .eyebrow span {
    width: 22px;
  }

  .intro h1 {
    margin: 7px 0 8px;
    font-size: clamp(32px, 9.5vw, 39px);
    line-height: .98;
    letter-spacing: -.06em;
  }

  .intro h1 br {
    display: block;
  }

  .intro h1 em {
    margin-left: 0;
  }

  .intro h1 em::after {
    height: 5px;
    bottom: -3px;
  }

  .lead {
    display: none;
  }

  .prize-strip {
    display: flex;
    gap: 8px;
    margin: 12px -15px 5px;
    padding: 0 15px 7px;
    overflow-x: auto;
    border: 0;
    scroll-padding-inline: 15px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .prize-strip::-webkit-scrollbar {
    display: none;
  }

  .prize-item,
  .prize-item + .prize-item,
  .prize-item:nth-child(3) {
    flex: 0 0 215px;
    min-width: 215px;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid rgba(22, 48, 44, .13);
    border-radius: 8px;
    background: rgba(255, 250, 240, .72);
    box-shadow: 0 4px 14px rgba(22, 48, 44, .05);
    scroll-snap-align: start;
  }

  .prize-item small {
    margin-bottom: 3px;
    font-size: 8px;
  }

  .prize-item b {
    font-size: 10px;
    line-height: 1.4;
    min-height: 2.8em;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .prize-item span {
    font-size: 8px;
  }

  .stats {
    justify-content: center;
    gap: 13px;
    margin: 0 0 9px;
    font-size: 8px;
  }

  .stats b {
    margin-right: 3px;
    font-size: 16px;
  }

  .stats i {
    height: 17px;
  }

  .wheel-area {
    width: 100%;
  }

  .phone-card {
    order: -1;
    width: calc(100% - 28px);
    margin: 0 14px 16px;
    padding: 11px 13px 9px;
    border: 1px solid rgba(22, 48, 44, .12);
    border-radius: 12px;
    box-shadow: 0 9px 28px rgba(22, 48, 44, .12);
  }

  .phone-card label {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .phone-row {
    min-height: 44px;
  }

  .phone-row > span {
    padding-right: 8px;
    font-size: 12px;
  }

  .phone-row input {
    min-width: 0;
    padding: 9px;
    font-size: 16px;
    letter-spacing: .04em;
  }

  .phone-row button {
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 12px;
    border-radius: 7px 7px 0 0;
    white-space: nowrap;
  }

  .phone-card p {
    margin-top: 6px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .phone-card p.success,
  .phone-card p.error {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    text-overflow: clip;
    white-space: normal;
  }

  .wheel-frame {
    --wheel-size: min(82vw, 38dvh, 330px);
    width: var(--wheel-size);
    height: var(--wheel-size);
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    box-shadow: 0 18px 40px rgba(22, 48, 44, .23), inset 0 0 0 2px var(--gold);
  }

  #wheel {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
  }

  .pointer {
    top: -18px;
    width: 44px;
    height: 58px;
  }

  .pointer span {
    top: 10px;
    left: 18px;
    width: 8px;
    height: 8px;
  }

  .spin-button {
    width: 86px;
    height: 86px;
  }

  .spin-button span {
    font-size: 20px;
  }

  .modal {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .result-card {
    width: 100%;
    min-height: min(500px, calc(100dvh - 24px));
    padding: 50px 22px 28px;
    border-radius: 18px;
  }

  .result-kicker {
    margin-top: 24px;
  }

  .result-card h2 {
    margin-top: 14px;
    font-size: 50px;
  }

  .result-name {
    margin-bottom: 32px;
    font-size: 21px;
  }

  .admin-panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 24px 14px;
    border-radius: 16px;
  }

  .admin-login {
    margin: 40px auto;
  }

  .admin-login input,
  .admin-grid textarea {
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .intro h1 {
    font-size: 30px;
  }

  .prize-item,
  .prize-item + .prize-item,
  .prize-item:nth-child(3) {
    flex-basis: 200px;
    min-width: 200px;
  }

  .wheel-frame {
    --wheel-size: min(80vw, 38dvh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-frame {
    animation: none;
  }
}
