/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: #0c0c12;
  color: #eeeef2;
  min-height: 100vh;
  line-height: 1.5;
}
a { color: #f47521; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

:root {
  --bg: #0c0c12; --bg2: #14141e; --card: #1a1a28; --input: #22222f;
  --accent: #f47521; --accent2: #ff9a52; --accent-bg: rgba(244,117,33,.12);
  --text: #eeeef2; --text2: #9999ad; --text3: #55556a;
  --green: #34d399; --red: #f87171; --yellow: #fbbf24;
  --border: rgba(255,255,255,.07); --radius: 12px;
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 20px 60px; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== NAV ===== */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.nav-brand { font-size: 1.1rem; font-weight: 800; color: var(--text); text-decoration: none; }
.nav-brand span { color: var(--accent); }
/* Logo: Sub(orange) To(white) Raw(orange) */
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: var(--text2); font-size: .85rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--accent); }
.nav-login {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .82rem !important;
  transition: all .15s;
}
.nav-login:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
.nav-cta {
  padding: 8px 18px; background: var(--accent); color: #fff !important;
  border-radius: 6px; font-size: .82rem; font-weight: 700; transition: all .15s; text-decoration: none;
}
.nav-cta:hover { background: var(--accent2); }
.nav-cta-short { display: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; font-size: 1rem; font-weight: 700;
  border: none; border-radius: var(--radius); transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-secondary:hover { background: var(--accent-bg); }
.btn-ghost { background: var(--input); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text2); color: var(--text); }
.btn-lg { padding: 18px 44px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ===== HERO ===== */
.hero { text-align: center; padding: 48px 20px 40px; margin-bottom: 40px; }
.hero-badge {
  display: inline-block; padding: 6px 18px;
  background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent);
  border-radius: 40px; font-size: .8rem; font-weight: 700; letter-spacing: .5px; margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem); font-weight: 900; line-height: 1.15;
  margin-bottom: 20px; letter-spacing: -.02em;
}
.hero h1 .accent { color: var(--accent); }
.hero p { font-size: 1.05rem; color: var(--text2); max-width: 520px; margin: 0 auto 36px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Lesson of the day card */
.lotd {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-width: 400px; margin: 0 auto 48px; cursor: pointer; transition: all .15s;
  text-decoration: none; color: inherit; display: block;
}
.lotd:hover { border-color: var(--accent); transform: translateY(-2px); }
.lotd img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.lotd-info { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.lotd-info h4 { font-size: .9rem; }
.lotd-info .badge { font-size: .68rem; }

/* ===== STEPS ===== */
.section-title { font-size: 1.3rem; font-weight: 800; text-align: center; margin-bottom: 28px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 56px; }
.step {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center;
}
.step-n {
  display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 800; border-radius: 50%; font-size: .85rem; margin-bottom: 12px;
}
.step h4 { font-size: .9rem; margin-bottom: 5px; }
.step p { font-size: .78rem; color: var(--text2); line-height: 1.55; }

.bottom-cta { text-align: center; padding: 48px 0; }
.bottom-cta p { color: var(--text2); max-width: 520px; margin: 0 auto 24px; line-height: 1.7; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; margin-bottom: 16px;
}
.page-header h2 { font-size: 1.1rem; font-weight: 700; }
.badge {
  padding: 5px 14px; background: var(--accent-bg); color: var(--accent);
  border-radius: 40px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}

/* ===== VIDEO ===== */
.video-wrap {
  position: relative; width: 100%; padding-bottom: 56.25%;
  background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 0;
}
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-controls {
  position: absolute; bottom: 0; right: 0; z-index: 10;
  display: flex; gap: 4px; padding: 8px;
}
.vid-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.6); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s; font-size: .9rem;
}
.vid-btn:hover { background: rgba(0,0,0,.85); }
.vid-btn svg { width: 18px; height: 18px; }

