:root {
  --site-bg: #f3efe4;
  --site-panel: rgba(255, 250, 240, 0.88);
  --site-panel-strong: #fffaf0;
  --site-ink: #102432;
  --site-muted: #536271;
  --site-line: rgba(16, 36, 50, 0.12);
  --site-accent: #c8632a;
  --site-accent-deep: #8d3e14;
  --site-secondary: #0f596c;
  --site-shadow: 0 22px 60px rgba(16, 36, 50, 0.14);
}

body.site-body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(200, 99, 42, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 89, 108, 0.18), transparent 30%),
    linear-gradient(180deg, #f7f0e4 0%, var(--site-bg) 40%, #ebe3d2 100%);
  color: var(--site-ink);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

body.site-body.game-focus-mode {
  overflow: hidden;
}

body.site-body.game-focus-mode .site-header {
  z-index: 400;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: rgba(247, 240, 228, 0.88);
  border-bottom: 1px solid var(--site-line);
}

.site-header-inner {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
}

.site-brand strong,
.site-brand small {
  display: block;
}

.site-brand > span:last-child {
  min-width: 0;
}

.site-brand small {
  color: var(--site-muted);
  font-size: 0.74rem;
}

.site-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 24px rgba(15, 89, 108, 0.14);
  overflow: hidden;
}

.site-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a,
.section-link,
.inline-link {
  color: var(--site-secondary);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover,
.section-link:hover,
.inline-link:hover {
  color: var(--site-accent-deep);
}

.site-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 1 auto;
  gap: 10px;
  flex-wrap: wrap;
}

.site-game-status {
  border-top: 1px solid rgba(16, 36, 50, 0.08);
  background: rgba(255, 250, 240, 0.72);
}

.site-game-status[hidden] {
  display: none;
}

.site-game-status-inner {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 8px 0 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
}

.game-hud-btns {
  display: inline-flex;
  align-items: center;
  grid-column: 1;
  justify-self: start;
  gap: 6px;
  flex-wrap: wrap;
}

.game-hud-btns[hidden] {
  display: none;
}

.game-score-group {
  display: inline-flex;
  align-items: center;
  grid-column: 3;
  justify-content: flex-end;
  justify-self: end;
  gap: 14px;
  flex-wrap: wrap;
}

.site-game-status .score {
  color: var(--site-ink);
  font-size: 0.95rem;
}

.site-game-status .score.stamina {
  color: var(--site-secondary);
}

.site-game-status .score.color-swap {
  color: #27a6d9;
  font-weight: 800;
  grid-column: 2;
  justify-self: center;
}

.site-game-status .score.color-swap[hidden] {
  display: none;
}

.site-game-status .stamina-timer {
  color: var(--site-muted);
}

.site-game-status .stamina-debug-btn {
  background: rgba(15, 89, 108, 0.08);
  border-color: rgba(15, 89, 108, 0.22);
  color: var(--site-secondary);
}

.site-game-status .stamina-debug-btn:hover {
  background: rgba(15, 89, 108, 0.14);
}

.site-main {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

body.site-body.route-game .site-main {
  padding-top: 6px;
}

.hero-panel,
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 22px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 32px;
  background:
    linear-gradient(140deg, rgba(255, 250, 240, 0.96), rgba(255, 244, 229, 0.88)),
    linear-gradient(135deg, rgba(15, 89, 108, 0.08), rgba(200, 99, 42, 0.12));
  box-shadow: var(--site-shadow);
}

.eyebrow,
.section-kicker {
  color: var(--site-accent-deep);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1 {
  font-size: clamp(1.72rem, 3.3vw, 3rem);
  line-height: 1.12;
  margin: 4px 0 12px;
}

.hero-text,
.page-summary,
.content-note,
.content-card p,
.empty-state {
  color: var(--site-muted);
  line-height: 1.7;
}

.hero-text {
  font-size: clamp(1rem, 1.55vw, 1.22rem);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-metrics {
  display: grid;
  gap: 10px;
}

.metric-tile {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--site-panel);
  border: 1px solid var(--site-line);
}

.metric-tile strong {
  display: block;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  line-height: 1.05;
}

.metric-tile span {
  color: var(--site-muted);
  font-size: 0.84rem;
}

.site-btn,
.site-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.site-btn:hover,
.site-link-btn:hover {
  transform: translateY(-1px);
}

.site-btn-primary,
.site-link-btn.primary {
  background: linear-gradient(135deg, var(--site-accent), #d7823c);
  color: #fff9f2;
  box-shadow: 0 12px 28px rgba(200, 99, 42, 0.22);
}

.site-btn-secondary,
.site-link-btn.secondary {
  background: rgba(15, 89, 108, 0.08);
  color: var(--site-secondary);
  border-color: rgba(15, 89, 108, 0.2);
}

.site-btn-ghost {
  background: rgba(255, 255, 255, 0.66);
  color: var(--site-ink);
  border-color: var(--site-line);
}

.site-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--site-line);
  color: var(--site-ink);
}

