:root {
  --yellow: #ffff00;
  --black: #000000;
  --dark-grey: #111111;
  --red: #ff3333;
  --green: #00ff8c;
  --orange: #ff9b2f;
  --mono-muted: #a3a3a3;
  --mono-subtle: #8d8d8d;
  --font-display: "Archivo Black", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

body {
  background-color: var(--black);
  color: var(--yellow);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  text-transform: uppercase;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 0, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

header {
  align-items: center;
  border-bottom: 2px solid var(--yellow);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 20px;
}

.system-status {
  align-items: center;
  display: flex;
  font-size: 10px;
  gap: 10px;
  letter-spacing: 1px;
}

.status-dot {
  animation: blink 0.5s infinite;
  background: var(--yellow);
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

@keyframes blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }

  100% {
    opacity: 1;
  }
}

.logo {
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-display);
  font-size: 24px;
  padding: 4px 15px;
}

.header-connect {
  align-items: center;
  display: flex;
  height: 100%;
  justify-self: end;
}

.connect-button {
  background: transparent;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  min-height: 40px;
  padding: 8px 14px;
  touch-action: manipulation;
}

.connect-button:disabled {
  opacity: 1;
}

main {
  display: grid;
  flex-grow: 1;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  overflow: hidden;
}

.panel {
  border-right: 1px solid rgba(255, 255, 0, 0.2);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 20px;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
}

.panel-right {
  border-left: 1px solid rgba(255, 255, 0, 0.2);
  border-right: none;
}

.panel-label {
  background: rgba(255, 255, 0, 0.1);
  display: inline-block;
  font-weight: 700;
  margin-bottom: 10px;
  padding: 5px 10px;
}

.feed-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ticker-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.ticker-scroll {
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  left: 0;
  position: absolute;
  right: 0;
}

.ticker-item {
  border-left: 2px solid var(--yellow);
  align-items: baseline;
  color: var(--mono-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  opacity: 0.72;
  padding-left: 8px;
}

.ticker-item.fail {
  border-color: #333;
}

.ticker-item.win {
  border-color: rgba(0, 255, 136, 0.6);
}

.ticker-item.cooldown {
  border-color: var(--yellow);
}

.ticker-item.closed {
  border-color: var(--red);
}

.ticker-item-meta {
  color: inherit;
}

.ticker-item-outcome {
  font-weight: 700;
  letter-spacing: 1px;
}

.ticker-item-score {
  font-weight: 700;
  letter-spacing: 1px;
}

.ticker-item.fail .ticker-item-outcome {
  color: #ff2d2d;
}

.ticker-item.win .ticker-item-outcome {
  color: var(--green);
}

.ticker-item.cooldown .ticker-item-outcome {
  color: #d9d900;
}

.ticker-item.closed .ticker-item-outcome {
  color: #ff8f8f;
}

.ticker-item-score.is-low {
  color: var(--red);
}

.ticker-item-score.is-mid {
  color: var(--orange);
}

.ticker-item-score.is-high {
  color: #d9d900;
}

.ticker-item-score.is-elite {
  color: #f2f2f2;
}

.ticker-item-score.is-win {
  color: var(--green);
}

.button-zone {
  align-items: center;
  background: radial-gradient(circle, #111 0%, #000 70%);
  display: flex;
  flex-direction: column;
  gap: 30px;
  justify-content: center;
  position: relative;
}

.prize-value {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 0.9;
  text-align: center;
}

.luck-button-wrapper {
  border: 1px solid var(--yellow);
  padding: 35px;
  position: relative;
  width: 98%;
}

#luck-button {
  background: var(--yellow);
  border: none;
  color: var(--black);
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 16rem);
  overflow: hidden;
  padding: 50px 10px;
  text-align: center;
  touch-action: manipulation;
  transition:
    transform 0.05s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    background 0.1s,
    color 0.1s,
    opacity 0.1s;
  user-select: none;
  width: 100%;
}

#luck-button:active:not(:disabled) {
  background: #fff;
  transform: scale(0.92);
}

#luck-button:disabled {
  opacity: 0.72;
}

#luck-button.is-fail {
  background: var(--red);
  color: var(--black);
}