/* ===== COUNTDOWN ===== */
.countdown-overlay {
  position: relative; width: 100%; padding-bottom: 56.25%;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.countdown-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 20px;
}
.countdown-num {
  font-size: clamp(4rem, 15vw, 7rem); font-weight: 900; color: var(--accent);
  line-height: 1; animation: countPop .35s ease;
}
@keyframes countPop { from { transform: scale(1.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.countdown-text { font-size: .95rem; color: var(--text2); margin-top: 10px; max-width: 380px; line-height: 1.5; }
.countdown-label {
  font-size: .72rem; color: var(--text3); text-transform: uppercase;
  letter-spacing: 2px; font-weight: 700; margin-bottom: 6px;
}
.rules-list {
  text-align: left; max-width: 360px; margin: 0 auto;
}
.rules-list li {
  list-style: none; padding: 6px 0; font-size: .88rem; color: var(--text2);
}
.rules-list li strong { color: var(--text); }

/* ===== LIVE INPUT (during video) ===== */
.live-input-area {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px; margin-bottom: 20px;
  border-top: 2px solid var(--accent);
}
.live-label {
  font-size: .78rem; color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.live-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 12px;
}
.live-chip {
  padding: 5px 12px; background: var(--accent-bg); color: var(--accent);
  border-radius: 20px; font-size: .85rem; font-weight: 600;
  font-family: 'Noto Sans JP', sans-serif;
  animation: chipIn .2s ease;
}
@keyframes chipIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.live-input {
  width: 100%; padding: 12px 16px;
  background: var(--input); border: 2px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'Noto Sans JP', 'Inter', sans-serif;
  font-size: 1.1rem; outline: none; transition: border-color .15s;
}
.live-input:focus { border-color: var(--accent); }
.live-input::placeholder { color: var(--text3); }
.live-hint { font-size: .72rem; color: var(--text3); margin-top: 6px; }
.done-wrap { text-align: center; margin-top: 16px; }

/* ===== RESULTS ===== */
.results {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; margin-bottom: 24px;
}
.score { text-align: center; margin-bottom: 28px; }
.score-ring { width: 130px; height: 130px; margin: 0 auto 14px; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .bg { stroke: var(--border); }
.score-ring .fill { stroke: var(--accent); transition: stroke-dashoffset 1s ease; }
.score-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; font-weight: 900; }
.score-label { color: var(--text2); font-size: .9rem; }
.score-label strong { color: var(--text); }
.improvement {
  display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: .82rem; font-weight: 700; margin-top: 8px;
}
.improvement.up { background: rgba(52,211,153,.15); color: var(--green); }
.improvement.same { background: rgba(153,153,173,.15); color: var(--text2); }

.word-section { margin-top: 20px; }
.word-section h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; font-weight: 700; }
.word-section h4.hit { color: var(--green); }
.word-section h4.miss { color: var(--red); }
.word-section h4.unknown { color: var(--yellow); }
.word-row {
  display: flex; align-items: center; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--border); font-size: .92rem;
}
.word-row:last-child { border-bottom: none; }
.word-icon { font-weight: 700; width: 20px; text-align: center; flex-shrink: 0; }
.word-icon.hit { color: var(--green); }
.word-icon.miss { color: var(--red); }
.word-icon.unknown { color: var(--yellow); }
.word-jp { font-family: 'Noto Sans JP', sans-serif; font-weight: 700; font-size: 1.05rem; min-width: 60px; }
.word-rd { color: var(--text2); font-family: 'Noto Sans JP', sans-serif; min-width: 70px; }
.word-en { color: var(--text2); }
.word-speak {
  margin-left: auto; background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 1rem; padding: 2px 6px; transition: color .15s;
}
.word-speak:hover { color: var(--accent); }

/* ===== FLASHCARDS ===== */
.fc-intro { text-align: center; padding: 48px 20px; }
.fc-intro h2 { font-size: 1.4rem; margin-bottom: 12px; }
.fc-intro p { color: var(--text2); margin-bottom: 8px; line-height: 1.6; }
.fc-rules {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin: 24px auto; max-width: 420px; text-align: left;
}
.fc-rules li { list-style: none; padding: 6px 0; font-size: .88rem; color: var(--text2); }
.fc-rules li strong { color: var(--text); }
.fc-countdown { font-size: 3rem; font-weight: 900; color: var(--accent); margin: 20px 0; }

.fc-progress { text-align: center; color: var(--text3); font-size: .85rem; margin-bottom: 12px; }
.fc-timer-bar { width: 100%; height: 6px; background: var(--input); border-radius: 3px; margin-bottom: 20px; overflow: hidden; }
.fc-timer-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .1s linear; }
.fc-timer-fill.danger { background: var(--red); }

