:root {
  --bg: #dff6fa;
  --card: #ffffff;
  --accent: #007b8a;
  --accent-2: #c0830a;
  --text: #0d2535;
  --muted: #3a6070;
  --border: rgba(0, 123, 138, 0.18);
  --shadow: 0 8px 40px rgba(0, 100, 120, 0.10);
  --radius: 16px;
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  background: linear-gradient(160deg, #a8e6f0 0%, #dff6fa 60%) fixed;
  color: var(--text);
  min-height: 100vh;
}

header.hero {
  position: relative;
  padding: 80px 24px 72px;
  overflow: hidden;
  isolation: isolate;
  background: url('./images/mm_hiru.jpg') center / cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 60, 0.45);
  z-index: -1;
}

header.hero,
header.hero .eyebrow,
header.hero .lede {
  color: rgba(255, 255, 255, 0.92);
}

.hero__content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 48px);
}

.lede {
  margin: 0 auto 24px;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.6;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(0, 123, 138, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), #00acc1);
  color: #ffffff;
  font-weight: 700;
}

.btn.ghost {
  border-color: rgba(0, 123, 138, 0.45);
}

.btn.subtle {
  background: rgba(255, 255, 255, 0.06);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 123, 138, 0.50);
}

.layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 64px;
  display: grid;
  gap: 20px;
}

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

.panel__toprow .progress {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}

.tiny-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.progress {
  position: relative;
  background: rgba(0, 123, 138, 0.10);
  border-radius: 999px;
  padding: 6px;
  margin-bottom: 12px;
}

.progress__bar {
  height: 12px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 200ms ease;
}

.progress__text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
}

.card {
  background: rgba(0, 123, 138, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card__header h3 {
  margin: 6px 0 8px;
}

.muted {
  color: var(--muted);
}

.muted.tiny {
  font-size: 12px;
  margin-top: 4px;
}

.question-body {
  margin: 12px 0 18px;
  line-height: 1.7;
}

/* 問題中の画像 */
.question-body img {
  display: block;
  max-width: 100%;
  margin: 12px auto;
  border-radius: 8px;
}

/* 問題中のSVG図形 */
.puzzle-svg {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 16px auto 8px;
  color: var(--text);
}

.stage-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.difficulty-tag {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 123, 138, 0.12);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(0, 123, 138, 0.30);
}

.hint-area {
  margin-bottom: 16px;
}

.hint-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* モーダル */
.hint-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hint-modal[hidden] {
  display: none;
}

.hint-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 60, 0.50);
}

.hint-modal__box {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px 20px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.hint-modal__label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.hint-modal__text {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: break-all;
}

.hint-modal__close {
  align-self: center;
  margin-top: 4px;
}

.input-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 16px;
}

input[type="text"]:focus {
  outline: 2px solid rgba(0, 123, 138, 0.50);
}

.feedback {
  min-height: 20px;
  color: var(--accent-2);
  font-weight: 600;
}

.explanation {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(0, 123, 138, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.result-card {
  text-align: center;
  padding: 24px;
}

.tip-section {
  margin: 24px 0 24px;
  padding: 20px;
  background: rgba(0, 123, 138, 0.08);
  border: 1px solid rgba(0, 123, 138, 0.25);
  border-radius: var(--radius);
}

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

.share-section {
  margin: 20px 0 4px;
  text-align: center;
}

.share-btn {
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 20px;
}

.top-link {
  display: block;
  margin-top: 20px;
  font-size: 13px;
  text-decoration: underline;
}

.tip-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.tip-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tip-btn {
  display: inline-block;
  text-decoration: none;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
}

/* ランディング情報 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.feature-card h3 {
  margin: 8px 0 8px;
  font-size: 15px;
}

.feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.feature-icon {
  font-size: 32px;
  margin: 0 0 4px;
}

.section-title {
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--accent);
}

.flow-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.flow-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.flow-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(120deg, var(--accent), #00acc1);
  color: #ffffff;
  font-weight: 700;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.flow-list strong {
  display: block;
  margin-bottom: 4px;
}

.flow-list p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

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

@media (max-width: 640px) {
  header.hero {
    padding: 64px 16px;
  }
  .panel__toprow {
    flex-direction: column;
    align-items: stretch;
  }
  .panel__toprow .progress {
    width: 100%;
  }
  .tiny-btn {
    width: 100%;
    text-align: center;
  }
  .answer-row {
    grid-template-columns: 1fr;
  }
}
