/* ============================================================
   AIなぞラボ — デジタルこどもBASE 道場ピクセルスタイル
   kids-skillup シリーズと統一されたデザインシステム
   ============================================================ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
  background-color: #f5f0e8;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(0,0,0,0.03) 31px, rgba(0,0,0,0.03) 32px),
    repeating-linear-gradient(90deg, transparent 0, transparent 31px, rgba(0,0,0,0.03) 31px, rgba(0,0,0,0.03) 32px);
  color: #222;
  line-height: 1.7;
  font-size: 17px;
}

ruby rt { font-size: 0.55em; color: #555; font-weight: normal; }

/* ========== Header ========== */
.site-header {
  background: #fff;
  border-bottom: 3px solid #6b4dff;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #222; }
.logo-img { height: 40px; }
.logo-text { font-weight: bold; font-size: 1.05rem; display: flex; flex-direction: column; line-height: 1.2; }
.logo-text-sub { font-size: 0.7rem; color: #666; }
.back-to-overview {
  background: #6b4dff; color: #fff; padding: 6px 14px;
  border-radius: 4px; text-decoration: none; font-size: 0.9rem; font-weight: bold;
  white-space: nowrap;
  border: 2px solid #222;
  box-shadow: 2px 2px 0 #222;
}
.back-to-overview:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #222; }

.page-main { max-width: 1100px; margin: 24px auto; padding: 0 16px 64px; }

/* ========== Back button (in-page) ========== */
.back-button {
  font-family: "DotGothic16", sans-serif;
  background: #fff; color: #222;
  border: 3px solid #222; border-radius: 8px;
  padding: 6px 14px; font-size: 0.95rem;
  cursor: pointer; box-shadow: 3px 3px 0 #222;
  margin-bottom: 16px;
}
.back-button:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #222; }

/* ========== Hero (mode select top) ========== */
.nazo-hero {
  background: linear-gradient(135deg, #6b4dff 0%, #4f37c4 50%, #3a1f8a 100%);
  border: 3px solid #222; border-radius: 12px;
  padding: 32px 24px; box-shadow: 6px 6px 0 #222;
  text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.nazo-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.18) 0, transparent 90px),
    radial-gradient(circle at 85% 80%, rgba(255,243,106,0.25) 0, transparent 110px);
  pointer-events: none;
}
.nazo-hero-content { position: relative; z-index: 1; }
.nazo-hero .kicker {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.86rem; letter-spacing: 0.2em;
  color: #fff36a; margin: 0 0 8px;
  text-shadow: 2px 2px 0 #222;
}
.nazo-hero h1 {
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 0 0 8px;
  text-shadow: 3px 3px 0 #222;
  color: #fff;
  line-height: 1.2;
}
.nazo-hero .tagline {
  font-family: "DotGothic16", sans-serif;
  font-size: 1rem; margin: 0 0 16px;
  color: #fff36a; text-shadow: 2px 2px 0 #222;
}
.hero-totals {
  display: inline-flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  background: rgba(0,0,0,0.3); border: 2px solid #fff36a;
  border-radius: 8px; padding: 10px 20px; margin-top: 4px;
}
.hero-totals .ht-cell {
  display: flex; flex-direction: column; min-width: 60px;
  font-family: "DotGothic16", sans-serif;
}
.hero-totals .num { font-size: 1.4rem; color: #fff36a; line-height: 1.1; }
.hero-totals .lbl { font-size: 0.78rem; color: #fff; }

.hero-ai-line {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 12px 0 14px;
  color: rgba(255,255,255,0.95);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
.hero-ai-line strong {
  color: #fff36a;
  text-shadow: 1px 1px 0 #222;
}

.hero-tech-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}
.tech-badge {
  font-family: "DotGothic16", sans-serif;
  background: rgba(0,0,0,0.4);
  border: 2px solid #fff36a;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* ========== AI roles section ========== */
.ai-roles {
  background: linear-gradient(135deg, #1a2533 0%, #2a3a55 100%);
  color: #fff;
  border: 3px solid #222; border-radius: 12px;
  padding: 22px 24px; box-shadow: 4px 4px 0 #222;
  margin-top: 18px;
}
.ai-roles-header {
  text-align: center; margin-bottom: 18px;
}
.ai-roles-header h2 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.25rem; margin: 0 0 6px;
  color: #fff36a;
  text-shadow: 2px 2px 0 #000;
}
.ai-roles-sub {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
}
.ai-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.ai-role-card {
  background: rgba(255,255,255,0.06);
  border: 2px solid #4a5870;
  border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 4px;
  position: relative;
  text-align: left;
}
.ai-role-card .role-emoji {
  font-size: 2rem;
  filter: drop-shadow(2px 2px 0 #000);
  margin-bottom: 2px;
}
.ai-role-card h3 {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.98rem; margin: 0 0 2px;
  color: #fff36a;
}
.ai-role-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.9);
}
.ai-role-card p strong {
  color: #fff;
  background: rgba(255, 243, 106, 0.18);
  padding: 0 2px;
  border-radius: 2px;
}
.ai-roles-foot {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  text-align: center;
}

/* AI tag in host bubble */
.ai-tag {
  font-family: "DotGothic16", sans-serif;
  background: #6b4dff; color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 4px;
  letter-spacing: 0.04em;
  border: 1px solid #4a3a82;
}

/* ========== How to play ========== */
.how-to-play {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 20px 22px; box-shadow: 4px 4px 0 #222;
  margin-top: 24px;
}
.howto-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.howto-header h2 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.3rem; margin: 0; color: #d97706;
}
.howto-pill {
  font-family: "DotGothic16", sans-serif;
  background: #fff36a; border: 2px solid #222; border-radius: 5px;
  padding: 2px 10px; font-size: 0.8rem; box-shadow: 2px 2px 0 #222;
}
.howto-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.howto-step {
  background: #fff8e1;
  border: 2px solid #222; border-radius: 10px;
  padding: 14px 12px; box-shadow: 3px 3px 0 #222;
  display: grid; grid-template-rows: auto auto auto 1fr;
  gap: 4px; text-align: center;
  position: relative;
}
.howto-step .step-num {
  position: absolute; top: -10px; left: -10px;
  width: 28px; height: 28px;
  background: #d83a52; color: #fff;
  border: 2px solid #222; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.95rem;
  box-shadow: 2px 2px 0 #222;
}
.howto-step .step-emoji {
  font-size: 2.2rem;
  filter: drop-shadow(2px 2px 0 #222);
  margin-top: 4px;
}
.howto-step .step-title {
  font-family: "DotGothic16", sans-serif;
  font-size: 1rem; color: #d97706;
}
.howto-step .step-text {
  font-size: 0.85rem; color: #333; line-height: 1.5;
}
.howto-cta {
  margin-top: 18px; text-align: center;
  padding-top: 16px; border-top: 2px dashed #ccc;
}
.howto-cta .big-button {
  background: #d83a52;
}
.howto-cta-sub {
  font-family: "DotGothic16", sans-serif;
  margin: 8px 0 0; font-size: 0.86rem; color: #666;
}

/* ========== Step guide ========== */
.step-guide {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 18px 22px; box-shadow: 4px 4px 0 #222; margin-top: 24px;
}
.step-guide h2 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.2rem; margin: 0 0 6px; color: #4f37c4;
}
.step-desc { margin: 0; color: #555; font-size: 0.94rem; }

/* ========== Mode grid ========== */
.mode-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px; margin-top: 18px;
}
.mode-card {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 20px; box-shadow: 4px 4px 0 #222;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left; cursor: pointer; font: inherit; color: #222;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.mode-card:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #222; }
.mode-card.mode-free { background: linear-gradient(180deg, #fff8e1 0%, #fff 60%); border-color: #d97706; }
.mode-card.mode-quest { background: linear-gradient(180deg, #f3e8ff 0%, #fff 60%); border-color: #7c3aed; }
.mode-card .head { display: flex; align-items: center; gap: 12px; }
.mode-card .big-emoji { font-size: 3.4rem; filter: drop-shadow(3px 3px 0 #222); }
.mode-card h2 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.3rem; margin: 0; line-height: 1.3;
}
.mode-card .desc { margin: 0; font-size: 0.94rem; line-height: 1.55; color: #333; }
.mode-card .features { display: flex; flex-wrap: wrap; gap: 6px; }
.feat {
  font-family: "DotGothic16", sans-serif; font-size: 0.78rem;
  background: #fff; border: 2px solid #222; border-radius: 5px; padding: 2px 8px;
}
.mode-card .footer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 10px; border-top: 2px dashed #ccc;
}
.mode-card .count { font-family: "DotGothic16", sans-serif; font-size: 0.95rem; }
.mode-card .count strong { font-size: 1.3rem; color: #d97706; }
.mode-card.mode-quest .count strong { color: #7c3aed; }
.mode-card .cta {
  font-family: "DotGothic16", sans-serif;
  background: #d97706; color: #fff;
  border: 2px solid #222; border-radius: 6px;
  padding: 6px 14px; font-size: 0.95rem;
  white-space: nowrap; box-shadow: 2px 2px 0 #222;
}
.mode-card.mode-quest .cta { background: #7c3aed; }
.level-badge {
  align-self: flex-start;
  font-family: "DotGothic16", sans-serif;
  background: #fff; border: 2px solid #222; border-radius: 6px;
  padding: 3px 10px; font-size: 0.82rem; box-shadow: 2px 2px 0 #222;
  margin-bottom: -2px;
}
.mode-card.mode-free .level-badge { background: #ffd35a; }
.mode-card.mode-quest .level-badge { background: #d6c2ff; }

/* ========== Hint card ========== */
.hint-card {
  margin-top: 18px;
  background: #fff36a; border: 3px solid #222; border-radius: 12px;
  padding: 14px 18px; box-shadow: 4px 4px 0 #222;
  font-size: 0.94rem;
}
.hint-card p { margin: 0; }

.footer-actions { margin-top: 28px; text-align: center; }

/* ========== Level screen ========== */
.level-hero {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 22px 24px; box-shadow: 4px 4px 0 #222; text-align: center;
  margin-bottom: 18px;
}
.level-hero h1 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.7rem; margin: 0 0 6px;
}
.level-hero p { margin: 0; color: #555; }

.level-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.level-tile {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 16px 14px; box-shadow: 4px 4px 0 #222;
  cursor: pointer; font: inherit;
  display: flex; flex-direction: column; gap: 8px;
  text-align: center; color: #222;
  transition: transform 0.08s, box-shadow 0.08s;
}
.level-tile:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #222; }
.level-tile img {
  width: 84px; height: 84px;
  margin: 0 auto; border-radius: 50%; object-fit: cover;
  border: 3px solid #222; box-shadow: 3px 3px 0 #222;
}
.level-tile .lt-eyebrow {
  font-family: "DotGothic16", sans-serif; font-size: 0.78rem;
  background: #fff; border: 2px solid #222; border-radius: 5px;
  padding: 2px 8px; box-shadow: 2px 2px 0 #222;
  align-self: center;
}
.level-tile .lt-name {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.15rem; line-height: 1.2; color: #222;
}
.level-tile .lt-stat { font-size: 0.84rem; color: #555; }
.level-tile .lt-bar {
  height: 8px; background: #f0e4cc;
  border: 2px solid #222; border-radius: 4px; overflow: hidden;
}
.level-tile .lt-bar > i {
  display: block; height: 100%;
  background: #1abc9c; transition: width 0.4s ease;
}
.level-tile[data-level="1"] { background: linear-gradient(180deg, #fff8e1 0%, #fff 60%); border-color: #d97706; }
.level-tile[data-level="1"] .lt-bar > i { background: #d97706; }
.level-tile[data-level="1"] .lt-eyebrow { background: #ffd35a; }
.level-tile[data-level="2"] { background: linear-gradient(180deg, #e8f0fa 0%, #fff 60%); border-color: #2563eb; }
.level-tile[data-level="2"] .lt-bar > i { background: #2563eb; }
.level-tile[data-level="2"] .lt-eyebrow { background: #b3e0ff; }
.level-tile[data-level="3"] { background: linear-gradient(180deg, #f3e8ff 0%, #fff 60%); border-color: #7c3aed; }
.level-tile[data-level="3"] .lt-bar > i { background: #7c3aed; }
.level-tile[data-level="3"] .lt-eyebrow { background: #d6c2ff; }
.level-tile[data-level="4"] { background: linear-gradient(180deg, #e8f4ec 0%, #fff 60%); border-color: #0f9f7a; }
.level-tile[data-level="4"] .lt-bar > i { background: #0f9f7a; }
.level-tile[data-level="4"] .lt-eyebrow { background: #b3e6cd; }
.level-tile[data-level="5"] { background: linear-gradient(180deg, #c5cae9 0%, #fff 70%); border-color: #1a1f3a; }
.level-tile[data-level="5"] .lt-bar > i { background: #1a1f3a; }
.level-tile[data-level="5"] .lt-eyebrow { background: #3a4570; color: #fff; }

/* ========== Scenario list screen ========== */
.list-hero {
  display: grid; grid-template-columns: 88px 1fr;
  gap: 16px; align-items: center;
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 18px; box-shadow: 4px 4px 0 #222;
  margin-bottom: 18px;
}
.list-avatar {
  width: 80px; height: 80px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid #222; box-shadow: 3px 3px 0 #222;
}
.list-hero-text .list-eyebrow {
  font-family: "DotGothic16", sans-serif;
  background: #fff; border: 2px solid #222; border-radius: 5px;
  padding: 2px 10px; font-size: 0.82rem; box-shadow: 2px 2px 0 #222;
  display: inline-block;
}
.list-hero-text h1 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.5rem; margin: 6px 0 4px;
}
.list-stat { margin: 0; color: #555; font-size: 0.9rem; }

.scenario-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.scenario-card {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 16px; box-shadow: 4px 4px 0 #222;
  cursor: pointer; font: inherit; color: #222;
  text-align: left; display: flex; flex-direction: column; gap: 8px;
  position: relative; transition: transform 0.08s, box-shadow 0.08s;
}
.scenario-card:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #222; }
.scenario-card .sc-num {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.78rem; color: #7c3aed;
}
.scenario-card .sc-title {
  font-family: "DotGothic16", sans-serif;
  font-weight: 700; font-size: 1.12rem; color: #222; line-height: 1.3;
}
.scenario-card .sc-tease {
  margin: 0; color: #555; font-size: 0.9rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.scenario-card .sc-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 8px; border-top: 2px dashed #ccc;
}
.scenario-card .sc-meta {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.78rem; color: #666;
}
.scenario-card .sc-cta {
  font-family: "DotGothic16", sans-serif;
  background: #7c3aed; color: #fff;
  border: 2px solid #222; border-radius: 5px;
  padding: 4px 12px; font-size: 0.85rem;
  box-shadow: 2px 2px 0 #222;
}
.scenario-card.cleared { background: linear-gradient(180deg, #e6f4ea 0%, #fff 70%); border-color: #1a4d27; }
.scenario-card.cleared .sc-num { color: #1a4d27; }
.scenario-card.cleared .sc-cta { background: #1a4d27; }
.scenario-card.cleared::before {
  content: "✓ クリア";
  position: absolute; top: -10px; right: -8px;
  font-family: "DotGothic16", sans-serif;
  background: #1abc9c; color: #fff;
  border: 2px solid #222; border-radius: 5px;
  padding: 3px 10px; font-size: 0.78rem;
  box-shadow: 2px 2px 0 #222;
}
.scenario-card .sc-best {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.78rem; color: #0f9f7a;
}

/* Per-level colored scenario cards (matching their level border color) */
.scenario-grid[data-level="1"] .scenario-card { border-color: #d97706; }
.scenario-grid[data-level="1"] .scenario-card .sc-cta { background: #d97706; }
.scenario-grid[data-level="1"] .scenario-card .sc-num { color: #d97706; }
.scenario-grid[data-level="2"] .scenario-card { border-color: #2563eb; }
.scenario-grid[data-level="2"] .scenario-card .sc-cta { background: #2563eb; }
.scenario-grid[data-level="2"] .scenario-card .sc-num { color: #2563eb; }
.scenario-grid[data-level="3"] .scenario-card { border-color: #7c3aed; }
.scenario-grid[data-level="3"] .scenario-card .sc-cta { background: #7c3aed; }
.scenario-grid[data-level="3"] .scenario-card .sc-num { color: #7c3aed; }
.scenario-grid[data-level="4"] .scenario-card { border-color: #0f9f7a; }
.scenario-grid[data-level="4"] .scenario-card .sc-cta { background: #0f9f7a; }
.scenario-grid[data-level="4"] .scenario-card .sc-num { color: #0f9f7a; }
.scenario-grid[data-level="5"] .scenario-card { border-color: #1a1f3a; }
.scenario-grid[data-level="5"] .scenario-card .sc-cta { background: #1a1f3a; }
.scenario-grid[data-level="5"] .scenario-card .sc-num { color: #1a1f3a; }
.scenario-grid .scenario-card.cleared { border-color: #1a4d27; }
.scenario-grid .scenario-card.cleared .sc-cta { background: #1a4d27; }

/* ========== Quest screen ========== */
.quest-stage {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 18px; align-items: center;
  background: linear-gradient(135deg, #6b4dff 0%, #4f37c4 100%);
  color: #fff;
  border: 3px solid #222; border-radius: 12px;
  padding: 22px; box-shadow: 6px 6px 0 #222;
}
.quest-stage[data-stage="1"] { background: linear-gradient(135deg, #f5b041 0%, #d97706 100%); }
.quest-stage[data-stage="2"] { background: linear-gradient(135deg, #5b9af3 0%, #2563eb 100%); }
.quest-stage[data-stage="3"] { background: linear-gradient(135deg, #8b6fc4 0%, #7c3aed 100%); }
.quest-stage[data-stage="4"] { background: linear-gradient(135deg, #4ec7a4 0%, #0f9f7a 100%); }
.quest-stage[data-stage="5"] { background: linear-gradient(135deg, #3a4570 0%, #1a1f3a 100%); }
.quest-avatar {
  width: 140px; height: 140px;
  border-radius: 50%; object-fit: cover;
  border: 4px solid #fff36a;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.quest-info .quest-eyebrow {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.86rem; color: #fff36a;
  text-shadow: 2px 2px 0 #222;
  letter-spacing: 0.1em;
}
.quest-info h1 {
  font-family: "DotGothic16", sans-serif;
  font-size: 2rem; margin: 4px 0 6px; color: #fff;
  text-shadow: 3px 3px 0 #222;
}
.quest-host { color: #fff; margin: 4px 0 12px; font-size: 0.95rem; opacity: 0.9; }
.quest-host strong { color: #fff36a; }
.quest-progress { display: flex; align-items: center; gap: 12px; }
.quest-dots { display: inline-flex; gap: 8px; }
.quest-dots .dot {
  width: 18px; height: 18px;
  background: rgba(255,255,255,0.2);
  border: 2px solid #fff;
  border-radius: 4px;
}
.quest-dots .dot.filled {
  background: #fff36a; border-color: #fff36a;
  box-shadow: 0 0 8px rgba(255, 243, 106, 0.6);
}
.quest-progress-text {
  font-family: "DotGothic16", sans-serif;
  color: #fff36a; font-size: 1.1rem;
  text-shadow: 2px 2px 0 #222;
}
.quest-actions { margin: 18px 0; text-align: center; }
.big-button {
  font-family: "DotGothic16", sans-serif;
  background: #d83a52; color: #fff;
  border: 3px solid #222; border-radius: 8px;
  padding: 14px 32px; font-size: 1.2rem;
  cursor: pointer; box-shadow: 4px 4px 0 #222;
}
.big-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #222; }
.big-button:disabled { opacity: 0.5; cursor: not-allowed; background: #888; }

.quest-complete {
  background: linear-gradient(180deg, #fff8e1 0%, #ffd35a 100%);
  border: 3px solid #222; border-radius: 12px;
  padding: 22px; box-shadow: 4px 4px 0 #222;
  text-align: center;
}
.quest-complete h2 {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.6rem; margin: 0 0 8px;
}
.quest-complete p { margin: 0 0 12px; }

/* ========== Game screen ========== */
.screen.game { display: grid; grid-template-columns: 1fr; gap: 16px; }

.host-stage {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 16px; align-items: stretch;
  background: #fff;
  color: #222;
  border: 3px solid #222; border-radius: 12px;
  padding: 16px; box-shadow: 4px 4px 0 #222;
  position: relative;
}
.host-stage[data-level="1"] { background: linear-gradient(135deg, #fff8e1 0%, #fff 100%); border-color: #d97706; }
.host-stage[data-level="2"] { background: linear-gradient(135deg, #e8f0fa 0%, #fff 100%); border-color: #2563eb; }
.host-stage[data-level="3"] { background: linear-gradient(135deg, #f3e8ff 0%, #fff 100%); border-color: #7c3aed; }
.host-stage[data-level="4"] { background: linear-gradient(135deg, #e8f4ec 0%, #fff 100%); border-color: #0f9f7a; }
.host-stage[data-level="5"] { background: linear-gradient(135deg, #c5cae9 0%, #fff 100%); border-color: #1a1f3a; }
.host-frame { position: relative; width: 120px; height: 120px; }
.host-avatar {
  width: 120px; height: 120px;
  border-radius: 50%; object-fit: cover;
  background: #fff;
  border: 3px solid #222;
  box-shadow: 3px 3px 0 #222;
  transition: transform 0.25s ease;
}
.host-frame[data-state="thinking"] .host-avatar { animation: avatar-think 1.6s ease-in-out infinite; }
.host-frame[data-state="happy"] .host-avatar { animation: avatar-happy 0.6s ease; }
.host-frame[data-state="sad"] .host-avatar { animation: avatar-shake 0.4s ease; }
@keyframes avatar-think { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes avatar-happy { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes avatar-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.host-mood {
  position: absolute; right: -6px; top: -6px;
  width: 36px; height: 36px;
  background: #fff36a;
  border: 3px solid #222; border-radius: 6px;
  box-shadow: 2px 2px 0 #222;
  display: grid; place-items: center;
  font-family: "DotGothic16", sans-serif;
  font-size: 1.1rem;
}
.host-mood[data-mood="idle"]::before { content: "?"; }
.host-mood[data-mood="thinking"]::before { content: "…"; }
.host-mood[data-mood="yes"]::before { content: "○"; color: #0f9f7a; }
.host-mood[data-mood="no"]::before { content: "×"; color: #d83a52; }
.host-mood[data-mood="partial"]::before { content: "△"; color: #d97706; }
.host-mood[data-mood="irrelevant"]::before { content: "—"; color: #666; }
.host-mood[data-mood="happy"]::before { content: "♪"; color: #d83a52; }
.host-mood[data-mood="hint"]::before { content: "!"; color: #d97706; }

.host-bubble {
  position: relative;
  background: #fff; border: 2px dashed #888; border-radius: 10px;
  padding: 12px 14px;
  align-self: center; min-height: 96px;
  display: flex; flex-direction: column; justify-content: center;
}
.host-bubble::before {
  content: ""; position: absolute;
  left: -10px; top: 30px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 12px solid #fff;
}
.host-name-line { margin: 0 0 6px; font-size: 0.85rem; color: #666; }
.host-name-line strong {
  font-family: "DotGothic16", sans-serif;
  font-size: 1rem; color: #222;
  margin-right: 6px;
}
.host-speech { margin: 0; font-size: 1rem; font-weight: 700; color: #222; }
.status-line { margin: 6px 0 0; font-size: 0.78rem; color: #888; min-height: 1em; }

/* ---------- Story panel ---------- */
.story-panel {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 18px; box-shadow: 4px 4px 0 #222;
}
.story-cover {
  display: inline-flex; align-items: baseline; gap: 12px;
  padding: 6px 14px;
  background: #fff36a;
  border: 2px solid #222; border-radius: 8px;
  box-shadow: 2px 2px 0 #222;
  margin-bottom: 12px;
}
.story-cover-label {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.78rem; letter-spacing: 0.1em; color: #666;
}
.story-cover-title {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.1rem; color: #222;
}
.story-body { margin: 4px 0 16px; font-size: 1.02rem; color: #222; white-space: pre-wrap; }
.story-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meter {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #fff8e1;
  border: 2px solid #222; border-radius: 8px;
  font-size: 0.86rem;
}
.meter-label {
  font-family: "DotGothic16", sans-serif;
  font-weight: 700; color: #d97706;
}
.meter-dots { display: inline-flex; gap: 3px; flex: 1; flex-wrap: wrap; }
.meter-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: #e3d8b9; border: 1px solid #b8a878; }
.meter-dots .dot.filled { background: #d97706; border-color: #b65a02; }
.meter-text {
  font-family: "DotGothic16", sans-serif;
  color: #666; font-size: 0.82rem; min-width: 40px; text-align: right;
}

/* ---------- Promote ---------- */
.promote-panel {
  background: linear-gradient(135deg, #fff36a 0%, #ffd35a 100%);
  border: 3px solid #222; border-radius: 12px;
  padding: 14px 18px; box-shadow: 4px 4px 0 #222;
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  animation: promote-pop 0.22s ease;
}
@keyframes promote-pop { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.promote-body { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.promote-tag {
  font-family: "DotGothic16", sans-serif;
  background: #d97706; color: #fff;
  border: 2px solid #222; border-radius: 5px;
  padding: 3px 10px; font-size: 0.8rem;
  box-shadow: 2px 2px 0 #222;
  flex-shrink: 0;
}
.promote-text { margin: 0; color: #5d3f0a; font-weight: 700; font-size: 0.96rem; }
.promote-text q { font-weight: 800; color: #222; quotes: "「" "」"; }
.promote-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Ask ---------- */
.ask-panel, .guess-panel, .log-panel, .result-panel {
  background: #fff; border: 3px solid #222; border-radius: 12px;
  padding: 16px 18px; box-shadow: 4px 4px 0 #222;
}
.ask-form { display: flex; gap: 8px; }
.ask-form input {
  flex: 1;
  border: 3px solid #222; border-radius: 8px;
  padding: 10px 14px; font: inherit; font-size: 1rem;
  background: #fff;
}
.ask-form input:focus { outline: none; box-shadow: 0 0 0 3px rgba(107, 77, 255, 0.3); }
.ask-form button {
  font-family: "DotGothic16", sans-serif;
  border: 3px solid #222;
  background: #6b4dff; color: #fff;
  padding: 10px 22px; border-radius: 8px;
  font-size: 1rem; cursor: pointer;
  box-shadow: 3px 3px 0 #222;
}
.ask-form button:hover:not(:disabled) { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #222; }
.ask-form button:disabled { opacity: 0.5; cursor: not-allowed; }

.quick-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.ghost-button {
  font-family: "DotGothic16", sans-serif;
  background: #fff; color: #222;
  border: 2px solid #222; border-radius: 6px;
  padding: 6px 14px; font-size: 0.88rem;
  cursor: pointer; box-shadow: 2px 2px 0 #222;
}
.ghost-button:hover:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #222; }
.ghost-button:disabled { opacity: 0.5; cursor: not-allowed; }
.ghost-button.hint { background: #fff36a; }
.ghost-button.guess { background: #fde2cf; color: #b3552b; }
.ghost-button.give-up { background: #eee; color: #666; }
.ghost-button.danger { background: #fee2e2; color: #b91c1c; }

.command-button {
  font-family: "DotGothic16", sans-serif;
  background: #6b4dff; color: #fff;
  border: 3px solid #222; border-radius: 8px;
  padding: 10px 18px; font-size: 1rem;
  cursor: pointer; box-shadow: 3px 3px 0 #222;
}
.command-button:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #222; }

/* ---------- Guess ---------- */
.guess-panel {
  background: linear-gradient(180deg, #fff0e8 0%, #fff 60%);
  border-color: #e67e22;
}
.guess-form { display: grid; gap: 8px; }
.guess-form label {
  font-family: "DotGothic16", sans-serif;
  font-weight: 700; color: #b3552b;
}
.guess-form textarea {
  border: 3px solid #222; border-radius: 8px;
  padding: 10px; font: inherit; font-size: 1rem;
  resize: vertical; background: #fff;
}
.guess-form textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.3); }
.guess-actions { display: flex; gap: 8px; justify-content: flex-end; }
#submitGuess {
  font-family: "DotGothic16", sans-serif;
  background: #e67e22; color: #fff;
  border: 3px solid #222; border-radius: 8px;
  padding: 9px 18px; font-size: 1rem;
  cursor: pointer; box-shadow: 3px 3px 0 #222;
}
#submitGuess:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #222; }

/* ---------- Chat log ---------- */
.log-panel h2 {
  font-family: "DotGothic16", sans-serif;
  margin: 0 0 12px; font-size: 1rem; color: #6b4dff;
}
.chat-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.chat-row { display: grid; gap: 4px; }
.chat-row.from-user { justify-items: end; }
.chat-row.from-host { justify-items: start; }
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px; font-size: 0.97rem; line-height: 1.55;
  word-break: break-word;
  border: 2px solid #222;
  box-shadow: 2px 2px 0 #222;
}
.chat-row.from-user .chat-bubble { background: #6b4dff; color: #fff; border-bottom-right-radius: 2px; }
.chat-row.from-host .chat-bubble { background: #fff; color: #222; border-bottom-left-radius: 2px; }
.chat-row.from-host.judgment-yes .chat-bubble { background: #d4ecd9; border-color: #0f9f7a; }
.chat-row.from-host.judgment-no .chat-bubble { background: #fadbd0; border-color: #d83a52; }
.chat-row.from-host.judgment-partial .chat-bubble { background: #fff36a; border-color: #d97706; }
.chat-row.from-host.judgment-irrelevant .chat-bubble { background: #eee; }
.chat-row.from-host.kind-hint .chat-bubble { background: #fff36a; border-color: #d97706; }
.chat-row.from-host.kind-verdict.verdict-correct .chat-bubble { background: #d4ecd9; border-color: #0f9f7a; font-weight: 700; }
.chat-row.from-host.kind-verdict.verdict-close .chat-bubble { background: #fff36a; border-color: #d97706; }
.chat-row.from-host.kind-verdict.verdict-wrong .chat-bubble { background: #fadbd0; border-color: #d83a52; }
.chat-meta { font-size: 0.72rem; color: #666; padding: 0 6px; }
.chat-tag {
  font-family: "DotGothic16", sans-serif;
  display: inline-block; margin-right: 6px;
  padding: 1px 8px; border-radius: 4px;
  background: #fff36a; color: #222;
  font-size: 0.72rem;
  border: 1px solid #222;
}
.judgment-pill {
  font-family: "DotGothic16", sans-serif;
  display: inline-block; padding: 2px 8px; margin-right: 8px;
  border-radius: 4px; font-size: 0.78rem;
  border: 1px solid #222;
}
.judgment-pill.yes { background: #0f9f7a; color: #fff; }
.judgment-pill.no { background: #d83a52; color: #fff; }
.judgment-pill.partial { background: #d97706; color: #fff; }
.judgment-pill.irrelevant, .judgment-pill.unjudgeable { background: #888; color: #fff; }
.judgment-pill.verdict-correct { background: #0f9f7a; color: #fff; }
.judgment-pill.verdict-close { background: #d97706; color: #fff; }
.judgment-pill.verdict-wrong { background: #d83a52; color: #fff; }

/* ---------- Result panel ---------- */
.result-panel {
  background: linear-gradient(180deg, #f3e8ff 0%, #fff 60%);
  border-color: #6b4dff;
}
.result-panel.win {
  background: linear-gradient(180deg, #d4ecd9 0%, #fff 60%);
  border-color: #0f9f7a;
}
.result-panel h2 {
  font-family: "DotGothic16", sans-serif;
  margin: 0 0 8px; font-size: 1.4rem; color: #222;
}
.result-message { margin: 0 0 12px; font-weight: 700; }
.result-reveal {
  background: #fff;
  border: 2px solid #222; border-radius: 8px;
  padding: 14px 16px; white-space: pre-wrap;
  margin: 10px 0 14px;
  font-size: 1rem; line-height: 1.8;
}
.result-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ========== Overlays ========== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 14, 56, 0.7);
  display: grid; place-items: center;
  z-index: 100; padding: 16px;
}
.overlay-content {
  background: #fff;
  border: 3px solid #222; border-radius: 12px;
  padding: 28px 24px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: 6px 6px 0 #222;
  position: relative;
  animation: overlay-pop 0.3s ease;
}
@keyframes overlay-pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.overlay-content h2 {
  font-family: "DotGothic16", sans-serif;
  margin: 0 0 8px; color: #222; font-size: 1.6rem;
}
.overlay-content h3 {
  font-family: "DotGothic16", sans-serif;
  margin: 8px 0; color: #222; font-size: 1.2rem;
}
.overlay-content p { margin: 0 0 12px; color: #222; }
.overlay-content .command-button { margin-top: 12px; }

.celebration {
  background: linear-gradient(180deg, #d4ecd9 0%, #fff 60%);
  border-color: #0f9f7a;
  overflow: hidden;
}
.celebration h2 { color: #0f9f7a; font-size: 2rem; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span {
  position: absolute; top: -10%;
  width: 10px; height: 14px;
  border: 1px solid #222;
  animation: confetti-fall 1.6s linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
  100% { transform: translateY(700%) rotate(720deg); opacity: 0; }
}

.promotion {
  background: linear-gradient(180deg, #fff36a 0%, #ffd35a 60%);
  border-color: #d97706;
}
.promotion .promotion-eyebrow {
  font-family: "DotGothic16", sans-serif;
  font-size: 0.86rem; letter-spacing: 0.2em;
  color: #d97706; font-weight: 700;
  margin: 0;
}
.promotion-arrow {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.6rem; margin: 6px 0;
}
.promotion-avatar {
  width: 96px; height: 96px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid #222; box-shadow: 3px 3px 0 #222;
  margin: 6px auto; display: block;
}
.promotion-greeting {
  margin-top: 12px;
  font-style: italic;
  background: #fff;
  border: 2px dashed #d97706; border-radius: 8px;
  padding: 10px 12px;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .host-stage, .quest-stage { grid-template-columns: 80px 1fr; padding: 12px; }
  .host-frame, .host-avatar { width: 80px; height: 80px; }
  .quest-avatar { width: 90px; height: 90px; }
  .quest-info h1 { font-size: 1.5rem; }
  .host-avatar { border-width: 2px; box-shadow: 2px 2px 0 #222; }
  .host-mood { width: 28px; height: 28px; font-size: 0.95rem; }
  .story-meta { grid-template-columns: 1fr; }
  .list-hero { grid-template-columns: 64px 1fr; padding: 14px; }
  .list-avatar { width: 64px; height: 64px; }
  .nazo-hero { padding: 24px 18px; }
  .hero-totals { gap: 12px; padding: 8px 14px; }
}

.loading { color: #666; margin: 0; }
.error { color: #d83a52; }
