:root { --app-accent: #48c9b0; --app-accent-soft: #dff8f2; }
[hidden] { display: none !important; }
body { background: #dcefe9; }
.japan-frame { max-width: 970px; }
.japan-header { border-bottom-color: var(--app-accent); }
.japan-brand-mark { background: var(--app-accent); }
.home-link { color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; }
.japan-screen { padding: clamp(22px, 4vw, 42px); }
.japan-hero { display: grid; grid-template-columns: 1fr 160px; align-items: center; gap: 28px; }
.japan-hero h1, .question-sheet h1, .result-screen h1 { margin: 3px 0 10px; color: var(--ink); font-size: clamp(1.65rem, 5vw, 2.8rem); line-height: 1.15; letter-spacing: .02em; white-space: nowrap; }
.japan-hero h1 em { color: #199d87; font-style: normal; }
.japan-hero p:not(.eyebrow) { margin: 0; color: var(--muted); font-weight: 650; line-height: 1.8; }
.japan-mini-doodle { width: 150px; }
.mode-sheet, .question-sheet { margin-top: 26px; padding: clamp(18px, 3vw, 28px); border: 2px solid var(--ink); border-radius: var(--panel-radius); background: var(--paper); box-shadow: var(--offset-shadow); }
.sheet-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-heading span { font-size: 1.25rem; font-weight: 900; }
.sheet-heading small { color: var(--muted); font-weight: 750; white-space: nowrap; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.mode-card { display: flex; align-items: center; min-height: 80px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 16px; background: white; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.mode-card:last-child { grid-column: 1 / -1; }
.mode-card:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 var(--ink); }
.mode-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.mode-card b { display: grid; place-items: center; flex: 0 0 48px; height: 48px; margin-right: 12px; border: 2px solid var(--ink); border-radius: 13px; font-size: 1.35rem; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: clamp(1rem, 2.4vw, 1.14rem); white-space: nowrap; }
.mode-card small { margin-top: 4px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.shape-mode b { background: var(--yellow); }.position-mode b { background: var(--coral); }.capital-mode b { background: var(--app-accent); }.region-mode b { background: var(--purple); }.clue-mode b { background: #ffdca0; }
.intro-note { margin: 24px 0 0; color: var(--muted); font-weight: 700; text-align: center; }
.quiz-status { display: flex; align-items: center; gap: 12px; }
.quiz-status p { display: flex; align-items: center; gap: 16px; margin: 0 0 0 auto; color: var(--muted); font-size: .76rem; font-weight: 850; }
.quiz-status p strong { color: var(--ink); font-size: 1.1rem; }.quiz-status p span { white-space: nowrap; }.quiz-status p b { color: #159681; font-size: 1.2rem; }
.quit-button { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--ink); font-weight: 850; cursor: pointer; white-space: nowrap; }
.mode-pill { padding: 7px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--app-accent-soft); font-weight: 850; white-space: nowrap; }
.progress-track { height: 9px; margin-top: 12px; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 999px; background: white; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--app-accent); transition: width .25s; }
.question-sheet { position: relative; margin-top: 16px; text-align: center; }
.question-sheet h1 { font-size: clamp(1.18rem, 4.1vw, 2.05rem); white-space: normal; overflow-wrap: anywhere; }
body[data-active-mode="clue"] .question-sheet > .eyebrow { display: none; }
.visual-stage { display: grid; place-items: center; min-height: 365px; margin: 10px 0 16px; border-radius: 18px; background: linear-gradient(160deg, #f4fcfa, #fff9e9); }
#mapCanvas { display: block; width: 100%; height: 370px; }
.clue-card { display: grid; place-items: center; width: min(100%, 680px); min-height: 260px; padding: 16px; overflow-wrap: anywhere; }
.clue-card > #clueIcon { display: none; }
.clue-card strong { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 4px; max-width: 100%; margin: 14px 0 8px; font-size: clamp(1.15rem, 4.6vw, 1.86rem); line-height: 1.35; white-space: normal; }.clue-card strong span { display: inline-block; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: white; box-shadow: 2px 2px 0 var(--ink); }.clue-card small { color: var(--muted); font-weight: 750; }
.specialty-visual { display: grid; width: min(100%, 650px); }
.specialty-photo-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.05)),
    url("./specialty-map-bg.jpg") center / cover no-repeat;
  box-shadow: 4px 5px 0 var(--ink);
}
.specialty-photo-card::before {
  content: none;
}
.specialty-pref { display: none; }
.specialty-hints { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 4vw, 32px); width: min(90%, 520px); align-items: start; }
.specialty-hint-card { display: grid; gap: 8px; justify-items: center; align-content: start; margin: 0; min-width: 0; }
.specialty-hint-image {
  position: relative;
  width: min(100%, 190px);
  height: auto;
  object-fit: cover;
  padding: 5px;
  border: 2px solid rgba(32,50,77,.82);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 3px 4px 0 rgba(32,50,77,.95), 0 8px 14px rgba(32,50,77,.12);
}
.specialty-hint-card:nth-child(1) .specialty-hint-image { transform: rotate(-2deg); }
.specialty-hint-card:nth-child(2) .specialty-hint-image { transform: rotate(2deg); }
.specialty-hint-card figcaption {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 4px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  color: var(--ink);
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  font-weight: 900;
  line-height: 1.15;
  box-shadow: 2px 3px 0 var(--ink);
  white-space: nowrap;
}
.specialty-name-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.specialty-name-chips span {
  padding: 5px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(.86rem, 3vw, 1rem);
  font-weight: 850;
}
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-button { min-height: 52px; padding: 7px 10px; border: 2px solid var(--ink); border-radius: 14px; background: white; color: var(--ink); font-size: clamp(.9rem, 2.9vw, 1.08rem); font-weight: 900; cursor: pointer; box-shadow: 2px 3px 0 var(--ink); white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.choice-button:focus { outline: none; }
.choice-button:focus-visible { outline: 3px solid rgba(72,201,176,.55); outline-offset: 3px; }
.choice-button:not(:disabled):hover { background: var(--app-accent-soft); }.choice-button:disabled { cursor: default; opacity: .65; }.choice-button.is-correct { background: var(--app-accent); opacity: 1; }.choice-button.is-wrong { background: #ffd9d3; opacity: 1; }
.answer-feedback { position: absolute; left: 50%; bottom: 104px; z-index: 2; display: flex; align-items: center; gap: 9px; transform: translateX(-50%) rotate(-1deg); padding: 12px 18px; border: 2px solid var(--ink); border-radius: 14px; background: white; box-shadow: 4px 4px 0 var(--ink); white-space: nowrap; }
.answer-feedback.correct { background: var(--app-accent-soft); }.answer-feedback.wrong { background: #fff0ed; }.answer-feedback strong { font-size: 1.15rem; }.answer-feedback span { font-weight: 750; }
.result-screen { min-height: 620px; text-align: center; }.result-doodle { width: 130px; margin-bottom: 4px; }.result-screen h1 { margin-bottom: 18px; }.score-medal { display: inline-flex; align-items: baseline; padding: 18px 30px; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); transform: rotate(-2deg); box-shadow: 5px 5px 0 var(--ink); }.score-medal strong { font-size: 3.6rem; line-height: 1; }.score-medal span { font-weight: 850; }.result-screen > p:not(.eyebrow,.best-score) { margin: 25px 0 8px; font-size: 1.15rem; font-weight: 800; }.best-score { color: var(--muted); font-weight: 700; }.best-score strong { color: #159681; font-size: 1.2rem; }
.result-actions { display: grid; width: min(100%, 430px); gap: 12px; margin: 28px auto 0; }.japan-primary-button,.japan-secondary-button { display: grid; place-items: center; min-height: 54px; padding: 10px 16px; border: 2px solid var(--ink); border-radius: 14px; color: var(--ink); font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; white-space: nowrap; }.japan-primary-button { background: var(--yellow); box-shadow: 3px 4px 0 var(--ink); }.japan-secondary-button { background: white; }
@media (min-width: 721px) and (max-height: 980px) {
  .japan-screen { padding: 16px 24px; }
  .japan-hero { gap: 18px; grid-template-columns: 1fr 118px; }
  .japan-hero h1 { margin-bottom: 6px; font-size: clamp(1.5rem, 3.4vw, 2.15rem); }
  .japan-hero p:not(.eyebrow) { line-height: 1.55; }
  .japan-mini-doodle { width: 112px; }
  .mode-sheet,
  .question-sheet {
    margin-top: 12px;
    padding: 16px 18px;
  }
  .sheet-heading { margin-bottom: 10px; }
  .mode-card {
    min-height: 64px;
    padding: 9px 12px;
  }
  .mode-card b {
    flex-basis: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
  .intro-note { margin-top: 14px; }
  .progress-track { margin-top: 8px; }
  .visual-stage {
    min-height: 325px;
    margin: 8px 0 12px;
  }
  #mapCanvas { height: 335px; }
  .clue-card {
    min-height: 212px;
    padding: 14px;
  }
  .specialty-visual {
    gap: 8px;
    margin-bottom: 9px;
  }
  .specialty-photo-card { min-height: 210px; }
  .specialty-hints { width: min(90%, 420px); gap: 16px; }
  .specialty-hint-image { width: min(100%, 150px); padding: 4px; }
  .specialty-hint-card figcaption { min-height: 34px; padding: 3px 11px; font-size: 1rem; }
  .specialty-name-chips span {
    padding: 4px 9px;
    font-size: .86rem;
  }
  .choice-grid { gap: 9px; }
  .choice-button {
    min-height: 46px;
    padding: 6px 9px;
  }
}
@media (max-width: 620px) {
  .japan-screen { padding: 20px 15px 28px; }.japan-hero { grid-template-columns: 1fr 86px; gap: 8px; }.japan-hero > div { display: contents; }.japan-hero .eyebrow { grid-column: 1; grid-row: 1; align-self: end; }.japan-hero h1 { grid-column: 1; grid-row: 2; }.japan-hero h1 em { display: block; }.japan-hero p:not(.eyebrow) { grid-column: 1 / -1; grid-row: 3; font-size: .91rem; }.japan-mini-doodle { grid-column: 2; grid-row: 1 / 3; width: 86px; }.mode-sheet { padding: 15px 12px; }.mode-grid { grid-template-columns: 1fr; }.mode-card:last-child { grid-column: auto; }.mode-card { min-height: 67px; padding: 8px 10px; }.mode-card b { flex-basis: 43px; height: 43px; }.mode-card small { font-size: .76rem; }.quiz-status { gap: 5px; }.mode-pill { padding: 6px 8px; font-size: .78rem; }.quiz-status p { gap: 7px; }.quiz-status p span { font-size: .67rem; }.question-sheet { padding: 17px 12px 20px; }.visual-stage { min-height: 310px; margin-bottom: 12px; }#mapCanvas { height: 310px; }.clue-card { min-height: 250px; padding: 8px 4px; }.specialty-photo-card { min-height: 208px; }.specialty-hints { width: 94%; gap: 10px; }.specialty-hint-image { width: min(100%, 132px); padding: 4px; }.specialty-hint-card figcaption { min-height: 32px; padding: 3px 8px; font-size: .92rem; }.choice-grid { gap: 8px; }.choice-button { min-height: 48px; padding: 6px 3px; }.answer-feedback { bottom: 96px; padding: 10px 12px; }.answer-feedback span { font-size: .84rem; }
}
@media (max-width: 380px) { .home-link { font-size: .78rem; }.japan-hero h1 { font-size: 1.42rem; }.japan-mini-doodle { width: 78px; }.sheet-heading small { font-size: .7rem; }.choice-button { font-size: .84rem; }.quiz-status p span { display: none; } }
@media (prefers-reduced-motion: reduce) { .mode-card,.progress-track span { transition: none; } }
