/* CODM CP Codes — demo simulator
   Everything is generated locally. Codes are fake. */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #04070a;
  --panel: #0a1117;
  --panel-2: #0d151c;
  --line: rgba(157, 255, 61, 0.14);
  --line-2: rgba(255, 255, 255, 0.08);
  --txt: #e8f2e6;
  --muted: #8fa197;
  --acc: #9dff3d;
  --acc-deep: #5bd600;
  --gold: #ffc857;
  --danger: #ff5c5c;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Hero background — swap this file to change the header image */
  --hero-image: url("assets/hero.jpg");
}

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 55% at 50% -10%, #0b1911 0%, transparent 55%),
    var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 330px;
  padding: calc(22px + env(safe-area-inset-top)) 20px 22px;
  border-bottom: 1px solid var(--line);
  background-color: #04070a;
  background-image:
    linear-gradient(180deg, rgba(4, 7, 10, 0) 0%, rgba(4, 7, 10, 0.5) 34%, rgba(4, 7, 10, 0.94) 66%, #04070a 100%),
    linear-gradient(90deg, rgba(4, 7, 10, 0.55) 0%, rgba(4, 7, 10, 0) 55%),
    var(--hero-image);
  background-size: cover, cover, 118% auto;
  background-position: center, center, 64% 14%;
  background-repeat: no-repeat;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(157, 255, 61, 0.35);
  border-radius: 999px;
  background: rgba(157, 255, 61, 0.06);
  color: var(--acc);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
  animation: blink 2s infinite;
}

.hero h1 {
  margin: 14px 0 6px;
  font-size: clamp(27px, 8.6vw, 38px);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: #f4fff0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.hero h1 em {
  font-style: normal;
  color: var(--acc);
  text-shadow: 0 0 26px rgba(157, 255, 61, 0.45);
}

