:root {
  --ink: #111111;
  --muted: #707070;
  --line: #dedede;
  --paper: #ffffff;
  --green: #111111;
  --green-soft: #eeeeee;
  --soft: #eeeeee;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
main { width: min(100% - 24px, 430px); margin: auto; padding: 36px 0 32px; }
.hero-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}
.method-intro {
  margin: 0 4px 24px;
  color: #222;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.9;
}
.hero { margin-bottom: 38px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
}
h1 { margin: 0; font-size: clamp(28px, 7vw, 42px); letter-spacing: -.04em; line-height: 1.25; }
.lead { margin: 12px 0 0; color: var(--muted); }
.finder {
  padding: 16px 0 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}
.all-button {
  display: block;
  width: calc(100% - 32px);
  height: 52px;
  margin: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.all-button.active { border-color: var(--green); background: var(--green); color: #fff; }
.kana {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  padding: 18px 16px 0;
}
.kana-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  direction: rtl;
}
.kana-group button {
  width: 100%;
  aspect-ratio: 1;
  min-height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  direction: ltr;
  box-shadow: 0 2px 5px rgba(30, 50, 38, .05);
}
.kana-group button:hover { border-color: #9bb2a2; }
.kana-group button.active { border-color: var(--green); background: var(--green); color: #fff; }
.kana-blank { width: 100%; aspect-ratio: 1; }
.results { margin-top: 34px; }
.result-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.result-head h2 { margin: 0; font-size: 17px; }
.result-head span { color: var(--muted); font-size: 13px; }
.name-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.name-list li {
  display: grid;
  grid-template-columns: 34px 1fr 1fr;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}
.rank { color: #a0a69d; font-size: 12px; }
.kanji { font-size: 20px; font-weight: 700; letter-spacing: .04em; }
.reading { color: #111; font-size: 15px; font-weight: 800; }
.empty { padding: 56px 16px; text-align: center; border-top: 1px solid var(--line); }
.empty p { color: var(--muted); }
.empty button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); }
footer { padding-top: 48px; text-align: center; color: #9aa097; font-size: 12px; }
footer a { color: inherit; text-decoration: none; }
.start-button {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 116px;
  padding: 24px 62px 24px 24px;
  border-radius: 20px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  border: 1px solid #000;
  box-shadow: 0 7px 0 #555, 0 10px 18px rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.start-button:active {
  transform: translateY(6px);
  box-shadow: 0 1px 0 #555, 0 3px 7px rgba(0, 0, 0, .16);
}
.start-button span { font-size: 20px; font-weight: 800; line-height: 1.55; }
.start-button small { margin-top: 6px; color: #dcebe1; font-size: 13px; }
.start-button b { position: absolute; right: 25px; top: 50%; translate: 0 -52%; font-size: 45px; font-weight: 300; }
.install-button {
  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  border: 1px solid #b8c9be;
  border-radius: 15px;
  background: #fff;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
}
.install-button span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 8px;
  background: var(--green-soft);
  font-size: 20px;
  vertical-align: middle;
}
.install-button[hidden] { display: none; }
.names-page { padding-top: 22px; padding-bottom: 40px; }
.names-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 32px;
  margin-bottom: 8px;
}
.header-kana {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
}
.names-header .eyebrow { margin-bottom: 3px; }
.names-header h1 { font-size: 25px; }
.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.kana-heading { display: flex; align-items: center; gap: 16px; padding: 8px 4px 22px; }
.kana-heading > span {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  border-radius: 23px;
  background: var(--green);
  color: #fff;
  font-size: 48px;
  font-weight: 800;
}
.kana-heading h2 { margin: 0 0 8px; font-size: 20px; }
.kana-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.swipe-list li {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 70px;
  padding: 0 12px;
  background: #fff;
}
.found-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.found-button:active {
  background: #111;
  color: #fff;
}
.page-nav {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 22px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
  backdrop-filter: blur(10px);
}
.page-nav button {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 38px;
  line-height: 1;
}
.page-nav button:disabled { background: #e6e9e5; color: #aeb3ac; }
.page-nav .header-kana { justify-self: center; }
.kana-stage {
  transition: transform .22s cubic-bezier(.22,.75,.28,1), opacity .18s ease;
  will-change: transform, opacity;
  touch-action: pan-y;
}
.kana-stage.leave-left { transform: translateX(-70px); opacity: 0; }
.kana-stage.leave-right { transform: translateX(70px); opacity: 0; }
.kana-stage.enter-right { transform: translateX(70px); opacity: 0; transition: none; }
.kana-stage.enter-left { transform: translateX(-70px); opacity: 0; transition: none; }
body.result-modal-open { overflow: hidden; }
.result-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .68);
}
.result-modal[hidden] { display: none; }
.result-modal-card {
  position: relative;
  width: min(100%, 390px);
  padding: 48px 22px 24px;
  border: 2px solid #111;
  border-radius: 18px;
  background: #fff;
  color: #111;
  text-align: center;
}
.result-modal-card p {
  margin: 0 0 28px;
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 900;
  line-height: 1.5;
}
.result-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 28px;
  line-height: 1;
}
.result-top {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
}
.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .26s ease;
}
.intro-modal[hidden] { display: none; }
.intro-modal.is-visible { opacity: 1; }
.intro-modal-card {
  width: min(100%, 380px);
  padding: 32px 22px 22px;
  border: 2px solid #111;
  border-radius: 18px;
  background: #fff;
  color: #111;
  text-align: center;
  transform: translateY(8px);
  transition: transform .26s ease;
}
.intro-modal.is-visible .intro-modal-card { transform: translateY(0); }
.intro-modal-card p {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.7;
}
.intro-modal-card button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
@media (max-width: 560px) {
  main { padding-top: 30px; }
  .hero { margin-bottom: 28px; }
  .finder { border-radius: 15px; }
}

body.line-browser-blocked {
  overflow: hidden !important;
}
.line-browser-blocker {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .68);
  font-family: "Yu Gothic", "Hiragino Sans", Meiryo, system-ui, sans-serif;
}
.line-browser-blocker-card {
  width: min(430px, calc(100vw - 28px));
  overflow: hidden;
  border: 2px solid #111;
  border-radius: 16px;
  background: #fff;
  color: #111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.line-browser-blocker-head {
  padding: 16px;
  border-bottom: 1px solid #111;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.4;
}
.line-browser-blocker-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.55;
}
.line-browser-blocker-note {
  margin: 0;
  font-weight: 800;
}
.line-browser-blocker button {
  width: 100%;
  min-height: 54px;
  border: 2px solid #111;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}
.line-browser-blocker-url {
  min-height: 42px;
  padding: 8px;
  border: 1px solid #aaa;
  border-radius: 8px;
  color: #555;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
