@import url("https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@500;700;900&display=swap");

/* ===== 色・サイズ ===== */
:root {
  --bg: #fffaf0;
  --surface: #ffffff;
  --ink: #2b3a55;
  --ink-soft: #56627a;
  --line: #e7dfcf;
  --sky: #2f9be0;
  --sky-dark: #1f78b4;
  --sky-pale: #e3f3fd;
  --sun: #ffc93c;
  --sun-pale: #fff3cf;
  --grass: #3cb878;
  --grass-pale: #e2f6eb;
  --coral: #ff6b6b;
  --coral-pale: #ffe6e6;
  --grape: #8a6cf0;
  --grape-pale: #eee9ff;
  --radius: 18px;
  --shadow: 0 4px 0 rgba(43, 58, 85, .08), 0 8px 24px rgba(43, 58, 85, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "BIZ UDPGothic", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: .02em;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--sky-dark); text-underline-offset: 3px; }
a:hover { color: var(--sky); }

h1, h2, h3 { line-height: 1.4; font-weight: 900; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.yomi { font-size: .62em; font-weight: 700; color: var(--ink-soft); margin-left: .2em; white-space: nowrap; }

:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; border-radius: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===== ヘッダー・メニュー ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 4px solid var(--sun);
}
.site-header .bar {
  max-width: 1100px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; font-weight: 900; font-size: 1.05rem; }
.brand-text small { font-size: .7rem; font-weight: 700; color: var(--sky-dark); }
.brand:hover { color: var(--ink); }