.fc-card {
  background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 48px 32px 36px; text-align: center; margin-bottom: 24px;
  min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: border-color .2s;
}
.fc-card.correct { border-color: var(--green); }
.fc-card.wrong { border-color: var(--red); }
.fc-word { font-family: 'Noto Sans JP', sans-serif; font-size: clamp(2.4rem, 8vw, 3.5rem); font-weight: 700; margin-bottom: 8px; }
.fc-reading { font-family: 'Noto Sans JP', sans-serif; font-size: 1.2rem; color: var(--text2); margin-bottom: 24px; }
.fc-input-wrap { width: 100%; max-width: 320px; }
.fc-input {
  width: 100%; padding: 14px 18px; background: var(--input); border: 2px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: inherit; font-size: 1.1rem;
  text-align: center; outline: none; transition: border-color .15s;
}
.fc-input:focus { border-color: var(--accent); }
.fc-input::placeholder { color: var(--text3); }
.fc-speak-btn {
  background: var(--accent-bg); border: 1px solid var(--accent); color: var(--accent);
  width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; margin-bottom: 20px;
}
.fc-speak-btn:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
.fc-hint { color: var(--text3); font-size: .78rem; margin-top: 10px; }
.fc-feedback { font-size: 1.1rem; font-weight: 700; margin-top: 16px; }
.fc-feedback.correct { color: var(--green); }
.fc-feedback.wrong { color: var(--red); }
.fc-answer-reveal { margin-top: 8px; font-size: .95rem; color: var(--text2); }
.fc-answer-reveal strong { color: var(--accent); }

/* ===== CHECKOUT ===== */
.checkout {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; max-width: 460px; margin: 32px auto;
}
.checkout h2 { text-align: center; margin-bottom: 8px; }
.checkout .price { text-align: center; font-size: 2.2rem; font-weight: 900; color: var(--accent); }
.checkout .price small { font-size: .9rem; color: var(--text3); font-weight: 400; }
.checkout .price-sub { text-align: center; color: var(--text3); font-size: .82rem; margin-bottom: 24px; }
.features { margin: 20px 0; padding: 18px; background: var(--input); border-radius: 8px; list-style: none; }
.features li { padding: 5px 0; font-size: .9rem; color: var(--text2); }
.features li::before { content: '\2713  '; color: var(--green); font-weight: 700; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .82rem; color: var(--text2); margin-bottom: 5px; font-weight: 600; }
.form-input {
  width: 100%; padding: 13px 16px; background: var(--input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: inherit; font-size: 1rem;
  outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== LIBRARY ===== */
.lib-header { text-align: center; padding: 36px 0 28px; }
.lib-header h1 { font-size: 1.8rem; margin-bottom: 6px; }
.lib-header p { color: var(--text2); }
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 40px;
}
.lib-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: all .15s; text-decoration: none; color: inherit; display: block;
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.lib-card.locked { opacity: .5; }
.lib-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--input);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-thumb .lock-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.lib-thumb .soon-tag {
  position: absolute; bottom: 6px; right: 6px;
  padding: 2px 8px; background: rgba(0,0,0,.7); color: var(--text2);
  border-radius: 4px; font-size: .65rem; font-weight: 600;
}
.lib-info { padding: 14px; }
.lib-info h4 { font-size: .88rem; margin-bottom: 3px; }
.lib-info p { color: var(--text2); font-size: .76rem; }
.lib-tag {
  display: inline-block; padding: 2px 8px; background: var(--accent-bg); color: var(--accent);
  border-radius: 4px; font-size: .66rem; font-weight: 700; margin-top: 6px;
}

