/* ============================================================
 * style.css — Translator page (index.html)
 * Scene, mascot, buttons, nav and motion live in kids.css.
 * ============================================================ */

/* ---------- Self-hosted fonts ---------- */
@font-face {
  font-family: 'Noto Sans Brahmi Local';
  src: url('fonts/NotoSansBrahmi-Regular.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+11000-1107F;
}
/* Only the Vedic signs (ᳵ ᳶ) come from a local 4 KB subset; ordinary
 * Devanagari uses Google's Noto Serif Devanagari (woff2, split by range)
 * instead of the 757 KB TTF that used to download on every visit. */
@font-face {
  font-family: 'Noto Serif Devanagari Local';
  src: url('fonts/VedicSigns.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+1CD0-1CFF;
}

/* ---- Per-script font classes (applied dynamically by script.js) ---- */
.fs-brahmi { font-family: 'JinShashan Brahmi', 'Noto Sans Brahmi Local', 'Noto Sans Brahmi', 'Segoe UI Historic', serif; }
.fs-eng    { font-family: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.fs-deva   { font-family: 'Noto Serif Devanagari Local', 'Noto Serif Devanagari', serif; }
.fs-beng   { font-family: 'Noto Sans Bengali', serif; }
.fs-gujr   { font-family: 'Noto Sans Gujarati', serif; }
.fs-guru   { font-family: 'Noto Sans Gurmukhi', serif; }
.fs-orya   { font-family: 'Noto Sans Oriya', serif; }
.fs-taml   { font-family: 'Noto Sans Tamil', serif; }
.fs-telu   { font-family: 'Noto Sans Telugu', serif; }
.fs-knda   { font-family: 'Noto Sans Kannada', serif; }
.fs-mlym   { font-family: 'Noto Sans Malayalam', serif; }
.fs-sinh   { font-family: 'Noto Sans Sinhala', serif; }

/* ============ Hero: गजू says hello ============ */
.tr-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 16px 6px;
}
.say-hero .say-mascot { width: 190px; height: 178px; }
html.motion .hero-gaju { animation: kidDrop 1s var(--ease-bounce) both; }
.say-hero .say-bubble { padding: 16px 24px 18px; margin-bottom: 40px; }
.tr-hello { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--ink-soft); }
.tr-title {
  margin: 0;
  font-size: clamp(2rem, 5.6vw, 3.3rem);
  line-height: 1.15;
  font-weight: 800;
}
.tr-title .pop-word { display: inline-block; }
.tr-title .pop-word:nth-child(1) { color: var(--orange-d); }
.tr-title .pop-word:nth-child(2) { color: var(--pink-d); }
.tr-title .pop-word:nth-child(3) { color: var(--grape-d); }
html.motion .tr-title .pop-word { animation: kidDrop .8s var(--ease-bounce) both; }
html.motion .tr-title .pop-word:nth-child(1) { animation-delay: .45s; }
html.motion .tr-title .pop-word:nth-child(2) { animation-delay: .6s; }
html.motion .tr-title .pop-word:nth-child(3) { animation-delay: .75s; }
.tr-sub { margin: 4px 0 0; font-size: 1.15rem; font-weight: 600; color: var(--ink); }

/* ============ Main ============ */
.tr-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}
.box-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
}

