:root {
  --green-deep: #0b2f1f;
  --gold: #d4af37;
  --gold-soft: #f5d37a;
  --bg: #0b2f1f;
  --card: #123a27;
  --primary: #22c55e;
  --accent: #f5d37a;
  --muted: #a9bdb1;
  --text: #eef4ef;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', sans-serif;
  background: radial-gradient(1200px 1200px at 80% -10%, #1c5a3a, #071d13);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.lf-header {
  background: linear-gradient(180deg, #0a2a1b 0%, #061a11 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.lf-header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
}
.lf-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}
.lf-back-btn {
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease;
}
.lf-back-btn:hover { background: rgba(212, 175, 55, 0.25); }

.lf-title { text-align: center; margin-bottom: 18px; }
.lf-title h1 { font-size: clamp(1.35rem, 4vw, 1.9rem); color: #fff; margin: 0 0 6px; }
.lf-title p { margin: 0; color: var(--muted); font-size: .95rem; }

.lf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .timer-red,
  .timer.timer-red { animation: none; }
  .progress-fill { transition: none; }
}

/* Footer */
.lf-footer {
  background: linear-gradient(180deg, #061a11 0%, #04120b 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  margin-top: 40px;
  padding: 36px 0 20px;
}
.lf-footer-inner { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.lf-footer-grid { display: grid; grid-template-columns: 1fr; gap: 26px; }
.lf-footer-col h2 { font-size: 1rem; font-weight: 800; color: var(--gold-soft); margin: 0 0 12px; }
.lf-footer-col p { color: var(--muted); font-size: .88rem; line-height: 1.8; margin: 12px 0 0; }
.lf-footer-links { list-style: none; padding: 0; margin: 0; }
.lf-footer-links li { margin-bottom: 8px; font-size: .88rem; color: var(--muted); }
.lf-footer-links a { color: var(--muted); text-decoration: none; transition: color .2s ease; }
.lf-footer-links a:hover { color: var(--gold-soft); }
.lf-footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
}
@media (min-width: 768px) {
  .lf-footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .lf-footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, #c89a2a, #f1d88a 50%, #c89a2a);
  border: 1px solid rgba(0,0,0,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 18px rgba(0,0,0,.35);
  color: #1f2937;
  margin-bottom: 16px;
}
.topbar-logo {
  width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.topbar-title { font-weight: 800; letter-spacing: .02em; }
.topbar-right { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.topbar-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .95rem; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(0,0,0,.15); font-weight: 700; }
.badge-green { background: linear-gradient(180deg, #86efac, #22c55e); color: #0a1f0f; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.round { font-weight: 700; }

/* status row and progress */
.status { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: rgba(255,255,255,.9); color: #0f172a; border-radius: 10px; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 6px 14px rgba(0,0,0,.18); max-width: 720px; margin: 0 auto; }
.status-left { display: flex; align-items: center; gap: 8px; }
.status-right { font-weight: 800; }
.timer-green { color: #16a34a; }
.timer-red { color: #ef4444; animation: blink .9s step-start infinite; }
@keyframes blink { 50% { opacity: .25; } }
.icon-clock { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #22c55e; display: inline-block; position: relative; background: #eafff2; }
.icon-clock::after { content: '🕒'; position: absolute; inset: -2px 0 0 0; text-align: center; font-size: 18px; line-height: 22px; }
.progress { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 8px auto 14px; border: 1px solid rgba(0,0,0,.12); max-width: 720px; }
.progress-fill { height: 100%; width: 0%; background-image: linear-gradient(90deg, #d4af37 0%, #d4af37 12%, #22c55e 12%, #22c55e 100%); transition: width .25s linear; }

/* hot pair as green balls */
.balls { display: inline-flex; align-items: center; gap: 10px; }
.ball { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: #052e16; background: radial-gradient(circle at 35% 30%, #a7f3d0, #22c55e 60%, #16a34a 100%); border: 1px solid #14532d; box-shadow: inset 0 2px 4px rgba(255,255,255,.35), 0 6px 12px rgba(0,0,0,.35); }
.dash { color: #9aa4b2; font-weight: 700; }
.container { max-width: 980px; margin: 40px auto 20px; padding: 20px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.brand { font-weight: 700; letter-spacing: .08em; color: var(--accent); }
h1 { margin: 0; font-size: 1.6rem; }

/* Footer styles */
.footer-main {
  background: rgba(26, 71, 42, 0.95);
  margin-top: 40px;
}
.footer-content a {
  text-decoration: none;
}
.footer-links a:hover {
  color: #00c853;
}
.payment-icons {
  margin: 0 auto;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.row { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px){ .row { grid-template-columns: 1fr; } }
.block { background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 16px; }
.label { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.value { font-size: 1.9rem; font-weight: 800; letter-spacing: .06em; display: flex; align-items: center; justify-content: center; gap: 10px; }
.value .pill {
  display: inline-block; background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.4); color: #86efac;
  padding: 6px 10px; border-radius: 10px; margin: 0 4px;
}
.numbers { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.num { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 50px; padding: 0 12px; border-radius: 10px; background: #0d2c1e; border: 1px solid rgba(255,255,255,.08); font-size: 1.4rem; font-weight: 700; }
.numbers-compact .num { min-width: 56px; height: 44px; font-size: 1.2rem; }
.controls { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.btn { appearance: none; border: 1px solid rgba(255,255,255,.16); background: #0e1526; color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: rgba(255,255,255,.28); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.meta { color: var(--muted); font-size: .9rem; }
.timer { color: var(--gold-soft); font-weight: 700; }
.footer { margin-top: 16px; color: var(--muted); font-size: .85rem; text-align: center; }
.small { font-size: .9rem; color: var(--muted); }
/* mini sections inside the previous stats card */
.mini { margin-top: 12px; }
.mini-label { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }

/* divider before previous stats */
.divider {
  border: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.18), rgba(255,255,255,0));
  margin: 18px 0;
}

/* ensure timer state overrides base .timer color */
.timer.timer-green { color: #16a34a; }
.timer.timer-red { color: #ef4444; animation: blink .9s step-start infinite; }

/* Mobile optimizations for 320px+ */
@media (max-width: 480px) {
  .container { 
    margin: 100px auto 12px;
    padding: 12px; 
  }
  .header-main {
    position: fixed;
    top: 0;
  }
  .topbar {
    padding: 8px 10px;
    gap: 8px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .topbar-logo {
    width: 24px;
    height: 24px;
  }
  .topbar-title {
    font-size: 14px;
  }
  .topbar-meta {
    font-size: .85rem;
    gap: 6px;
  }
  .badge {
    padding: 3px 8px;
    font-size: .8rem;
  }
  .status {
    padding: 6px 8px;
    border-radius: 8px;
  }
  .status-right {
    font-size: 15px;
  }
  .icon-clock {
    width: 20px;
    height: 20px;
  }
  .icon-clock::after {
    font-size: 16px;
    line-height: 20px;
  }
  .progress {
    height: 8px;
    margin: 6px auto 10px;
  }
  .card {
    padding: 12px;
    border-radius: 10px;
  }
  .block {
    padding: 12px;
    border-radius: 10px;
  }
  .label {
    font-size: .85rem;
    margin-bottom: 6px;
  }
  .value {
    font-size: 1.4rem;
  }
  .ball {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .numbers {
    gap: 8px;
  }
  .num {
    min-width: 52px;
    height: 42px;
    padding: 0 8px;
    font-size: 1.2rem;
    border-radius: 8px;
  }
  .numbers-compact .num {
    min-width: 48px;
    height: 38px;
    font-size: 1.1rem;
  }
  .small {
    font-size: .85rem;
  }
  .mini-label {
    font-size: .85rem;
  }
  .footer {
    font-size: .8rem;
    margin-top: 12px;
  }
  .footer-main {
    margin-top: 20px;
    padding: 20px 12px;
  }
}

/* Extra small screens (320px) */
@media (max-width: 360px) {
  .container {
    margin: 90px auto 8px;
    padding: 8px;
  }
  .topbar {
    padding: 6px 8px;
    gap: 6px;
    margin-bottom: 10px;
  }
  .topbar-logo {
    width: 22px;
    height: 22px;
  }
  .topbar-title {
    font-size: 13px;
  }
  .topbar-meta {
    font-size: .8rem;
  }
  .badge {
    padding: 2px 6px;
    font-size: .75rem;
  }
  .status {
    padding: 5px 6px;
  }
  .status-right {
    font-size: 14px;
  }
  .card {
    padding: 10px;
  }
  .block {
    padding: 10px;
  }
  .label {
    font-size: .8rem;
  }
  .value {
    font-size: 1.3rem;
  }
  .ball {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .numbers {
    gap: 6px;
  }
  .num {
    min-width: 46px;
    height: 38px;
    padding: 0 6px;
    font-size: 1.1rem;
  }
  .numbers-compact .num {
    min-width: 42px;
    height: 34px;
    font-size: 1rem;
  }
  .value .pill {
    padding: 4px 8px;
    font-size: .9rem;
  }
  .footer-main {
    padding: 16px 8px;
  }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
  .container {
    margin-top: 100px;
    padding: 24px;
  }
  .topbar {
    padding: 12px 16px;
  }
  .card {
    padding: 20px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1100px;
    margin-top: 110px;
  }
}
