/* ================================================
   人類には少し難しいG検定 — サイト共通スタイル
   ブランドガイド準拠:
   green #2ECC71 / orange #FF8A4C / black #000 / white #fff
   ================================================ */

:root {
  --green: #2ECC71;
  --green-dark: #27ae60;
  --green-deep: #1e8a4c;
  --orange: #FF8A4C;
  --orange-dark: #f0763a;
  --black: #111111;
  --cream: #f7f4ec;
  --white: #ffffff;
  --red-soft: #e74c3c;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --border: 3px solid var(--black);
  --shadow: 6px 6px 0 rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
  /* フッターより下(オーバースクロール領域)も黒にする */
  background-color: #111111;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  background-color: var(--green);
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 2.5px, transparent 2.5px);
  background-size: 26px 26px;
  color: var(--black);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

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

/* ---------- ヘッダー ---------- */

.site-header {
  padding: 18px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-badge {
  background: var(--cream);
  border: var(--border);
  border-radius: 999px;
  padding: 4px 16px;
  font-weight: 900;
  font-size: 0.95rem;
  white-space: nowrap;
}

.brand-badge .g {
  color: var(--green-deep);
}

.site-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--black);
  border-radius: 999px;
  padding: 5px 14px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.site-nav a:hover {
  background: var(--orange);
  transform: translateY(-2px);
}

/* ---------- ヒーロー(出迎え) ---------- */

.hero {
  padding: 24px 0 40px;
}

.hero-panel {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 44px 48px 36px;
  /* パネルは全幅のまま、中身(ロゴ・ジグ)を大きくして埋める。
     余白は 左端・中間・右端 に薄く均等分配 */
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.hero-left {
  max-width: 560px;
  flex: 0 1 auto;
}


.hero-panel::after {
  /* 右下のドット飾り */
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background-image: radial-gradient(var(--green) 3px, transparent 3px);
  background-size: 16px 16px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* ドット飾りはジグの後ろに敷く */
.hero .zig-stage {
  position: relative;
  z-index: 1;
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero-tag {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  border: var(--border);
  border-radius: 999px;
  padding: 4px 20px;
  font-weight: 900;
  font-size: 1rem;
}

.hero-tag-year {
  background: var(--orange);
  color: var(--black);
}

.hero-title-wrap {
  margin: 0;
  line-height: 0;
}

.hero-logo {
  width: min(350px, 68vw);
  height: auto;
}

/* ヒーロー内のジグはロゴと釣り合う大きさにする */
.hero .zig {
  width: min(330px, 60vw);
}

.hero-message {
  margin-top: 18px;
  font-weight: 700;
  font-size: 1.05rem;
}

.hero-message strong {
  background: linear-gradient(transparent 62%, rgba(255, 138, 76, 0.55) 62%);
}

.hero-sub {
  margin-top: 8px;
  font-size: 0.92rem;
  color: #444;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
  border: var(--border);
  border-radius: 999px;
  padding: 12px 30px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
}

.btn-primary {
  background: var(--orange);
  color: var(--black);
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
}

/* ---------- ジグ(キャラクター) ---------- */

.zig-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 320px;
}

.zig {
  width: min(210px, 52vw);
  height: auto;
  transform-origin: 50% 100%;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.zig.is-bounce {
  animation: zig-bounce 0.55s ease;
}

.zig.is-shake {
  animation: zig-shake 0.5s ease;
}

.zig.is-sway {
  animation: zig-sway 3.2s ease-in-out infinite;
}

@keyframes zig-bounce {
  0%   { transform: translateY(0) scaleY(1); }
  25%  { transform: translateY(0) scaleY(0.9); }
  55%  { transform: translateY(-26px) scaleY(1.04); }
  80%  { transform: translateY(0) scaleY(0.96); }
  100% { transform: translateY(0) scaleY(1); }
}

@keyframes zig-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-2deg); }
  40% { transform: translateX(7px) rotate(2deg); }
  60% { transform: translateX(-5px) rotate(-1deg); }
  80% { transform: translateX(4px) rotate(1deg); }
}

@keyframes zig-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(1.6deg); }
}

.zig-bubble {
  position: relative;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 18px;
  width: max-content;
  max-width: min(360px, 80vw);
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.zig-bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top: 10px solid var(--black);
}

