/* Sentences Hub — reader + match + quiz */

.sn-page {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
}

.sn-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 45% 40% at 80% 10%, rgba(192, 132, 252, 0.09), transparent 55%),
    radial-gradient(ellipse 40% 35% at 10% 60%, rgba(255, 101, 132, 0.06), transparent 50%);
}

.sn-page > *:not(.sn-ambient) { position: relative; z-index: 1; }

.sn-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 26px 30px;
  margin: 0 0 22px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 70% 60% at 18% 0%, rgba(192, 132, 252, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 45% at 88% 38%, rgba(255, 101, 132, 0.1), transparent 50%),
    linear-gradient(155deg, var(--bg) 0%, var(--bg2, #111) 50%, var(--bg) 100%);
  border: 1px solid rgba(192, 132, 252, 0.22);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

.sn-hero-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sn-hero-floats span {
  position: absolute;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 900;
  color: color-mix(in srgb, var(--text) 5%, transparent);
  animation: snFloat 14s ease-in-out infinite;
}

.sn-hero-floats span:nth-child(1) { left: 7%; top: 18%; font-size: 2.2rem; }
.sn-hero-floats span:nth-child(2) { left: 78%; top: 14%; font-size: 1.6rem; animation-delay: -3s; }
.sn-hero-floats span:nth-child(3) { left: 86%; top: 58%; font-size: 2.8rem; animation-delay: -6s; }
.sn-hero-floats span:nth-child(4) { left: 24%; top: 66%; font-size: 2rem; animation-delay: -9s; }

@keyframes snFloat {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-10px); opacity: 0.8; }
}

.sn-hero-content { position: relative; z-index: 1; max-width: 680px; }

.sn-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
  background: rgba(192, 132, 252, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 12px;
}

.sn-hero-title {
  font-size: clamp(1.75rem, 4.2vw, 2.45rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  line-height: 1.1;
}

.sn-hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, #c084fc, var(--text) 42%, var(--sakura, #ff6584));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sn-hero-sub {
  font-size: 0.9rem;
  color: var(--text3);
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 540px;
}

.sn-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }

.sn-stat-chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  text-align: center;
  min-width: 88px;
}

.sn-stat-val {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}

.sn-stat-lbl {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-top: 2px;
}

.sn-stat-chip--violet .sn-stat-val { color: var(--purple); }
.sn-stat-chip--mint .sn-stat-val { color: var(--mint, #00f5d4); }

.sn-dash {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.sn-dash-ring {
  padding: 18px 22px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  text-align: center;
  min-width: 140px;
}

.sn-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 8px;
}

.sn-ring-svg { width: 80px; height: 80px; transform: rotate(-90deg); }

.sn-ring-track {
  fill: none;
  stroke: color-mix(in srgb, var(--text) 8%, transparent);
  stroke-width: 5;
}

.sn-ring-fill {
  fill: none;
  stroke: url(#snGradRing);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.sn-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
}

.sn-ring-pct {
  font-family: 'Nunito', sans-serif;
  font-size: 0.55rem;
  font-weight: 800;
  color: #888;
  margin-top: 2px;
}

.sn-ring-label { font-size: 0.68rem; font-weight: 700; color: #777; }

.sn-dash-quest {
  padding: 16px 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

.sn-quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sn-quest-title { font-size: 0.72rem; font-weight: 800; color: var(--text2); }

.sn-quest-reward {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--mint, #00f5d4);
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.25);
}

.sn-quest-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.sn-quest-chip {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.2s, transform 0.2s;
}

.sn-quest-chip.done {
  border-color: rgba(0, 245, 212, 0.45);
  background: rgba(0, 245, 212, 0.08);
  color: var(--mint, #00f5d4);
}

.sn-quest-chip:hover:not(.done) {
  border-color: rgba(192, 132, 252, 0.4);
  transform: translateY(-1px);
}

.sn-quest-status { font-size: 0.68rem; color: #666; margin: 0; line-height: 1.45; }

.sn-session-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}

.sn-session-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  white-space: nowrap;
}

.sn-session-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  overflow: hidden;
}

.sn-session-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #c084fc, var(--sakura, #ff6584));
  transition: width 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.sn-session-msg {
  font-size: 0.68rem;
  font-weight: 700;
  color: #888;
  max-width: 200px;
  text-align: right;
}

.sn-shell {
  border-radius: 24px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg2) 75%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  margin-bottom: 40px;
}

.sn-dock {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg3);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}

.sn-dock-glider {
  position: absolute;
  top: 10px;
  left: 12px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.28), rgba(255, 101, 132, 0.15));
  border: 1px solid rgba(192, 132, 252, 0.32);
  box-shadow: 0 8px 24px rgba(192, 132, 252, 0.18);
  transition: transform 0.38s cubic-bezier(0.34, 1.35, 0.64, 1), width 0.38s;
  pointer-events: none;
  z-index: 0;
}

.sn-dock-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border: none;
  border-radius: 14px;
  background: transparent !important;
  color: #888 !important;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: color 0.25s;
}

.sn-dock-tab:hover { color: var(--text2) !important; }
.sn-dock-tab.active { color: var(--text) !important; }

.sn-dock-icon { font-size: 1.1rem; line-height: 1; }
.sn-dock-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sn-panel {
  display: none;
  padding: 28px 24px 32px;
  animation: snPanelIn 0.35s ease;
}

.sn-panel.active { display: block; }

@keyframes snPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sn-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #777;
  padding: 5px 12px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 7%, transparent);
}

.sn-pill strong { color: var(--purple); font-weight: 800; }
.sn-pill--streak {
  color: var(--gold);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}
.sn-pill--streak[hidden] { display: none !important; }