/* ===== PROGRESS STATS ===== */
.stats-bar {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px;
}
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 24px; text-align: center; min-width: 100px;
}
.stat-num { font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.stat-label { font-size: .7rem; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ===== COMPLETE ===== */
.complete { text-align: center; padding: 48px 0; }
.complete h2 { font-size: 1.5rem; margin-bottom: 10px; }
.complete p { color: var(--text2); font-size: 1.05rem; margin-bottom: 24px; line-height: 1.6; }
.complete p strong { color: var(--accent); }
.complete-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }

/* Preview grid on complete page */
.preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin: 24px 0;
}
.preview-thumb {
  aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; position: relative;
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-thumb .blur { filter: brightness(.5); }

/* ===== MODAL ===== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: modalFade .2s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; max-width: 400px; width: 100%; text-align: center;
  animation: modalSlide .25s ease;
}
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin-bottom: 8px; font-size: 1.1rem; }
.modal p { color: var(--text2); font-size: .88rem; margin-bottom: 18px; }

/* ===== LOGIN ===== */
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; max-width: 400px; margin: 60px auto; text-align: center;
}
.login-card h2 { margin-bottom: 6px; }
.login-card p { color: var(--text2); font-size: .88rem; margin-bottom: 24px; }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
.footer { border-top: 1px solid var(--border); padding: 32px 0 20px; margin-top: 48px; text-align: center; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { color: var(--text3); font-size: .78rem; transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--text3); font-size: .7rem; }

/* ===== PRICING SECTION ===== */
.pricing { text-align: center; padding: 48px 0; }
.pricing-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.pricing-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 28px; width: 280px; text-align: center; transition: all .15s; position: relative;
}
.pricing-card.featured { border-color: var(--accent); }
.pricing-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 3px 14px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; letter-spacing: .5px;
}
.pricing-card h3 { font-size: 1rem; margin-bottom: 8px; }
.pricing-card .price { font-size: 2rem; font-weight: 900; color: var(--accent); margin-bottom: 4px; }
.pricing-card .price small { font-size: .85rem; color: var(--text3); font-weight: 400; }
.pricing-card .price-note { font-size: .78rem; color: var(--text3); margin-bottom: 18px; }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 20px; }
.pricing-card ul li { padding: 4px 0; font-size: .85rem; color: var(--text2); }
.pricing-card ul li::before { content: '\2713  '; color: var(--green); font-weight: 700; }

/* ===== EMAIL CAPTURE INLINE ===== */
.email-row {
  display: flex; gap: 8px; max-width: 400px; margin: 0 auto;
}
.email-row input { flex: 1; }
.email-row .btn { white-space: nowrap; }

/* Plan toggle on checkout */
.plan-btn { padding: 10px 20px; font-size: .85rem; }
.plan-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.center { text-align: center; }
.mt { margin-top: 24px; }
.mb { margin-bottom: 24px; }
.hidden { display: none !important; }

@media (max-width: 700px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hero { padding: 32px 12px 28px; }
  .hero h1 br { display: none; }
  .nav-cta-full { display: none; }
  .nav-cta-short { display: inline; }
  .lib-grid { grid-template-columns: 1fr 1fr; }
  .preview-grid { grid-template-columns: repeat(3, 1fr); }
  .checkout { padding: 24px 18px; }
  .form-row { grid-template-columns: 1fr; }
  .fc-word { font-size: 2.2rem; }
  .steps { gap: 8px; }
  .step { padding: 18px 12px; }
  .stats-bar { gap: 8px; }
  .stat { padding: 12px 16px; min-width: 80px; }
}
