.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--color-surface);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hud__title {
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.hud__status {
  display: flex;
  gap: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
}

.screens {
  width: min(780px, 100%);
}

.screen {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.screen--active {
  opacity: 1;
  transform: none;
}

.screen--hidden {
  display: none;
}

.screen__title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.screen__copy {
  color: var(--color-muted);
  line-height: 1.6;
  max-width: 52ch;
  margin-inline: auto;
}

.screen__cta {
  margin-top: 2rem;
}

.prepare-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  width: 100%;
}

.ticket-card,
.payout-card,
.draw-status,
.resolve-summary {
  background: var(--color-card);
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid var(--color-card-border);
  text-align: left;
}

.ticket-card__header,
.payout-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ticket-card__numbers {
  display: flex;
  gap: 0.75rem;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  justify-content: center;
  align-items: center;
  color: var(--color-accent);
}

.ticket-card__power {
  margin-top: 1rem;
  font-size: 1.1rem;
}

.ticket-card__note {
  margin-top: 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.ticket-card__empty {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.ticket-card__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  width: 100%;
  justify-content: center;
}

.ticket-row__label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.ball--match {
  box-shadow: 0 0 0 3px rgba(76, 217, 100, 0.7), inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.ball--selected {
  box-shadow: 0 0 0 3px rgba(230, 154, 42, 0.6), inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.ball--white {
  background: #f5f7fa;
  color: #1b2431;
}

.ball--gold {
  background: linear-gradient(135deg, #f9d976, #f39f86);
  color: #1b2431;
}

.ball--blue {
  background: linear-gradient(135deg, #90c2ff, #437dd1);
  color: #0a1630;
}

.ball--black {
  background: linear-gradient(135deg, #3c3f46, #0f1116);
  color: #f5f7fa;
}

.ball--red,
.ball--power {
  background: linear-gradient(135deg, #ff6b6b, #c9184a);
  color: #fefefe;
}

.ball--selected {
  box-shadow: 0 0 0 3px rgba(230, 154, 42, 0.5);
}

.ball-stack {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.payout-card__hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.payout-table {
  width: 100%;
  border-collapse: collapse;
}

.payout-table th,
.payout-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.payout-table tbody tr:last-child td {
  border-bottom: none;
}

.draw-status {
  width: 100%;
  margin-top: 1.5rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.draw-status__queue {
  font-size: 0.95rem;
  color: var(--color-muted);
}

.draw-timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 0;
  margin: 0;
}

.draw-timeline__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem;
  align-items: start;
  opacity: 0;
  transform: translateY(6px);
}

.draw-timeline__item--enter {
  animation: timelineEnter 220ms ease forwards;
}

.draw-timeline__marker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.draw-timeline__content {
  background: var(--color-card-highlight);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.draw-timeline__content .ball {
  width: 2rem;
  height: 2rem;
  font-size: 0.95rem;
}

.resolve-summary {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.breakdown-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.25rem;
}

.breakdown-list dt {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.breakdown-list dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.resolve-notes {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.resolve-notes ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.black-market {
  margin-top: 2.5rem;
  background: var(--color-card);
  border-radius: 14px;
  border: 1px solid var(--color-card-border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.black-market--highlight {
  box-shadow: 0 0 0 3px rgba(230, 154, 42, 0.45);
  transition: box-shadow 200ms ease;
}

.black-market__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.black-market__hint {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.black-market__standing {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.black-market__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.black-market__cost {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.black-market__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.black-market__subhead {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.shop-card {
  border: 1px solid var(--color-card-border);
  background: var(--color-card);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.shop-card__title {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
}

.shop-card__rarity {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.shop-card__family {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.shop-card__description {
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.shop-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 0.75rem;
}

.shop-card__price {
  font-weight: 600;
  color: var(--color-accent);
}

.shop-card--purchased {
  opacity: 0.6;
  border-style: dashed;
}

.misprint-inventory {
  margin-top: 2.5rem;
  background: var(--color-card);
  border-radius: 14px;
  border: 1px solid var(--color-card-border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.misprint-inventory__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.misprint-inventory__hint {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.misprint-inventory__slots,
.misprint-inventory__owned {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.misprint-card {
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--color-card);
}

.misprint-card--owned {
  background: var(--color-card-highlight);
}

.misprint-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.misprint-card__description {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
  min-height: 2.4em;
}

.misprint-card__controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.misprint-card__rarity {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.misprint-card__empty {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.ten-draw {
  margin-top: 2.5rem;
  background: var(--color-card);
  border-radius: 14px;
  border: 1px solid var(--color-card-border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ten-draw__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ten-draw__hint {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.ten-draw__balls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ten-draw-ball {
  padding: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.ten-draw-ball:hover {
  transform: translateY(-1px);
}

.ten-draw__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ten-draw-card {
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--color-card);
}

.ten-draw-card--used {
  opacity: 0.55;
}

.ten-draw-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.ten-draw-card__heat {
  font-size: 0.78rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ten-draw-card__description {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
  min-height: 2.2em;
}

.ten-draw-card__footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.ten-draw-card__select {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--color-card-border);
  background: var(--color-surface);
  color: inherit;
}

.ten-draw-card__hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-right: auto;
}

.ten-draw-card__hint--error {
  color: #ff6b6b;
  font-weight: 600;
}

.hud__highlight {
  color: #ffcf5c !important;
  transition: color 160ms ease;
}

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  background: rgba(19, 24, 31, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.85rem 1rem;
  color: var(--color-text);
  font-size: 0.9rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(-10px);
  animation: toastFade 260ms ease forwards;
}

.toast--info {
  border-color: rgba(86, 173, 255, 0.4);
}

.toast--notice {
  border-color: rgba(230, 154, 42, 0.6);
}

.toast--warning {
  border-color: rgba(255, 94, 94, 0.7);
}

.toast__title {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.toast__message {
  line-height: 1.4;
}

.safety-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 3000;
}

.safety-overlay__content {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  border: 1px solid var(--color-card-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.safety-overlay__title {
  font-size: 1.4rem;
}

.safety-overlay__message {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.safety-overlay__list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tooltip {
  position: fixed;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  background: rgba(19, 24, 31, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.78rem;
  line-height: 1.4;
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -4px, 0);
  transition: opacity 140ms ease, transform 140ms ease;
}

.tooltip--visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(19, 24, 31, 0.95) transparent transparent transparent;
}

@keyframes timelineEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    transition: none;
    transform: none;
  }

  .draw-timeline__item,
  .toast {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .tooltip {
    transition: none;
  }
}
.draw-overview {
  display: grid;
  gap: 1rem;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.draw-tickets {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  padding: 1rem;
}

.draw-ticket {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.draw-ticket__empty {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.draw-ticket__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.draw-ticket__numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.draw-misprints {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  padding: 1rem;
}

.draw-misprint {
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--color-card-highlight);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.draw-misprint__name {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.draw-misprint__description {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.draw-misprint__status {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.draw-misprint--triggered {
  border-color: rgba(230, 154, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(230, 154, 42, 0.3);
}