#luck-button.is-win {
  background: var(--green);
  color: var(--black);
}

.caution-stripes {
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow),
    var(--yellow) 10px,
    var(--black) 10px,
    var(--black) 20px
  );
  height: 15px;
  margin: 10px 0;
  width: 100%;
}

.button-subhead {
  color: var(--mono-muted);
  font-size: 12px;
}

.button-id {
  bottom: -25px;
  font-size: 9px;
  position: absolute;
  right: 0;
}

.button-warning {
  color: var(--mono-subtle);
  font-size: 10px;
  line-height: 1.4;
  max-width: 430px;
  text-align: center;
}

.button-status {
  font-size: 10px;
  letter-spacing: 1px;
  min-height: 14px;
  text-align: center;
}

.button-status.is-error {
  color: var(--red);
}

.button-status.is-success {
  color: var(--green);
}

.turnstile-slot {
  min-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  transform: scale(0.8);
}

.time-panel {
  border-top: 1px solid #333;
  margin-top: auto;
  padding-top: 20px;
}

.countdown-text {
  font-size: 20px;
  font-weight: bold;
}

.time-subcopy {
  color: var(--mono-muted);
  margin-top: 5px;
}

.metrics-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.metric-label {
  color: var(--mono-muted);
}

.metric-value {
  font-size: 18px;
}

.location-panel {
  margin-top: auto;
}

.location-value {
  font-family: var(--font-display);
  font-size: 24px;
}

.location-meta {
  color: var(--mono-muted);
}

.mobile-gate {
  align-items: center;
  display: none;
  flex: 1;
  justify-content: center;
  padding: 24px;
}

.mobile-gate-panel {
  background: rgba(255, 255, 0, 0.06);
  border: 1px solid var(--yellow);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 0, 0.08);
  padding: 24px 22px;
  width: min(100%, 420px);
}

.mobile-gate-kicker {
  color: var(--mono-muted);
  font-size: 10px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.mobile-gate-title {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 13vw, 4.1rem);
  line-height: 0.86;
  margin-bottom: 16px;
  max-width: 8ch;
  text-wrap: balance;
}

.mobile-gate-copy {
  color: #d7d700;
  font-size: 12px;
  line-height: 1.55;
  max-width: 28ch;
}

.mobile-gate-meta {
  color: var(--mono-muted);
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 18px;
}