/* Reader */
.sn-reader {
  max-width: 640px;
  margin: 0 auto;
}

.sn-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sn-progress-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 18px;
  max-width: 100%;
}

.sn-prog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.sn-prog-dot:hover { background: rgba(192, 132, 252, 0.4); transform: scale(1.15); }
.sn-prog-dot.current { background: #c084fc; transform: scale(1.25); box-shadow: 0 0 8px rgba(192, 132, 252, 0.5); }
.sn-prog-dot.done { background: var(--mint, #00f5d4); }

.sn-card-wrap {
  position: relative;
  margin-bottom: 20px;
}

.sn-card {
  position: relative;
  padding: 36px 28px 32px;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(160deg, var(--bg2), var(--bg2));
  border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: border-color 0.35s, box-shadow 0.35s;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sn-card.revealed {
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(192, 132, 252, 0.12);
}

.sn-audio-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: var(--bg3);
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s, background 0.2s;
}

.sn-audio-btn:hover {
  transform: scale(1.08);
  background: rgba(192, 132, 252, 0.2);
  border-color: rgba(192, 132, 252, 0.4);
}

.sn-tap-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  pointer-events: none;
}

.sn-card.revealed .sn-tap-hint { opacity: 0; }

.sn-jp {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 0;
  transition: margin 0.3s;
}

.sn-card.revealed .sn-jp { margin-bottom: 14px; }

.sn-rom {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 700;
  color: #c9a45c;
  font-style: italic;
  letter-spacing: 0.02em;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin 0.35s;
}

.sn-card.revealed .sn-rom {
  max-height: 80px;
  opacity: 1;
  margin-bottom: 10px;
}

.sn-en {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text2);
  font-style: italic;
  line-height: 1.45;
  transition: max-height 0.35s ease, opacity 0.35s ease;
}

.sn-card.revealed .sn-en {
  max-height: 120px;
  opacity: 1;
}

.sn-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sn-nav-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all 0.2s;
}

.sn-nav-btn:hover {
  border-color: rgba(192, 132, 252, 0.4);
  color: var(--text);
}

.sn-reveal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #9333ea, var(--sakura, #ff6584));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.35);
}

.sn-reveal-btn:hover { transform: translateY(-2px); }

.sn-keys-hint {
  text-align: center;
  font-size: 0.62rem;
  color: #555;
  margin-top: 12px;
}

.sn-keys-hint kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 0.58rem;
}

/* Match */
.sn-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.sn-match-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  margin: 0;
}

.sn-match-sub { font-size: 0.75rem; color: #666; margin: 4px 0 0; }

.sn-match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.sn-match-col { display: flex; flex-direction: column; gap: 8px; }

.sn-match-item {
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 2px solid color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text, #ddd);
  transition: all 0.22s;
  text-align: left;
  user-select: none;
  line-height: 1.4;
}

.sn-match-item:hover:not(.matched) {
  border-color: rgba(192, 132, 252, 0.35);
  transform: translateY(-2px);
}

.sn-match-item.selected {
  border-color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
}

.sn-match-item.matched {
  border-color: rgba(0, 245, 212, 0.55);
  background: rgba(0, 245, 212, 0.08);
  color: var(--mint, #00f5d4);
  cursor: default;
}

.sn-match-item.wrong-match {
  border-color: #ff6584;
  background: rgba(255, 101, 132, 0.1);
  animation: snShake 0.4s ease;
}

@keyframes snShake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.sn-match-jp {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.45;
  display: block;
}

.sn-match-rom {
  display: block;
  font-size: 0.65rem;
  color: #8a7f6d;
  font-style: italic;
  margin-top: 4px;
}

.sn-match-result {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 28px;
  margin-top: 16px;
}

.sn-match-actions { text-align: center; margin-top: 14px; }

/* Quiz */
.sn-quiz-arena {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 24px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  text-align: center;
}

.sn-quiz-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 14px;
}

.sn-quiz-jp {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 20px;
}

.sn-quiz-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.sn-quiz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

.sn-quiz-dot.done { background: var(--mint, #00f5d4); }
.sn-quiz-dot.current { background: #c084fc; transform: scale(1.2); }
.sn-quiz-dot.miss { background: #ff6584; }

.sn-quiz-opts { display: grid; gap: 10px; text-align: left; }

.sn-quiz-opt {
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--bg3);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  line-height: 1.4;
  transition: all 0.2s;
}

.sn-quiz-opt:hover:not(:disabled) {
  border-color: rgba(192, 132, 252, 0.4);
  transform: translateY(-1px);
}

.sn-quiz-opt.correct {
  border-color: var(--mint, #00f5d4);
  background: rgba(0, 245, 212, 0.1);
  color: var(--mint, #00f5d4);
}

.sn-quiz-opt.wrong {
  border-color: #ff6584;
  background: rgba(255, 101, 132, 0.1);
  color: #ff8a94;
}

.sn-quiz-opt:disabled { cursor: default; opacity: 0.9; }

.sn-quiz-done {
  display: none;
  text-align: center;
  padding: 20px 10px;
}

.sn-quiz-done.show { display: block; }

.sn-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.sn-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 720px) {
  .sn-dash { grid-template-columns: 1fr; }
  .sn-session-msg { display: none; }
  .sn-panel { padding: 20px 14px 24px; }
  .sn-match-grid { grid-template-columns: 1fr; }
  .sn-card { padding: 32px 18px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .sn-hero-floats span, .sn-panel, .sn-match-item.wrong-match { animation: none; }
  .sn-dock-glider { transition: none; }
}
.sn-keys-actions {
  text-align: center;
  margin: 6px 0 0;
}
