:root {
  --bg: #eaf3fb;
  --bg2: #f4f9f3;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.74);
  --text: #2b3646;
  --muted: #6d7a8c;
  --border: #d9e6f1;
  --gold: #c69a3f;
  --gold-deep: #9a751f;
  --gold-soft: #f5ecd6;
  --sky: #6ba6dc;
  --sky-deep: #2f74bb;
  --meadow: #86bd6a;
  --link: #2f74bb;
  --shadow: 0 6px 20px rgba(53, 96, 138, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Segoe UI", Meiryo, sans-serif;
  line-height: 1.65;
  background: linear-gradient(180deg, #eaf3fb 0%, #eef5f6 45%, #f4f9f3 100%);
  background-attachment: fixed;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ヒーローヘッダー (ファンタジー風景) */
.site-header {
  position: relative;
  background: url("hero.jpg") center 32% / cover no-repeat;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  border-bottom: 3px solid rgba(255, 255, 255, 0.7);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 38%, rgba(28, 52, 84, 0.34) 100%);
}

.site-header .container {
  position: relative;
  padding-top: 140px;
  padding-bottom: 24px;
}

.site-title {
  margin: 0;
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(18, 38, 66, 0.55);
}

.site-title .gold {
  color: #ffe6a6;
}

.site-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
  text-shadow: 0 1px 8px rgba(18, 38, 66, 0.55);
}

/* タブナビ */
.tab-nav {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab-nav-inner {
  display: flex;
}

.tab-btn {
  flex: 1;
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.tab-btn:hover {
  color: var(--sky-deep);
}

.tab-btn.active {
  color: var(--sky-deep);
  font-weight: 700;
  border-bottom-color: var(--sky);
}

.tab-panel {
  margin: 28px 0 40px;
}

.tab-note {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .site-header {
    min-height: 220px;
  }

  .site-header .container {
    padding-top: 90px;
  }

  .site-title {
    font-size: 1.7rem;
  }

  .tab-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    border-bottom: none;
    box-shadow: 0 -2px 14px rgba(53, 96, 138, 0.14);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .tab-btn {
    padding: 14px 2px;
    border-bottom: none;
    border-top: 3px solid transparent;
    font-size: 0.8rem;
  }

  .tab-btn.active {
    border-top-color: var(--sky);
  }

  body {
    padding-bottom: 72px;
  }
}

.section {
  margin: 40px 0;
}

.section-title {
  font-size: 1.2rem;
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--sky);
}

/* アプリカード */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.app-card:hover {
  box-shadow: 0 10px 26px rgba(53, 96, 138, 0.2);
  transform: translateY(-3px);
}

.app-tag {
  align-self: flex-start;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
}

.app-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.app-open {
  color: var(--sky-deep);
  font-weight: 600;
  font-size: 0.9rem;
}

/* お知らせ */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.news-list li {
  display: flex;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list time {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  padding-top: 2px;
}

.news-text strong {
  font-size: 0.95rem;
}

.news-text p {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.news-text a {
  color: var(--link);
}

.news-link {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: var(--sky-deep);
}

.news-link:hover {
  text-decoration: underline;
}

/* リンク集 */
.link-group {
  margin-bottom: 20px;
}

.link-group h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--sky-deep);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.link-list li {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.link-list li:last-child {
  border-bottom: none;
}

.link-list a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.link-list a:hover {
  text-decoration: underline;
}

.link-desc {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

/* 当選率 */
.stats-disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.stats-formula {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.stats-disclaimer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-disclaimer .tab-note {
  margin: 8px 0 0;
}

.stats-overall {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.stats-overall-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.stats-overall-rate {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stats-overall-detail {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-group {
  margin-bottom: 12px;
}

.stats-group summary {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sky-deep);
  padding: 12px 16px;
  background: linear-gradient(180deg, #eaf3fb, #e0edf8);
  border: 1px solid var(--border);
  border-radius: 14px;
  user-select: none;
}

.stats-group[open] summary {
  border-radius: 14px 14px 0 0;
  border-bottom: none;
}

.stats-count {
  float: right;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}

.stats-group[open] .stats-list {
  border-radius: 0 0 14px 14px;
}

.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stats-list li {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.stats-list li:last-child {
  border-bottom: none;
}

.stats-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.stats-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.stats-rate {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.stats-bar {
  height: 8px;
  margin: 6px 0 4px;
  background: #e6eef6;
  border-radius: 999px;
  overflow: hidden;
}

.stats-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--meadow));
  border-radius: 999px;
}

.stats-detail {
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer {
  margin-top: 56px;
  padding: 24px 0 32px;
  background: linear-gradient(180deg, #dceaf5, #cfe0ee);
  color: #46586b;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 4px 0;
}