.site-user-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.site-user-icon-default {
  font-size: 1.1rem;
  line-height: 1;
}


.site-user-dropdown {
  position: relative;
  max-width: 100%;
}

.site-user-avatar-btn {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--site-line);
  color: var(--site-ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.16s ease;
}

.site-user-avatar-btn .user-id {
  min-width: 0;
  flex-wrap: nowrap;
}

.site-user-avatar-btn #user-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-user-avatar-btn:hover {
  background: rgba(255, 255, 255, 0.96);
}

.site-dropdown-caret {
  font-size: 0.75rem;
  color: var(--site-muted);
}

.site-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--site-panel-strong);
  border: 1px solid var(--site-line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16, 36, 50, 0.14);
  overflow: hidden;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.site-dropdown-menu[hidden] {
  display: none;
}

.site-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 18px;
  text-align: left;
  color: var(--site-ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.site-dropdown-item:hover {
  background: rgba(16, 36, 50, 0.06);
}

.site-dropdown-item-primary {
  color: var(--site-accent-deep);
}

.section-block {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.content-card h2 {
  margin-top: 6px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.leaderboard-panel {
  padding: 12px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255, 250, 240, 0.96), rgba(255, 244, 229, 0.9)),
    linear-gradient(135deg, rgba(15, 89, 108, 0.06), rgba(200, 99, 42, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 38px rgba(16, 36, 50, 0.08);
}

.home-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.home-leaderboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(16, 36, 50, 0.08);
}

.home-leaderboard-item.me {
  background: linear-gradient(135deg, rgba(200, 99, 42, 0.12), rgba(15, 89, 108, 0.08)), rgba(255, 255, 255, 0.92);
  border-color: rgba(200, 99, 42, 0.28);
}

.home-leaderboard-rank {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 89, 108, 0.12), rgba(200, 99, 42, 0.18));
  color: var(--site-accent-deep);
  font-size: 1.05rem;
  font-weight: 800;
}

.home-leaderboard-main {
  min-width: 0;
}

.home-leaderboard-name {
  min-width: 0;
  font-weight: 700;
}

.home-leaderboard-name .player-chip {
  max-width: 100%;
}

.home-leaderboard-subtext,
.home-leaderboard-score span {
  color: var(--site-muted);
  font-size: 0.84rem;
}

.home-leaderboard-score {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.home-leaderboard-score strong {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1;
}

.map-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 300px;
  border-radius: 24px;
  background: var(--site-panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 34px rgba(16, 36, 50, 0.12);
}

.map-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 36, 50, 0.06), rgba(16, 36, 50, 0.68));
  opacity: 0.96;
  z-index: 1;
}

.map-card-media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.38), transparent 24%),
    linear-gradient(135deg, #0f596c, #c8632a);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.map-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
  padding: 20px;
  color: #fff7f0;
}

.map-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: start;
  margin-bottom: auto;
}

.map-badge-row,
.map-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-badge,
.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.16);
  border: 1px solid rgba(255, 250, 240, 0.28);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
}

.map-mode-badge {
  font-weight: 800;
  letter-spacing: 0;
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.42);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.map-mode-badge--mine {
  background: rgba(200, 99, 42, 0.74);
}

.map-mode-badge--color {
  background: rgba(39, 166, 217, 0.74);
}

.map-card h3 {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.map-card p {
  color: rgba(255, 247, 240, 0.9);
  line-height: 1.6;
  margin-bottom: 14px;
}

.map-card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.map-progress-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  margin: 14px 0 8px;
}

.map-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f7cf73, #f29a4a);
}

.service-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.guide-card,
.content-card {
  padding: 24px;
  border-radius: 24px;
  background: var(--site-panel);
  border: 1px solid var(--site-line);
  box-shadow: 0 16px 34px rgba(16, 36, 50, 0.08);
}

.guide-card-accent {
  background: linear-gradient(160deg, rgba(15, 89, 108, 0.08), rgba(200, 99, 42, 0.08)), var(--site-panel);
}

