:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent-red: #dc2626;
  --accent-green: #16a34a;
  --accent-blue: #0284c7;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
  --accent-slate: #334155;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.07);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 12% 10%, #fef9c3 0%, #f8fafc 38%, #eff6ff 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.screen {
  animation: screenIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screenIn {
  0% { opacity: 0; transform: translateY(14px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.hidden {
  display: none !important;
}

/* イワシダーツ共通スリムヘッダー */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #d7e1eb;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: #142230;
  text-decoration: none;
}

.brand-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #163a5f;
  background: #ffffff;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #5a6d80;
}

.status-dot i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0283e;
}

.nav-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #d7e1eb;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #142230;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.nav-pill:hover {
  border-color: #163a5f;
  background: #edf3f8;
}

.nav-pill.accent {
  border-color: #e0283e;
  background: #e0283e;
  color: #ffffff;
}

.nav-pill.accent:hover {
  background: #c51d32;
}

/* Main Container */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Loose Playful Hero Playground */
.hero-playground {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 10px 22px;
  margin-bottom: 14px;
  min-height: 176px;
}

.loose-title-wrap {
  flex: 1;
  text-align: center;
  z-index: 2;
}

.loose-title-svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 0 rgba(15, 23, 42, 0.1));
}

.kid-text {
  font-family: "HG丸ｺﾞｼｯｸM-PRO", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", cursive, sans-serif;
  font-weight: 900;
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 8px;
  stroke-linejoin: round;
}

.kid-line1 {
  font-size: 62px;
  letter-spacing: 4px;
}

.kid-line2 {
  font-size: 56px;
  letter-spacing: 3px;
}

.hero-loose-sub {
  margin: 6px 0 0;
  font-size: 0.96rem;
  font-weight: 800;
  color: #334155;
}

.wander-actor {
  position: relative;
  width: 124px;
  height: 124px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  transition: transform 1.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.wander-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.abcd-bubble {
  position: absolute;
  top: -28px;
  left: -14px;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  border: 2.5px solid #ffffff;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 5;
}

.abcd-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid currentColor;
  color: inherit;
}

.abcd-bubble.abcd-bubble-left {
  left: auto;
  right: -14px;
}

.abcd-bubble.abcd-bubble-left::after {
  right: auto;
  left: 12px;
}

.abcd-bubble.is-hidden {
  opacity: 0;
  transform: scale(0.6) translateY(8px);
}

/* Player Bar & Ranking */
.player-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.player-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.player-input {
  flex: 1;
  min-width: 210px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

.player-input:focus {
  border-color: #0f172a;
}

.player-auth-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-auth-primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-auth-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-ranking {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-ranking:hover {
  background: #fde68a;
}

.player-welcome {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.96rem;
}

.player-badge {
  background: #16a34a;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.player-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.player-auth-msg {
  margin: 8px 0 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #dc2626;
}

.player-auth-msg.is-ok {
  color: #16a34a;
}

.ranking-card {
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 120px);
  border: 2px solid #fde68a;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.12);
}

.ranking-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ranking-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(90deg, #d97706, #ea580c, #db2777);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ranking-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ranking-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ranking-help {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #b45309;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-ranking-help:hover {
  background: #fef3c7;
}

.ranking-period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}