.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-button {
  display: none; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; background: var(--sky-pale); color: var(--sky-dark);
  font-weight: 900; font-size: .95rem; user-select: none;
}
.nav-button .bars, .nav-button .bars::before, .nav-button .bars::after {
  display: block; width: 18px; height: 3px; border-radius: 2px; background: currentColor; position: relative; content: "";
}
.nav-button .bars::before { position: absolute; top: -6px; }
.nav-button .bars::after { position: absolute; top: 6px; }
.nav-toggle:focus-visible + .nav-button { outline: 4px solid var(--sun); outline-offset: 3px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-weight: 700; font-size: .95rem;
}
.site-nav a:hover { background: var(--sky-pale); color: var(--sky-dark); }
.site-nav a[aria-current="page"] { background: var(--sky); color: #fff; }
.site-nav .nav-login { border: 2px solid var(--grass); color: var(--grass); padding: 6px 14px; }
.site-nav .nav-login:hover { background: var(--grass-pale); color: var(--grass); }
.site-nav .nav-admin { color: var(--ink-soft); font-size: .85rem; }

@media (max-width: 420px) {
  .site-header .bar { gap: 8px; }
  .brand { gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .brand-text { font-size: .95rem; }
  .brand-text small { font-size: .6rem; }
  .nav-button { padding: 6px 12px; font-size: .9rem; }
}

@media (max-width: 820px) {
  .nav-button { display: inline-flex; }
  .site-nav { display: none; width: 100%; }
  .nav-toggle:checked ~ .site-nav { display: block; }
  .site-nav ul { flex-direction: column; padding: 4px 0 8px; }
  .site-nav a { padding: 12px 16px; font-size: 1.05rem; }
  .site-nav .nav-login { text-align: center; }
}

/* ===== レイアウト ===== */
main { display: block; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.section { padding: 40px 0; }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title .num {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--sun); color: var(--ink); font-size: 1.1rem;
}
.lead { color: var(--ink-soft); }

.page-head { padding: 28px 0 8px; }
.breadcrumb { font-size: .9rem; margin-bottom: 8px; color: var(--ink-soft); }
.breadcrumb a { color: var(--ink-soft); }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; border: 2px solid var(--line);
}
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ===== ボタン ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-weight: 900; text-decoration: none; line-height: 1.4;
  background: var(--sky-pale); color: var(--sky-dark);
  box-shadow: 0 4px 0 rgba(31, 120, 180, .25);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { color: var(--sky-dark); filter: brightness(1.03); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(31, 120, 180, .25); }
.btn-primary { background: var(--sky); color: #fff; box-shadow: 0 4px 0 var(--sky-dark); }
.btn-primary:hover { color: #fff; }
.btn-primary:active { box-shadow: 0 1px 0 var(--sky-dark); }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #d9a21a; }
.btn-sun:hover { color: var(--ink); }
.btn-grass { background: var(--grass); color: #fff; box-shadow: 0 4px 0 #278a57; }
.btn-grass:hover { color: #fff; }
.btn-danger { background: var(--coral-pale); color: #b42323; box-shadow: 0 3px 0 rgba(180, 35, 35, .25); padding: 6px 14px; font-size: .9rem; }
.btn-danger:hover { color: #b42323; }
.btn-lg { padding: 16px 32px; font-size: 1.15rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 28px 0; }

/* ===== トップ ===== */
.hero { background: linear-gradient(180deg, var(--sky-pale) 0%, var(--bg) 100%); padding: 28px 0 12px; }
.hero .container { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: center; }
.hero-kicker {
  display: inline-block; background: var(--surface); color: var(--sky-dark); font-weight: 900;
  padding: 4px 14px; border-radius: 999px; border: 2px solid var(--sky); font-size: .95rem; margin-bottom: 12px;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.1rem); margin-bottom: .3em; }
.hero h1 .accent { color: var(--coral); }
.hero p { font-size: 1.1rem; }
.hero-art img { display: block; border-radius: 28px; }
.hero .btn-row { justify-content: flex-start; }
@media (max-width: 760px) { .hero .btn-row { justify-content: center; } }
@media (max-width: 760px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; }
}

.basics .card { text-align: center; border-top: 8px solid var(--sky); }
.basics .card:nth-child(2) { border-top-color: var(--grass); }
.basics .card:nth-child(3) { border-top-color: var(--coral); }
.basics .card svg { width: 88px; height: 88px; margin: 4px auto 8px; display: block; }
.basics .card h3 { font-size: 1.35rem; margin-bottom: .3em; }

.notice { background: var(--sun-pale); border-color: #f3dfa0; }
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.about iframe { width: 100%; height: 280px; border: 0; border-radius: 14px; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* ===== 一覧 ===== */
.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.item-link {
  display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow); transition: transform .1s ease, border-color .1s ease;
}
.item-link:hover { transform: translateY(-2px); border-color: var(--sky); color: var(--ink); }
.item-badge {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: var(--sky); color: #fff; font-weight: 900; font-size: 1.05rem;
}
.item-badge.quiz { background: var(--coral); }
.item-body { display: flex; flex-direction: column; }
.item-title { font-weight: 900; font-size: 1.1rem; }
.item-meta { color: var(--ink-soft); font-size: .9rem; }
.item-go { margin-left: auto; color: var(--sky); font-weight: 900; font-size: 1.4rem; }

/* ===== 動画 ===== */
.video-frame { background: #1d2433; border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.video-frame video { display: block; width: 100%; border-radius: 12px; background: #000; }

/* ===== クイズ ===== */
.q-card { border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; margin: 0 0 20px; box-shadow: var(--shadow); }
.q-card legend {
  float: left; width: 100%; padding: 0; margin-bottom: 10px;
  font-weight: 900; font-size: 1.15rem; color: var(--coral);
}
.q-card legend + * { clear: both; }
.q-text { font-weight: 700; }
.q-hint { background: var(--sun-pale); border-radius: 12px; padding: 10px 14px; font-size: .95rem; }
.q-figure { text-align: center; margin: 12px 0; }
.q-figure img { border-radius: 12px; border: 2px solid var(--line); max-width: 760px; width: 100%; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  padding: 8px 20px; border-radius: 999px; border: 3px solid var(--line); background: var(--surface); font-weight: 700;
}
.choice span::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); background: #fff; flex: none;
}
.choice input[type="checkbox"] + span::before { border-radius: 5px; }
.choice:hover span { border-color: var(--sky); }
.choice input:checked + span { border-color: var(--sky); background: var(--sky-pale); }
.choice input:checked + span::before { border-color: var(--sky); background: var(--sky); box-shadow: inset 0 0 0 3px #fff; }
.choice input:focus-visible + span { outline: 4px solid var(--sun); outline-offset: 2px; }
.choices-img { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choices-img .choice span { flex-direction: column; border-radius: 16px; padding: 10px; height: 100%; justify-content: flex-start; }
.choices-img .choice span::before { align-self: flex-start; }
.choices-img img { width: 100%; max-width: 260px; border-radius: 10px; }
.choices-wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.choices-wide img { max-width: 420px; }
.choices-num .choice span { min-width: 56px; justify-content: center; padding: 8px 12px; }
.choices-num .choice span::before { display: none; }

/* ===== 結果 ===== */
.result { text-align: center; border-top: 8px solid var(--sun); }
.score { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 900; margin: 0; }
.score strong { color: var(--coral); font-size: 1.3em; }
.stars { font-size: 2rem; letter-spacing: .2em; color: var(--sun); margin: 4px 0 8px; }
.stars .off { color: var(--line); }
.cheer { font-size: 1.2rem; font-weight: 900; color: var(--grass); }
.answer-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0; font-size: 1rem; overflow: hidden; border-radius: 14px; border: 2px solid var(--line); }
.answer-table th, .answer-table td { padding: 10px 12px; text-align: center; border-bottom: 2px solid var(--line); }
.answer-table tr:last-child td { border-bottom: 0; }
.answer-table th { background: var(--sky-pale); }
.answer-table .ok { color: var(--grass); font-weight: 900; }
.answer-table .ng { color: var(--coral); font-weight: 900; }
.explain { margin-top: 18px; }
.explain summary {
  cursor: pointer; display: inline-block; padding: 10px 22px; border-radius: 999px; font-weight: 900;
  background: var(--grape-pale); color: var(--grape); list-style: none;
}
.explain summary::-webkit-details-marker { display: none; }
.explain[open] summary { margin-bottom: 12px; }
.explain .card { text-align: left; }

/* ===== レビュー ===== */
.review-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; }
.review-card .cover { width: 120px; border-radius: 8px; box-shadow: var(--shadow); }
.review-card .cover-blank {
  width: 120px; height: 160px; border-radius: 8px; display: grid; place-items: center;
  background: var(--sky-pale); color: var(--sky-dark); font-weight: 900; text-align: center; font-size: .85rem;
}
.review-card h2 { font-size: 1.3rem; margin-bottom: .2em; }
.meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: .6em; }
.bubble { background: var(--sun-pale); border-radius: 14px; padding: 12px 16px; position: relative; }
.comments { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.comments li { background: var(--sky-pale); border-radius: 12px; padding: 8px 14px; font-size: .95rem; }
.comments .who { font-weight: 900; }
.comments .when { color: var(--ink-soft); font-size: .85rem; }
@media (max-width: 560px) {
  .review-card { grid-template-columns: 1fr; }
  .review-card .cover, .review-card .cover-blank { margin: 0 auto; }
}

/* ===== フォーム ===== */
.form { display: grid; gap: 14px; }
.field label { display: block; font-weight: 900; margin-bottom: 4px; }
.field .note { font-size: .85rem; color: var(--ink-soft); }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 3px solid var(--line); background: #fff; color: var(--ink);
}
.form input:focus, .form textarea:focus { border-color: var(--sky); outline: none; }
.form textarea { min-height: 120px; resize: vertical; }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; }
.flash { border-radius: 14px; padding: 12px 16px; font-weight: 700; margin: 16px 0; }
.flash-ok { background: var(--grass-pale); color: #1d6e44; }
.flash-ng { background: var(--coral-pale); color: #a12222; }
.flash ul { margin: 0; padding-left: 1.2em; }
.login-box { max-width: 460px; margin: 32px auto; }
.login-box .switch { text-align: center; font-size: .95rem; margin: 16px 0 0; }

/* ===== 管理者 ===== */
.admin-table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--surface); }
.admin-table th, .admin-table td { border-bottom: 2px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.admin-table th { background: var(--sky-pale); }
.table-scroll { overflow-x: auto; border-radius: 14px; border: 2px solid var(--line); }

/* ===== フッター ===== */
.site-footer { margin-top: 48px; background: var(--ink); color: #dfe6f3; padding: 28px 0; font-size: .9rem; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 .4em; }

/* ===== セレクト ===== */
.form select, select.select {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 3px solid var(--line);
  background: #fff; color: var(--ink);
}
.form select:focus { border-color: var(--sky); outline: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-edit { background: var(--sky-pale); color: var(--sky-dark); box-shadow: 0 3px 0 rgba(31, 120, 180, .25); padding: 6px 14px; font-size: .9rem; }
