

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

body {
  background: #0a0a0a;
  color: #d4d4d4;
  font-family: 'Courier New', 'Menlo', monospace;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

main {
  max-width: 36rem;
  width: 100%;
  text-align: center;
}

.mark {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.85rem;
  margin-bottom: 1.85rem;
  border-bottom: 1px solid #1a1a1a;
}

.brand {
  font-family: 'Georgia', 'Garamond', serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: #6a6a6a;
}

.serial {
  font-family: 'Courier New', 'Menlo', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: #6a6a6a;
}

h1 {
  font-family: 'Georgia', 'Garamond', serif;
  font-size: 3rem;
  font-weight: 400;
  color: #fafafa;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
}

.rules {
  font-size: 0.95rem;
  color: #8a8a8a;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.wheel-mount {
  width: 100%;
  max-width: 22rem;
  margin: 2.5rem auto 1.5rem;
  display: flex;
  justify-content: center;
  
  background: radial-gradient(circle at center, #0f0f0f 0%, #0a0a0a 70%);
  padding: 0.5rem;
}

.wheel-svg {
  width: 100%;
  height: auto;
  display: block;
  
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.7));
}

#wheel-rotor {
  transform-origin: 0 0;
  transform: rotate(0deg);
  
}

#wheel-idle {
  transform-origin: 0 0;
  animation: idle-drift 14s ease-in-out infinite;
}

[data-spinning="true"] #wheel-idle {
  animation-play-state: paused;
}

@keyframes idle-drift {
  0%, 100% { transform: rotate(-0.45deg); }
  50%      { transform: rotate(0.45deg);  }
}

.wheel-segment {
  
  pointer-events: none;
}

.wheel-label {
  fill: #d4d4d4;
  font-family: 'Courier New', 'Menlo', monospace;
  font-size: 13px;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.05em;
  user-select: none;
  pointer-events: none;
}

.wheel-hub {
  fill: #0a0a0a;
  stroke: #4a0010;
  stroke-width: 1.5;
}

.wheel-pointer {
  fill: #9F1239;
  stroke: #c41a45;
  stroke-width: 1;
  
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.wheel-pointer-wrap {
  transform-origin: 0 -188px;
  animation: pointer-pulse 1.6s ease-in-out infinite;
}

@keyframes pointer-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.wheel-hub {
  
  animation: hub-breathe 3.4s ease-in-out infinite;
}

@keyframes hub-breathe {
  0%, 100% { opacity: 0.88; }
  50%      { opacity: 1; }
}

.wheel-rivet {
  filter: drop-shadow(0 0 3px rgba(159, 18, 57, 0.7));
}

.wheel-segment[data-amount="1000"] {
  filter: drop-shadow(0 0 6px rgba(159, 18, 57, 0.55));
}

@media (prefers-reduced-motion: reduce) {
  .wheel-pointer-wrap,
  .wheel-hub,
  #wheel-idle {
    animation: none !important;
  }
  .receipt-row--amount .receipt-value.revealing {
    animation: none !important;
  }
}

#spin-button {
  background: linear-gradient(180deg, #1a0008 0%, #0a0004 100%);
  border: 1px solid #4a0010;
  border-top: 1px solid #6a0018;
  color: #d4d4d4;
  font-family: inherit;
  font-size: 1.25rem;
  padding: 1rem 3rem;
  margin: 0.5rem 0 2.5rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow:
    inset 0 1px 0 rgba(159, 18, 57, 0.15),
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.6);
  transition:
    background 220ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 220ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 120ms ease,
    box-shadow 220ms ease;
}

#spin-button:hover {
  background: linear-gradient(180deg, #2a000c 0%, #14000a 100%);
  border-color: #7a0018;
  border-top-color: #9F1239;
  box-shadow:
    inset 0 1px 0 rgba(196, 26, 69, 0.25),
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(159, 18, 57, 0.18);
}

