:root {
  color-scheme: dark;
  --bg: #111313;
  --panel: #ede4d2;
  --ink: #171717;
  --muted: #a69d8d;
  --line: rgba(237, 228, 210, 0.18);
  --red: #c83e35;
  --green: #41c76a;
  --gold: #d6a14a;
  --blue: #3f7ea3;
  --violet: #6e557c;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  --machine-width: min(100%, 1060px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% -12%, rgba(214, 161, 74, 0.28), transparent 32rem),
    radial-gradient(circle at 8% 24%, rgba(200, 62, 53, 0.14), transparent 18rem),
    linear-gradient(135deg, #171918 0%, #0c0f0f 47%, #190f0d 100%);
  color: #f7efe0;
}

button,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: clamp(0.8rem, 1.6vw, 1.5rem);
}

.hero {
  position: relative;
  display: grid;
  gap: clamp(0.75rem, 1.3vw, 1.15rem);
  max-width: 1580px;
  margin: 0 auto;
}

.stamp {
  position: absolute;
  top: 1.45rem;
  left: 1.4rem;
  transform: rotate(-8deg);
  border: 3px solid rgba(200, 62, 53, 0.82);
  border-radius: 8px;
  color: #e15950;
  padding: 0.62rem 0.95rem;
  font-weight: 900;
  font-size: clamp(0.9rem, 1.55vw, 1.42rem);
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.15;
  box-shadow: inset 0 0 0 1px rgba(200, 62, 53, 0.25);
}

.help-button {
  position: absolute;
  top: 1.3rem;
  right: 1.35rem;
  min-height: 3.25rem;
  border: 1px solid rgba(214, 161, 74, 0.46);
  border-radius: 8px;
  padding: 0 1rem 0 2.7rem;
  background:
    radial-gradient(circle at 1.45rem 50%, transparent 0 0.72rem, rgba(214, 161, 74, 0.78) 0.74rem 0.78rem, transparent 0.8rem),
    linear-gradient(180deg, #24211d, #121313);
  color: #dfd0ba;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.help-button::before {
  content: "i";
  position: absolute;
  left: 1.22rem;
  top: 50%;
  transform: translateY(-53%);
  color: #f5d28b;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 900;
}

.masthead {
  position: relative;
  text-align: center;
  padding-top: 0;
}

.masthead::after {
  content: "";
  display: block;
  width: min(520px, 74vw);
  height: 20px;
  margin: 0.25rem auto 0;
  background:
    linear-gradient(90deg, transparent 0 11%, #b83a32 11% 15%, transparent 15% 20%, #b83a32 20% 21%, transparent 21% 26%, #b83a32 26% 30%, transparent 30% 70%, #b83a32 70% 74%, transparent 74% 79%, #b83a32 79% 80%, transparent 80% 85%, #b83a32 85% 89%, transparent 89% 100%),
    linear-gradient(#b83a32, #b83a32) center / 100% 2px no-repeat;
  opacity: 0.9;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1.1vw, 1rem);
  font-weight: 800;
}

h1 {
  margin: 0.1rem 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 8.3vw, 8.45rem);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #ffcf73;
  -webkit-text-stroke: 2px #762719;
  text-shadow:
    0 1px 0 #fff1b1,
    0 2px 0 #8d3b25,
    0 5px 0 #5c231b,
    0 8px 0 #31100c,
    0 0 16px rgba(255, 207, 115, 0.75),
    0 0 34px rgba(235, 108, 62, 0.58);
}

.tagline {
  margin: 0.25rem auto 0;
  max-width: 48rem;
  color: #d3c8b6;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 650;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  max-width: 830px;
  width: 100%;
  margin: 0 auto;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #efe8dc;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 3.6rem;
  border: 1px solid rgba(237, 228, 210, 0.32);
  border-radius: 8px;
  padding: 0 1rem;
  background: #1d1c1a;
  color: #f7efe0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.refresh-button {
  min-height: 1.9rem;
  border: 1px solid rgba(237, 228, 210, 0.2);
  border-radius: 8px;
  padding: 0 0.7rem;
  background: rgba(237, 228, 210, 0.06);
  color: #d8cdbc;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}

.refresh-button:hover {
  border-color: rgba(65, 199, 106, 0.42);
  color: #b9f7c7;
  background: rgba(65, 199, 106, 0.08);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.machine-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--machine-width)) 220px;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 1.6vw, 1.4rem);
  margin-bottom: 2.25rem;
}

