/* The home screen is a single-purpose picker; preferences live below the result. */
.site-header {
  position: relative;
}

.header-inner {
  min-height: 58px;
}

.sound-toggle {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  font-size: 1rem;
}

.hero {
  display: block;
  padding: 26px 0 6px;
  text-align: center;
}

.hero-copy {
  display: grid;
  justify-items: center;
}

.hero .eyebrow {
  margin-bottom: 8px;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.65rem, 6vw, 4.5rem);
}

.hero-subtitle {
  max-width: 680px;
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  justify-content: center;
  margin-top: 20px;
}

.hero-actions .btn-primary {
  min-height: 62px;
  min-width: min(100%, 300px);
  padding: 0 34px;
  font-size: 1.2rem;
}

.result-section {
  padding: 0 0 28px;
}

.result-card {
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  gap: 24px;
  padding: 16px;
}

.result-poster {
  min-height: 270px;
}

.result-content {
  padding: 4px 4px 4px 0;
}

.result-reason {
  display: block;
  margin-top: 5px;
  min-height: 0;
  white-space: normal;
}

.result-note-label {
  width: fit-content;
  margin: 13px 0 0;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.result-note-label[hidden] {
  display: none;
}

.result-actions {
  align-items: center;
}

.result-actions .btn-primary {
  min-height: 52px;
}

.btn-icon {
  display: inline-grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
}

.btn-icon:hover,
.btn-icon:focus-visible {
  border-color: #f2b0a7;
  background: var(--surface-strong);
  color: var(--accent-dark);
  outline: none;
}

.control-panel {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 10px 0 30px;
}

.panel-block {
  box-shadow: none;
}

.tag-group {
  border-top: 0;
  padding: 14px 16px 12px;
  border-radius: 8px;
  background: #fff9f7;
}

.tag-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tag-group-title {
  display: block;
  cursor: pointer;
  padding: 0 0 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 900;
  margin: 0;
}

.tag-group .tag-list {
  padding: 0;
  gap: 7px;
}

.tag-group .tag-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.situation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.situation-button {
  display: block;
  min-height: 44px;
  padding: 0 10px;
  text-align: center;
}

.situation-button .situation-icon,
.situation-button span {
  display: none;
}

.site-footer {
  padding: 22px 0 28px;
}

.site-footer > .shell.footer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, auto);
  align-items: start;
  gap: 24px 48px;
}

.site-footer .footer-brand p {
  max-width: 430px;
}

.site-footer strong {
  font-size: 0.9rem;
}

.celebration-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  contain: layout paint style;
}

.special-cut-in {
  position: absolute;
  top: 38%;
  left: 50%;
  z-index: 5;
  max-width: calc(100% - 32px);
  border-top: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  padding: 14px 24px;
  background: rgba(23, 18, 23, 0.9);
  color: #fff;
  font-size: 3rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  animation: specialCutInSlam 1.35s cubic-bezier(0.16, 0.82, 0.24, 1) forwards;
}

.special-cut-in.is-golden {
  color: #ffd84d;
  box-shadow: 0 0 46px rgba(255, 190, 0, 0.72);
}

.special-cut-in.is-legend {
  color: #fff4c7;
  box-shadow: 0 0 52px rgba(215, 47, 63, 0.78);
}

.special-cut-in.is-hidden {
  color: #73fbd3;
  box-shadow:
    8px 8px 0 rgba(255, 79, 163, 0.72),
    0 0 48px rgba(115, 251, 211, 0.68);
}

.confetti-piece {
  position: absolute;
  left: var(--x);
  top: -24px;
  width: 12px;
  height: 20px;
  border-radius: 2px;
  background: var(--color);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--color) 60%, transparent);
  animation: confettiFall 1.9s cubic-bezier(0.16, 0.7, 0.35, 1) var(--delay) forwards;
}

.confetti-piece.is-golden {
  box-shadow: 0 0 8px rgba(255, 210, 56, 0.72);
}

