:root {
  --paper: #f4f0e7;
  --paper-strong: #e8e0d1;
  --ink: #252c28;
  --muted: #686c65;
  --accent: #a23c2d;
  --accent-strong: #7f2d23;
  --pine: #29483d;
  --border: rgba(44, 54, 48, 0.18);
  --shadow: 0 18px 50px rgba(38, 45, 39, 0.1);
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

body {
  font-family: "Noto Serif JP", serif;
  line-height: 1.8;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(42, 53, 47, 0.08) 0.55px, transparent 0.55px);
  background-size: 7px 7px;
  color: var(--ink);
  min-height: 100vh;
  letter-spacing: 0.035em;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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

button,
input,
textarea {
  font-family: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.lead {
  color: var(--muted);
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.text-link::after {
  width: 34px;
  height: 1px;
  background: var(--accent);
  content: "";
  transition: width 0.25s ease;
}

.text-link:hover::after {
  width: 52px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
}

.container {
  width: min(1180px, 90%);
  margin: 0 auto;
}

.section {
  padding: 110px 0;
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background-image: linear-gradient(90deg, rgba(243, 241, 234, 0.9) 0%, rgba(243, 241, 234, 0.48) 26%, rgba(26, 46, 39, 0.02) 60%), url("/assets/images/common/home-hero-landscape.jpg");
  background-position: center;
  background-size: cover;
}

.hero::after {
  position: absolute;
  right: -5%;
  bottom: -7vw;
  left: -5%;
  height: 13vw;
  border-radius: 50% 50% 0 0/45% 45% 0 0;
  background: var(--paper);
  content: "";
}

.hero-inner {
  position: relative;
  width: min(1180px, 90%);
  min-height: 100svh;
  margin: 0 auto;
}

.hero-copy {
  position: absolute;
  top: 21%;
  left: 2%;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: clamp(34px, 5vw, 76px);
  height: 52%;
  padding-top: 48px;
}

.hero-kicker {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.36em;
}

.hero-copy h1 {
  display: flex;
  flex-direction: row-reverse;
  gap: clamp(16px, 2.4vw, 38px);
  margin: 0;
  font-size: clamp(31px, 3.5vw, 54px);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.72);
}

.hero-copy h1 span {
  writing-mode: vertical-rl;
}

.hero-description {
  margin: 28px 0 0;
  color: #3f4843;
  font-size: 12px;
  line-height: 2.25;
  writing-mode: vertical-rl;
}

.hero-panel {
  position: absolute;
  right: 3%;
  bottom: 15%;
  width: min(340px, 30vw);
  padding: 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(244, 240, 231, 0.82);
  backdrop-filter: blur(12px);
}

.hero-panel__label {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.24em;
}

.hero-panel__title {
  margin-bottom: 22px;
  font-size: 22px;
  letter-spacing: 0.12em;
  line-height: 1.7;
}

.hero-scroll {
  position: absolute;
  z-index: 2;
  bottom: 5%;
  left: 50%;
  display: grid;
  place-items: center;
  gap: 8px;
  font-size: 8px;
  letter-spacing: 0.24em;
  transform: translateX(-50%);
}

.hero-scroll span {
  width: 1px;
  height: 32px;
  background: var(--ink);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 52px;
}

.section-header h1,
.section-header h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.section-header h2 span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.25em;
}

.section-header__side {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}

.section-header__side .text-link {
  margin-top: 16px;
}

.hero-actions,
.session-actions,
.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.site-header {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(244, 240, 231, 0.82);
  backdrop-filter: blur(14px);
  position: fixed;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 10px 0;
  gap: 16px;
}

.logo {
  display: grid;
  gap: 1px;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.logo-sub {
  font-size: 8px;
  letter-spacing: 0.28em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-nav a {
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

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

.site-nav .site-nav__play {
  padding: 10px 20px;
  border: 1px solid var(--pine);
  border-radius: 999px;
  background: var(--pine);
  color: #fff;
}

.site-nav .site-nav__play:hover {
  background: transparent;
  color: var(--pine);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--pine);
  color: rgba(255, 255, 255, 0.82);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.footer-logo {
  font-size: 17px;
  letter-spacing: 0.18em;
}

.footer-note {
  margin: 6px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 0;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn.primary {
  background: var(--pine);
  color: #fff;
  border-color: var(--pine);
}

.btn.primary:hover {
  background: #1d352d;
}

.btn.ghost {
  background: transparent;
}

.btn.wide {
  width: 100%;
}

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

.card-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card-tile {
  display: block;
  background: rgba(255, 255, 255, 0.5);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(42, 49, 44, 0.08);
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card-tile:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 48px rgba(42, 49, 44, 0.16);
}

.card-tile__media {
  position: relative;
  background: var(--paper-strong);
  overflow: hidden;
}

.card-tile__media img {
  width: 100%;
  aspect-ratio: 500/628;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-tile:hover .card-tile__media img {
  transform: scale(1.025);
}

.card-tile__body {
  padding: 14px 16px 16px;
}

.card-tile__header {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.card-tile__kana {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.card-tile__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.8;
}

.card-tile__description {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  min-height: 36px;
}

.card-detail {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 26px;
  align-items: start;
}

.detail-media {
  display: grid;
  gap: 12px;
}

.detail-media__image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-body h1 {
  margin: 8px 0 12px;
}

.detail-description {
  color: var(--muted);
  margin-bottom: 12px;
}

.detail-reading {
  color: var(--ink);
  margin-bottom: 12px;
  font-size: 16px;
}

.detail-reading span {
  font-weight: 600;
  margin-right: 6px;
}

.map-embed {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.map-embed__frame {
  display: block;
  border: 0;
}

.map-embed__actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: right;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.pager {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.card-group {
  margin-bottom: 52px;
}

.card-group__label {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

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

@media (min-width: 960px) {
  .card-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}

.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.search-bar input {
  flex: 1;
  padding: 12px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
}

.setup-form {
  display: grid;
  gap: 18px;
  max-width: 520px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input[type=number] {
  width: 120px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.choice-group {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.play-session .session-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
}

.question-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.question-card h2 {
  margin: 8px 0 0;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.choice-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 0;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

.choice-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.choice-card.correct {
  border-color: #54a36b;
  box-shadow: 0 10px 28px rgba(84, 163, 107, 0.3);
}

.choice-card.wrong {
  border-color: #c74230;
  box-shadow: 0 10px 28px rgba(199, 66, 48, 0.25);
}

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

.choice-card--ka-006 img {
  object-position: top center;
  scale: 1.4;
}

.choice-image {
  position: relative;
  background: var(--paper-strong);
}

.choice-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.choice-kana {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
}

.choice-caption {
  display: none !important;
  padding: 10px 12px 14px;
  margin: 0;
  font-weight: 600;
}

.session-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
}

.feedback {
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.feedback.is-correct {
  color: #155724;
  background: #e1f2e5;
}

.feedback.is-wrong {
  color: #7f2319;
  background: #f7e3df;
}

.play-setup,
.play-result {
  display: grid;
  gap: 18px;
}

.card-detail .detail-media {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.play-result .result-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

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

.placeholder {
  display: grid;
  place-items: center;
  background: var(--paper-strong);
  color: var(--muted);
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
}

.placeholder.large {
  min-height: 320px;
}

@media (max-width: 840px) {
  .card-detail {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    right: 5%;
    width: 300px;
  }
}
@media (max-width: 640px) {
  .section-header,
  .hero-actions,
  .search-bar,
  .session-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar input {
    width: 100%;
  }
  .header-inner {
    min-height: 68px;
  }
  .site-nav {
    gap: 12px;
  }
  .site-nav a:not(.site-nav__play) {
    display: none;
  }
  .site-nav .site-nav__play {
    padding: 8px 13px;
    font-size: 10px;
  }
  .logo-text {
    font-size: 17px;
  }
  .section {
    padding: 72px 0;
  }
  .hero {
    min-height: 820px;
    background-image: linear-gradient(180deg, rgba(244, 240, 231, 0.72) 0%, rgba(244, 240, 231, 0.05) 50%, rgba(26, 46, 39, 0.18) 100%), url("/assets/images/common/home-hero-landscape.jpg");
    background-position: 54% center;
  }
  .hero-inner {
    min-height: 820px;
  }
  .hero-copy {
    top: 15%;
    left: 2%;
    flex-direction: column;
    gap: 0;
    height: 48%;
    padding-top: 0;
  }
  .hero-kicker {
    position: static;
    margin: 0 0 24px;
  }
  .hero-copy h1 {
    gap: 14px;
    font-size: 30px;
  }
  .hero-description {
    display: none;
  }
  .hero-panel {
    right: 0;
    bottom: 12%;
    left: 0;
    width: auto;
    padding: 22px;
  }
  .hero-panel__title {
    font-size: 18px;
  }
  .hero-actions {
    flex-direction: row;
  }
  .hero-actions .btn {
    flex: 1;
    padding: 10px;
  }
  .hero-scroll {
    bottom: 3%;
  }
  .section-header {
    align-items: flex-start;
  }
  .section-header__side {
    max-width: none;
  }
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