.hero p {
  margin: 0;
  max-width: 30ch;
  color: #b6c7bb;
  font-size: 13px;
  line-height: 1.4;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

/* ---------- Notice ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(157, 255, 61, 0.05);
  color: #b9cabe;
  font-size: 11.5px;
  line-height: 1.45;
}

.notice strong { color: var(--acc); }

.notice-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid rgba(157, 255, 61, 0.4);
  border-radius: 50%;
  background: transparent;
  color: var(--acc);
  font-size: 9px;
  font-weight: 800;
}

.notice p { margin: 0; }

/* ---------- Steps ---------- */

.step {
  padding: 18px 16px 8px;
  animation: stepIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.step-head h2 {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.step-head p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Option buttons ---------- */

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, #0d171d, #0a1116);
  color: var(--txt);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.option::after {
  content: "";
  position: absolute;
  inset: auto -40% -70% -40%;
  height: 120px;
  background: radial-gradient(closest-side, rgba(157, 255, 61, 0.16), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.option:hover::after,
.option:focus-visible::after { opacity: 1; }

.option:active { transform: scale(0.97); }

.option:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.option.pressed { transform: scale(0.96); border-color: rgba(157, 255, 61, 0.45); }

.option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.option-tag {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.option-arrow { color: var(--acc); font-size: 13px; }

.option-amt {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 16px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.option-amt small {
  color: var(--acc);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.option-amt.range { font-size: 18px; }

.option-amt .dash {
  margin: 0 3px;
  color: #6f8a76;
  font-weight: 500;
}

.option-random {
  border-color: rgba(157, 255, 61, 0.3);
  background:
    linear-gradient(100deg, rgba(157, 255, 61, 0.12), rgba(157, 255, 61, 0.02) 60%),
    #0b1217;
}

.option-random .option-amt { color: #eaffdf; }

.dice { font-size: 18px; line-height: 1; filter: saturate(0.9); }

/* ---------- How it works ---------- */

.how {
  margin-top: 18px;
  padding: 15px 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: #080e12;
}

.how ol {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 11px;
  align-items: start;
}

.how .n {
  padding: 3px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--acc);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.how h3 { margin: 0 0 2px; font-size: 13px; }

.how p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.trust span {
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: #7e9187;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Global live feed ---------- */

.feed-global {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}

.feed-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(157, 255, 61, 0.18);
  border-radius: 999px;
  background: rgba(9, 15, 20, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  color: #b9cabe;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feed-item.in { opacity: 1; transform: none; }
.feed-item.out { opacity: 0; transform: translateX(-10px); }

.feed-item .flag { font-size: 10px; }

.fi-guest {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.fi-code {
  color: var(--acc);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.fi-amt {
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Scan card ---------- */

.scan-card {
  padding: 16px 15px 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, #0b1318, #080e13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 40px rgba(0, 0, 0, 0.35);
}

.scan-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.scan-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
}

.scan-pct {
  color: var(--acc);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(157, 255, 61, 0.35);
}

.bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  background: #0a1216;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3fae00, #9dff3d 60%, #d9ff9e);
  box-shadow: 0 0 18px rgba(157, 255, 61, 0.55);
  transition: width 0.15s linear;
}

.bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.6s linear infinite;
}

.status {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 16px;
  margin: 12px 0 10px;
  color: #cfe4d2;
  font-family: var(--mono);
  font-size: 11px;
}

.status-k {
  padding: 2px 5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: #5f7466;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  transform: translateY(-1px);
}

#statusText { color: var(--acc); }

#statusText::after {
  content: "▋";
  margin-left: 2px;
  color: var(--acc);
  animation: blink 1s steps(2) infinite;
}

.status.flash #statusText { animation: flick 0.25s steps(2) 1; }

.console {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 154px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: #060b0e;
  color: #7f9a87;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.55;
}

.console::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 26px;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(180deg, #060b0e, transparent);
  pointer-events: none;
  z-index: 1;
}

.console .line {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  animation: lineIn 0.25s ease both;
}

.console .line.hot { color: #d8ffb9; }

/* ---------- Result ---------- */

.step-result { padding-top: 18px; }

.result-card {
  position: relative;
  overflow: hidden;
  padding: 24px 16px 20px;
  border: 1px solid rgba(157, 255, 61, 0.22);
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(157, 255, 61, 0.14), transparent 65%),
    linear-gradient(180deg, #0b1413, #080e12);
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(157, 255, 61, 0.05) 0 1px, transparent 1px 22px);
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 0%, #000, transparent 80%);
  mask-image: radial-gradient(80% 70% at 50% 0%, #000, transparent 80%);
}

.result-card > * { position: relative; z-index: 1; }

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(157, 255, 61, 0.35);
  border-radius: 999px;
  background: rgba(157, 255, 61, 0.07);
  color: var(--acc);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
}

.code {
  margin: 18px 0 16px;
  padding: 18px 8px;
  border: 1px dashed rgba(157, 255, 61, 0.28);
  border-radius: 12px;
  background: rgba(157, 255, 61, 0.04);
  color: var(--acc);
  font-family: var(--mono);
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(157, 255, 61, 0.45);
  word-break: break-all;
}

/* ---------- Agree checkbox ---------- */

.agree {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  color: #93a29a;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.agree input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid rgba(157, 255, 61, 0.4);
  border-radius: 4px;
  background: rgba(157, 255, 61, 0.05);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.agree input:checked {
  background: var(--acc);
  border-color: var(--acc);
}

.agree input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #06100a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agree input:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.agree a {
  color: var(--acc);
  text-underline-offset: 2px;
}

.result-actions { display: flex; gap: 10px; }

.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active { transform: scale(0.975); }

.btn.primary {
  background: linear-gradient(180deg, #b9ff5c, #8bef2a);
  color: #08130a;
  box-shadow:
    0 10px 24px rgba(157, 255, 61, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.primary:hover { filter: brightness(1.05); }

.btn.primary.is-disabled {
  background: #131f17;
  color: #55665a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: not-allowed;
}

.btn.primary.is-disabled:hover { filter: none; }

.linklike {
  margin-top: 14px;
  padding: 6px;
  border: 0;
  background: none;
  color: #8fa197;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Footer + toast ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 22px 20px 6px;
  color: #5f7166;
  font-size: 10.5px;
}

.footer p { margin: 0; }
.footer a { color: #8fa197; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: 86vw;
  padding: 10px 14px;
  border: 1px solid rgba(157, 255, 61, 0.3);
  border-radius: 10px;
  background: #101a13;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  color: #dff5d6;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Keyframes ---------- */

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

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes blink {
  0%, 60% { opacity: 1; }
  70%, 100% { opacity: 0.25; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes flick {
  50% { opacity: 0.35; }
}

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

@media (prefers-reduced-motion: reduce) {
  .chip .dot,
  .live-dot,
  #statusText::after,
  .bar-fill::after {
    animation: none !important;
  }
  .feed-item { transition: none; }
  .step,
  .console .line {
    animation-duration: 0.001s !important;
  }
}

/* ---------- Phone-only gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 55% at 50% -10%, #0b1911 0%, transparent 55%),
    var(--bg);
}

.gate[hidden] { display: none; }

.gate-card {
  width: 100%;
  max-width: 360px;
  padding: 34px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.gate-ico {
  display: inline-block;
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(157, 255, 61, 0.35));
  animation: gatePulse 2.4s ease-in-out infinite;
}

.gate-card h2 {
  margin: 18px 0 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.gate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

@keyframes gatePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .gate-ico { animation: none; }
}
