:root {
  --bg-1: #f6f8ea;
  --bg-2: #d7ecdd;
  --bg-3: #f3d7c0;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --surface-muted: #f4efe4;
  --ink-strong: #1f2a28;
  --ink-soft: #4e5f5b;
  --line: #d7d0c2;
  --accent: #176b61;
  --accent-2: #d97841;
  --accent-soft: #e5f2ef;
  --danger-bg: #fde7e3;
  --danger-fg: #9a3120;
  --shadow-1: 0 18px 44px rgba(40, 56, 44, 0.14);
  --shadow-2: 0 8px 18px rgba(33, 55, 50, 0.1);
}

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

body {
  background:
    radial-gradient(circle at 7% 8%, rgba(217, 120, 65, 0.22), transparent 28%),
    radial-gradient(circle at 92% 14%, rgba(23, 107, 97, 0.26), transparent 29%),
    linear-gradient(150deg, var(--bg-1) 0%, var(--bg-2) 52%, var(--bg-3) 100%);
  color: var(--ink-strong);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  min-height: 100vh;
  padding: 28px 16px;
}

.dashboard-shell {
  background: color-mix(in srgb, var(--surface) 90%, #ffffff 10%);
  border: 1px solid rgba(215, 208, 194, 0.85);
  border-radius: 24px;
  box-shadow: var(--shadow-1);
  margin: 0 auto;
  max-width: 1280px;
  overflow: hidden;
  position: relative;
}

.dashboard-shell::before {
  background: linear-gradient(90deg, rgba(23, 107, 97, 0.14), rgba(217, 120, 65, 0.16));
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.hero {
  padding: 32px 32px 18px;
}

.hero h1 {
  font-family: "Sora", "Avenir Next", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-top: 8px;
}

.view-switch {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 14px 32px 20px;
}

.nav-link {
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 16px;
  text-decoration: none;
  transition: all 180ms ease;
}

.nav-link:hover {
  border-color: var(--line);
  color: var(--ink-strong);
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(120deg, var(--accent), #1f8d7f 65%);
  color: #f7fffd;
}

.dashboard-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  padding: 0 32px 32px;
}

.panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
}

.control-panel {
  align-self: start;
  padding: 20px;
}

.panel-title {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.filters {
  display: grid;
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-group label {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

select {
  appearance: none;
  background:
    linear-gradient(180deg, #ffffff, #f9f4e9) padding-box,
    linear-gradient(120deg, rgba(23, 107, 97, 0.22), rgba(217, 120, 65, 0.25)) border-box;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink-strong);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 42px;
  padding: 8px 12px;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

select:focus {
  box-shadow: 0 0 0 3px rgba(23, 107, 97, 0.15);
  outline: none;
}

.hint {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.4;
  margin-top: 14px;
  padding: 10px 12px;
}

.content-panel {
  padding: 20px;
}

.loading {
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 600;
  padding: 40px 8px;
  text-align: center;
}

.error {
  background: var(--danger-bg);
  border: 1px solid rgba(154, 49, 32, 0.28);
  border-radius: 10px;
  color: var(--danger-fg);
  font-size: 0.95rem;
  margin: 12px 0 18px;
  padding: 12px 14px;
}

.chart-card {
  background: linear-gradient(180deg, #fffefc, #fff8ec);
  border: 1px solid var(--line);
  border-radius: 14px;
  height: 430px;
  margin-bottom: 18px;
  padding: 12px;
}

.stats-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  background: linear-gradient(140deg, #176b61, #1d7f71 62%, #216f65);
  border-radius: 12px;
  color: #ecfffa;
  min-height: 110px;
  padding: 16px;
}

.stat-card h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  opacity: 0.92;
  text-transform: uppercase;
}

.stat-card .value {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 1.78rem;
  font-weight: 600;
}

.section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2px 0 12px;
}

.number-list,
.combination-list {
  display: grid;
  gap: 10px;
}

.number-list {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.combination-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.number-item,
.combination-item {
  animation: card-rise 280ms ease both;
  background: #fff8ee;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.number-item {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.combination-item .digits,
.number-item .number {
  color: var(--accent);
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 1.2rem;
  font-weight: 600;
}

.count {
  background: color-mix(in srgb, var(--accent) 80%, black 8%);
  border-radius: 999px;
  color: #f3fffc;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 8px;
  padding: 5px 10px;
  text-transform: uppercase;

.lookup-panel {
  margin-top: 16px;
}

.lookup-label {
  color: var(--ink-soft);
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 7px;
}

.lookup-row {
  display: flex;
  gap: 10px;
}

.lookup-input {
  appearance: none;
  background: linear-gradient(180deg, #ffffff, #f9f4e9);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-strong);
  flex: 1;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 42px;
  padding: 8px 12px;
}

.lookup-input:focus {
  border-color: rgba(23, 107, 97, 0.42);
  box-shadow: 0 0 0 3px rgba(23, 107, 97, 0.12);
  outline: none;
}

.lookup-button {
  background: linear-gradient(120deg, var(--accent), #1f8d7f 65%);
  border: 0;
  border-radius: 10px;
  color: #f7fffd;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 86px;
  padding: 0 14px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.lookup-button:hover {
  box-shadow: 0 8px 14px rgba(52, 70, 58, 0.12);
  transform: translateY(-1px);
}

.lookup-note {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 8px;
}

.lookup-result {
  margin-top: 12px;
}

.lookup-empty {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.lookup-card {
  background: linear-gradient(140deg, #176b61, #1d7f71 62%, #216f65);
  border-radius: 12px;
  color: #ecfffa;
  padding: 14px;
}

.lookup-card--empty {
  opacity: 0.88;
}

.lookup-combination {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lookup-count {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 6px;
}

.lookup-examples {
  font-size: 0.84rem;
  line-height: 1.45;
  margin-top: 10px;
}

.lookup-examples-label {
  font-weight: 700;
}
}

.number-item .count {
  margin-top: 0;
}

.examples {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-top: 8px;
}

.examples-label {
  font-weight: 700;
}

.number-item:hover,
.combination-item:hover {
  box-shadow: 0 8px 14px rgba(52, 70, 58, 0.12);
  transform: translateY(-2px);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Large lookup components for the dedicated lookup page */
.lookup-page-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.lookup-large-header {
  text-align: center;
  margin-bottom: 30px;
}

.lookup-large-header h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.lookup-large-header p {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.lookup-large-input-wrapper {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 40px;
}

.lookup-large-input {
  flex: 1;
  font-size: 1.5rem;
  padding: 16px 20px;
  border-radius: 14px;
  text-align: center;
  letter-spacing: 0.1em;
}

.lookup-large-button {
  font-size: 1.2rem;
  padding: 0 28px;
  border-radius: 14px;
}

.lookup-result-large {
  width: 100%;
  max-width: 500px;
}

.lookup-empty-large {
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.1rem;
  padding: 30px;
  border: 2px dashed var(--line);
  border-radius: 16px;
}

.lookup-card-large {
  background: linear-gradient(140deg, #176b61, #1d7f71 62%, #216f65);
  border-radius: 16px;
  color: #ecfffa;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow-2);
}

.lookup-card-large--empty {
  opacity: 0.88;
}

.lookup-combination-large {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.lookup-count-large {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.lookup-examples-large {
  font-size: 1rem;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: 10px;
}

.lookup-examples-label-large {
  font-weight: 700;
  color: #a4e5d9;
}

.lookup-draws-container {
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  overflow-y: auto;
  max-height: 400px;
  text-align: left;
}

.lookup-draws-table {
  width: 100%;
  border-collapse: collapse;
}

.lookup-draws-table th {
  background: rgba(0, 0, 0, 0.2);
  color: #a4e5d9;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  position: sticky;
  top: 0;
}

.lookup-draws-table td {
  padding: 12px 16px;
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lookup-draws-table td.draw-number {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.05em;
}

.lookup-draws-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.draw-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  letter-spacing: 0.02em;
}

.draw-type-magnum { color: #f4d03f; }
.draw-type-toto { color: #ec7063; }
.draw-type-damacai { color: #5dade2; }
.draw-type-grand-dragon { color: #58d68d; }

.draw-grade-1st { color: #fff; background: rgba(244, 208, 63, 0.3); }
.draw-grade-2nd { color: #ebedef; }
.draw-grade-3rd { color: #d5d8dc; }

.public-notice {
  padding: 20px 24px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.public-notice a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.public-notice h2 {
  margin-top: 24px;
}

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

  .control-panel {
    order: 2;
  }

  .content-panel {
    order: 1;
  }

  .chart-card {
    height: 360px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 12px;
  }

  .hero,
  .view-switch,
  .dashboard-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .view-switch {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-link {
    font-size: 0.9rem;
    width: 100%;
  }

  .lookup-row {
    flex-direction: column;
  }

  .lookup-button {
    min-height: 42px;
    width: 100%;
  }

  .lookup-large-input-wrapper {
    flex-direction: column;
  }

  .chart-card {
    height: 300px;
  }
}