footer {
  align-items: center;
  background: var(--black);
  border-top: 2px solid var(--yellow);
  display: flex;
  font-size: 10px;
  gap: 40px;
  height: 60px;
  overflow: hidden;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.data-point {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.data-point span:first-child {
  color: var(--mono-muted);
  font-size: 8px;
}

.footer-link,
.mobile-gate-meta a {
  color: inherit;
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible,
.mobile-gate-meta a:hover,
.mobile-gate-meta a:focus-visible {
  color: var(--yellow);
}

.footer-marquee-wrap {
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  align-items: center;
  bottom: 0;
  cursor: pointer;
  display: flex;
  height: 100%;
  left: 50%;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  overflow: hidden;
  pointer-events: auto;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: clamp(220px, 30vw, 480px);
  z-index: 0;
}

.footer-copy-hint {
  color: var(--mono-muted);
  font-size: 8px;
  left: 50%;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 6px;
  transform: translate(-50%, -4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease;
  white-space: nowrap;
}

.footer-marquee-wrap.is-hovered .footer-copy-hint,
.footer-marquee-wrap.is-copied .footer-copy-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.footer-marquee-wrap.is-copied .footer-copy-hint {
  color: var(--yellow);
}

.footer-marquee {
  animation: footer-scroll 20s linear infinite;
  display: flex;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}

.footer-marquee-item {
  font-weight: 700;
  letter-spacing: 2px;
  padding: 0 40px;
}

@keyframes footer-scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.footer-note {
  font-weight: bold;
  letter-spacing: 2px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.flash-overlay {
  background: var(--yellow);
  height: 100%;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 2000;
}

.win-screen {
  align-items: center;
  background: var(--black);
  display: none;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  text-align: center;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.win-screen h2 {
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 20vw;
  line-height: 0.8;
}

.win-screen p {
  font-size: 24px;
  margin-top: 20px;
}

@media (max-width: 1280px), (max-height: 820px) {
  header {
    padding: 16px 18px;
  }

  main {
    grid-template-columns: 240px minmax(0, 1fr) 240px;
  }

  .panel {
    padding: 16px;
  }

  .button-zone {
    gap: 22px;
  }

  .luck-button-wrapper {
    padding: 24px;
  }

  #luck-button {
    font-size: clamp(5rem, 14vw, 12rem);
    padding: 38px 10px;
  }

  .prize-value {
    font-size: clamp(3.4rem, 10vw, 6.8rem);
  }

  footer {
    gap: 24px;
  }

  .footer-marquee-wrap {
    width: clamp(240px, 34vw, 430px);
  }
}

@media (max-height: 820px) {
  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
  }

  main {
    overflow: visible;
  }
}

@media (max-width: 1000px) {
  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
  }

  header {
    gap: 12px;
    grid-template-areas:
      "status connect"
      "logo logo";
    grid-template-columns: 1fr auto;
    padding: 14px 16px;
  }

  .system-status {
    flex-wrap: wrap;
    font-size: 9px;
    gap: 8px;
    grid-area: status;
    min-width: 0;
  }

  .logo {
    font-size: clamp(1.6rem, 8vw, 2.5rem);
    grid-area: logo;
    justify-self: start;
    padding: 4px 12px;
  }

  .header-connect {
    grid-area: connect;
  }

  .connect-button {
    padding: 10px 12px;
  }

  main {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .button-zone {
    gap: 18px;
    min-height: clamp(420px, 70vh, 620px);
    order: 1;
    padding: 22px 16px 28px;
  }

  .panel {
    border-right: none;
    border-top: 1px solid rgba(255, 255, 0, 0.18);
    display: flex;
    gap: 16px;
    min-height: auto;
    order: 2;
    overflow: visible;
    padding: 16px;
  }

  .panel-right {
    border-left: none;
    order: 3;
  }

  .feed-column {
    min-height: 220px;
  }

  .ticker-container {
    max-height: 220px;
    min-height: 190px;
  }

  .prize-value {
    font-size: clamp(3.2rem, 16vw, 5.8rem);
  }

  .luck-button-wrapper {
    max-width: 680px;
    padding: 18px 14px 28px;
    width: 100%;
  }

  #luck-button {
    font-size: clamp(4.4rem, 20vw, 8rem);
    padding: 32px 10px;
  }

  .button-subhead {
    font-size: 11px;
  }

  .button-warning {
    font-size: 9px;
    line-height: 1.5;
    max-width: none;
  }

  .button-id {
    bottom: -20px;
    font-size: 8px;
  }

  .metrics-stack {
    gap: 12px;
  }

  footer {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px 18px;
    height: auto;
    min-height: 60px;
    padding: 12px 16px 14px;
  }

  .data-point {
    min-width: calc(50% - 9px);
  }

  .footer-note {
    font-size: 9px;
    letter-spacing: 1px;
    margin-left: 0;
    order: 4;
    width: 100%;
  }

  .footer-marquee-wrap {
    bottom: auto;
    height: 34px;
    left: auto;
    min-width: 100%;
    order: 5;
    position: relative;
    top: auto;
    transform: none;
    width: 100%;
  }

  .footer-copy-hint {
    font-size: 7px;
    letter-spacing: 1.5px;
    top: -2px;
  }

  .footer-marquee-item {
    letter-spacing: 1.5px;
    padding: 0 28px;
  }
}

@media (max-width: 640px) {
  header {
    grid-template-areas:
      "logo"
      "status"
      "connect";
    grid-template-columns: 1fr;
  }

  .header-connect {
    justify-self: stretch;
  }

  .connect-button {
    width: 100%;
  }

  .panel,
  .button-zone,
  footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel-label {
    font-size: 10px;
  }

  .data-point {
    min-width: 100%;
  }

  .mobile-gate {
    padding: 18px;
  }
}

@media (max-width: 820px) and (hover: none) and (pointer: coarse) {
  body {
    height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  header,
  main,
  footer {
    display: none;
  }

  .mobile-gate {
    display: flex;
  }
}