/* ---- Picture word tiles ---- */
.try-box { --card-c: #FF9EBB; padding: 16px; margin-bottom: 20px; }
.try-chips {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}
.try-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  cursor: pointer;
  padding: 10px 4px 8px;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--c), 0 6px 0 var(--cd);
  font-family: var(--font-fun);
  transition: transform .2s var(--ease-bounce), box-shadow .2s ease, background .2s ease;
}
.try-chip:hover { transform: translateY(-5px) rotate(-3deg); background: #FFFBEA; box-shadow: inset 0 0 0 3px var(--c), 0 10px 0 var(--cd); }
.try-chip:nth-child(even):hover { transform: translateY(-5px) rotate(3deg); }
.try-chip:active { transform: translateY(5px); box-shadow: inset 0 0 0 3px var(--c), 0 1px 0 var(--cd); }
.tc-pic { font-size: 2.6rem; line-height: 1.15; }
.try-chip:hover .tc-pic { animation: kidWiggle .5s ease; }
.tc-word { font-weight: 800; font-size: 1rem; line-height: 1.2; text-align: center; }

/* 3D: with a mouse a chip turns over to show its word in Brahmi; a tap still types it */
.try-chip { position: relative; }
.tc-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: inherit;
  background: var(--c);
  color: #fff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35);
  opacity: 0;
  pointer-events: none;
}
.tc-back b { font-weight: 400; font-size: 1.45rem; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.tc-back small { font-size: .72rem; font-weight: 800; }
html.motion .try-chip {
  transform-style: preserve-3d;
  transform: perspective(700px) rotateY(0deg);
  transition: transform .6s var(--ease-bounce), box-shadow .2s ease, background .2s ease;
}
html.motion .tc-pic, html.motion .tc-word { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
html.motion .tc-back { opacity: 1; transform: rotateY(180deg) translateZ(1px); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
/* jain3d.js turns the chips over one after another (data-flip), on every screen */
html.motion .try-chip.j3-flip,
html.motion .try-chip.j3-flip:nth-child(even) { transform: perspective(700px) rotateY(180deg); }
@media (hover: hover) and (pointer: fine) {
  html.motion .try-chip:hover,
  html.motion .try-chip:nth-child(even):hover,
  html.motion .try-chip:focus-visible { transform: perspective(700px) rotateY(180deg); }
  html.motion .try-chip:active { transform: perspective(700px) rotateY(180deg) translateY(4px); }
}
@media (hover: none) {
  html.motion .try-chip:hover, html.motion .try-chip:nth-child(even):hover { transform: perspective(700px) rotateY(0deg); }
}

/* gentle, never-ending motion: the tile emojis bob */
html.motion .go-emoji { animation: bob3d 3.4s ease-in-out infinite; }
html.motion .go-tile:nth-child(2) .go-emoji { animation-delay: -1.1s; }
html.motion .go-tile:nth-child(3) .go-emoji { animation-delay: -2.2s; }
@keyframes bob3d {
  0%, 100% { transform: perspective(300px) translateY(0) rotateY(-12deg); }
  50% { transform: perspective(300px) translateY(-7px) rotateY(12deg); }
}

/* the tumbling Brahmi letter cube beside Gaju (jain3d.js) */
.hero-cube { --s: 116px; align-self: center; margin-left: 26px; }

/* go-tiles: the emoji and the title lift off the tile in 3D while it leans */
@media screen {
  .go-tile.j3-tilting, .go-tile.j3-tilting .go-text { transform-style: preserve-3d; }
  .go-tile .go-emoji, .go-tile .go-title { transition: translate .4s var(--ease-bounce); }
  .go-tile.j3-tilting .go-emoji { translate: 0 0 48px; }
  .go-tile.j3-tilting .go-title { translate: 0 0 22px; }
}

/* ---- Picker bar ---- */
.picker-bar {
  --card-c: #C4B5FD;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 20px;
}
.script-picker {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 14px 10px;
  border-radius: 20px;
  background: #fff;
  background: color-mix(in srgb, var(--c) 25%, #fff);
  border: 3px solid var(--c);
  box-shadow: 0 4px 0 var(--cd);
  cursor: pointer;
  transition: transform .18s var(--ease-bounce);
}
.script-picker:hover { transform: translateY(-2px); }
.picker-label { font-size: .85rem; font-weight: 800; color: var(--cd); }
.script-picker select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: none;
  outline: none;
  cursor: pointer;
  background: transparent
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="9" viewBox="0 0 14 9"><path fill="%232B2140" d="M7 9L0 0h14z"/></svg>')
    no-repeat right 2px center;
  background-size: 13px 9px;
  padding: 2px 22px 2px 0;
  font: 800 1.2rem/1.3 var(--font-fun);
  color: var(--ink);
  text-overflow: ellipsis;
}
.script-picker select option { color: var(--ink); background: #fff; }
.script-picker:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.swap-btn { width: 58px; height: 58px; padding: 0; border-radius: 50%; flex-shrink: 0; }
.swap-btn svg { width: 26px; height: 26px; transition: transform .5s var(--ease-bounce); }
.swap-btn.spin svg { transform: rotate(180deg); }

/* ---- Translator cards ---- */
.tr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.tr-card { display: flex; flex-direction: column; overflow: hidden; }
.tr-in  { --card-c: var(--sun); }
.tr-out { --card-c: var(--pink); }
.tr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
}
.tr-in  .tr-card-head { background: #FFF1C2; }
.tr-out .tr-card-head { background: #FFE0EA; }
.tr-label {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  font-family: var(--font-fun), 'Noto Sans Brahmi Local', 'Noto Sans Gujarati', 'Noto Sans Bengali', 'Noto Sans Tamil', 'Noto Sans Kannada', 'Noto Sans Gurmukhi', sans-serif;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inputArea, #outputArea {
  font-family: 'Noto Serif Devanagari Local', 'Noto Serif Devanagari', serif;
  font-feature-settings: "liga" 1, "calt" 1;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  line-height: 1.6;
  color: var(--ink);
}
#inputArea {
  width: 100%;
  box-sizing: border-box;
  min-height: 11rem;
  padding: 14px 16px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
}
#inputArea::placeholder { color: #B8A9C9; }
.tr-in:focus-within { box-shadow: 0 8px 0 rgba(43, 33, 64, .10), 0 0 0 6px rgba(255, 201, 60, .45); }

#outputArea {
  flex: 1;
  min-height: 11rem;
  padding: 14px 16px;
  color: #C0265E;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: opacity .2s ease, transform .2s ease;
}
#outputArea.fs-brahmi { font-size: clamp(2rem, 4.6vw, 2.8rem); line-height: 1.5; }
#outputArea.flash { opacity: .35; transform: translateY(3px) scale(.99); }
#outputArea:empty::before {
  content: "✨ यहाँ जादू दिखेगा…";
  font-family: var(--font-fun);
  font-size: 1.2rem;
  font-weight: 600;
  color: #D9A7BA;
}

.tr-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-top: 3px dashed #F6E7C8;
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.det-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #166534;
  animation: kidPop .4s var(--ease-bounce);
}

/* ---- Suggestion popup (Google Input Tools style) ---- */
.suggest-popup {
  margin: 0 12px 12px;
  padding: 8px 10px 10px;
  background: #FFFBEA;
  border: 3px solid var(--sun);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--sun-d);
  animation: kidPop .25s var(--ease-bounce);
}
.suggest-hint { font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.suggest-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest-chip {
  padding: 5px 12px;
  border-radius: 14px;
  border: 2.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: 'Noto Serif Devanagari Local', 'Noto Serif Devanagari', serif;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform .15s var(--ease-bounce), background .15s ease, border-color .15s ease;
}
.suggest-chip:hover { transform: translateY(-2px); background: #FFF1C2; border-color: var(--sun); }
.suggest-chip.active { background: #DCFCE7; border-color: var(--leaf); color: #14532D; }
.suggest-chip .chip-num {
  display: inline-block;
  min-width: 14px;
  margin-right: 4px;
  font-family: var(--font-fun);
  font-size: .72rem;
  font-weight: 700;
  color: #A08DB8;
}
.suggest-chip .chip-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: #EDE9FE;
  color: var(--grape-d);
  font-family: var(--font-fun);
  font-size: .62rem;
  font-weight: 800;
  vertical-align: middle;
}

/* ---- Go-to tiles ---- */
.go-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.go-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 28px;
  text-decoration: none;
  color: #fff;
  background: var(--c);
  box-shadow: 0 8px 0 var(--cd), inset 0 4px 0 rgba(255, 255, 255, .25);
  transition: transform .2s var(--ease-bounce), box-shadow .2s ease;
}
.go-tile:hover { transform: translateY(-5px) rotate(-1.5deg); box-shadow: 0 12px 0 var(--cd), inset 0 4px 0 rgba(255, 255, 255, .25); }
.go-tile:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--cd); }
.go-emoji {
  flex-shrink: 0;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: rgba(255, 255, 255, .3);
  border-radius: 22px;
}
.go-tile:hover .go-emoji { animation: kidWiggle .5s ease; }
.go-text { display: flex; flex-direction: column; min-width: 0; }
.go-title { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.go-sub { font-size: .92rem; font-weight: 600; opacity: .95; line-height: 1.35; }

/* ---- Quick chart (for grown-ups) ---- */
.chart-card { --card-c: #9EDCF8; margin-top: 24px; overflow: hidden; }
.chart-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 1.15rem;
  background: #E3F6FF;
}
.chart-card summary::-webkit-details-marker { display: none; }
.chart-card .chev { transition: transform .35s var(--ease-bounce); color: var(--sky-d); }
.chart-card[open] .chev { transform: rotate(180deg); }
.chart-hint { margin: 10px 16px 0; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.chart-scroll { overflow-x: auto; padding: 12px 16px 16px; -webkit-overflow-scrolling: touch; }
#chart {
  display: grid;
  grid-template-columns: repeat(var(--chart-cols, 22), minmax(58px, 1fr));
  gap: 5px;
  min-width: min-content;
}
.chart-cell {
  background: #FFFBEA;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 6px 4px;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  min-height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .15s var(--ease-bounce), background .15s ease;
}
.chart-cell:not(.chart-head):hover { transform: scale(1.15); background: #FFF1C2; position: relative; z-index: 1; }
.chart-cell.chart-head {
  background: var(--sky);
  border-color: var(--sky-d);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  min-height: 26px;
}

/* ---- The book: ब्राह्मी लिपि वर्णाक्षर ---- */
.book-promo {
  --card-c: #FFB3C9;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #FFF6DD, #FFEFF4);
}
/* .bp-pic is a 3D book (jain3d.js styles .j3-book); room for the near edge */
.bp-pic { display: block; padding: 8px 20px 12px 4px; }
.bp-pic img { display: block; width: 100%; height: auto; }
.bp-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bp-tag {
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
}
.bp-title { margin: 2px 0 0; font-size: 2.2rem; font-weight: 800; line-height: 1.15; color: #233C8C; }
.bp-sub { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--grape-d); }
.bp-meta { margin: 0; font-size: .95rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.bp-meta b { color: #9A3412; }
.bp-list { margin: 4px 0 6px; padding: 0; list-style: none; font-weight: 600; line-height: 1.7; }
/* लेखिका परिचय — the author's qualifications under the book's credit line */
.bp-author {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 12px;
  border: 2px dashed #F6C453;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}
.bp-author summary { cursor: pointer; list-style: none; font-weight: 800; color: var(--grape-d); }
.bp-author summary::-webkit-details-marker { display: none; }
.bp-author summary::after { content: "▾"; display: inline-block; margin-left: 6px; transition: transform .2s; }
.bp-author[open] summary::after { transform: rotate(180deg); }
.bp-author summary b { color: #9A3412; }
.bp-author ul { margin: 6px 0 4px; padding: 0; list-style: none; font-size: .92rem; font-weight: 600; line-height: 1.55; color: var(--ink-soft); }
.bp-author li { position: relative; padding-left: 18px; }
.bp-author li::before { content: "✦"; position: absolute; left: 0; top: 1px; color: #F58220; font-size: .75em; }
.bpa-lipi { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 2px; font-size: .88rem; font-weight: 700; color: #233C8C; }
.bpa-lipi i { padding: 1px 9px; border-radius: 999px; background: #FFE9C7; color: #9A3412; font-style: normal; }
.bp-btn { margin-top: 4px; }

/* ---- The Jain Prateek in 3D (jain3d.js builds the scene) ---- */
.j3-sec {
  --card-c: #F6C453;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 18px;
  color: #EEF2FF;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 65% at 25% 40%, rgba(255, 196, 80, .22), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.6px) 0 0 / 24px 24px,
    linear-gradient(135deg, #131C40, #1B2653 50%, #23407A);
}
.j3-sec-stage { min-width: 0; }
.j3-motto { margin: 0; text-align: center; font-size: 1.35rem; font-weight: 800; color: #FFD98A; letter-spacing: .5px; }
.j3-motto small { display: block; font-size: .9rem; font-weight: 600; color: #B9C6F2; }
.j3-tag { display: inline-block; padding: 2px 14px; border-radius: 999px; background: #F6C453; color: #5B2A00; font-weight: 800; font-size: .9rem; }
.j3-title { margin: 8px 0 8px; font-size: 2rem; font-weight: 800; line-height: 1.2; color: #FFE7A8; }
.j3-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.j3-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 7px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
  font-weight: 600; line-height: 1.55;
}
.j3-list b, .j3-note b { color: #FFD98A; }
.j3-ico { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #FFF3CF; font-size: 1rem; }
.j3-note { margin: 12px 0 0; font-weight: 600; line-height: 1.65; color: #DCE3FF; }
.j3-flagrow { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); }
.j3-flagrow p { margin: 0; line-height: 1.8; font-weight: 600; }
.fc { padding: 0 7px; border-radius: 6px; font-weight: 800; }
.fc-w { background: #fff; color: #1B2653; }
.fc-r { background: #E0262B; color: #fff; }
.fc-y { background: #F9C80E; color: #3B2A00; }
.fc-g { background: #1E9E48; color: #fff; }
.fc-b { background: #1F3C9A; color: #fff; }

/* ---- FAQ (for grown-ups) ---- */
.faq-card { --card-c: #A7E8B9; margin-top: 24px; padding: 16px 18px 10px; }
.faq-title { margin: 0 0 10px; font-size: 1.35rem; font-weight: 800; color: var(--leaf-d); }
.faq-item { border-top: 2px dashed #CFEFD8; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 30px 10px 2px;
  position: relative;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "＋";
  position: absolute;
  right: 4px;
  top: 8px;
  color: var(--leaf-d);
  font-weight: 800;
  transition: transform .3s var(--ease-bounce);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 12px; font-size: 1rem; line-height: 1.75; color: var(--ink-soft); font-weight: 600; }
.faq-item a { color: var(--sky-d); font-weight: 800; }

/* ---- Scrollbar ---- */
textarea::-webkit-scrollbar, .chart-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
textarea::-webkit-scrollbar-thumb, .chart-scroll::-webkit-scrollbar-thumb { background: #F3D58A; border-radius: 6px; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .try-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .tr-grid, .go-tiles, .book-promo, .j3-sec { grid-template-columns: 1fr; }
  .bp-title { font-size: 1.8rem; }
  .j3-title { font-size: 1.7rem; }
  .j3-flagrow { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .tr-hero { padding-top: 16px; }
  .say-hero { flex-direction: column; align-items: center; }
  .hero-cube { --s: 84px; margin: 16px auto 4px; }
  .say-hero .say-mascot { width: 130px; height: 122px; }
  .say-hero .say-bubble { margin-bottom: 0; text-align: center; }
  .say-hero .say-bubble::before { left: 50%; bottom: auto; top: -20px; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 18px solid var(--ink); border-top: 0; }
  .say-hero .say-bubble::after  { left: 50%; bottom: auto; top: -12px; transform: translateX(-50%); border: 9px solid transparent; border-bottom: 13px solid #fff; border-top: 0; }
  .try-box { padding: 12px; }
  .try-chips { gap: 8px; }
  .tc-pic { font-size: 2.1rem; }
  .tc-word { font-size: .85rem; }
  /* stack From / To so full language names fit; ⇅ sits between them */
  .picker-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
  .script-picker { padding: 6px 12px 8px; }
  .swap-btn { width: 50px; height: 50px; align-self: center; margin: -4px 0; }
  #inputArea, #outputArea { min-height: 9rem; }
}
