:root {
  --brown: #6b4a32;
  --brown-soft: #6d5a48;
  --cream: #fff7e8;
  --white: #fff;
  --yellow: #f6c85f;
  --accent: #d68c00;
  --line: #eadcc5;
  --shadow: 0 18px 45px rgba(84, 56, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: #222;
  background:
    radial-gradient(circle at 8% 8%, rgba(246, 200, 95, 0.25), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(142, 197, 255, 0.22), transparent 28%),
    var(--cream);
  line-height: 1.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* iOS Safari は非同期デコード後に再描画が走らず、
     画像が空白のまま残ることがある。GPU合成を強制して回避する。 */
  transform: translateZ(0);
}

picture {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.detail-text p a,
.detail-section p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 900;
}

.container {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

/* =========================
   header / nav
========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 247, 232, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.site-logo span {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--brown);
  line-height: 1;
  letter-spacing: 0.03em;
  font-family: "Zen Maru Gothic", sans-serif;
}

.site-logo small {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: #b08a67;
  margin-top: 4px;
}

nav ul {
  display: flex;
  gap: 22px;
  padding: 0;
  margin: 0;
  list-style: none;
}

nav a {
  font-weight: 800;
  color: var(--brown);
}

nav a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--brown);
  transition: 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* =========================
   hero
========================= */
.hero {
  position: relative;
  padding: 56px 0 42px;
  overflow: hidden;
}

.floating-stone {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.45;
  pointer-events: none;
  animation: stone-drift 7s ease-in-out infinite;
}

.stone-1 { top: 10%; left: 4%; animation-delay: 0s; }
.stone-2 { top: 74%; left: 10%; font-size: 1.1rem; animation-delay: 1.4s; }
.stone-3 { top: 42%; right: 4%; animation-delay: 2.8s; }

@keyframes stone-drift {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(8deg);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
  align-items: center;
}

.hero-text {
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.hero-badge {
  display: inline-flex;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #f0d8aa;
  color: var(--brown);
  font-weight: 900;
  margin-bottom: 18px;
  animation: badge-pulse 2.8s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(246, 200, 95, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(246, 200, 95, 0);
  }
}

h1,
.hero h1 {
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  font-weight: 900;
  color: var(--brown);
  line-height: 1.12;
  margin: 0 0 20px;
  text-shadow: 3px 3px 0 #f5e5c5;
}

.subtitle {
  letter-spacing: 0.3em;
  color: #b08a67;
  font-weight: 700;
}

.hero-text p {
  font-weight: 700;
  color: var(--brown-soft);
}

.hero-text p.hero-narration {
  font-size: 0.85rem;
  font-style: italic;
  font-weight: 600;
  color: var(--brown-soft);
  margin-top: 10px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--brown);
  border: 2px solid var(--brown);
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--brown);
  transition: 0.15s ease;
}

.btn:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--brown);
}

.btn-white {
  background: #fff;
}

.hero-image {
  background: #fff;
  border-radius: 34px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 2px solid var(--line);
  animation: hero-float 5s ease-in-out infinite;
}

.hero-image img {
  border-radius: 24px;
}

@keyframes hero-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image,
  .hero-badge,
  .floating-stone {
    animation: none;
  }
}

/* =========================
   scroll reveal animation
========================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================
   section / titles
========================= */
section {
  padding: 54px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 28px;
}

.section-title small {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.18em;
}

.section-title h2 {
  position: relative;
  margin: 4px 0 8px;
  padding-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--brown);
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: var(--yellow);
}

/* =========================
   gateways (世界への入口)
========================= */
.gateways-lead {
  text-align: center;
  margin-top: -6px;
  font-weight: 700;
  color: var(--brown-soft);
}

.gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gateway-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a.gateway-card:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 24px 48px rgba(84, 56, 24, 0.22);
}

.gateway-visual {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gateway-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

a.gateway-card:hover .gateway-visual img {
  transform: scale(1.06);
}

.gateway-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.gateway-body h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--brown);
}

.gateway-body p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brown-soft);
}

.gateway-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-open {
  background: #e8f3e5;
  color: #3d7a3d;
}

