:root {
  --bg: #080404;
  --bg-deep: #120707;
  --card: rgba(24, 12, 10, 0.92);
  --card-strong: rgba(42, 14, 10, 0.94);
  --red: #d22630;
  --red-dark: #7f1219;
  --gold: #f3b54a;
  --gold-soft: #ffd98a;
  --ember: #ff6b22;
  --text: #fff5e6;
  --muted: #c9a98f;
  --line: rgba(255, 185, 78, 0.24);
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.55);
  --radius: 28px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(210, 38, 48, 0.24), transparent 30rem),
    radial-gradient(circle at 80% 0%, rgba(255, 107, 34, 0.16), transparent 24rem),
    linear-gradient(145deg, #050303 0%, var(--bg-deep) 52%, #180806 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 185, 78, 0.34) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 88, 32, 0.18) 0 1px, transparent 2px);
  background-position: 0 0, 34px 58px;
  background-size: 90px 90px, 130px 130px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 78%, transparent);
  opacity: 0.55;
}

button {
  font: inherit;
  touch-action: manipulation;
}

.app-shell {
  width: min(1120px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
}

.hero {
  padding: clamp(1rem, 4vw, 2.25rem) 0 clamp(1rem, 3vw, 1.5rem);
  text-align: center;
}

.eyebrow,
.side-kicker,
.result-side,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
.operator-name {
  margin: 0;
  line-height: 1;
  text-wrap: balance;
}

h1 {
  margin-top: 0.45rem;
  font-size: clamp(2.25rem, 8vw, 5.8rem);
  letter-spacing: -0.08em;
  text-shadow:
    0 0 24px rgba(210, 38, 48, 0.55),
    0 0 58px rgba(255, 107, 34, 0.3);
}

.subtitle {
  max-width: 42rem;
  margin: 1rem auto 0;
  color: var(--gold-soft);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
}

.picker-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.operator-card,
.utility-panel {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.operator-card {
  display: flex;
  min-width: 0;
  min-height: 34rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  flex-direction: column;
  background:
    linear-gradient(160deg, rgba(255, 185, 78, 0.08), transparent 40%),
    linear-gradient(180deg, var(--card-strong), var(--card));
}

.operator-card::after,
.utility-panel::after {
  position: absolute;
  right: -5rem;
  bottom: -7rem;
  width: 17rem;
  height: 17rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 107, 34, 0.24), transparent 64%);
  content: "";
  pointer-events: none;
}

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

.side-pill {
  border: 1px solid rgba(243, 181, 74, 0.35);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  margin-top: 0.75rem;
  font-size: clamp(2rem, 5vw, 3.45rem);
  letter-spacing: -0.05em;
}

.result-panel {
  display: grid;
  flex: 1;
  place-items: center;
  margin: clamp(1rem, 3vw, 1.5rem) 0;
  border: 1px solid rgba(255, 185, 78, 0.15);
  border-radius: calc(var(--radius) - 0.7rem);
  padding: clamp(1rem, 4vw, 2rem);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 107, 34, 0.2), transparent 47%),
    rgba(0, 0, 0, 0.24);
  text-align: center;
}

.logo-frame {
  display: grid;
  width: min(78vw, 18rem);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(243, 181, 74, 0.16), transparent 58%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.08));
  filter: drop-shadow(0 0 28px rgba(255, 107, 34, 0.28));
}