.slot-machine {
  position: relative;
  width: var(--machine-width);
  border: 1px solid rgba(237, 228, 210, 0.24);
  border-radius: 26px 26px 8px 8px;
  padding: clamp(1.25rem, 2vw, 1.7rem);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 14%, transparent 86%, rgba(0, 0, 0, 0.38)),
    radial-gradient(circle at 12px 12px, #f4cc77 0 3px, transparent 4px) 0 0 / 42px 42px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 18%),
    linear-gradient(135deg, #30302e, #111313 50%, #27201a);
  box-shadow:
    0 36px 80px rgba(0, 0, 0, 0.56),
    0 18px 0 #080908,
    18px 20px 0 rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.slot-machine::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(214, 161, 74, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.slot-machine::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 8%;
  bottom: -28px;
  height: 32px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #121313, #050606);
  filter: blur(0.2px);
  pointer-events: none;
}

.slot-window {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  overflow: hidden;
  border: 16px solid #171818;
  border-radius: 22px;
  background: #120f0d;
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.72),
    inset 0 16px 22px rgba(255, 255, 255, 0.08),
    inset 0 -22px 32px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(214, 161, 74, 0.55),
    0 18px 28px rgba(0, 0, 0, 0.42);
}

.reel {
  min-height: clamp(235px, 23vw, 335px);
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  justify-items: center;
  padding: 1rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.8), transparent 38%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.22), transparent 38%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.42)),
    repeating-linear-gradient(180deg, #f5eedf 0 92px, #dfd3bd 92px 96px, #f2eadb 96px 188px);
  color: var(--ink);
  text-align: center;
  box-shadow:
    inset 18px 0 28px rgba(0, 0, 0, 0.22),
    inset -18px 0 28px rgba(0, 0, 0, 0.2),
    inset 0 22px 28px rgba(255, 255, 255, 0.34),
    inset 0 -26px 30px rgba(0, 0, 0, 0.2);
}

.reel.spinning .symbol {
  animation: reel-flicker 0.16s linear infinite;
}

.reel-label {
  align-self: start;
  width: 100%;
  border-bottom: 2px solid rgba(23, 23, 23, 0.34);
  padding-bottom: 0.5rem;
  font-size: clamp(1.1rem, 1.65vw, 1.75rem);
  font-weight: 900;
}

.symbol {
  display: grid;
  gap: 0.65rem;
  align-items: center;
  justify-items: center;
  min-width: 0;
  width: 100%;
  color: #1d1d1b;
  font-size: clamp(1.35rem, 2.4vw, 2.35rem);
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.symbol-text {
  display: block;
}

.reel-icon {
  position: relative;
  display: block;
  width: clamp(82px, 8vw, 118px);
  height: clamp(82px, 8vw, 118px);
  color: var(--red);
}

.reel-icon.doctor {
  border-radius: 22% 22% 18% 18%;
  background:
    radial-gradient(circle at 50% 20%, var(--red) 0 16%, transparent 17%),
    radial-gradient(ellipse at 50% 86%, var(--red) 0 48%, transparent 49%);
}

.reel-icon.doctor::before,
.reel-icon.doctor::after {
  content: "";
  position: absolute;
  border: 5px solid var(--red);
}

.reel-icon.doctor::before {
  left: 18%;
  top: 45%;
  width: 22%;
  height: 30%;
  border-right: 0;
  border-bottom-left-radius: 20px;
}

.reel-icon.doctor::after {
  right: 18%;
  top: 45%;
  width: 22%;
  height: 30%;
  border-left: 0;
  border-bottom-right-radius: 20px;
}

.reel-icon.hospital {
  color: var(--blue);
  background:
    linear-gradient(var(--blue), var(--blue)) 16% 48% / 24% 44% no-repeat,
    linear-gradient(var(--blue), var(--blue)) 84% 48% / 24% 44% no-repeat,
    linear-gradient(var(--blue), var(--blue)) 50% 36% / 52% 62% no-repeat;
  border-bottom: 8px solid var(--blue);
}

.reel-icon.hospital::before,
.reel-icon.hospital::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  background: #f5eedf;
}

.reel-icon.hospital::before {
  width: 44%;
  height: 15%;
}

.reel-icon.hospital::after {
  width: 15%;
  height: 44%;
}