@media (max-width: 900px) {
  .gateway-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* =========================
   character grid / card
========================= */
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.character-card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.character-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(84, 56, 24, 0.2);
}

.character-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.character-card:hover img {
  transform: scale(1.05);
}

.card-body {
  padding: 20px;
}

.card-body span {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: #f8edcf;
  color: var(--brown);
  font-weight: 900;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.card-body h3 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  color: var(--brown);
}

.card-body p {
  margin: 0;
  font-weight: 700;
  color: var(--brown-soft);
}

.detail-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s ease;
}

.detail-btn:hover {
  transform: translateY(-2px);
}

/* =========================
   school section
========================= */
.school-map {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 30px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.school-button {
  text-align: center;
  margin: 20px 0 50px;
}

.gakuen-btn {
  display: inline-block;
  background: var(--brown);
  color: #fff !important;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.gakuen-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* =========================
   gallery
========================= */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.gallery-grid img {
  width: 100%;
  height: 320px;
  object-fit: contain;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 30px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.gallery-grid img:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(84, 56, 24, 0.2);
}

.gallery-grid.gallery-mosaic {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.gallery-item {
  margin: 0;
}

.gallery-item figcaption {
  text-align: center;
  margin-top: 10px;
  font-weight: 700;
  color: var(--brown-soft);
}

.gallery-item figcaption a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================
   news
========================= */
.news-list {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.news-item {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-item > span {
  color: var(--accent);
}

.news-item p {
  margin: 4px 0 0;
}

.news-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.news-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f8edcf;
  color: var(--brown);
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

/* お知らせページ */
.news-hero {
  padding: 56px 0 20px;
  text-align: center;
}

.news-hero .section-label {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
}

.news-hero h1 {
  margin: 6px 0 14px;
}

.news-hero .lead {
  color: var(--brown-soft);
  font-weight: 700;
  max-width: 520px;
  margin: 0 auto;
}

.news-archive {
  padding: 20px 0 70px;
}

/* =========================
   student directory button (index)
========================= */
.student-directory-btn {
  text-align: center;
  margin: 60px 0 0;
}

.student-directory-btn a {
  display: inline-block;
  background: #7b5638;
  color: #fff;
  padding: 18px 40px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: 0.3s;
}

.student-directory-btn a:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

/* =========================
   footer
========================= */
footer {
  padding: 36px 0;
  text-align: center;
  color: #8c725b;
  font-weight: 800;
  border-top: 1px solid var(--line);
}

/* =========================
   popup / lightbox
========================= */
.popup-img {
  cursor: zoom-in;
  transition: 0.2s ease;
}

.popup-img:hover {
  opacity: 0.86;
  transform: scale(1.01);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 90vh;
  border-radius: 18px;
  background: #fff;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 38px;
  font-weight: bold;
  cursor: pointer;
}

/* =========================
   responsive: header + top-level grids
========================= */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-header nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-header nav.open {
    max-height: 320px;
  }

  .site-header nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .site-header nav a {
    display: block;
    padding: 14px 24px;
  }

  .hero-grid,
  .character-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

  .news-item {
    grid-template-columns: 1fr;
  }
}

/* =========================
   キャラクター詳細ページ
========================= */
.character-detail {
  padding-top: 40px;
}

.detail-hero {
  padding: 60px 0 40px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: center;
}

.detail-image {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.detail-image img {
  border-radius: 24px;
}

.detail-text {
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.detail-no {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f8edcf;
  color: var(--brown);
  font-weight: 900;
  margin-bottom: 14px;
}

.detail-copy {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent);
}

.detail-section {
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.detail-section h2 {
  margin-top: 0;
  color: var(--brown);
}

.profile-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-list div,
.status-card {
  background: #fffdf7;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.profile-list span {
  display: block;
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 4px;
}

.profile-list p,
.status-card p {
  margin: 0;
  font-weight: 800;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.status-card {
  text-align: center;
}

.status-card h3 {
  margin: 0 0 8px;
  color: var(--brown);
}

.quote-box {
  background: #fffdf7;
  border: 2px dashed #f0c36a;
  border-radius: 24px;
  padding: 24px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--brown);
  line-height: 2;
}

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

.relation-list li {
  background: #fffdf7;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--brown-soft);
}

.setting-img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background: #fff;
}

.character-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 50px 0;
}

.character-nav a {
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 999px;
  background: #f8edcf;
  color: var(--brown);
  font-weight: 900;
  border: 2px solid #f0c36a;
  transition: 0.2s;
}

.character-nav a:hover {
  transform: translateY(-3px);
}

@media (max-width: 900px) {
  .detail-grid,
  .profile-list,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    padding-top: 30px;
  }
}

/* =========================
   学園施設ページ
========================= */
.facility-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(135deg, var(--scene-a, var(--yellow)), var(--scene-b, var(--line)));
}

.scene-deco {
  position: absolute;
  font-size: 1.3rem;
  opacity: 0.5;
  animation: stone-drift 7s ease-in-out infinite;
}

.scene-deco:nth-child(2) { top: 15%; left: 12%; }
.scene-deco:nth-child(3) { top: 72%; right: 14%; animation-delay: 2s; font-size: 1rem; }
.scene-deco:nth-child(4) { top: 40%; left: 78%; animation-delay: 3.5s; }

@media (prefers-reduced-motion: reduce) {
  .scene-deco {
    animation: none;
  }
}

/* =========================
   あげまる学園ページ
========================= */
.gakuen-page {
  background: var(--cream);
  color: #3b2a1f;
}

.gakuen-hero {
  text-align: center;
  padding: 44px 20px 36px;
  background:
    radial-gradient(circle at 12% 15%, rgba(246, 200, 95, 0.35), transparent 32%),
    radial-gradient(circle at 88% 20%, rgba(142, 197, 255, 0.2), transparent 30%),
    linear-gradient(135deg, #fff3c4, #fff7e8);
}

.gakuen-copy {
  display: inline-block;
  background: var(--yellow);
  color: var(--brown);
  padding: 7px 18px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 12px;
}

.gakuen-hero h1 {
  font-family: "Zen Maru Gothic", sans-serif;
  text-shadow: 2px 2px 0 #fff;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 900;
  color: var(--brown);
  margin: 10px 0 15px;
}

.gakuen-hero p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--brown-soft);
}

.gakuen-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 46px 20px;
}

