/* ============================================================
   COOL ENGLISH ÃƒÂ¢ --  Super Bowl LX ESL Activity v4
   PROJECTION-FIRST: All text readable from back of classroom
   Text scale slider: 100%ÃƒÂ¢-160% via --ts custom property
   ============================================================ */

:root {
  --ce-navy: #1B3A5C;
  --ce-teal: #3CB4A0;
  --navy: #0A1628;
  --navy-light: #12243D;
  --navy-mid: #1B3455;
  --gold: #FFB800;
  --gold-light: #FFD54F;
  --gold-dark: #CC9300;
  --red: #FF3B4A;
  --green: #00C853;
  --blue: #2979FF;
  --purple: #AA47FF;
  --orange: #FF8F00;
  --white: #FFFFFF;
  --beginner: #00C853;
  --intermediate: #FF8F00;
  --advanced: #AA47FF;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Text scale ÃƒÂ¢ --  controlled by slider, default 1.6 for projection */
  --ts: 1.6;

  /* Gold gradient  --  reused across text and backgrounds */
  --gold-grad: linear-gradient(180deg, #e8dfc4 0%, #d4c598 40%, #b0a072 100%);
  --gold-grad-warm: linear-gradient(145deg, #e8dfc4 0%, #d4c598 40%, #b0a072 100%);
  --gold-mid: #d4c598;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
img { display: block; max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   HOME SCREEN
   ============================================================ */
.home {
  height: 100vh; width: 100vw;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

/* Animated background */
.home::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(60,180,160,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(255,184,0,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 30%, rgba(41,121,255,0.06) 0%, transparent 40%),
    linear-gradient(180deg, #0A1628 0%, #0E1D34 50%, #142848 100%);
  z-index: 0;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(15deg); }
}

/* Floating field lines */
.home::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: repeating-linear-gradient(90deg, transparent, transparent calc(12.5% - 1px), rgba(255,255,255,0.02) calc(12.5% - 1px), rgba(255,255,255,0.02) 12.5%);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 100%);
  z-index: 0; pointer-events: none;
}

/* ============================================================
   HOME  --  HERO (title + subtitle + buttons)
   ============================================================ */
.home-hero {
  position: relative; z-index: 2;
  text-align: center;
  padding: 0.5rem 2rem 0.25rem;
  flex-shrink: 0;
}

.home-hero__corner {
  position: absolute;
  top: 0.5rem; right: 2rem;
  display: flex; align-items: center; gap: 0.5rem;
  z-index: 5;
}

.home-hero__title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  letter-spacing: 3px; line-height: 1;
  color: var(--white);
}

.home-hero__title span {
  background: linear-gradient(180deg, #e8dfc4 0%, #d4c598 40%, #b0a072 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.home-hero__sub {
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  color: rgba(255,255,255,0.5);
  font-weight: 500; letter-spacing: 1.5px;
}

.btn-reset-sm {
  width: 38px; height: 38px;
  display: none; /* hidden until progress exists */
  align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.3);
  transition: all 250ms var(--ease-out);
}

.btn-reset-sm:hover {
  background: rgba(255,59,74,0.1);
  border-color: rgba(255,59,74,0.3);
  color: var(--red);
}

.btn-reset-sm svg { width: 18px; height: 18px; }

.btn-how {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.6rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-size: 1.15rem; font-weight: 600;
  transition: all 250ms var(--ease-out);
}

.btn-how:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
}

.btn-how svg { width: 22px; height: 22px; }

.btn-pdf {
  text-decoration: none;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   CARD GRID
   ============================================================ */
.home-grid {
  position: relative; z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.9rem;
  padding: 0.3rem 2rem 0.3rem;
  min-height: 0;
  max-height: calc(100vh - 170px);
}

/* ============ CARD ============ */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all 300ms var(--ease-out);
  background: var(--navy-light);
  text-align: left;
}

.card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.card:active { transform: scale(0.97); }

/* --- Background image fills entire card --- */
.card__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  transition: transform 500ms var(--ease-out);
}

.card:hover .card__bg { transform: scale(1.05); }

/* Shimmer on hover */
.card__shimmer {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 45%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 55%, transparent 60%);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity 300ms;
}

.card:hover .card__shimmer {
  opacity: 1;
  animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* Gradient overlay  --  stronger at bottom for frosted glass readability */
.card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.5) 100%);
  z-index: 2;
}

