:root {
  --cream:     #F2EDE4;
  --linen:     #E8E0D4;
  --terracotta:#C4662A;
  --amber:     #D4874A;
  --olive:     #4A6B3A;
  --forest:    #1E4D2B;
  --slate:     #252520;
  --espresso:  #2C2318;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 8px 24px rgba(37, 37, 32, 0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--slate);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }

.hidden { display: none !important; }
.muted { color: rgba(37,37,32,0.55); font-size: 14px; margin: 4px 0 0; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative;
  background: var(--forest);
  color: var(--cream);
  padding: 30px 22px 0;
  text-align: center;
  overflow: hidden;
}
.hero-inner { padding-bottom: 26px; }
.logo-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: nowrap;
}
.logo {
  height: clamp(42px, 13vw, 60px);
  width: auto;
  object-fit: contain;
}
.logo-x {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(20px, 6vw, 28px);
  color: var(--amber);
  flex: 0 0 auto;
}
.hero-sub {
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(242,237,228,0.7);
}
.wave {
  display: block;
  width: 100%;
  height: 26px;
  margin-bottom: -1px;
}
.wave path { fill: var(--terracotta); }

/* ---------------- CONTENT ---------------- */
.content { padding: 18px 16px 8px; }

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--forest);
}

/* ---------------- BUTTONS ---------------- */
.btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 18px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: transform .05s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--terracotta); color: var(--cream); }
.btn-dark { background: var(--forest); color: var(--cream); margin-top: 12px; }
.btn-amber { background: var(--amber); color: var(--espresso); }

/* ---------------- CODE ENTRY ---------------- */
.code-row { margin: 14px 0 12px; }
.code-input {
  width: 100%;
  text-align: center;
  font-family: "Baloo 2", monospace;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 8px;
  text-transform: uppercase;
  padding: 14px 10px;
  border: 2px solid var(--linen);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--espresso);
  outline: none;
}
.code-input:focus { border-color: var(--amber); }
.code-input::placeholder { color: rgba(37,37,32,0.25); letter-spacing: 8px; }

.msg { margin-top: 12px; font-size: 14px; min-height: 18px; font-weight: 600; }
.msg.error { color: var(--terracotta); }
.msg.success { color: var(--olive); }
.msg.info { color: var(--slate); }

/* ---------------- MY CODES ---------------- */
.pill {
  display: inline-block;
  background: var(--olive);
  color: var(--cream);
  border-radius: 999px;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 1px 10px;
  vertical-align: middle;
}
.codes-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.code-chip {
  background: var(--forest);
  color: var(--cream);
  font-family: "Baloo 2", monospace;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px;
}

/* ---------------- CHANCE ---------------- */
.chance-card {
  background: linear-gradient(135deg, var(--terracotta), var(--amber));
  color: var(--cream);
  text-align: center;
}
.chance-label { font-size: 14px; opacity: 0.9; }
.chance-value {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 56px;
  line-height: 1.05;
  margin: 4px 0;
}
.chance-meta { font-weight: 600; }
.chance-note { font-size: 12px; opacity: 0.8; margin-top: 6px; }

/* ---------------- SUBSCRIPTION ---------------- */
.accent-card { background: var(--forest); color: var(--cream); }
.accent-card h2 { color: var(--cream); }
.accent-card .muted { color: rgba(242,237,228,0.7); }
.channel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px;
}
.channel .ch-name {
  font-weight: 700;
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-right { flex: 0 0 auto; display: flex; align-items: center; }
.channel a.ch-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; min-width: 118px;
  background: var(--amber); color: var(--espresso);
  text-decoration: none; font-weight: 700; font-family: "Baloo 2", sans-serif;
  padding: 0 18px; border-radius: 999px; font-size: 14px; line-height: 1; white-space: nowrap;
}
.channel.ok a.ch-btn { background: var(--olive); color: var(--cream); }
.ch-check { display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; min-width: 36px; font-size: 22px; }

/* the confirm action sits on the dark card — make it clearly a button */
.accent-card .btn { margin-top: 14px; box-shadow: 0 6px 16px rgba(0,0,0,0.22); }

/* ---------------- PRIZES ---------------- */
.prize { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.prize + .prize { border-top: 1px solid var(--linen); }
.prize-ico { font-size: 26px; }

/* ---------------- COUNTDOWN ---------------- */
.countdown-card { text-align: center; background: var(--olive); color: var(--cream); }
.countdown-label { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; }
.countdown-value { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 34px; }
.countdown-card .muted { color: rgba(242,237,228,0.75); }

/* ---------------- MISC ---------------- */
.footer { text-align: center; padding: 16px; font-size: 12px; color: rgba(37,37,32,0.45); }
.loading { text-align: center; padding: 50px 0; color: rgba(37,37,32,0.6); }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--linen); border-top-color: var(--terracotta);
  margin: 0 auto 14px; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