.gakuen-section h2 {
  text-align: center;
  font-size: clamp(1.5rem, 3.4vw, 1.9rem);
  margin-bottom: 24px;
  color: var(--brown);
}

.gakuen-section > p {
  max-width: 700px;
  margin: 0 auto;
  line-height: 2;
  font-size: 16px;
  text-align: center;
}

.motto-box {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px;
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  color: var(--brown);
  background: #fff;
  border: 3px dashed var(--yellow);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.gakuen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.gakuen-card {
  display: block;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

a.gakuen-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(84, 56, 24, 0.2);
}

a.gakuen-card:hover .gateway-visual img {
  transform: scale(1.06);
}

.gakuen-card-body {
  padding: 20px 22px 26px;
}

.gakuen-card h3 {
  font-size: 21px;
  margin: 10px 0 12px;
  color: var(--brown);
}

.gakuen-card p {
  line-height: 1.8;
  font-size: 15px;
  color: var(--brown-soft);
}

.symbol-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.symbol-item {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.symbol-item h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--brown);
}

.symbol-item p {
  margin: 0;
  line-height: 1.8;
  font-size: 15px;
  color: var(--brown-soft);
}

.gakuen-map {
  max-width: 1180px;
  margin: 20px auto 0;
  padding: 0 20px;
  text-align: center;
}

.gakuen-map img {
  width: 100%;
  height: auto;
  max-width: 1100px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 6px solid #fff;
}

