:root {
  --red: #2a4a5a;
  --red-dark: #1b3641;
  --gold: #d9b23c;
  --gold-light: #f2de9b;
  --cream: #f4f6f7;
  --ink: #14242c;
  --green: #1b8a3a;
  --card-shadow: 0 6px 24px rgba(27, 54, 65, 0.14);
}

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

body {
  font-family: "Kanit", "Noto Sans Myanmar", sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- header ---------- */
.hero {
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 55%, #3c6478 100%);
  color: #fff;
  padding: 18px 16px 0;
  border-bottom: 4px solid var(--gold);
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 2.4rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: .5px; }
.subtitle { font-size: .85rem; color: var(--gold-light); }

.lang-switch button {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: .85rem;
  margin-left: 4px;
  transition: all .2s;
}
.lang-switch button.active,
.lang-switch button:hover {
  background: var(--gold);
  color: var(--red-dark);
  border-color: var(--gold);
  font-weight: 600;
}

.countdown-bar {
  max-width: 860px;
  margin: 14px auto 0;
  background: rgba(0,0,0,.25);
  border-radius: 12px 12px 0 0;
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: .95rem;
}
.countdown-bar strong { color: var(--gold-light); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- layout ---------- */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 14px 40px;
  display: grid;
  gap: 18px;
}

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  border-top: 3px solid var(--gold);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint { font-size: .8rem; color: #6e7e86; margin-top: -8px; margin-bottom: 10px; }
.loading { color: #6e7e86; }

/* ---------- live ---------- */
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff1744; display: inline-block;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.video-wrap { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- check ---------- */
.draw-select-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.draw-select-row label { font-weight: 600; font-size: .9rem; }

select, textarea {
  font-family: inherit;
  font-size: 1rem;
  border: 2px solid var(--gold-light);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--cream);
  color: var(--ink);
}
select:focus, textarea:focus { outline: 2px solid var(--gold); }
textarea { width: 100%; resize: vertical; letter-spacing: 2px; }

.check-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.btn-primary, .btn-gold, .btn-ghost {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 10px 26px;
  cursor: pointer;
  transition: transform .1s, box-shadow .2s;
}
.btn-primary { background: linear-gradient(135deg, var(--red) 0%, #3c6478 100%); color: #fff; box-shadow: 0 4px 14px rgba(42,74,90,.35); }
.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, #ffd54f 100%); color: var(--red-dark); box-shadow: 0 4px 14px rgba(217,178,60,.35); }
.btn-ghost { background: transparent; color: var(--red-dark); border: 2px solid var(--gold-light); }
.btn-primary:active, .btn-gold:active { transform: scale(.97); }

/* check results */
#check-results { margin-top: 14px; display: grid; gap: 8px; }
.ticket {
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 12px; padding: 10px 16px;
  border: 2px dashed var(--gold-light);
  background: var(--cream);
}
.ticket .num { font-size: 1.3rem; font-weight: 800; letter-spacing: 3px; }
.ticket.win { border-color: var(--green); background: #ecf9ef; }
.ticket .outcome { font-size: .85rem; text-align: right; }
.ticket.win .outcome { color: var(--green); font-weight: 700; }
.ticket.lose .outcome { color: #9e9e9e; }
.ticket .prize-amount { display: block; font-size: 1rem; }

.summary-banner {
  border-radius: 12px; padding: 12px 16px; font-weight: 700; text-align: center;
}
.summary-banner.win { background: linear-gradient(135deg, #1b8a3a, #34c759); color: #fff; }
.summary-banner.lose { background: #e3e9ec; color: #6e7e86; }

/* ---------- lucky ---------- */
.lucky-display {
  font-size: 2.6rem; font-weight: 800; letter-spacing: 12px; text-align: center;
  color: var(--red); background: var(--cream);
  border: 3px solid var(--gold); border-radius: 14px;
  padding: 14px 6px; margin: 8px 0;
  font-variant-numeric: tabular-nums;
}

/* ---------- results ---------- */
.prize-block { text-align: center; padding: 14px 0; border-bottom: 1px dashed #d6dee2; }
.prize-block:last-child { border-bottom: none; }
.prize-block .label { font-weight: 700; color: var(--red-dark); }
.prize-block .amount { font-size: .78rem; color: #6e7e86; margin-bottom: 4px; }
.first-prize-number {
  font-size: 2.8rem; font-weight: 800; color: var(--red);
  letter-spacing: 8px; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 var(--gold-light);
}
.big-number { font-size: 1.7rem; font-weight: 800; letter-spacing: 5px; }
.number-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.number-grid span { background: var(--cream); border-radius: 8px; padding: 4px 0; font-weight: 600; }

details.more-prizes summary {
  cursor: pointer; text-align: center; padding: 10px;
  color: var(--red-dark); font-weight: 600;
}

/* ---------- history ---------- */
.history-list { display: grid; gap: 8px; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--cream); padding: 10px 16px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent; transition: border .15s;
}
.history-item:hover { border-color: var(--gold); }
.history-item .h-first { font-weight: 800; color: var(--red); letter-spacing: 2px; }

/* ---------- footer ---------- */
footer {
  text-align: center; padding: 24px 16px 36px; font-size: .8rem; color: #6e7e86;
}

@media (max-width: 520px) {
  .first-prize-number { font-size: 2.1rem; letter-spacing: 5px; }
  .brand h1 { font-size: 1.2rem; }
  .lucky-display { font-size: 2rem; letter-spacing: 8px; }
}