.reel-icon.calendar {
  color: #3d8f4f;
  border: 8px solid #3d8f4f;
  border-radius: 8px;
  background: rgba(61, 143, 79, 0.1);
}

.reel-icon.calendar::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -16%;
  height: 26%;
  border-left: 8px solid #3d8f4f;
  border-right: 8px solid #3d8f4f;
}

.reel-icon.calendar::after {
  content: "14";
  position: absolute;
  inset: 24% 0 auto;
  color: #2f703c;
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  font-weight: 950;
}

.reel-icon.warning {
  color: var(--red);
  border-radius: 50%;
  background:
    linear-gradient(var(--red), var(--red)) 50% 30% / 10% 38% no-repeat,
    radial-gradient(circle at 50% 75%, var(--red) 0 6%, transparent 7%),
    radial-gradient(circle, rgba(200, 62, 53, 0.18), transparent 64%);
  border: 7px solid var(--red);
}

.symbol small {
  display: block;
  margin-top: 0.4rem;
  color: #5f574d;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  font-weight: 800;
}

.payline {
  position: absolute;
  left: 2.15rem;
  right: 2.15rem;
  top: calc(1.7rem + clamp(118px, 11.5vw, 168px));
  height: 4px;
  background: linear-gradient(90deg, transparent, #fff6c9 18%, #ffffff, #fff6c9 82%, transparent);
  box-shadow: 0 0 20px rgba(255, 243, 171, 0.9);
  pointer-events: none;
}

.result-panel {
  margin-top: 0.9rem;
  border: 1px solid rgba(237, 228, 210, 0.2);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  background: #121615;
}

.result-panel.win {
  border-color: rgba(65, 199, 106, 0.7);
  background:
    radial-gradient(circle at 4rem 50%, rgba(65, 199, 106, 0.2), transparent 6rem),
    linear-gradient(180deg, #122116, #101915);
  box-shadow:
    inset 0 0 34px rgba(65, 199, 106, 0.22),
    inset 0 0 0 2px rgba(128, 255, 152, 0.2),
    0 0 22px rgba(65, 199, 106, 0.16);
}

.result-panel.lose {
  border-color: rgba(200, 62, 53, 0.72);
  box-shadow: inset 0 0 34px rgba(200, 62, 53, 0.15);
}

.result-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-panel h2 {
  margin: 0.1rem 0 0;
  font-size: clamp(1.8rem, 3.7vw, 3.35rem);
  line-height: 1;
}

.result-panel.win h2 {
  color: #9cffac;
  text-shadow: 0 0 14px rgba(65, 199, 106, 0.72);
}

.result-panel.win .result-kicker {
  color: #7fff9c;
}

.result-panel.win h2::before {
  content: "♕";
  display: inline-grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  margin-right: 0.55rem;
  border: 3px solid rgba(127, 255, 156, 0.85);
  border-radius: 50%;
  color: #9cffac;
  font-size: 1.7rem;
  vertical-align: middle;
  box-shadow: 0 0 14px rgba(65, 199, 106, 0.54);
}

.result-panel.lose h2 {
  color: #ff897f;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
  color: #eadfce;
}

.detail {
  min-width: 0;
  border: 1px solid rgba(237, 228, 210, 0.16);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(237, 228, 210, 0.06);
}

.result-panel.win .detail {
  border-color: rgba(214, 161, 74, 0.35);
  background: rgba(0, 0, 0, 0.24);
}

.result-panel.win .detail strong {
  color: #f8ead0;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail strong {
  display: block;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}

.lever-panel {
  display: grid;
  justify-items: center;
}

.lever {
  position: relative;
  width: 208px;
  min-height: 500px;
  border: 0;
  background: transparent;
  color: #fff5df;
  cursor: pointer;
}

.lever:disabled {
  cursor: wait;
  opacity: 0.72;
}

.lever-stick {
  position: absolute;
  top: 60px;
  left: 98px;
  width: 22px;
  height: 235px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7d5226, #f0bc68, #72451f);
  transform-origin: bottom center;
  transition: transform 0.25s ease;
  box-shadow:
    inset 4px 0 7px rgba(255, 255, 255, 0.35),
    inset -5px 0 8px rgba(0, 0, 0, 0.42),
    10px 8px 18px rgba(0, 0, 0, 0.34);
}

.lever.pulled .lever-stick {
  transform: rotate(14deg);
}

.lever-ball {
  position: absolute;
  top: 0;
  left: 60px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #ffb2a7, #d94338 36%, #6f1715 100%);
  box-shadow:
    inset 10px -12px 20px rgba(0, 0, 0, 0.28),
    inset -8px 9px 16px rgba(255, 255, 255, 0.3),
    0 18px 30px rgba(0, 0, 0, 0.48);
}

.lever-plate {
  position: absolute;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 208px;
  min-height: 168px;
  border: 6px solid #4f3822;
  border-radius: 8px;
  background: linear-gradient(180deg, #d85a43, #8b241f);
  box-shadow:
    inset 0 0 0 2px rgba(255, 232, 183, 0.38),
    inset 10px 0 16px rgba(255, 255, 255, 0.1),
    inset -12px 0 18px rgba(0, 0, 0, 0.28),
    0 18px 0 #3a2718,
    0 28px 38px rgba(0, 0, 0, 0.46);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1.05;
  text-transform: uppercase;
}

.more-results {
  display: grid;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-heading button {
  border: 1px solid rgba(237, 228, 210, 0.28);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  background: #1e1e1d;
  color: #f7efe0;
  cursor: pointer;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.provider-card {
  border: 1px solid rgba(237, 228, 210, 0.15);
  border-radius: 8px;
  padding: 0.95rem;
  background: rgba(237, 228, 210, 0.06);
}

.provider-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.provider-card p {
  margin: 0.25rem 0;
  color: #d8cdbc;
  line-height: 1.35;
}

.days-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  border-radius: 999px;
  padding: 0 0.65rem;
  background: rgba(65, 199, 106, 0.16);
  color: #8df0a9;
  font-weight: 900;
}

.data-note {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  max-width: 980px;
  margin: 0.75rem auto 0;
  color: #bfb3a1;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.45;
}

@keyframes reel-flicker {
  0% {
    transform: translateY(-18px);
    opacity: 0.35;
  }
  50% {
    transform: translateY(14px);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-8px);
    opacity: 0.48;
  }
}

@media (max-width: 920px) {
  .stamp {
    position: static;
    width: fit-content;
    margin: 0 auto;
  }

  .help-button {
    position: static;
    justify-self: center;
  }

  .machine-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .slot-machine {
    order: 2;
  }

  .lever-panel {
    order: 1;
  }

  .lever {
    width: min(100%, 460px);
    min-height: 86px;
  }

  .lever-stick,
  .lever-ball {
    display: none;
  }

  .lever-plate {
    position: static;
    width: 100%;
    min-height: 72px;
    font-size: 1.45rem;
  }

  .result-details,
  .result-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0.65rem;
  }

  .controls,
  .result-details,
  .result-list {
    grid-template-columns: 1fr;
  }

  .reel {
    min-height: 156px;
    padding: 0.45rem;
  }

  .masthead::after {
    height: 12px;
    margin-top: 0.1rem;
  }

  .tagline {
    margin-top: 0.25rem;
    font-size: 0.95rem;
  }

  .slot-machine {
    padding: 0.65rem;
  }

  .slot-window {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-width: 8px;
    gap: 0.25rem;
    border-radius: 14px;
  }

  .reel-label {
    padding-bottom: 0.3rem;
    font-size: 0.72rem;
  }

  .symbol {
    gap: 0.35rem;
    font-size: clamp(0.72rem, 3.2vw, 0.95rem);
    line-height: 1.08;
  }

  .symbol small {
    margin-top: 0.2rem;
    font-size: 0.62rem;
  }

  .reel-icon {
    width: clamp(38px, 14vw, 54px);
    height: clamp(38px, 14vw, 54px);
  }

  .reel-icon.doctor::before,
  .reel-icon.doctor::after {
    border-width: 3px;
  }

  .reel-icon.calendar {
    border-width: 5px;
  }

  .reel-icon.calendar::before {
    border-left-width: 5px;
    border-right-width: 5px;
  }

  .reel-icon.calendar::after {
    font-size: 1rem;
  }

  .reel-icon.warning {
    border-width: 5px;
  }

  .payline {
    display: block;
    left: 1rem;
    right: 1rem;
    top: calc(0.65rem + 78px);
    height: 2px;
  }

  .result-panel h2 {
    font-size: 1.45rem;
  }

  .result-details {
    gap: 0.45rem;
  }

  .detail {
    padding: 0.6rem;
  }

  .data-note {
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.78rem;
  }

  .refresh-button {
    min-height: 1.8rem;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