.guide-list {
  margin-top: 14px;
  padding-left: 20px;
  color: var(--site-ink);
  line-height: 1.8;
}

.guide-list.compact {
  margin-top: 12px;
}

.game-map-titlebar {
  padding: 14px 0 10px;
}

.game-map-titlebar h1 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.2;
  margin: 0;
}

.game-map-meta {
  padding: 14px 0 2px;
}

.game-map-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.game-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.12);
  border: 1px solid rgba(255, 250, 240, 0.22);
  backdrop-filter: blur(10px);
}

.game-metric-value {
  font-size: clamp(1.05rem, 1.85vw, 1.55rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.game-metric-label {
  color: var(--site-muted);
  font-size: 0.9rem;
  line-height: 1;
  white-space: nowrap;
}

.game-shell {
  margin-top: 4px;
}

.game-focus-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.game-focus-toggle {
  pointer-events: auto;
  border: 1px solid rgba(255, 250, 240, 0.28);
  background: rgba(16, 36, 50, 0.72);
  color: #f7efe6;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.app-wrapper {
  position: relative;
  inset: auto;
  min-height: 0;
  height: clamp(560px, calc(100dvh - 135px), 900px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(16, 36, 50, 0.12);
  box-shadow: 0 22px 60px rgba(16, 36, 50, 0.14);
  background: #15232c;
}

body.site-body.game-focus-mode .app-wrapper {
  position: fixed;
  top: var(--game-focus-top-offset, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: calc(100dvh - var(--game-focus-top-offset, 0px));
  border-radius: 0;
  border-width: 0;
  z-index: 300;
}

body.site-body.game-focus-mode .game-shell {
  margin-top: 0;
}

body.site-body.game-focus-mode .game-map-titlebar,
body.site-body.game-focus-mode .game-map-meta,
body.site-body.game-focus-mode .game-view > .section-block,
body.site-body.game-focus-mode .site-footer {
  display: none;
}

.game-stage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.site-footer {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 44px;
  color: var(--site-muted);
}

.home-view[hidden],
.game-view[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .map-grid,
  .compact-grid,
  .service-guide,
  .hero-panel,
  .page-hero {
    grid-template-columns: 1fr;
  }

  .game-map-metrics {
    grid-template-columns: 1fr;
  }

  .app-wrapper {
    height: clamp(520px, calc(100dvh - 115px), 820px);
  }
}

@media (max-width: 760px) {
  .section-heading,
  .map-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header-inner {
    width: min(100vw - 20px, 1200px);
    padding: 12px 0;
    gap: 10px;
    flex-direction: row;
    align-items: center;
  }

  .site-brand {
    gap: 10px;
  }

  .site-brand strong {
    font-size: 0.98rem;
    line-height: 1.15;
  }

  .site-brand small {
    font-size: 0.67rem;
    line-height: 1.2;
  }

  .site-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .site-header-actions {
    flex: 0 1 auto;
    flex-wrap: nowrap;
  }

  .site-user-avatar-btn {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .site-user-avatar-btn .user-id {
    gap: 0.28rem;
  }

  .site-nav {
    width: 100%;
    order: 3;
  }

  .site-game-status-inner {
    width: min(100vw - 20px, 1200px);
    grid-template-columns: 1fr;
  }

  .game-hud-btns,
  .site-game-status .score.color-swap,
  .game-score-group {
    grid-column: 1;
    justify-self: center;
  }

  .game-score-group {
    justify-content: center;
  }

  .map-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .home-leaderboard-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-leaderboard-score {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
    padding-left: calc(2.5rem + 14px);
  }

  .hero-panel,
  .page-hero,
  .guide-card,
  .content-card {
    padding: 22px;
  }

  .game-map-titlebar {
    padding: 10px 0 8px;
  }

  .game-map-titlebar h1 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .game-map-metrics {
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .game-map-metrics::-webkit-scrollbar {
    display: none;
  }

  .game-metric-chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 10px;
    gap: 6px;
  }

  .game-metric-value {
    font-size: clamp(0.9rem, 4vw, 1.08rem);
  }

  .game-metric-label {
    font-size: 0.72rem;
  }

  .site-main {
    width: min(100vw - 20px, 1200px);
  }

  body.site-body.route-game .site-main {
    padding-top: 4px;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: clamp(1.42rem, 7vw, 2.15rem);
    line-height: 1.16;
  }

  .hero-text {
    font-size: 0.94rem;
  }

  .metric-tile {
    padding: 14px 16px;
  }

  .metric-tile strong {
    font-size: clamp(1.18rem, 6vw, 1.6rem);
  }

  .metric-tile span {
    font-size: 0.78rem;
  }

  .site-footer {
    width: min(100vw - 20px, 1200px);
  }

  .app-wrapper {
    height: clamp(320px, 54dvh, 520px);
  }

  .game-focus-toolbar {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: 10px;
  }

  body.site-body.game-focus-mode .game-focus-toolbar {
    right: max(10px, env(safe-area-inset-right, 0px));
    top: max(10px, env(safe-area-inset-top, 0px));
  }
}

/* ===== Dark mode / System theme ===== */

[data-theme="dark"],
[data-theme="system"] {
  --site-bg: #111c26;
  --site-panel: rgba(20, 34, 48, 0.92);
  --site-panel-strong: #162130;
  --site-ink: #dce8f0;
  --site-muted: #7fa0b8;
  --site-line: rgba(220, 232, 240, 0.10);
  --site-accent: #e07840;
  --site-accent-deep: #c8632a;
  --site-secondary: #4ab8d4;
  --site-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] body.site-body,
[data-theme="system"] body.site-body {
  background:
    radial-gradient(circle at top left, rgba(180, 80, 20, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(10, 60, 90, 0.15), transparent 30%),
    linear-gradient(180deg, #111c26 0%, #0e1820 40%, #131f2a 100%);
}

[data-theme="dark"] .site-header,
[data-theme="system"] .site-header {
  background: rgba(14, 24, 32, 0.88);
  border-bottom-color: rgba(220, 232, 240, 0.10);
}

[data-theme="dark"] .site-game-status,
[data-theme="system"] .site-game-status {
  background: rgba(14, 24, 32, 0.72);
  border-top-color: rgba(220, 232, 240, 0.08);
}

[data-theme="dark"] .site-user-avatar-btn,
[data-theme="system"] .site-user-avatar-btn {
  background: rgba(220, 232, 240, 0.08);
  border-color: rgba(220, 232, 240, 0.16);
}

[data-theme="dark"] .site-user-avatar-btn:hover,
[data-theme="system"] .site-user-avatar-btn:hover {
  background: rgba(220, 232, 240, 0.14);
}

[data-theme="dark"] .site-nav a,
[data-theme="system"] .site-nav a {
  color: var(--site-muted);
}

[data-theme="dark"] .site-nav a:hover,
[data-theme="system"] .site-nav a:hover {
  color: var(--site-ink);
}

[data-theme="dark"] .site-link-btn.secondary,
[data-theme="system"] .site-link-btn.secondary {
  background: rgba(220, 232, 240, 0.08);
  border-color: rgba(220, 232, 240, 0.18);
  color: var(--site-ink);
}

/* admin-page dark overrides */
[data-theme="dark"] .admin-panel,
[data-theme="system"] .admin-panel {
  background: var(--site-panel-strong);
  border-color: var(--site-line);
  color: var(--site-ink);
}

[data-theme="dark"] .admin-page .profile-input,
[data-theme="system"] .admin-page .profile-input {
  background-color: #1e2d3a;
  border-color: rgba(220, 232, 240, 0.18);
  color: var(--site-ink);
}

[data-theme="dark"] .admin-page .profile-input::placeholder,
[data-theme="system"] .admin-page .profile-input::placeholder {
  color: rgba(220, 232, 240, 0.3);
}

[data-theme="dark"] .admin-page select.profile-input,
[data-theme="system"] .admin-page select.profile-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237fa0b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px 6px;
  appearance: none;
  padding-right: 1.8rem;
}

[data-theme="dark"] .drop-zone,
[data-theme="system"] .drop-zone {
  background: rgba(220, 232, 240, 0.04);
  border-color: rgba(220, 232, 240, 0.15);
}

[data-theme="dark"] .image-preview,
[data-theme="system"] .image-preview {
  background: rgba(220, 232, 240, 0.04);
  border-color: rgba(220, 232, 240, 0.10);
}

[data-theme="dark"] .admin-map-list li,
[data-theme="system"] .admin-map-list li {
  border-bottom-color: rgba(220, 232, 240, 0.10);
}

/* system: OSがダークならダーク適用 */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --site-bg: #111c26;
    --site-panel: rgba(20, 34, 48, 0.92);
    --site-panel-strong: #162130;
    --site-ink: #dce8f0;
    --site-muted: #7fa0b8;
    --site-line: rgba(220, 232, 240, 0.10);
    --site-accent: #e07840;
    --site-accent-deep: #c8632a;
    --site-secondary: #4ab8d4;
    --site-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  }
}

@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --site-bg: #f3efe4;
    --site-panel: rgba(255, 250, 240, 0.88);
    --site-panel-strong: #fffaf0;
    --site-ink: #102432;
    --site-muted: #536271;
    --site-line: rgba(16, 36, 50, 0.12);
    --site-accent: #c8632a;
    --site-accent-deep: #8d3e14;
    --site-secondary: #0f596c;
    --site-shadow: 0 22px 60px rgba(16, 36, 50, 0.14);
  }
}

/* theme toggle button */
.theme-btn-group {
  display: inline-flex;
}

.theme-btn-group button {
  background: none;
  border: 1px solid var(--site-line);
  color: var(--site-muted);
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  margin-left: -1px;
}

.theme-btn-group button:first-child {
  border-radius: 999px 0 0 999px;
  margin-left: 0;
}

.theme-btn-group button:last-child {
  border-radius: 0 999px 999px 0;
}

.theme-btn-group button.active {
  background: var(--site-secondary);
  color: #fff;
  border-color: var(--site-secondary);
  position: relative;
  z-index: 1;
}

.theme-btn-group button:hover:not(.active) {
  background: var(--site-line);
  color: var(--site-ink);
}

/* hero-panel / metric-tile dark overrides */
[data-theme="dark"] .hero-panel,
[data-theme="dark"] .page-hero,
[data-theme="system"] .hero-panel,
[data-theme="system"] .page-hero {
  background:
    linear-gradient(140deg, rgba(20, 34, 50, 0.96), rgba(16, 28, 44, 0.90)),
    linear-gradient(135deg, rgba(10, 60, 80, 0.15), rgba(180, 80, 20, 0.10));
  border-color: rgba(220, 232, 240, 0.08);
}

[data-theme="dark"] .metric-tile,
[data-theme="system"] .metric-tile {
  background: rgba(220, 232, 240, 0.05);
  border-color: rgba(220, 232, 240, 0.10);
}

[data-theme="dark"] .content-card,
[data-theme="system"] .content-card {
  background: var(--site-panel-strong);
  border-color: var(--site-line);
}

/* press page */
.press-main {
  display: grid;
  gap: 0;
}

.press-hero {
  align-items: center;
}

.press-note {
  margin-top: 18px;
}

.press-quote {
  margin: 0 0 18px;
  padding: 20px 22px;
  border-left: 4px solid var(--site-accent);
  border-radius: 18px;
  background: rgba(200, 99, 42, 0.08);
  color: var(--site-ink);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.6;
  font-weight: 700;
}

.press-facts,
.press-contact {
  margin: 0;
  display: grid;
  gap: 12px;
}

.press-facts div,
.press-contact div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--site-line);
}