.zig-bubble::before {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top: 9px solid var(--white);
  z-index: 1;
}

/* ---------- セクション ---------- */

.section {
  padding: 28px 0;
}

.section-title {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  padding: 6px 24px;
  font-weight: 900;
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.section-title .paw {
  color: var(--orange);
}

/* ---------- コンテンツカード ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.content-card {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 24px 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease;
  position: relative;
}

a.content-card:hover {
  transform: translateY(-5px);
}

.content-card.is-soon {
  opacity: 0.75;
}

.card-icon {
  width: 72px;
  height: 72px;
  background: var(--green);
  border: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-icon img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  transform: translateY(4px);
}

.card-title {
  font-weight: 900;
  font-size: 1.2rem;
}

.card-desc {
  font-size: 0.9rem;
  color: #333;
  flex-grow: 1;
}

.card-cta {
  font-weight: 900;
  color: var(--green-deep);
  font-size: 0.95rem;
}

.soon-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 12px;
}

/* ---------- 進捗パネル ---------- */

.progress-panel {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 30px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.15);
}

.progress-row:last-child {
  border-bottom: none;
}

.progress-face {
  width: 52px;
  height: 52px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-face img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.progress-info {
  flex-grow: 1;
}

.progress-label {
  font-weight: 900;
  font-size: 1rem;
}

.progress-bar {
  height: 16px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.progress-count {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- クイズ画面 ---------- */

.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
  padding-bottom: 48px;
}

.quiz-main {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 34px;
  min-height: 420px;
}

.quiz-side {
  position: sticky;
  top: 20px;
}

.quiz-side .zig-stage {
  min-height: 260px;
}

.quiz-side .zig {
  width: min(190px, 40vw);
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.quiz-category {
  background: var(--green);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: 999px;
  font-weight: 900;
  padding: 3px 16px;
  font-size: 0.9rem;
}

.quiz-progress-text {
  font-weight: 900;
  font-size: 0.95rem;
}

.quiz-combo {
  font-weight: 900;
  color: var(--orange-dark);
  font-size: 0.95rem;
  min-height: 1.4em;
}

.quiz-question {
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 22px;
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
  line-height: 1.5;
}

.choice-btn:hover:not(:disabled) {
  background: #fff3ea;
  transform: translateX(4px);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-btn.is-correct {
  background: var(--green);
  color: var(--white);
}

.choice-btn.is-wrong {
  background: var(--red-soft);
  color: var(--white);
}

.choice-btn.is-dim {
  opacity: 0.45;
}

.quiz-feedback {
  margin-top: 22px;
  display: none;
}

.quiz-feedback.is-open {
  display: block;
  animation: fade-up 0.3s ease;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feedback-result {
  font-weight: 900;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.feedback-result.ok { color: var(--green-deep); }
.feedback-result.ng { color: var(--red-soft); }

.feedback-explain {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.95rem;
}

.feedback-zig {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.feedback-zig .mini-face {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-zig .mini-face img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.feedback-zig .zig-word {
  background: #eafaf1;
  border: 2px solid var(--green-dark);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.quiz-next {
  margin-top: 20px;
  text-align: right;
}

/* カテゴリ選択 */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

.category-card {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
}

.category-card:hover:not(:disabled) {
  transform: translateY(-5px);
}

.category-card:disabled {
  opacity: 0.6;
  cursor: default;
}

.category-card .card-title {
  margin-bottom: 6px;
}

.category-card .best {
  margin-top: 10px;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--green-deep);
}

/* 結果画面 */

.result-panel {
  text-align: center;
  padding: 20px 0;
}

.result-score {
  font-weight: 900;
  font-size: 3rem;
  line-height: 1.2;
}

.result-score .denom {
  font-size: 1.4rem;
  color: #555;
}

.result-comment {
  font-weight: 700;
  margin: 12px 0 24px;
  font-size: 1.05rem;
}

/* ---------- 用語辞典 ---------- */

.glossary-head {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.glossary-zig {
  flex-shrink: 0;
  text-align: center;
  width: 150px;
}

.glossary-zig img {
  width: 130px;
  margin: 0 auto;
}

.glossary-zig-bubble {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 10px;
  margin-bottom: 8px;
}

.glossary-controls {
  flex-grow: 1;
  min-width: 0;
}

.search-box {
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 18px;
  border: var(--border);
  border-radius: 999px;
  background: var(--white);
  outline: none;
}

.search-box:focus {
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.45);
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border: 2px solid var(--black);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  transition: background 0.1s ease, transform 0.1s ease;
}

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

.chip.is-active {
  background: var(--green);
  color: var(--white);
}

.glossary-count {
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #333;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  padding-bottom: 48px;
}

.term-card {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.term-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.term-name {
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0;
}

.term-badge {
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  white-space: nowrap;
}

.term-def {
  font-size: 0.92rem;
  margin: 0;
  flex-grow: 1;
}

.term-empty {
  grid-column: 1 / -1;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  padding: 36px 20px;
}

@media (max-width: 640px) {
  .glossary-head {
    flex-direction: column;
    align-items: stretch;
  }

  .glossary-zig {
    margin: 0 auto;
  }
}

/* ---------- 勉強Tips ---------- */

.tips-intro {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 30px;
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 24px;
}

.tips-intro img {
  width: 170px;
  flex-shrink: 0;
}

.tips-intro-lead {
  font-weight: 900;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.tips-intro a {
  font-weight: 700;
  color: var(--green-deep);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.tip-card {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tip-no {
  align-self: flex-start;
  background: var(--orange);
  border: 2px solid var(--black);
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 2px 14px;
}

.tip-title {
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0;
}

.tip-body {
  font-size: 0.92rem;
  margin: 0;
  flex-grow: 1;
}

.tip-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-small {
  font-size: 0.85rem;
  padding: 8px 18px;
}

.video-promo {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
}

.video-promo h3 {
  font-weight: 900;
  font-size: 1.3rem;
  margin: 0 0 10px;
}

.video-promo p {
  font-size: 0.95rem;
  margin: 0 0 18px;
}

.video-promo strong {
  color: var(--green);
}

.video-promo-zig {
  /* 黒背景でも見えるように、クリームの丸で囲む */
  width: 190px;
  height: 190px;
  padding: 16px;
  box-sizing: border-box;
  object-fit: contain;
  background: var(--cream);
  border: 3px solid var(--white);
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .tips-intro,
  .video-promo {
    flex-direction: column;
    text-align: center;
  }

  .tips-intro img {
    margin: 0 auto;
  }
}

/* ---------- 準備中ページ ---------- */

.soon-panel {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 48px 30px;
  text-align: center;
  margin-bottom: 48px;
}

.soon-panel img {
  width: 200px;
  margin: 0 auto 20px;
}

.soon-panel h1 {
  font-weight: 900;
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.soon-panel p {
  font-weight: 700;
  color: #444;
  margin-bottom: 24px;
}

/* ---------- フッター ---------- */

.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 28px 0 32px;
  /* 短いページでもフッターを最下部に張り付かせ、下に緑を見せない */
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.site-footer a {
  color: var(--green);
  font-weight: 700;
}

.footer-note {
  font-size: 0.78rem;
  color: #aaa;
}

/* ---------- レスポンシブ ---------- */

@media (max-width: 760px) {
  /* ナビは1行に収める(小さめボタン+収まらない端末では横スクロール) */
  .site-header .container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .site-nav {
    flex-wrap: nowrap;
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    font-size: 0.82rem;
    padding: 4px 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .hero-panel {
    padding: 32px 24px 28px;
  }

  /* スマホではヒーローの中身を中央揃えに */
  .hero-left {
    text-align: center;
  }

  .hero-tags,
  .hero-actions {
    justify-content: center;
  }

  .hero-logo {
    margin: 0 auto;
  }

  /* スマホではサイトトップのジグだけ一回り小さく */
  .hero .zig {
    width: 170px;
  }

  .hero .zig-stage {
    min-height: 210px;
  }

  .zig-stage {
    min-height: 260px;
  }

  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .quiz-side {
    position: static;
    order: -1;
  }

  .quiz-side .zig-stage {
    min-height: 200px;
  }

  .quiz-side .zig {
    width: 130px;
  }

  .quiz-main {
    padding: 24px 20px;
  }
}