.ranking-period-tab {
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 9px;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.ranking-period-tab.active {
  background: #ffffff;
  color: #d97706;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.ranking-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
}

.ranking-modal {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.ranking-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ranking-modal-head h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  color: #0f172a;
}

.btn-modal-close {
  border: none;
  background: #f1f5f9;
  color: #334155;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.ranking-modal-body ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.ranking-tab {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.ranking-tab:hover {
  transform: translateY(-1px);
}

.ranking-tab.active {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.ranking-podium {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ranking-podium-23 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rank-hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 14px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  background: #ffffff;
  overflow: hidden;
}

.rank-hero-card.rank-1 {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 48%, #fde68a 100%);
  border-color: #f59e0b;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.22);
  padding: 20px 22px;
  text-align: center;
  align-items: center;
}

.rank-hero-card.rank-2 {
  background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 55%, #e2e8f0 100%);
  border-color: #94a3b8;
  box-shadow: 0 5px 14px rgba(100, 116, 139, 0.14);
  align-items: center;
  text-align: center;
}

.rank-hero-card.rank-3 {
  background: linear-gradient(135deg, #ffedd5 0%, #ffffff 55%, #fed7aa 100%);
  border-color: #d97706;
  box-shadow: 0 5px 14px rgba(217, 119, 6, 0.14);
  align-items: center;
  text-align: center;
}

.rank-hero-card.is-me {
  outline: 3px solid #22c55e;
  outline-offset: 2px;
}

.rank-medal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.rank-1 .rank-medal-badge {
  background: #b45309;
  color: #ffffff;
  border-color: transparent;
  font-size: 0.9rem;
}

.rank-hero-name {
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 1位: 大きめサイズ / 2・3位: 1位より小さめで両方同じ大きさ */
.rank-1 .rank-hero-name {
  font-size: 1.65rem;
}

.rank-2 .rank-hero-name,
.rank-3 .rank-hero-name {
  font-size: 1.2rem;
}

.rank-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #334155;
  font-weight: 700;
}

.rank-hero-time {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  font-weight: 900;
}

.ranking-top45 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* 4位・5位: 通常の大きさ */
.rank-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.96rem;
}

.rank-row-card.is-me {
  background: #f0fdf4;
  border-color: #4ade80;
}

.rank-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rank-num-pill {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.rank-row-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rank-row-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #334155;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ranking-fold-wrap {
  margin-top: 14px;
}

.btn-ranking-fold {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-ranking-fold:hover {
  background: #f1f5f9;
}

.ranking-fold-body {
  margin-top: 10px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ranking-table th,
.ranking-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.ranking-table th {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--surface-soft);
}

.ranking-table tr.is-me {
  background: #f0fdf4;
  font-weight: 700;
}

.result-rank-info {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fef3c7, #ffedd5);
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 0.9rem;
  font-weight: 800;
  display: inline-block;
}

@media (max-width: 560px) {
  .ranking-podium-23 {
    grid-template-columns: 1fr;
  }
  .rank-1 .rank-hero-name {
    font-size: 1.45rem;
  }
  .rank-2 .rank-hero-name,
  .rank-3 .rank-hero-name {
    font-size: 1.15rem;
  }
}

.rank-pass-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.rank-pass-pill.pass {
  background: #dcfce7;
  color: #15803d;
}

.rank-pass-pill.try {
  background: #f1f5f9;
  color: #475569;
}

/* Section Heading */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.section-note {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-green);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 3px 10px;
  border-radius: 999px;
}

/* Mode Card Grid */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mock-disclaimer {
  margin: 14px 0 0;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.calc-heading {
  margin-top: 28px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.calc-level-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.calc-level-selector .count-chip {
  flex: 1 1 auto;
  min-width: 64px;
}

.mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s, border-color 0.22s;
  animation: cardPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardPopIn {
  0% { opacity: 0; transform: translateY(18px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.mode-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.11);
  border-color: #94a3b8;
}

.mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mode-pill {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 999px;
}

.mode-pool {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mode-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.mode-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  min-height: 2.6em;
}

.mode-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.count-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.count-chip {
  flex: 1;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.count-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-start {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.btn-start::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}

.btn-start:hover::after {
  left: 140%;
}

.btn-start:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Quiz Screen */
.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.mode-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-red);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progressShimmer 1.6s linear infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  min-width: 54px;
  text-align: right;
}

.timer-pill {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 4px 10px;
  border-radius: 8px;
}

/* Presenter + Speech Bubble (Bubble Left, Character Bottom-Right) */
.presenter-area {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  margin: 6px 0 8px;
}

.speech-bubble {
  flex: 1;
  position: relative;
  background: #ffffff;
  border: 3px solid #64748b;
  border-radius: 28px;
  padding: 22px 26px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  right: -20px;
  bottom: 26px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 20px solid #64748b;
  transform: rotate(12deg);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  right: -14px;
  bottom: 28px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid #ffffff;
  transform: rotate(12deg);
}

.speech-bubble.is-popping {
  animation: bubblePop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bubblePop {
  0% { opacity: 0.65; transform: scale(0.97) translateX(4px); }
  100% { opacity: 1; transform: scale(1) translateX(0); }
}

.mascot-stage {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mascot-quiz-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform-origin: bottom center;
  animation: mascotFloat 3s ease-in-out infinite;
}

.mascot-quiz-img.is-talking {
  animation: mascotTalk 0.22s ease-in-out infinite alternate;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-1.5deg); }
}

@keyframes mascotTalk {
  0% { transform: translateY(0) scale(1, 1) rotate(-2deg); }
  100% { transform: translateY(-7px) scale(1.04, 0.96) rotate(2deg); }
}

.giveup-wrap {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

/* 10-Fish 10-Second Timer Row */
.fish-timer-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
}

.fish-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  transition: color 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.fish-icon svg {
  width: 100%;
  max-width: 44px;
  height: auto;
  display: block;
}

.fish-icon.is-lit {
  animation: fishPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fishPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.22) translateY(-2px); }
  100% { transform: scale(1); }
}

.btn-giveup {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-giveup:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--text);
  border-color: #94a3b8;
}

.btn-giveup:disabled {
  opacity: 0.6;
  cursor: default;
}



.speech-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-red);
  margin-bottom: 6px;
}

