@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+JP:wght@400;600;700;900&display=swap');

:root {
  --paper: #f0dfbd;
  --ink: #24170d;
  --muted: #76664f;
  --line: #b49b70;
  --orange: #a93722;
  --yellow: #d8a94d;
  --green: #174f52;
  --gold: #c99a43;
  --night: #120d08;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(8,5,3,.3), rgba(8,5,3,.08)),
    url("assets/renaissance-workshop.png") center / cover fixed,
    var(--night);
  font-family: "Noto Sans JP", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.game-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f5e7cc;
  border-bottom: 1px solid rgba(218, 178, 101, .62);
  text-shadow: 0 1px 8px #000;
}

.brand {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 900 24px/1 "Noto Sans JP", sans-serif;
  letter-spacing: -.06em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #201208;
  background: linear-gradient(145deg, #f0c66c, #a66c22);
  border: 1px solid #f7d995;
  border-radius: 50% 50% 8px 50%;
  transform: rotate(-5deg);
}

.high-score {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: "DM Mono", monospace;
}
.header-actions { display: flex; align-items: center; gap: 28px; }
.ranking-link, .review-link { border: 0; border-bottom: 1px solid; padding: 4px 0; background: transparent; cursor: pointer; font: 500 11px "DM Mono"; letter-spacing: .14em; }
.ranking-link:disabled, .review-link:disabled { cursor: not-allowed; opacity: .35; }
.review-count { display: inline-grid; min-width: 19px; height: 19px; margin-left: 4px; padding: 0 5px; place-items: center; border-radius: 10px; color: #201208; background: #efc565; font-size: 9px; }
.high-score span { color: #cdbd9e; font-size: 11px; letter-spacing: .18em; }
.high-score strong { font-size: 20px; }

.hero, .result-screen {
  flex: 1;
  width: min(1040px, 100%);
  margin: auto;
  padding: 72px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}
.hero-copy { min-width: 0; }
.hero-copy {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(222, 184, 111, .5);
  background: linear-gradient(135deg, rgba(13,8,4,.86), rgba(28,17,8,.62));
  box-shadow: 0 28px 80px rgba(0,0,0,.4), inset 0 0 50px rgba(193,138,54,.05);
  backdrop-filter: blur(4px);
}
.hero h1 { color: #fff7e9; font-family: Georgia, "Yu Mincho", serif; text-shadow: 0 3px 25px #000; }
.hero .hero-title { font-size: clamp(38px, 5.4vw, 68px); line-height: 1.16; letter-spacing: -.06em; }
.hero .hero-title em { display: inline-block; white-space: nowrap; font-size: clamp(20px, 3.8vw, 46px); background: linear-gradient(transparent 58%, rgba(216,169,77,.92) 58%, rgba(216,169,77,.92) 88%, transparent 88%); }
.hero .hero-title em::after { display: none; }
.hero .lead { color: #d7c6a8; }
.hero .shortcut { color: #b9a98e; }
.hero kbd { border-color: #8f7650; background: rgba(255,255,255,.08); color: #f4dfb9; }
.review-entry { position: relative; display: block; margin: 0 0 24px; padding: 15px 48px 15px 17px; color: #f7ead2; border: 1px solid #a98652; background: rgba(173,112,39,.16); text-decoration: none; transition: border-color .2s, background .2s; }
.review-entry:hover { border-color: #efc565; background: rgba(173,112,39,.27); }
.review-entry span { display: block; margin-bottom: 4px; color: #d8bd8b; font: 9px "DM Mono"; letter-spacing: .1em; }
.review-entry span b { color: #ffd47f; font-size: 12px; }
.review-entry strong { font-size: 13px; }
.review-entry i { position: absolute; top: 50%; right: 18px; color: #efc565; font-size: 22px; font-style: normal; transform: translateY(-50%); }
.input-policy { margin: 0 0 18px; padding: 11px 13px; border-left: 3px solid #4d9da0; background: rgba(27,105,110,.16); }
.input-policy span { display: block; margin-bottom: 4px; color: #8fd2d1; font: 9px "DM Mono"; letter-spacing: .1em; }
.input-policy p { margin: 0; color: #d8d2c5; font-size: 10px; line-height: 1.65; }
.review-input-policy { border: 1px solid #7ba2a0; border-left: 5px solid #287075; background: #dfede7; }
.review-input-policy span { color: #27676a; }
.review-input-policy p { color: #425d5b; }
.mascot-intro { position: relative; margin: 35px 0 0; align-self: center; }
.mascot-intro img { display: block; width: 100%; filter: drop-shadow(0 15px 24px rgba(0,0,0,.65)); animation: mascot-float 3.2s ease-in-out infinite; }
.mascot-intro figcaption { margin-top: 15px; color: #dbc398; text-align: center; font: 10px "DM Mono"; letter-spacing: .13em; text-shadow: 0 2px 6px #000; }
.mascot-bubble {
  position: absolute;
  z-index: 1;
  top: -42px;
  left: -10px;
  padding: 13px 18px;
  border: 1px solid #7c5627;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(145deg, #fff3d8, #e2c795);
  font-size: 13px;
  line-height: 1.55;
  transform: rotate(-3deg);
  box-shadow: 4px 4px 0 #8e5d25, 0 12px 30px rgba(0,0,0,.35);
}
.mascot-bubble strong { color: var(--orange); }

.eyebrow {
  margin: 0 0 18px;
  color: var(--orange);
  font: 500 12px/1.4 "DM Mono", monospace;
  letter-spacing: .18em;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(52px, 8vw, 104px);
  line-height: 1.02;
  letter-spacing: -.075em;
}
h1 em {
  color: var(--orange);
  font-style: normal;
  position: relative;
}
h1 em::after {
  content: "";
  position: absolute;
  height: 8px;
  left: 3%; right: -3%; bottom: 1px;
  background: var(--yellow);
  z-index: -1;
  transform: rotate(-2deg);
}

.lead { margin: 28px 0 42px; color: #50534e; line-height: 1.9; }

.name-field { display: block; margin-bottom: 18px; }
.name-field span { display: block; margin-bottom: 7px; color: #c8b797; font: 10px "DM Mono"; letter-spacing: .14em; }
.name-field input { width: 100%; border: 1px solid #a98652; padding: 14px 16px; color: #f7ead2; background: rgba(12,8,5,.64); outline: none; }
.name-field input::placeholder { color: #9f9079; }
.name-field input:focus { border-color: var(--orange); box-shadow: 3px 3px 0 var(--orange); }

.difficulty {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #a98652;
  margin-bottom: 18px;
}

.level {
  border: 0;
  border-right: 1px solid #a98652;
  color: #e7d8bd;
  background: transparent;
  padding: 18px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.level:last-child { border-right: 0; }
.level span { display: block; margin-bottom: 5px; color: #a9987a; font: 10px "DM Mono", monospace; }
.level.active { color: #fff5df; background: linear-gradient(135deg, #12646a, #173e35); box-shadow: inset 0 0 20px rgba(78,215,216,.15); }
.level.active span { color: #acd5d3; }
.level:hover:not(.active) { background: rgba(255,255,255,.08); }
.level.coming-soon { cursor: not-allowed; opacity: .48; }
.level.coming-soon small { display: block; margin-top: 5px; color: #d9bd87; font: 9px "DM Mono", monospace; letter-spacing: .12em; }
.level.coming-soon:hover { background: transparent; }

.start-button {
  width: 100%;
  min-height: 76px;
  border: 1px solid #f1cc83;
  background: linear-gradient(135deg, #b34128, #7f241c);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 26px;
  color: white;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 6px 6px 0 #201208, inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .15s, box-shadow .15s;
}
.start-button:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.start-button:active { transform: translate(6px, 6px); box-shadow: none; }
.arrow { font-size: 28px; }
.shortcut { color: var(--muted); text-align: center; font-size: 12px; margin: 22px 0 0; }
kbd { border: 1px solid var(--line); padding: 2px 8px; background: rgba(255,255,255,.5); font: 11px "DM Mono"; }

.play-screen {
  flex: 1;
  width: min(900px, 100%);
  margin: auto;
  padding: 42px 0;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; padding: 18px 0; color: #f7ead3; border: 1px solid rgba(214,174,98,.55); background: rgba(14,9,5,.78); backdrop-filter: blur(5px); }
.stats div { padding: 0 24px; border-right: 1px solid var(--line); text-align: center; }
.stats div:last-child { border: 0; }
.stats span, .result-score span { display: block; color: #bdae91; font: 11px "DM Mono"; letter-spacing: .16em; }
.stats strong { font: 500 clamp(30px, 5vw, 52px) "DM Mono"; }
.combo-stat small { display: block; min-height: 16px; color: var(--orange); font: 500 10px "DM Mono"; letter-spacing: .08em; }
.timer-track { height: 5px; background: rgba(255,255,255,.18); }
.timer-track div { width: 100%; height: 100%; background: var(--orange); transition: width 1s linear; }
.countdown { position: relative; z-index: 2; min-height: 4.5rem; margin: 1.5rem 0 -1rem; color: var(--ink); font-family: var(--display-font); font-size: clamp(3.5rem, 10vw, 6rem); font-weight: 800; line-height: 1; text-align: center; text-shadow: 0 0 2rem rgba(215, 91, 52, 0.3); }
.play-screen.counting-down .word-card { visibility: hidden; }
.play-screen.counting-down .countdown { visibility: visible; display: grid !important; }
.countdown { display: grid; place-items: center; min-height: 220px; margin: 28px 0 0; padding: 28px; border: 1px solid rgba(214,174,98,.72); background: rgba(14,9,5,.84); color: #f7ead3; box-shadow: 0 22px 60px rgba(0,0,0,.35); text-align: center; }
.countdown::before { content: "STARTING IN"; display: block; margin-bottom: -18px; color: #d8bd8b; font: 500 11px "DM Mono"; letter-spacing: .2em; }
.countdown-pop { animation: countdown-pop .72s cubic-bezier(.2,.8,.2,1); }

.word-card {
  min-height: 390px;
  margin-top: 28px;
  padding: 40px;
  border: 1px solid #9e7a42;
  background:
    linear-gradient(rgba(245,229,194,.94), rgba(225,200,151,.95)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(93,61,29,.08) 28px);
  box-shadow: 0 28px 70px rgba(0,0,0,.42), inset 0 0 55px rgba(120,73,23,.11);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.word-card.correct-flash { animation: correct .25s ease; }
.word-card.miss { animation: shake .16s linear; }
.word-number { position: absolute; top: 22px; left: 24px; color: var(--muted); font: 11px "DM Mono"; letter-spacing: .12em; }
.japanese { margin: 0 0 12px; font-size: clamp(30px, 6vw, 58px); font-weight: 900; letter-spacing: -.04em; }
.word-card.long-prompt .japanese { max-width: 720px; font-size: clamp(20px, 3.3vw, 36px); line-height: 1.65; letter-spacing: -.02em; text-align: center; }
.word-card[data-level="hard"] .japanese { font-family: Georgia, "Yu Mincho", serif; }
.romaji { min-height: 30px; margin: 0 0 28px; color: #9a9b96; font: 500 clamp(18px, 3vw, 27px) "DM Mono"; letter-spacing: .08em; }
.romaji .typed { color: var(--orange); }
.romaji.typewriter-flow { position: relative; width: 100%; overflow: hidden; text-align: left; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.romaji.typewriter-flow::after { content: ""; position: absolute; top: 1px; bottom: 1px; left: 50%; width: 1px; background: rgba(169,55,34,.3); pointer-events: none; }
.romaji-track { position: relative; left: 50%; display: inline-block; white-space: nowrap; will-change: transform; }
.typing-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.typing-input:focus { outline: none; }
.input-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.mascot-coach { position: absolute; right: 16px; bottom: 0; display: flex; align-items: flex-end; pointer-events: none; }
.mascot-coach img { width: 112px; margin-bottom: -23px; transform: rotate(-4deg); filter: drop-shadow(4px 5px 0 rgba(23,32,29,.1)); }
.mascot-coach span { max-width: 145px; margin: 0 -5px 70px 0; padding: 8px 11px; border: 1px solid var(--ink); border-radius: 13px 13px 2px 13px; background: white; font-size: 10px; font-weight: 700; line-height: 1.45; box-shadow: 3px 3px 0 var(--yellow); }
.quit-button, .back-button { display: block; margin: 24px auto 0; border: 0; border-bottom: 1px solid; background: transparent; cursor: pointer; color: #dfcfb2; font-size: 12px; text-shadow: 0 1px 4px #000; }
.result-screen .back-button { color: var(--muted); text-shadow: none; }
.result-shortcuts { margin: 17px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.result-shortcuts kbd { margin: 0 3px 0 8px; }

.result-screen { position: relative; width: min(700px, 100%); margin-block: 40px; padding: 48px; color: var(--ink); text-align: center; border: 1px solid #a9854e; background: linear-gradient(145deg, rgba(247,231,195,.97), rgba(217,189,137,.97)); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.result-mascot { position: absolute; z-index: 1; top: 116px; right: -78px; width: 170px; transform: rotate(7deg); filter: drop-shadow(5px 7px 0 rgba(23,32,29,.12)); }
.result-screen h2 { margin: 0 0 28px; font-size: clamp(38px, 6vw, 64px); letter-spacing: -.05em; }
.result-score { border: 1px solid var(--ink); padding: 25px; background: var(--yellow); }
.result-score strong { display: block; font: 500 clamp(58px, 10vw, 96px) "DM Mono"; line-height: 1.1; }
.new-record { margin: 5px 0 0; color: var(--orange); font: 500 12px "DM Mono"; letter-spacing: .12em; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 22px 0; border: solid var(--line); border-width: 1px 0; }
.result-grid div { padding: 20px 10px; border-right: 1px solid var(--line); }
.result-grid div:last-child { border: 0; }
.result-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.result-grid strong { font: 500 24px "DM Mono"; }
.result-topics { margin: 0 0 22px; padding: 18px 20px; border: 1px solid var(--line); background: rgba(255,255,255,.28); text-align: left; }
.result-topics-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.result-topics-heading h3 { margin: 0; font-size: 14px; }
.result-topics-heading span { color: var(--muted); font: 500 11px "DM Mono"; }
.result-topics ol { max-height: 190px; margin: 0; padding-left: 28px; overflow-y: auto; }
.result-topics li { padding: 7px 3px; border-bottom: 1px solid rgba(112,89,57,.2); font-size: 12px; line-height: 1.65; }
.result-topics li:last-child { border-bottom: 0; }
.result-topic-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.result-topics a { flex: 1; min-width: 0; color: var(--ink); text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.result-topics a:hover { color: var(--orange); }
.inline-feedback { display: flex; flex: 0 0 auto; gap: 5px; }
.inline-feedback-button { min-width: 48px; border: 1px solid rgba(112,89,57,.35); padding: 5px 7px; background: rgba(255,255,255,.32); cursor: pointer; font-size: 14px; }
.inline-feedback-button span { margin-left: 4px; color: var(--muted); font: 500 10px "DM Mono"; }
.inline-feedback-button.active { border-color: var(--green); background: #d7e8dc; }
.inline-feedback-button:last-child.active { border-color: var(--orange); background: #efd7d0; }
.result-topics-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.rank-message { min-height: 25px; margin: -8px 0 18px; color: var(--orange); font-weight: 700; }

.topic-page .game-shell { min-height: 100vh; }
.topic-detail { flex: 1; width: min(820px, 100%); margin: 54px auto; padding: clamp(28px, 5vw, 56px); border: 1px solid #a9854e; background: linear-gradient(145deg, rgba(247,231,195,.98), rgba(217,189,137,.98)); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.topic-detail h1 { margin: 0 0 22px; font: 700 clamp(28px, 5vw, 48px)/1.55 Georgia, "Yu Mincho", serif; letter-spacing: -.04em; }
.topic-result-back { margin: 0 0 24px; border: 0; border-bottom: 1px solid; padding: 4px 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.topic-detail-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.topic-detail-level { padding: 5px 10px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 10px; }
.topic-feedback { margin-top: 28px; padding: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.32); text-align: center; }
.topic-feedback h2 { margin: 0 0 6px; font-size: 18px; }
.topic-feedback > p { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.feedback-actions { display: flex; justify-content: center; gap: 14px; }
.feedback-button { min-width: 112px; border: 1px solid var(--line); padding: 13px 18px; background: #f7ead0; cursor: pointer; font-size: 24px; transition: transform .15s, border-color .15s, background .15s; }
.feedback-button span { margin-left: 8px; font: 500 15px "DM Mono"; }
.feedback-button:hover { border-color: var(--green); transform: translateY(-2px); }
.feedback-button.active { border-color: var(--green); background: #d7e8dc; box-shadow: inset 0 0 0 1px var(--green); }
.feedback-button[data-vote="bad"].active { border-color: var(--orange); background: #efd7d0; box-shadow: inset 0 0 0 1px var(--orange); }
.topic-coming-soon { margin-top: 20px; padding: 18px 20px; border-left: 4px solid var(--gold); background: rgba(112,89,57,.08); }
.topic-coming-soon strong { display: block; margin-bottom: 5px; font-size: 12px; }
.topic-coming-soon p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.topic-source { display: inline-block; margin-top: 20px; color: var(--green); font-size: 11px; text-underline-offset: 3px; }

.ranking-screen { flex: 1; width: min(960px, 100%); margin: 42px auto; padding: 48px; border: 1px solid #a9854e; background: linear-gradient(145deg, rgba(247,231,195,.97), rgba(217,189,137,.97)); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.ranking-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.ranking-heading h2 { margin: 0 0 30px; font-size: clamp(42px, 7vw, 72px); letter-spacing: -.06em; }
.close-ranking { width: 44px; height: 44px; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 25px; }
.ranking-tabs { display: flex; border-bottom: 1px solid var(--ink); }
.ranking-tab { border: 0; padding: 14px 24px; color: var(--muted); background: transparent; cursor: pointer; font: 500 11px "DM Mono"; letter-spacing: .1em; }
.ranking-tab.active { color: white; background: var(--green); }
.ranking-table-wrap { min-height: 310px; }
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th { padding: 14px 10px; color: var(--muted); text-align: right; font: 10px "DM Mono"; letter-spacing: .08em; }
.ranking-table td { padding: 17px 10px; border-bottom: 1px solid var(--line); text-align: right; font: 500 14px "DM Mono"; }
.ranking-table th:first-child, .ranking-table td:first-child { width: 52px; text-align: left; }
.ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { text-align: left; }
.ranking-table tr.is-me { background: rgba(246,201,69,.24); }
.ranking-table tr:first-child td:first-child { color: var(--orange); font-size: 20px; }
.empty-ranking { padding: 70px 10px; color: var(--muted); text-align: center; }
.ranking-note { margin-top: 20px; color: var(--muted); font-size: 11px; text-align: center; }

.review-screen { flex: 1; width: min(1000px, 100%); margin: 42px auto; padding: 48px; border: 1px solid #a9854e; background: linear-gradient(145deg, rgba(247,231,195,.98), rgba(217,189,137,.98)); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.review-screen-standalone { width: min(1080px, 100%); }
.review-title { max-width: none; color: var(--ink); font: 700 clamp(42px, 7vw, 72px)/1.1 Georgia, "Yu Mincho", serif; letter-spacing: -.06em; text-shadow: none; }
.review-back-link { color: #f5e7cc; font: 500 11px "DM Mono"; letter-spacing: .08em; text-decoration: none; }
.review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.review-heading h2 { margin: 0; font-size: clamp(42px, 7vw, 72px); letter-spacing: -.06em; }
.review-lead { margin: 12px 0 30px; color: var(--muted); line-height: 1.8; }
.review-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.24); }
.review-summary div { padding: 16px 18px; border-right: 1px solid var(--line); }
.review-summary div:last-child { border: 0; }
.review-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.review-summary strong { font: 500 26px "DM Mono"; }
.approval-gate { margin: 0 0 24px; padding: 17px 19px; border: 1px solid #8b6031; border-left: 6px solid var(--orange); background: #fff0cf; }
.approval-gate strong { display: block; margin-bottom: 5px; font-size: 14px; }
.approval-gate p { margin: 0; color: #65513a; font-size: 11px; line-height: 1.75; }
.review-progress-wrap { margin: -5px 0 24px; }
.review-progress-wrap > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.review-progress-wrap strong { font: 500 11px "DM Mono"; }
.review-progress-track { height: 6px; overflow: hidden; background: rgba(63,40,19,.14); }
.review-progress-track div { width: 0; height: 100%; background: linear-gradient(90deg, var(--green), #4c9177); transition: width .25s ease; }
.approved-topic-panel { margin: 0 0 24px; padding: 20px; border: 1px solid #75a894; background: rgba(217,236,223,.72); }
.approved-topic-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.approved-topic-heading span { color: #39715f; font: 9px "DM Mono"; letter-spacing: .1em; }
.approved-topic-heading h2 { margin: 4px 0 0; font-size: 20px; }
.approved-topic-heading > strong { color: #17523f; font: 500 14px "DM Mono"; }
.approved-topic-list { display: grid; gap: 7px; }
.approved-topic-item { display: grid; grid-template-columns: 64px 1fr; align-items: start; gap: 10px; padding: 10px 12px; border-top: 1px solid rgba(39,116,95,.2); background: rgba(255,255,255,.35); }
.approved-topic-item > span { padding-top: 2px; color: #39715f; font-size: 9px; font-weight: 700; }
.approved-topic-item p { margin: 0; font-size: 12px; line-height: 1.7; }
.approved-topic-empty { margin: 0; color: var(--muted); font-size: 11px; }
.learning-levels { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; border: 1px solid var(--line); background: rgba(70,47,23,.05); }
.learning-level { position: relative; min-height: 148px; padding: 20px; border-right: 1px solid var(--line); }
.learning-level:last-child { border: 0; }
.learning-level::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--level-color); }
.learning-level.beginner { --level-color: #4e8a74; }
.learning-level.intermediate { --level-color: #b77b2e; }
.learning-level.advanced { --level-color: #923d45; }
.learning-level span { display: block; margin-bottom: 10px; color: var(--muted); font: 9px "DM Mono"; letter-spacing: .08em; }
.learning-level strong { display: block; margin-bottom: 7px; font-size: 16px; }
.learning-level p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.review-toolbar { display: flex; gap: 7px; margin-bottom: 18px; }
.review-filter { border: 1px solid var(--line); padding: 9px 15px; color: var(--muted); background: rgba(255,255,255,.2); cursor: pointer; font-size: 11px; }
.review-filter.active { border-color: var(--green); color: white; background: var(--green); }
.review-list { display: grid; gap: 14px; }
.review-card { padding: 22px; border: 1px solid var(--line); background: rgba(255,249,234,.58); transition: opacity .2s, border-color .2s; }
.review-card[data-status="approved"] { border-left: 6px solid #27745f; }
.review-card[data-status="rejected"] { border-left: 6px solid #a13b2b; opacity: .7; }
.review-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.review-state, .fact-state, .length-state { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 15px; font: 500 9px "DM Mono"; letter-spacing: .08em; }
.review-state.pending { color: #765d35; background: #f2dfb6; }
.review-state.approved { color: #17523f; border-color: #75a894; background: #d9ecdf; }
.review-state.rejected { color: #7c281d; border-color: #c48a80; background: #efd7d0; }
.fact-state.verified { color: #16515a; border-color: #70a9ae; background: #d8ebea; }
.fact-state.unverified { color: #7c5826; background: #f1dfb9; }
.fact-state.discussion { color: #71323b; border-color: #b78289; background: #ecd8dc; }
.comment-state { color: #49356f; border-color: #a28bc2; background: #e7def0; }
.length-state.fits { color: #495b3b; border-color: #98a985; background: #e4ead9; }
.length-state.warning { color: #862d20; border-color: #c38c80; background: #f0d8d2; }
.difficulty-select { border: 1px solid var(--line); padding: 7px 9px; color: var(--ink); background: #f7ead0; font-size: 11px; }
.review-topic { margin: 0 0 15px; font-size: clamp(17px, 2.2vw, 22px); font-weight: 700; line-height: 1.75; }
.review-reason { margin: 0 0 16px; padding-left: 13px; border-left: 2px solid var(--gold); color: #65543e; font-size: 12px; line-height: 1.7; }
.review-comment-field { display: block; margin: 0 0 16px; }
.review-comment-field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.review-comment-field textarea { width: 100%; resize: vertical; border: 1px solid var(--line); padding: 10px 12px; color: var(--ink); background: rgba(255,255,255,.48); font: 12px/1.65 "Noto Sans JP", sans-serif; outline: none; }
.review-comment-field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(23,79,82,.12); }
.verification-sources { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin: -3px 0 16px; font-size: 10px; }
.verification-sources span { color: var(--muted); font: 9px "DM Mono"; letter-spacing: .1em; }
.verification-sources a { color: #17545a; text-decoration: underline; text-underline-offset: 3px; }
.review-source-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-top: 15px; border-top: 1px solid rgba(112,89,57,.3); }
.review-source { min-width: 0; }
.review-source span { display: block; margin-bottom: 4px; color: var(--muted); font: 9px "DM Mono"; letter-spacing: .1em; }
.review-source a { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.review-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.review-action { min-width: 94px; border: 1px solid var(--ink); padding: 9px 13px; background: transparent; cursor: pointer; font-weight: 700; font-size: 11px; }
.review-action.approve { color: white; border-color: #205d4a; background: #205d4a; }
.review-action.reject { color: #7f2d21; border-color: #9b4a3e; }
.review-action.reset { min-width: auto; color: var(--muted); border-color: var(--line); }
.review-empty { padding: 58px 20px; border: 1px dashed var(--line); text-align: center; }
.review-empty-mark { display: grid; width: 48px; height: 48px; margin: auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--orange); font-size: 26px; }
.review-empty h3 { margin: 15px 0 7px; font-size: 20px; }
.review-empty p { max-width: 520px; margin: auto; color: var(--muted); font-size: 12px; line-height: 1.8; }
.review-storage-note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.review-finish { margin-top: 28px; }
.review-finish .start-button { text-decoration: none; }

footer { min-height: 66px; border-top: 1px solid rgba(218,178,101,.62); display: flex; justify-content: space-between; align-items: center; color: #c9b692; text-shadow: 0 1px 5px #000; font: 10px "DM Mono"; letter-spacing: .12em; }
.hidden { display: none !important; }

@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes correct { 50% { background: rgba(246,201,69,.45); transform: scale(1.012); } }
@keyframes mascot-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-9px) rotate(1deg); } }
@keyframes countdown-pop { 0% { opacity: 0; transform: scale(.55); } 45% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }

@media (max-width: 600px) {
  .game-shell { width: min(100% - 24px, 1120px); }
  .topbar { min-height: 72px; }
  .hero, .result-screen { padding: 45px 0 35px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 22px; }
  .hero-copy { padding: 22px 18px; }
  .mascot-intro { order: -1; width: 150px; margin: 18px auto -18px; }
  .mascot-bubble { top: -14px; left: 105px; width: 128px; padding: 8px 10px; font-size: 10px; }
  .mascot-intro figcaption { display: none; }
  .difficulty { grid-template-columns: 1fr; }
  .level { border-right: 0; border-bottom: 1px solid var(--ink); padding: 12px; }
  .level:last-child { border-bottom: 0; }
  .level span { display: inline; margin-right: 10px; }
  .word-card { min-height: 330px; padding: 35px 18px; }
  .mascot-coach img { width: 78px; margin-bottom: -17px; }
  .mascot-coach span { display: none; }
  .stats div { padding: 0 6px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid div { border-right: 0; border-bottom: 1px solid var(--line); }
  footer { display: none; }
  .header-actions { gap: 12px; }
  .review-link { font-size: 0; }
  .review-link::before { content: "REVIEW"; font-size: 10px; }
  .review-count { font-size: 9px; }
  .high-score span { display: none; }
  .ranking-table th:nth-child(5), .ranking-table td:nth-child(5), .ranking-table th:nth-child(6), .ranking-table td:nth-child(6) { display: none; }
  .ranking-tab { flex: 1; padding: 13px 4px; }
  .result-mascot { top: 125px; right: -5px; width: 100px; }
  .result-screen, .ranking-screen { padding: 30px 18px; }
  .review-screen { margin: 20px auto; padding: 30px 16px; }
  .review-summary { grid-template-columns: repeat(2, 1fr); }
  .review-summary div:nth-child(2) { border-right: 0; }
  .review-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .review-card-top, .review-source-row { align-items: stretch; flex-direction: column; }
  .learning-levels { grid-template-columns: 1fr; }
  .learning-level { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .review-actions { display: grid; grid-template-columns: 1fr 1fr auto; }
  .review-action { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.review-state.revision {
  color: #7a4a00;
  background: #fff0c7;
  border-color: #e3a52e;
}

.review-action.revision,
.review-copy-revisions {
  color: #2b1c00;
  background: #ffd978;
  border-color: #c58a18;
}

.review-copy-revisions {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #c58a18;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.review-copy-revisions:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.completion-bonus {
  margin: 6px 0 0;
  color: var(--pink);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.start-ranking-button {
  width: 100%;
  margin: 12px 0 0;
  min-height: 46px;
  border: 1px solid rgba(72, 47, 29, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.start-ranking-button:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.ranking-level-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0 10px;
}

.ranking-level-tab {
  min-height: 48px;
  border: 1px solid rgba(72, 47, 29, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.ranking-level-tab.active {
  border-color: var(--pink);
  background: var(--pink);
  color: white;
}

.ranking-level-tab small {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}
.difficulty .level small {
  display: block;
  margin-top: 3px;
  line-height: 1.15;
}