/* Brand tag  --  top-left, LARGE for readability */
.card__brand-tag {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  z-index: 5;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  letter-spacing: 2px;
  color: var(--white);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  line-height: 1.35;
}

/* Per-card gradient fallbacks */
.card--budweiser .card__bg { background-image: linear-gradient(145deg, #9B2226 0%, #CA3C3F 50%, #E07A5F 100%); }
.card--lays .card__bg { background-image: linear-gradient(145deg, #C77D00 0%, #E6A817 50%, #FFD54F 100%); }
.card--ring .card__bg { background-image: linear-gradient(145deg, #1A94C4 0%, #1FB8E0 50%, #48D1EC 100%); }
.card--redfin .card__bg { background-image: linear-gradient(145deg, #B71C1C 0%, #E53935 50%, #FF8A80 100%); }
.card--pepsi .card__bg { background-image: linear-gradient(145deg, #0D47A1 0%, #1E88E5 50%, #64B5F6 100%); }
.card--michelob .card__bg { background-image: linear-gradient(145deg, #1A237E 0%, #3949AB 50%, #7986CB 100%); }
.card--google .card__bg { background-image: linear-gradient(145deg, #1B5E20 0%, #43A047 50%, #81C784 100%); }
.card--alexa .card__bg { background-image: linear-gradient(145deg, #006064 0%, #00ACC1 50%, #4DD0E1 100%); }

/* --- Frosted glass metadata overlay  --  title left, badges right --- */
.card__meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 4;
  padding: 0.6rem 0.85rem;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
}

.card__title {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 800;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
  flex: 1; min-width: 0;
  text-align: left;
}

.card__badges {
  display: flex; align-items: center; gap: 0.5rem;
  flex-shrink: 0;
}

.card__dur {
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-weight: 700;
  color: rgba(255,255,255,0.55);
}

.card__diff-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.card__diff-dot--b { background: var(--beginner); }
.card__diff-dot--i { background: var(--intermediate); }
.card__diff-dot--a { background: var(--advanced); }

.card__diff-label {
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-weight: 800;
  display: flex; align-items: center; gap: 0.3rem;
}

.card__diff-label--b { color: var(--beginner); }
.card__diff-label--i { color: var(--intermediate); }
.card__diff-label--a { color: var(--advanced); }

/* Staggered entrance */
@keyframes cardFloat {
  from { opacity: 0; transform: translateY(30px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card { animation: cardFloat 500ms var(--ease-bounce) both; }
.card:nth-child(1) { animation-delay: 50ms; }
.card:nth-child(2) { animation-delay: 100ms; }
.card:nth-child(3) { animation-delay: 150ms; }
.card:nth-child(4) { animation-delay: 200ms; }
.card:nth-child(5) { animation-delay: 250ms; }
.card:nth-child(6) { animation-delay: 300ms; }
.card:nth-child(7) { animation-delay: 350ms; }
.card:nth-child(8) { animation-delay: 400ms; }

/* Completion badge */
.card__done {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  z-index: 6;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--gold-grad-warm);
  color: var(--navy);
  box-shadow: 0 2px 12px rgba(212,197,152,0.5);
  animation: badgePop 400ms var(--ease-bounce);
}

.card__done svg { width: 20px; height: 20px; }

@keyframes badgePop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   VIDEO PAGE
   ============================================================ */
.vpage {
  height: 100vh; width: 100vw;
  display: none; flex-direction: column;
  background: var(--navy); overflow: hidden;
}
.vpage.active { display: flex; }
.home.hidden { display: none; }

/* --- Top Bar --- */
.vtop {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  flex-shrink: 0; z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.btn-back {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
  font-size: calc(1rem * var(--ts)); font-weight: 700;
  transition: all 200ms;
}

.btn-back:hover {
  background: rgba(60,180,160,0.2);
  border-color: var(--ce-teal);
  color: var(--ce-teal);
}

.btn-back svg { width: 20px; height: 20px; }

.vtop__brand {
  font-family: var(--font-display);
  font-size: calc(1.6rem * var(--ts));
  letter-spacing: 2px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.vtop__title {
  font-size: calc(1.1rem * var(--ts));
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.vtop__right {
  margin-left: auto;
  display: flex; align-items: center; gap: 1rem;
}

/* TEXT SIZE SLIDER */
.size-ctrl {
  display: flex; align-items: center; gap: 0.4rem;
}

.size-ctrl__label {
  font-size: 0.65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
}

.size-ctrl__icon {
  width: 16px; height: 16px;
  color: rgba(255,255,255,0.4);
}

.size-ctrl__icon--lg { width: 22px; height: 22px; }

.size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  outline: none;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold-mid);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(212,197,152,0.4);
}

.size-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold-mid);
  cursor: pointer;
  border: none;
}

.vtop__diff {
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
}

.vtop__diff--beginner { background: rgba(0,200,83,0.2); color: var(--beginner); border: 1px solid rgba(0,200,83,0.3); }
.vtop__diff--intermediate { background: rgba(255,143,0,0.2); color: var(--intermediate); border: 1px solid rgba(255,143,0,0.3); }
.vtop__diff--advanced { background: rgba(170,71,255,0.2); color: var(--advanced); border: 1px solid rgba(170,71,255,0.3); }

/* --- Split Layout --- */
.vsplit {
  flex: 1; display: flex;
  min-height: 0; overflow: hidden;
}

.v-left {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  min-width: 0;
}

.v-player {
  width: 100%; max-height: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
}

.v-player video {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}

.v-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.6rem; color: rgba(255,255,255,0.3);
}

/* Subtitle toggle ÃƒÂ¢ --  on video, bottom-right, prominent */
.sub-btn {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 5;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.85);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  backdrop-filter: blur(6px);
}

.sub-btn:hover {
  background: rgba(212,197,152,0.2);
  border-color: var(--gold-mid);
  color: var(--gold-mid);
}

.sub-btn.active {
  background: var(--gold-grad-warm);
  border-color: var(--gold-mid);
  color: var(--navy);
  box-shadow: 0 0 16px rgba(212,197,152,0.4);
}

/* Style the native subtitle cues ÃƒÂ¢ --  LARGE for classroom projection */
video::cue {
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.4;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.v-fallback svg { width: 52px; height: 52px; opacity: 0.3; }
.v-fallback__label { font-size: 1.1rem; font-weight: 700; }
.v-fallback__file {
  font-family: monospace; font-size: 1rem;
  padding: 0.3rem 0.8rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06); color: var(--gold-light);
}

/* --- SIDE PANEL --- */
.v-panel {
  width: 40%; min-width: 380px; max-width: 560px;
  display: flex; flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}

/* Tabs */
.v-tabs {
  display: flex; flex-shrink: 0;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  position: relative;
}

.v-tab {
  flex: 1;
  padding: 0.65rem 0.25rem;
  text-align: center;
  font-size: calc(0.75rem * var(--ts));
  font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.25);
  border-bottom: 3px solid transparent;
  transition: all 200ms var(--ease-out);
  margin-bottom: -2px;
  position: relative;
}

.v-tab:hover { color: rgba(255,255,255,0.5); }

.v-tab.active {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom-color: var(--gold-mid);
}

/* Active tab glow */
.v-tab.active::after {
  content: '';
  position: absolute; bottom: -3px; left: 20%; right: 20%;
  height: 3px;
  background: var(--gold-mid);
  filter: blur(6px);
}

/* Scroll area */
.v-scroll {
  flex: 1; overflow-y: auto;
  padding: 0.75rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.v-scroll::-webkit-scrollbar { width: 5px; }
.v-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.panel { display: none; }
.panel.active { display: block; animation: pFade 250ms var(--ease-out); }
@keyframes pFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   VOCABULARY ÃƒÂ¢ --  Click to expand (INDEPENDENT TOGGLE)
   ============================================================ */
.vocab-item {
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.06);
  transition: all 200ms;
}

.vocab-item:hover { border-color: rgba(212,197,152,0.3); }
.vocab-item.open { border-color: rgba(212,197,152,0.45); background: rgba(212,197,152,0.04); }

.vocab-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 150ms;
  width: 100%; text-align: left;
  color: var(--white);
  gap: 0.5rem;
}

.vocab-head:hover { background: rgba(255,255,255,0.06); }

.vocab-head__left {
  display: flex; align-items: center; gap: 0.6rem;
  flex-wrap: wrap;
}

.vocab-word {
  font-family: var(--font-display);
  font-size: calc(1.65rem * var(--ts));
  letter-spacing: 1.5px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.vocab-type {
  font-size: calc(0.55rem * var(--ts));
  font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Color-coded word types */
.vocab-type--noun { color: #4FC3F7; background: rgba(79,195,247,0.12); }
.vocab-type--verb { color: var(--beginner); background: rgba(0,200,83,0.12); }
.vocab-type--adj { color: var(--gold); background: rgba(255,184,0,0.12); }
.vocab-type--adv { color: var(--intermediate); background: rgba(255,143,0,0.12); }
.vocab-type--phrasal { color: var(--advanced); background: rgba(170,71,255,0.12); }
.vocab-type--default { color: var(--ce-teal); background: rgba(60,180,160,0.12); }

.vocab-chevron {
  width: 22px; height: 22px;
  color: rgba(255,255,255,0.25);
  transition: transform 250ms var(--ease-out);
  flex-shrink: 0;
}

.vocab-item.open .vocab-chevron {
  transform: rotate(180deg);
  color: var(--gold-mid);
}

.vocab-body {
  max-height: 0; overflow: hidden;
  transition: max-height 300ms var(--ease-out);
  background: rgba(0,0,0,0.12);
}

.vocab-body__inner { padding: 0.6rem 0.85rem 0.8rem; }

.vocab-def {
  font-size: calc(1.1rem * var(--ts));
  color: rgba(255,255,255,0.9);
  line-height: 1.5; font-weight: 700;
  margin-bottom: 0.35rem;
}

.vocab-ex {
  font-size: calc(0.9rem * var(--ts));
  color: rgba(255,255,255,0.45);
  font-style: italic; line-height: 1.5;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(212,197,152,0.35);
}

/* ============================================================
   SUMMARY
   ============================================================ */
.sum-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.65rem;
}

.sum-label {
  font-family: var(--font-display);
  font-size: calc(1.4rem * var(--ts));
  letter-spacing: 1px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.sum-actions {
  display: flex; gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
}

.sum-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: calc(0.9rem * var(--ts));
  font-weight: 800;
  transition: all 200ms;
  flex-shrink: 0;
}

.sum-btn--show {
  background: var(--gold-grad-warm);
  color: var(--navy);
}

.sum-btn--show:hover { filter: brightness(0.9); }

/* --- TTS Player Controls --- */
.tts-player {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.tts-btn {
  display: flex; align-items: center; justify-content: center;
  width: calc(36px * var(--ts));
  height: calc(36px * var(--ts));
  border-radius: var(--radius-full);
  transition: all 200ms var(--ease-out);
  flex-shrink: 0;
}

.tts-btn svg { width: calc(18px * var(--ts)); height: calc(18px * var(--ts)); }

.tts-btn--play {
  background: rgba(60,180,160,0.15);
  border: 1.5px solid rgba(60,180,160,0.3);
  color: var(--ce-teal);
}

.tts-btn--play:hover {
  background: rgba(60,180,160,0.25);
  border-color: var(--ce-teal);
  transform: scale(1.05);
}

.tts-btn--play.tts-btn--playing {
  background: rgba(60,180,160,0.25);
  border-color: var(--ce-teal);
  animation: ttsGlow 2s ease-in-out infinite;
}

@keyframes ttsGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(60,180,160,0); }
  50% { box-shadow: 0 0 12px 2px rgba(60,180,160,0.25); }
}

.tts-btn--stop {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
}

.tts-btn--stop:hover {
  background: rgba(255,59,74,0.15);
  border-color: rgba(255,59,74,0.3);
  color: var(--red);
}

.tts-btn--stop svg { width: calc(14px * var(--ts)); height: calc(14px * var(--ts)); }

/* Speed control */
.tts-speed {
  position: relative;
}

.tts-speed-btn {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: calc(0.75rem * var(--ts));
  font-weight: 800;
  transition: all 200ms;
  white-space: nowrap;
}

.tts-speed-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

.tts-speed-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  pointer-events: none;
  transition: all 200ms var(--ease-out);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 20;
}

.tts-speed-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) scale(1);
}

.tts-speed-opt {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: calc(0.7rem * var(--ts));
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  text-align: left;
  transition: all 150ms;
}

.tts-speed-opt:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

.tts-speed-opt.active {
  background: rgba(60,180,160,0.15);
  color: var(--ce-teal);
}

/* TTS progress indicator */
.tts-progress {
  font-size: calc(0.65rem * var(--ts));
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  min-width: 2em;
  letter-spacing: 0.5px;
}

/* --- Sentence Highlighting --- */
.sum-sentence {
  transition: background 300ms var(--ease-out), color 300ms var(--ease-out);
  border-radius: 3px;
  padding: 1px 3px;
  margin: 0 -1px;
}

.sum-sentence.speaking {
  background: rgba(60,180,160,0.15);
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(60,180,160,0.2);
}

.sum-btn svg { width: 18px; height: 18px; }

.sum-text {
  font-size: calc(1.25rem * var(--ts));
  color: rgba(255,255,255,0.85);
  line-height: 1.75; font-weight: 500;
  overflow: hidden;
  transition: max-height 400ms var(--ease-out);
}

.sum-text.collapsed { max-height: 0; }

/* Cultural Context ÃƒÂ¢ --  BIG */
.ctx-box {
  background: linear-gradient(135deg, rgba(60,180,160,0.08), rgba(212,197,152,0.06));
  border: 1.5px solid rgba(60,180,160,0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.65rem;
}

.ctx-title {
  font-family: var(--font-display);
  font-size: calc(1.2rem * var(--ts));
  letter-spacing: 1.5px;
  color: var(--ce-teal);
  margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.4rem;
}

.ctx-title svg { width: 18px; height: 18px; }

.ctx-text {
  font-size: calc(1.15rem * var(--ts));
  color: rgba(255,255,255,0.7);
  line-height: 1.65; font-weight: 500;
}

/* ============================================================
   RETELLING ÃƒÂ¢ --  BIG
   ============================================================ */
.ret-item {
  display: flex; gap: 0.65rem; align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  transition: border-color 200ms;
}

.ret-item:hover { border-color: rgba(212,197,152,0.3); }

.ret-num {
  width: calc(32px * var(--ts));
  height: calc(32px * var(--ts));
  min-width: calc(32px * var(--ts));
  border-radius: var(--radius-full);
  background: var(--gold-grad-warm);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: calc(1.1rem * var(--ts));
  display: flex; align-items: center; justify-content: center;
}

.ret-text {
  font-size: calc(1.35rem * var(--ts));
  color: rgba(255,255,255,0.9);
  line-height: 1.6; font-weight: 600;
}

.ret-text .blank {
  display: inline-block;
  min-width: calc(90px * var(--ts));
  border-bottom: 3px dashed var(--gold-mid);
  margin: 0 4px;
  cursor: pointer;
  color: transparent;
  position: relative;
  transition: all 300ms var(--ease-out);
  user-select: none;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(212,197,152,0.06);
}

.ret-text .blank::after {
  content: 'tap to reveal';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: calc(0.75rem * var(--ts));
  font-weight: 800;
  font-style: italic;
  color: rgba(212,197,152,0.5);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 250ms;
  letter-spacing: 0.5px;
}

.ret-text .blank:hover {
  background: rgba(212,197,152,0.12);
  border-bottom-color: var(--gold);
}

.ret-text .blank.revealed {
  color: var(--gold);
  border-bottom-style: solid;
  border-bottom-color: rgba(212,197,152,0.25);
  background: rgba(212,197,152,0.1);
  font-weight: 800;
  animation: revealPop 350ms var(--ease-bounce);
}

.ret-text .blank.revealed::after { opacity: 0; }

@keyframes revealPop {
  0% { transform: scale(0.85); opacity: 0.5; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   DISCUSSION ÃƒÂ¢ --  BIG
   ============================================================ */
.disc-item {
  background: rgba(255,255,255,0.03);
  border-left: 4px solid var(--gold-mid);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.55rem;
  transition: background 200ms;
}

.disc-item:hover { background: rgba(255,255,255,0.05); }

.disc-q {
  font-size: calc(1.3rem * var(--ts));
  font-weight: 700; color: var(--white);
  line-height: 1.5; margin-bottom: 0.25rem;
}

.disc-hint {
  font-size: calc(1rem * var(--ts));
  color: rgba(255,255,255,0.55);
  font-style: italic; line-height: 1.45;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(10,22,40,0.9);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 250ms;
}

.modal-bg.active { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  max-width: 780px; width: 92%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 80px rgba(0,0,0,0.6);
  transform: scale(0.92) translateY(20px);
  transition: transform 300ms var(--ease-bounce);
}

.modal-bg.active .modal-box { transform: scale(1) translateY(0); }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-head__t {
  font-family: var(--font-display);
  font-size: 2.8rem; letter-spacing: 3px;
  background: linear-gradient(180deg, #e8dfc4 0%, #d4c598 40%, #b0a072 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-x {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
  transition: all 200ms;
}

.modal-x:hover { background: var(--red); color: var(--white); transform: rotate(90deg); }
.modal-x svg { width: 20px; height: 20px; }

.modal-body { padding: 1.75rem 2rem 2rem; }

.m-step {
  display: flex; gap: 1.1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.m-step:last-child { margin-bottom: 0; }

.m-step__n {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, #e8dfc4 0%, #d4c598 40%, #b0a072 100%);
  color: var(--navy);
  font-family: var(--font-display); font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
}

.m-step h3 {
  font-family: var(--font-display);
  font-size: 1.6rem; letter-spacing: 1.5px;
  color: var(--white); margin-bottom: 0.2rem;
}

.m-step p {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6; font-weight: 500;
}

/* ============================================================
   FOOTER COPYRIGHT
   ============================================================ */
.home-footer {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 0.35rem 2rem;
  flex-shrink: 0;
}

.home-footer__text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
}

.home-footer__text a {
  color: rgba(255,255,255,0.25);
  text-decoration: none;
  transition: color 200ms;
}

.home-footer__text a:hover {
  color: var(--ce-teal);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .v-panel { min-width: 300px; }
  .size-ctrl { display: none; }
}

@media (max-width: 768px) {
  body { overflow-y: auto; }
  .home { height: auto; min-height: 100vh; }

  /* Hero  --  compact, subtitle + buttons on one line */
  .home-hero { padding: 0.35rem 0.75rem 0.1rem; }
  .home-hero__title { font-size: clamp(1.6rem, 7.5vw, 2.4rem); letter-spacing: 2px; white-space: nowrap; }
  .home-hero__row { gap: 0.4rem; margin-top: 0.05rem; }
  .home-hero__sub { font-size: 0.65rem; letter-spacing: 0.5px; white-space: nowrap; }
  .home-hero__corner { top: 0.35rem; right: 0.75rem; gap: 0.35rem; }
  .btn-how { padding: 0.2rem; border-radius: var(--radius-full); width: 28px; height: 28px;
    justify-content: center; background: none; border: 1px solid rgba(255,255,255,0.15); }
  .btn-how__text { display: none; }
  .btn-how svg { width: 16px; height: 16px; }
  .btn-reset-sm { width: 28px; height: 28px; }
  .btn-reset-sm svg { width: 14px; height: 14px; }
  .card__done { width: 28px; height: 28px; top: 0.35rem; right: 0.35rem; }
  .card__done svg { width: 16px; height: 16px; }

  /* Card grid */
  .home-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; padding: 0.4rem 0.75rem; max-height: none; gap: 0.6rem; }
  .card__brand-tag { font-size: 0.65rem; padding: 0.15rem 0.45rem; }

  /* Card meta  --  title gets priority, hide difficulty text */
  .card__meta { padding: 0.4rem 0.6rem; }
  .card__title { font-size: 0.95rem; }
  .card__dur { font-size: 0.75rem; }
  .card__diff-label span:not(.card__diff-dot) { display: none; }
  .card__diff-label { font-size: 0; gap: 0; }
  .card__diff-dot { width: 8px; height: 8px; }
  .card__badges { gap: 0.35rem; }

  /* Video page top bar */
  .vsplit { flex-direction: column; overflow-y: auto; }
  .v-left { flex: none; padding: 0.5rem; }
  .v-panel { width: 100%; max-width: 100%; min-width: 0; border-left: none; }
  .vtop { gap: 0.6rem; padding: 0.35rem 0.6rem; }
  .btn-back { font-size: 0.85rem; padding: 0.25rem 0.5rem; gap: 0.15rem; }
  .btn-back svg { width: 16px; height: 16px; }
  .vtop__brand { font-size: 1.3rem; letter-spacing: 1px; }
  .vtop__title { font-size: 0.85rem; }
  .vtop__diff { font-size: 0.6rem; padding: 0.15rem 0.5rem; }
  .vtop__right { gap: 0.5rem; }

  /* CC button  --  compact on mobile */
  .sub-btn { font-size: 0.7rem; padding: 0.25rem 0.55rem; top: 6px; right: 6px; }
  .sub-btn__text { display: none; }

  /* Footer */
  .home-footer { padding: 0.3rem 0.75rem; }
  .home-footer__text { font-size: 0.6rem; }

  /* Subtitles  --  smaller on mobile */
  video::cue { font-size: 1.1rem; font-weight: 700; }

  /* TTS player  --  compact on mobile */
  .tts-btn { width: 32px; height: 32px; }
  .tts-btn svg { width: 16px; height: 16px; }
  .tts-btn--stop svg { width: 12px; height: 12px; }
  .tts-speed-btn { font-size: 0.7rem; padding: 0.15rem 0.35rem; }
  .tts-progress { font-size: 0.6rem; }
}