:root {
  --bg: #f7f9ff;
  --surface: #ffffff;
  --surface-strong: #eef3ff;
  --surface-muted: #ebeff4;
  --primary: #00355f;
  --primary-container: #0f4c81;
  --primary-fixed: #d2e4ff;
  --secondary: #835500;
  --secondary-container: #feae2c;
  --tertiary: #6f0007;
  --tertiary-container: #9a000e;
  --text: #181c20;
  --text-soft: #42474f;
  --text-light: #6f7783;
  --outline: #dfe3e8;
  --outline-strong: #c2c7d1;
  --shadow: rgba(25, 35, 55, 0.08);
  --yellow: #f5b700;
  --red: #ea5d5d;
  --blue: #2f80ed;
  --grey: #6d7885;
  --green: #3ca45a;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 0 18px 40px var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: rgba(247, 249, 255, 0.94);
  border-bottom: 1px solid var(--outline);
  backdrop-filter: blur(10px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  color: var(--primary-container);
  font-size: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.topbar-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  display: grid;
  place-items: center;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-transform: none;
}

.content {
  padding: 16px 16px 108px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.winner-card,
.package-card,
.mini-card,
.policy-banner,
.filter-section {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(17, 31, 54, 0.04);
}

.winner-card {
  position: relative;
  padding: 16px;
  overflow: hidden;
}

.winner-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-container), var(--secondary-container), var(--primary));
}

.winner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.winner-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-fixed);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.winner-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.winner-date {
  font-size: 11px;
  color: var(--text-soft);
}

.winner-balls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
}

.winner-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.bonus-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-soft);
  font-weight: 700;
}

.winner-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--outline);
  font-size: 12px;
  color: var(--text-soft);
}

.winner-footer strong {
  color: var(--tertiary-container);
  font-size: 14px;
}

.filter-section {
  padding: 12px 12px 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.section-head button {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.section-head button .material-symbols-outlined {
  font-size: 15px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--text-soft);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip.active {
  background: var(--primary-container);
  border-color: var(--primary-container);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.2);
}

.chip .material-symbols-outlined {
  font-size: 16px;
}

.package-card {
  overflow: hidden;
}

.package-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--outline);
}

.package-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary-container);
  box-shadow: 0 0 0 6px rgba(254, 174, 44, 0.15);
}

.package-cost {
  font-size: 11px;
  color: var(--text-soft);
}

.package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--surface-muted);
}

.package-row:last-child {
  border-bottom: none;
}

.row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 76px;
}

.label-badge {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-muted);
}

.label-badge.a { background: var(--primary-fixed); color: var(--primary); }
.label-badge.b { background: #f4f6ff; }
.label-badge.c { background: #f5f2ff; }
.label-badge.d { background: #f8f5e9; }
.label-badge.e { background: #f3f5f8; }

.label-text {
  display: none;
  font-size: 11px;
  color: var(--text-soft);
}

.number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-soft);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: inherit;
  display: grid;
  place-items: center;
  transition: 0.2s ease;
}

.icon-btn:hover {
  background: var(--surface-muted);
}

.icon-btn.active {
  color: var(--secondary);
}

.icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.stats-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head.compact {
  padding: 0 2px;
}

.section-sub {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-card {
  padding: 12px;
}

.mini-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.mini-card-head.hot {
  color: var(--tertiary-container);
}

.mini-card-head.cold {
  color: var(--primary);
}

.mini-card-head .material-symbols-outlined {
  font-size: 16px;
}

.mini-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.mini-card p {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.5;
}

.policy-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-muted);
  padding: 12px 14px;
  border: 1px solid var(--outline);
}

.policy-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-fixed);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.policy-banner p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.policy-banner small {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 10px;
}

.comments-section {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 18px;
  padding: 16px 14px 10px;
  box-shadow: 0 6px 18px rgba(17, 31, 54, 0.04);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.comments-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--primary);
}

.comments-header span {
  font-size: 11px;
  color: var(--text-soft);
}

#disqus_thread {
  width: 100%;
  min-height: 300px;
}

#disqus_thread iframe {
  width: 100% !important;
  max-width: 100% !important;
}

.floating-cta {
  position: fixed;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  z-index: 25;
}

.floating-cta button {
  width: 100%;
  border: none;
  border-radius: 14px;
  height: 52px;
  background: var(--primary-container);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 16px 30px rgba(15, 76, 129, 0.2);
}

.floating-cta button .material-symbols-outlined {
  font-size: 20px;
  color: #f9db8b;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--outline);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.nav-item {
  flex: 1;
  height: 64px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item .material-symbols-outlined {
  font-size: 20px;
}

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 28, 32, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.toast.visible {
  opacity: 1;
}

.lotto-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  position: relative;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.14), inset 2px 2px 3px rgba(255, 255, 255, 0.45), inset -2px -2px 3px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.lotto-ball.small {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.ball-yellow { background: radial-gradient(circle at 35% 35%, #ffd233, #f59f00); }
.ball-blue   { background: radial-gradient(circle at 35% 35%, #4dabf7, #1971c2); }
.ball-red    { background: radial-gradient(circle at 35% 35%, #ff6b6b, #e03131); }
.ball-grey   { background: radial-gradient(circle at 35% 35%, #adb5bd, #495057); }
.ball-green  { background: radial-gradient(circle at 35% 35%, #51cf66, #2f9e44); }

@media (max-width: 420px) {
  .label-text {
    display: inline;
  }

  .winner-balls {
    gap: 4px;
  }

  .lotto-ball {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
  color: var(--muted);
  font-size: 0.8rem;
}

.meta-row strong {
  color: var(--text);
}

@media (max-width: 760px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-btn {
    width: 100%;
  }
}