.q-text {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

/* Choices */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.14s, background 0.14s, transform 0.14s, box-shadow 0.14s;
  animation: choiceSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes choiceSlideIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.choice-btn:hover:not(:disabled) {
  border-color: #64748b;
  background: #f8fafc;
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.choice-btn.is-correct {
  border-color: var(--accent-green);
  background: #f0fdf4;
  animation: correctPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.choice-btn.is-wrong {
  border-color: var(--accent-red);
  background: #fef2f2;
  animation: wrongShake 0.35s ease;
}

@keyframes correctPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.18); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.choice-key {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-key-0 {
  background: #dc2626;
  color: #ffffff;
}

.choice-key-1 {
  background: #2563eb;
  color: #ffffff;
}

.choice-key-2 {
  background: #eab308;
  color: #0f172a;
}

.choice-key-3 {
  background: #16a34a;
  color: #ffffff;
}

.choice-btn.is-correct .choice-key {
  background: var(--accent-green);
  color: #ffffff;
}

.choice-btn.is-wrong .choice-key {
  background: var(--accent-red);
  color: #ffffff;
}

/* Confetti Celebration */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0;
  }
}

/* Result Screen */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}

.result-top {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.mascot-result-wrap {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-result-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.result-summary {
  flex: 1;
}

.result-status {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.result-status.pass {
  background: #dcfce7;
  color: #15803d;
}

.result-status.fail {
  background: #fee2e2;
  color: #b91c1c;
}

.result-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
}

.result-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.stat-box {
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 8px 16px;
  min-width: 100px;
}

.stat-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 800;
}

.result-comment {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--surface-soft);
}

/* Review List */
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.review-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.filter-tabs {
  display: flex;
  gap: 6px;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent-green);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.review-item.is-wrong {
  border-left-color: var(--accent-red);
}

.review-q {
  font-weight: 700;
  margin-bottom: 8px;
}

.review-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 6px;
}

.review-badge.ok {
  background: #dcfce7;
  color: #15803d;
}

.review-badge.ng {
  background: #fee2e2;
  color: #b91c1c;
}

.review-badge.giveup {
  background: #e2e8f0;
  color: #475569;
}

.review-badge.timeout {
  background: #fef3c7;
  color: #b45309;
}

.review-answers {
  font-size: 0.88rem;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.review-exp {
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 8px 12px;
  border-radius: 8px;
}

body.in-quiz {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.in-quiz .app-header {
  flex-shrink: 0;
}

body.in-quiz .topbar-inner {
  padding: 8px 16px;
}

body.in-quiz .container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 16px 20px 16px;
  min-height: 0;
  overflow: hidden;
}

body.in-quiz #screen-quiz {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 100%;
}

body.in-quiz .quiz-topbar {
  margin-bottom: 0;
  padding: 10px 16px;
  flex-shrink: 0;
}

body.in-quiz .choices-grid {
  gap: 12px;
}

body.in-quiz .choice-btn {
  padding: 15px 18px;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
}

body.in-quiz .giveup-wrap {
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 820px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .mode-grid,
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .choices-grid {
    grid-template-columns: 1fr;
  }
  .hero-playground {
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 4px 12px;
    min-height: auto;
  }
  .loose-title-wrap {
    order: -1;
    flex-basis: 100%;
  }
  .wander-actor {
    width: 88px;
    height: 88px;
  }
  .result-top {
    flex-direction: column;
    align-items: flex-start;
  }
  body.in-quiz .container {
    padding: 8px 12px 10px;
  }
  body.in-quiz #screen-quiz {
    gap: 10px;
  }
  body.in-quiz .presenter-area {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
  }
  body.in-quiz .mascot-stage {
    width: 88px;
    height: 88px;
  }
  body.in-quiz .fish-timer-row {
    gap: 3px;
    padding: 4px 6px;
  }
  body.in-quiz .fish-icon svg {
    max-width: 28px;
  }
  body.in-quiz .speech-bubble {
    padding: 12px 14px;
    min-height: 76px;
    border-radius: 20px;
    border-width: 2.5px;
  }
  body.in-quiz .speech-bubble::before {
    right: -14px;
    bottom: 18px;
    border-top-width: 7px;
    border-bottom-width: 10px;
    border-left-width: 14px;
  }
  body.in-quiz .speech-bubble::after {
    right: -9px;
    bottom: 20px;
    border-top-width: 5px;
    border-bottom-width: 8px;
    border-left-width: 11px;
  }
  body.in-quiz .q-text {
    font-size: 0.92rem;
    line-height: 1.4;
  }
  body.in-quiz .choices-grid {
    gap: 8px;
  }
  body.in-quiz .choice-btn {
    padding: 10px 12px;
    font-size: 0.86rem;
    gap: 8px;
  }
  body.in-quiz .choice-key {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }
  body.in-quiz .btn-giveup {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.84rem;
  }
}