.press-facts div:last-child,
.press-contact div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.press-facts dt,
.press-contact dt {
  color: var(--site-muted);
  font-weight: 700;
}

.press-facts dd,
.press-contact dd {
  margin: 0;
  color: var(--site-ink);
}

.press-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.press-shot-grid,
.press-download-grid,
.press-qa-list {
  display: grid;
  gap: 18px;
}

.press-shot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.press-shot-card {
  padding: 18px;
}

.press-shot-link {
  display: block;
}

.press-shot-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--site-line);
  background: rgba(16, 36, 50, 0.08);
}

.press-shot-card figcaption {
  margin-top: 14px;
  color: var(--site-muted);
  line-height: 1.7;
}

.press-download-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.press-download-card {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.press-download-card:hover {
  transform: translateY(-1px);
  border-color: rgba(200, 99, 42, 0.3);
  box-shadow: 0 18px 36px rgba(16, 36, 50, 0.1);
}

.press-download-card strong {
  font-size: 1.04rem;
}

.press-download-card span {
  color: var(--site-muted);
  line-height: 1.7;
}

.press-qa-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.press-qa-list h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

@media (max-width: 1100px) {
  .press-feature-grid,
  .press-shot-grid,
  .press-download-grid,
  .press-qa-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .press-facts div,
  .press-contact div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .press-quote {
    padding: 18px;
    font-size: 1.02rem;
  }
}

[data-theme="dark"] .map-card,
[data-theme="system"] .map-card {
  background: var(--site-panel-strong);
  border-color: var(--site-line);
}

[data-theme="dark"] .site-footer,
[data-theme="system"] .site-footer {
  border-top-color: var(--site-line);
}