.confetti-piece.is-legend {
  box-shadow: 0 0 9px rgba(215, 47, 63, 0.68);
}

.confetti-piece.is-hidden {
  box-shadow: 0 0 9px rgba(115, 251, 211, 0.72);
}

.firework-burst {
  position: absolute;
  left: var(--left);
  top: calc(100% - 66px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: hsl(var(--hue) 100% 62%);
  box-shadow:
    0 -70px 0 -4px hsl(var(--hue) 100% 62%),
    50px -50px 0 -4px hsl(var(--hue) 100% 62%),
    70px 0 0 -4px hsl(var(--hue) 100% 62%),
    50px 50px 0 -4px hsl(var(--hue) 100% 62%),
    0 70px 0 -4px hsl(var(--hue) 100% 62%),
    -50px 50px 0 -4px hsl(var(--hue) 100% 62%),
    -70px 0 0 -4px hsl(var(--hue) 100% 62%),
    -50px -50px 0 -4px hsl(var(--hue) 100% 62%);
  opacity: 0;
  animation: fireworkBurst 1.15s cubic-bezier(0.16, 0.7, 0.3, 1) var(--burst-delay, 0ms) forwards;
}

.gold-coin {
  position: absolute;
  left: var(--x);
  top: -52px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px solid #fff0a0;
  border-radius: 50%;
  background: #f5ad00;
  box-shadow:
    inset 0 0 0 3px #c87900,
    inset 5px 0 7px rgba(255, 255, 255, 0.52),
    0 0 16px rgba(255, 191, 0, 0.72);
  color: #fff7b2;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
  animation: goldCoinFall var(--duration) cubic-bezier(0.16, 0.65, 0.28, 1) var(--delay) forwards;
}

.gold-coin.is-rush {
  width: 24px;
  height: 24px;
  border-width: 2px;
  opacity: 0.84;
}

.gold-coin.is-result {
  z-index: 2;
}

.legend-emblem,
.hidden-ticket {
  position: absolute;
  left: var(--x);
  top: -52px;
  display: grid;
  place-items: center;
  font-weight: 950;
  line-height: 1;
  animation: specialTokenFall var(--duration) cubic-bezier(0.16, 0.65, 0.28, 1) var(--delay) forwards;
}

.legend-emblem {
  width: 32px;
  height: 32px;
  border: 3px double #f4ba27;
  border-radius: 50%;
  background: #7d1020;
  box-shadow:
    inset 0 0 0 3px #3e0710,
    0 0 18px rgba(215, 47, 63, 0.72);
  color: #fff4c7;
  font-size: 0.78rem;
}

.hidden-ticket {
  width: 44px;
  height: 25px;
  border: 2px solid #73fbd3;
  border-radius: 3px;
  background: #171217;
  box-shadow:
    4px 4px 0 rgba(255, 79, 163, 0.78),
    0 0 16px rgba(115, 251, 211, 0.58);
  color: #fff45c;
  font-size: 0.58rem;
}

.legend-emblem.is-rush,
.hidden-ticket.is-rush {
  transform: scale(0.78);
  opacity: 0.86;
}

.legend-emblem.is-result,
.hidden-ticket.is-result {
  z-index: 2;
}

.special-screen-flash {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  animation: specialScreenFlash 0.82s ease-out forwards;
}

.golden-screen-flash {
  background: rgba(255, 215, 72, 0.48);
}

.legend-screen-flash {
  background: rgba(174, 24, 45, 0.48);
}

.hidden-screen-flash {
  background: rgba(72, 245, 205, 0.42);
}

@keyframes confettiFall {
  0% { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate3d(var(--drift), 112vh, 0) rotate(var(--turn)); opacity: 0.95; }
}

@keyframes specialCutInSlam {
  0% { transform: translate(-160%, -50%) scaleX(1.7); opacity: 0; }
  24% { transform: translate(-48%, -50%) scaleX(0.92); opacity: 1; }
  42% { transform: translate(-50%, -50%) scaleX(1); opacity: 1; }
  72% { transform: translate(-50%, -50%) scaleX(1); opacity: 1; }
  100% { transform: translate(72%, -50%) scaleX(1.4); opacity: 0; }
}

@keyframes fireworkBurst {
  0% { transform: translateY(55px) scale(0.1); opacity: 0; }
  22% { transform: translateY(-18px) scale(0.42); opacity: 1; }
  100% { transform: translateY(-190px) scale(1.7); opacity: 0; }
}

@keyframes goldCoinFall {
  0% { transform: translate3d(0, -60px, 0) rotateY(0deg) rotateZ(0deg) scale(0.35); opacity: 0; }
  9% { opacity: 1; }
  74% { opacity: 1; }
  100% { transform: translate3d(var(--drift), 116vh, 0) rotateY(var(--turn)) rotateZ(720deg) scale(1.08); opacity: 0; }
}

@keyframes specialTokenFall {
  0% { transform: translate3d(0, -60px, 0) rotate(0deg) scale(0.4); opacity: 0; }
  9% { opacity: 1; }
  74% { opacity: 1; }
  100% { transform: translate3d(var(--drift), 116vh, 0) rotate(var(--turn)) scale(1.08); opacity: 0; }
}

@keyframes specialScreenFlash {
  0% { opacity: 0; }
  18% { opacity: 0.78; }
  42% { opacity: 0.18; }
  68% { opacity: 0.5; }
  100% { opacity: 0; }
}

.footer-links {
  gap: 12px;
  font-size: 0.78rem;
}

@media (max-width: 760px), (pointer: coarse) {
  .site-header {
    background: rgba(255, 250, 248, 0.97);
    backdrop-filter: none;
  }

  .result-card.is-golden-rush,
  .result-card.is-legend-pick,
  .result-card.is-hidden-gem {
    animation: none;
    filter: none;
  }

  .result-card.is-golden-rush,
  .result-card.is-golden-rush.is-special-hit {
    box-shadow:
      0 18px 42px rgba(218, 154, 0, 0.28),
      0 0 0 3px rgba(255, 210, 66, 0.78);
  }

  .result-card.is-legend-pick,
  .result-card.is-legend-pick.is-special-hit {
    box-shadow:
      0 18px 42px rgba(151, 18, 38, 0.26),
      0 0 0 3px rgba(232, 185, 55, 0.78);
  }

  .result-card.is-hidden-gem,
  .result-card.is-hidden-gem.is-special-hit {
    box-shadow:
      0 18px 42px rgba(32, 196, 165, 0.24),
      0 0 0 3px rgba(115, 251, 211, 0.74);
  }

  .result-card.is-rolling .result-poster {
    animation: none;
    filter: none;
  }

  .result-card.is-revealed {
    will-change: transform;
  }

  .confetti-piece,
  .confetti-piece.is-golden,
  .confetti-piece.is-legend,
  .confetti-piece.is-hidden,
  .gold-coin,
  .legend-emblem,
  .hidden-ticket {
    box-shadow: none;
  }

  .confetti-piece {
    width: 9px;
    height: 15px;
  }
}

@media (max-width: 620px) {
  .special-cut-in {
    padding: 12px 16px;
    font-size: 2rem;
  }

  .header-inner {
    display: flex;
    min-height: 56px;
    padding: 0;
    gap: 6px;
  }

  .home-main-nav {
    gap: 2px;
  }

  .home-main-nav a {
    min-width: 0;
    min-height: 34px;
    padding: 7px 5px;
    font-size: 0.78rem;
  }

  .home-nav-wide {
    display: none;
  }

  .home-nav-short {
    display: inline;
  }

  .hero {
    padding-top: 20px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 10vw, 2.5rem);
    word-break: keep-all;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn-primary {
    width: min(100%, 340px);
  }

  .result-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tag-groups {
    grid-template-columns: 1fr;
  }

  .result-card.is-empty {
    min-height: 290px;
  }

  .draw-stage-button {
    min-height: 82px;
    width: min(100%, 340px);
    padding: 0 22px;
    font-size: 1.75rem;
  }

  .result-poster {
    min-height: 168px;
  }

  .result-content {
    padding: 0;
  }

  .result-reason {
    font-size: 0.84rem;
  }

  .result-note-label {
    margin-top: 10px;
  }

  .result-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .result-actions .btn-primary {
    grid-column: 1 / -1;
  }

  .result-actions.has-active-tags .btn-primary {
    grid-column: span 2;
  }

  .result-actions .btn-tag-reset {
    grid-column: span 1;
    min-width: 0;
    padding-inline: 5px;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .result-actions .btn-ghost,
  .result-actions .btn-search,
  .result-actions .btn-share {
    min-height: 44px;
    padding: 0 5px;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .result-actions .action-icon {
    display: none;
  }

  .site-footer > .shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer > .shell > .footer-links {
    justify-content: flex-start;
    margin-top: 6px;
  }

  .legal-toolbar {
    margin-bottom: 18px;
    justify-content: space-between;
  }

  .legal-list li,
  .legal-service-list li {
    padding: 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .site-header .brand {
    min-width: 44px;
  }

  .site-header .brand > span:last-child {
    display: none;
  }

  .result-reason {
    padding: 7px 6px;
    font-size: 0.68rem;
  }

  .result-reason.is-long-reason {
    font-size: 0.64rem;
  }

}

/* Compact homepage paths: the picker stays primary; trust content lives one click away. */
.home-essentials {
  margin-top: 52px;
  margin-bottom: 72px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.home-essentials-heading {
  max-width: 680px;
}

.home-essentials-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.25;
  word-break: keep-all;
}

.home-essentials-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.home-essentials-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.home-essentials-links a {
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.home-essentials-links a:hover,
.home-essentials-links a:focus-visible {
  border-color: #e0aaa3;
  background: #fff;
  outline: none;
}

.home-essentials-links strong {
  color: var(--text);
  font-size: 0.98rem;
}

.home-essentials-links span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.home-trust-note {
  margin: 18px 0 0;
  color: #5e5661;
  font-size: 0.84rem;
  line-height: 1.65;
}

.home-trust-note a {
  margin-left: 4px;
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-trust-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.home-trust-stats > div {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-left: 1px solid var(--line);
}

.home-trust-stats > div:first-child {
  border-left: 0;
}

.home-trust-stats dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.home-trust-stats dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .site-footer > .shell.footer-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .footer-navigation {
    width: 100%;
    justify-items: start;
  }

  .footer-legal-links,
  .footer-more .footer-links {
    justify-content: flex-start;
  }

  .footer-more {
    width: 100%;
  }

  .footer-more summary {
    justify-content: flex-start;
  }

  .home-essentials {
    margin-top: 42px;
    margin-bottom: 54px;
    padding-top: 32px;
  }

  .home-essentials-links {
    grid-template-columns: 1fr;
  }

  .home-essentials-links a {
    min-height: 78px;
  }

  .home-trust-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-trust-stats > div:nth-child(odd) {
    border-left: 0;
  }

  .home-trust-stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 360px) {
  .control-panel .section-heading h2 {
    font-size: 1.42rem;
    word-break: keep-all;
  }
}

.home-main-nav a,
.sound-toggle,
.tag-group .tag-button,
.brand {
  min-height: 44px;
}

.home-main-nav a,
.sound-toggle {
  min-width: 44px;
}

.home-main-nav a {
  white-space: nowrap;
}

.result-tags {
  min-height: 42px;
  max-height: 58px;
}

.poster-neutral .poster-label,
.poster-neutral .poster-symbol {
  color: #334155;
}