.school-map-frame {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.map-hotspot {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
  outline: none;
}

.hotspot-label {
  margin-bottom: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brown);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.map-hotspot:hover .hotspot-label,
.map-hotspot:focus-visible .hotspot-label {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .hotspot-label {
    font-size: 0.65rem;
    padding: 4px 8px;
  }
}

.lounge-text {
  max-width: 680px;
  margin: 24px auto 0;
  text-align: center;
  line-height: 2;
  font-size: 18px;
  color: var(--brown-soft);
}

.sp-br {
  display: none;
}

@media (max-width: 480px) {
  .sp-br {
    display: inline;
  }
}

@media (max-width: 768px) {
  .gakuen-hero {
    padding: 40px 18px 32px;
  }

  .gakuen-grid {
    grid-template-columns: 1fr;
  }

  .motto-box {
    font-size: 21px;
  }

  .gakuen-section {
    padding: 32px 22px;
  }

  .gakuen-section h2 {
    margin-bottom: 18px;
  }

  .gakuen-section > p {
    font-size: 16px;
    line-height: 1.9;
    text-align: left;
  }

  .school-button {
    margin: 20px auto 40px;
    padding: 0 20px;
  }

  .gakuen-btn {
    width: auto;
    max-width: 90%;
    padding: 14px 22px;
    font-size: 15px;
  }

  .lounge-text {
    font-size: 17px;
    line-height: 2.1;
    padding: 0 24px;
  }
}

/* =========================
   生徒名簿ページ
========================= */
.students-page {
  min-height: 100vh;
  padding: 70px 20px 90px;
  background:
    radial-gradient(circle at 10% 10%, rgba(246, 200, 95, 0.22), transparent 30%),
    var(--cream);
  color: #4b3324;
}

.students-page .section-label {
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.students-page h1 {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 18px;
}

.students-page .lead {
  text-align: center;
  line-height: 1.9;
  margin-bottom: 46px;
  font-weight: 600;
  color: var(--brown-soft);
}

.student-group {
  max-width: 1120px;
  margin: 0 auto 56px;
}

.student-group-head {
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 4px solid var(--yellow);
}

.student-group-head h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--brown);
}

.student-group-head p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--brown-soft);
  font-weight: 600;
}

.student-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}

.student-grid.solo {
  grid-template-columns: minmax(0, 300px);
}

.student-card {
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  text-decoration: none;
  color: #4b3324;
  box-shadow: 0 14px 34px rgba(95, 65, 35, 0.14);
  border: 2px solid rgba(255, 199, 87, 0.35);
  transition: 0.25s ease;
}

.student-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 42px rgba(95, 65, 35, 0.22);
}

.student-card img {
  width: 100%;
  height: 320px;
  object-fit: contain;
  background: #fff8ea;
  padding: 10px;
}

.student-card .student-no {
  display: inline-block;
  margin: 22px 22px 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff0c8;
  color: #875a1b;
  font-weight: 700;
  font-size: 0.85rem;
}

.student-card h2 {
  margin: 6px 22px 10px;
  font-size: 1.45rem;
  color: var(--brown);
}

.student-card p {
  margin: 0 22px 26px;
  line-height: 1.7;
  font-weight: 600;
}

.back-home {
  text-align: center;
  margin-top: 60px;
}

.back-home a {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  background: #7b5638;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: 0.2s ease;
}

.back-home a:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

/* =========================
   あそぶ・診断ページ
========================= */
.quiz-page .quiz-screen {
  max-width: 640px;
  margin: 0 auto 50px;
  text-align: center;
}

.quiz-screen .btn {
  margin-top: 10px;
}

.quiz-progress {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

#quiz-question-text {
  font-size: 1.4rem;
  color: var(--brown);
  margin: 0 0 28px;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quiz-option:hover,
.quiz-option:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--yellow);
  outline: none;
}

.quiz-result-card {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: 44px 30px;
  box-shadow: var(--shadow);
  animation: quiz-pop 0.4s ease;
}

.quiz-result-emoji {
  font-size: 3.6rem;
  margin-bottom: 12px;
}

.quiz-result-card h2 {
  margin: 0 0 14px;
  color: var(--brown);
}

.quiz-result-card p {
  color: var(--brown-soft);
  font-weight: 600;
  line-height: 1.9;
}

.quiz-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

@keyframes quiz-pop {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-result-card {
    animation: none;
  }
}