.operator-logo {
  width: 82%;
  max-width: 100%;
  height: 82%;
  object-fit: contain;
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.operator-card.is-rolling .operator-logo {
  filter: drop-shadow(0 0 22px rgba(243, 181, 74, 0.7));
  transform: scale(1.05) rotate(-2deg);
}

.result-side {
  margin-top: 0.4rem;
  color: var(--gold);
}

.operator-name {
  margin-top: 0.55rem;
  font-size: clamp(2.2rem, 8vw, 4.25rem);
  font-weight: 950;
  letter-spacing: -0.08em;
}

.roll-button {
  position: relative;
  z-index: 1;
  min-height: 3.4rem;
  border: 0;
  border-radius: 1rem;
  padding: 0.95rem 1.25rem;
  color: #1b0804;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 48%, #d47b24);
  box-shadow:
    0 12px 28px rgba(255, 107, 34, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.roll-button:hover:not(:disabled),
.roll-button:focus-visible:not(:disabled) {
  outline: 3px solid rgba(255, 217, 138, 0.48);
  outline-offset: 3px;
  transform: translateY(-1px);
}

.roll-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.roll-button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.62;
}

.utility-panel {
  display: grid;
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  padding: clamp(1rem, 3vw, 1.35rem);
  place-items: center;
  gap: 0.8rem;
  background: rgba(11, 5, 5, 0.78);
  text-align: center;
}

.roll-button-small {
  width: min(100%, 20rem);
  min-height: 3rem;
  padding: 0.78rem 1rem;
  color: var(--text);
  background: linear-gradient(180deg, var(--red), var(--red-dark));
}

.jambo-says {
  min-height: 1.6rem;
  margin: 0;
  color: var(--gold-soft);
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  font-weight: 850;
}

.hint {
  letter-spacing: 0.08em;
  text-transform: none;
}

@media (max-width: 780px) {
  :root {
    --radius: 22px;
    --shadow: 0 14px 38px rgba(0, 0, 0, 0.46);
  }

  .app-shell {
    padding: 0.75rem;
  }

  .hero {
    padding: 0.6rem 0 0.85rem;
  }

  h1 {
    margin-top: 0.35rem;
    font-size: clamp(2rem, 9vw, 3.1rem);
    letter-spacing: -0.065em;
  }

  .subtitle {
    margin-top: 0.55rem;
    font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  }

  .picker-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .operator-card {
    min-height: auto;
    padding: 0.85rem;
  }

  h2 {
    margin-top: 0.45rem;
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .result-panel {
    min-height: 17rem;
    margin: 0.75rem 0;
    padding: 0.8rem;
  }

  .logo-frame {
    width: min(58vw, 13.5rem);
  }

  .operator-name {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .utility-panel {
    margin-top: 0.75rem;
    padding: 0.85rem;
    gap: 0.6rem;
  }
}

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

  .hero {
    padding-top: 0.35rem;
    padding-bottom: 0.65rem;
  }

  .eyebrow,
  .side-kicker,
  .result-side,
  .hint {
    font-size: 0.68rem;
    letter-spacing: 0.11em;
  }

  h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.25rem);
    letter-spacing: -0.045em;
    text-shadow:
      0 0 16px rgba(210, 38, 48, 0.48),
      0 0 34px rgba(255, 107, 34, 0.24);
  }

  .subtitle {
    max-width: 20rem;
    margin-top: 0.45rem;
    font-size: 0.95rem;
  }

  .picker-grid {
    gap: 0.6rem;
  }

  .operator-card {
    padding: 0.7rem;
  }

  .side-pill {
    padding: 0.35rem 0.55rem;
    font-size: 0.68rem;
  }

  h2 {
    margin-top: 0.35rem;
    font-size: 1.55rem;
  }

  .result-panel {
    min-height: 13.25rem;
    margin: 0.55rem 0;
    padding: 0.65rem;
  }

  .logo-frame {
    width: min(52vw, 10.75rem);
  }

  .operator-name {
    margin-top: 0.35rem;
    font-size: clamp(1.75rem, 8.5vw, 2.35rem);
    letter-spacing: -0.055em;
  }

  .roll-button {
    min-height: 3.05rem;
    border-radius: 0.85rem;
    padding: 0.75rem 0.9rem;
  }

  .roll-button-small {
    min-height: 2.8rem;
  }

  .utility-panel {
    margin-top: 0.6rem;
    padding: 0.7rem;
  }

  .jambo-says {
    min-height: 1.35rem;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .operator-card.is-rolling .operator-logo {
    transform: none;
  }
}
