/* ===== Google Font Import ===== */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700&display=swap');

/* ===== Design Tokens (Cute Theme) ===== */
:root {
  /* Colors */
  --color-primary: #e1bee7; /* Soft Lavender */
  --color-accent: #ff8a80; /* Coral Pink */
  --color-link: #4fc3f7; /* Light Blue */
  --color-bg: #fdf6f8; /* Very Light Pink */
  --color-content-bg: #ffffff;
  --color-table-header: #ce93d8; /* Medium Lavender */
  --color-summary-bg: #fffde7; /* Light Yellow */
  --color-summary-border: #fff59d; /* Yellow */
  --color-special-bg: #e0f7fa; /* Light Cyan */
  --color-special-border: #80deea; /* Cyan */
  --color-hover-bg: #f3e5f5; /* Lighter Lavender */
  --color-text-main: #5d4037; /* Brown */
  --color-text-light: #8d6e63;

  /* Fonts */
  --font-main: "M PLUS Rounded 1c", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "メイリオ", sans-serif;
  --font-mono: "Courier New", monospace;

  /* Layout */
  --sidebar-width: 160px;
  --max-width: 1200px;
  --border-radius: 16px;
}

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

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.7;
  font-weight: 400;
}

a { color: var(--color-link); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; color: #0091ea; }

/* ===== Hero ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 0;
}

.hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ===== Navbar ===== */
.navbar {
  background: var(--color-primary);
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 50px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-link {
  color: var(--color-text-main);
  padding: 0 16px;
  line-height: 50px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.2);
}

/* ===== Layout ===== */
.page-container {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  gap: 20px;
}

.content {
  flex: 1;
  min-width: 0;
  background: var(--color-content-bg);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ad-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.ad-placeholder {
  background: #fff;
  border: 2px dashed #e0e0e0;
  text-align: center;
  padding: 20px 8px;
  color: #ccc;
  font-size: 12px;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
}

.ad-bottom {
  max-width: var(--max-width);
  margin: 0 auto 20px;
  padding: 0 20px;
}

.ad-bottom .ad-placeholder {
  min-height: 90px;
  width: 100%;
}

/* ===== Title ===== */
h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 8px;
  margin-bottom: 20px;
  text-align: center;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-light);
  margin: 24px 0 16px;
  padding-left: 12px;
  border-left: 5px solid var(--color-accent);
}

h3 {
  font-size: 16px;
  color: var(--color-text-main);
  margin: 16px 0 8px;
  font-weight: 700;
}

h4 {
  font-size: 14px;
  color: var(--color-text-light);
  margin: 12px 0 6px;
}

/* ===== Summary Box ===== */
.summary-box {
  background: var(--color-summary-bg);
  border: 1px solid var(--color-summary-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.summary-box .draw-info {
  font-size: 16px;
  margin-bottom: 8px;
}

.summary-box .prev-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: bold;
  color: var(--color-accent);
}

.summary-box .prediction-label {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: bold;
  margin: 4px 4px 4px 0;
}

/* ===== Prediction Table ===== */
.prediction-group {
  margin-bottom: 24px;
}

.prediction-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin-bottom: 12px;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

.prediction-table th {
  background: var(--color-table-header);
  color: #fff;
  padding: 10px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.prediction-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid #f5f5f5;
}

.prediction-table tr:last-child td {
  border-bottom: none;
}

.prediction-table tr:nth-child(even) {
  background: #fafafa;
}

.prediction-table tr:hover {
  background: var(--color-hover-bg);
}

.prediction-number {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: bold;
  color: var(--color-link);
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

.badge-match { background: #a5d6a7; color: var(--color-text-main); } /* Light Green */
.badge-neutral { background: #ffe082; color: var(--color-text-main); } /* Light Yellow */
.badge-warning { background: var(--color-accent); color: #fff; } /* Coral Pink */
.badge-info { background: var(--color-link); color: #fff; } /* Light Blue */

/* ===== Archive List ===== */
.archive-list {
  list-style: none;
  padding: 0;
}

.archive-list li {
  padding: 12px;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}

.archive-list li:hover {
  background: var(--color-hover-bg);
}

.archive-list a {
  display: block;
  font-size: 15px;
}

/* ===== Special Category ===== */
.special-section {
  background: var(--color-special-bg);
  border: 1px solid var(--color-special-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.special-number {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: bold;
  color: #00838f; /* Dark Cyan */
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  background: var(--color-primary);
  color: var(--color-text-light);
  margin-top: 20px;
}

footer .disclaimer {
  margin-top: 4px;
  font-size: 11px;
  color: #fff;
}

/* ===== Error Page ===== */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-page h1 {
  border: none;
  font-size: 48px;
  color: var(--color-accent);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root {
    --border-radius: 12px;
  }
  .page-container {
    flex-direction: column;
    padding: 10px;
  }

  .ad-sidebar { width: 100%; }

  .ad-placeholder {
    min-height: 90px;
  }

  .content {
    padding: 16px;
  }

  h1 { font-size: 20px; }

  .summary-box .prev-number { font-size: 26px; }

  .prediction-table {
    font-size: 12px;
  }

  .prediction-table th,
  .prediction-table td {
    padding: 6px 3px;
  }

  .prediction-number { font-size: 18px; }
}