#spin-button:focus-visible {
  outline: 2px solid #9F1239;
  outline-offset: 3px;
}

#spin-button:active {
  background: linear-gradient(180deg, #0a0004 0%, #1a0008 100%);
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 0 rgba(0, 0, 0, 0);
}

#spin-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notice {
  margin: 0 auto 1.5rem;
  max-width: 30rem;
  min-height: 1.5rem;
  padding: 0 1rem;
  font-family: 'Courier New', 'Menlo', monospace;
  font-size: 0.9rem;
  color: #8a8a8a;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transition: opacity 240ms ease;
}

.notice[data-visible="true"] {
  opacity: 1;
}

.receipt {
  margin: 0 auto 2rem;
  max-width: 30rem;
  padding: 1.25rem 1.5rem 1.4rem;
  border: 1px dashed #2a2a2a;
  border-top: 2px solid #4a0010;
  background: linear-gradient(180deg, #0c0c0c 0%, #0a0a0a 100%);
  font-family: 'Courier New', 'Menlo', monospace;
  text-align: left;
  transition: border-top-color 480ms ease;
}

.receipt[data-state="filled"] {
  border-top-color: #9F1239;
}

.receipt-row {
  display: grid;
  align-items: end;
  gap: 0.5rem;
  margin: 0.4rem 0;
  
}

.receipt-row--amount { grid-template-columns: 5rem 1fr 14rem; }
.receipt-row--code   { grid-template-columns: 5rem 1fr 10rem; }
.receipt-row--at     { grid-template-columns: 5rem 1fr 14rem; }

.receipt-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #6a6a6a;
  
}

.receipt-leader {
  border-bottom: 1px dotted #2a2a2a;
  height: 0.5rem;
  align-self: end;
  margin-bottom: 0.3rem;
}

.receipt-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  user-select: all;
  
  opacity: 0.35;
  transition: opacity 420ms ease;
  
}

.receipt[data-state="filled"] .receipt-value {
  opacity: 1;
}

.receipt-value:focus-visible {
  outline: 1px solid #9F1239;
  outline-offset: 2px;
}

.receipt-row--amount .receipt-value {
  font-family: 'Georgia', 'Garamond', serif;
  font-size: 1.45rem;
  line-height: 1.2;
  min-height: 1.74rem; 
  color: #fafafa;
  letter-spacing: 0.01em;
}

.receipt-row--code .receipt-value {
  font-size: 1.05rem;
  line-height: 1.2;
  min-height: 1.26rem;
  color: #b08080;
  letter-spacing: 0.14em;
}

.receipt-row--at .receipt-value {
  font-size: 0.78rem;
  line-height: 1.35;
  min-height: 1.05rem;
  color: #6a6a6a;
  letter-spacing: 0.05em;
  
  word-break: break-all;
}

.receipt-row--amount { min-height: 1.85rem; }
.receipt-row--code   { min-height: 1.4rem; }
.receipt-row--at     { min-height: 1.2rem; }

@media (max-width: 28rem) {
  .receipt-row--amount,
  .receipt-row--code,
  .receipt-row--at {
    grid-template-columns: 4rem 1fr;
  }
  .receipt-leader {
    display: none;
  }
  .receipt-row--amount .receipt-value { font-size: 1.2rem; }
  .receipt-row--at .receipt-value { font-size: 0.72rem; }
}

.receipt-row--amount .receipt-value.revealing {
  animation: result-emerge 620ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes result-emerge {
  0%   { opacity: 0;    color: #9F1239; }
  50%  {                color: #d4889a; }
  100% { opacity: 1;    color: #fafafa; }
}

footer {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: #7a7a7a;
  border-top: 1px solid #1a1a1a;
  padding-top: 1.5rem;
}

.footnote {
  font-size: 0.72rem;
  color: #6a6a6a;
  margin-top: 0.75rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  #wheel-rotor {
    transition: transform 600ms linear !important;
  }
}
