/* Дизайн-система по референсу Café del Alma: синяя линия по кремовому, сочные плашки orange / sky / neon,
   Space Grotesk (кириллица из Golos Text), маркерный логотип, рисованные дудлы и паттерн. */
:root {
  --blue: #1a1aa7;
  --orange: #ffa142;
  --sky: #b1d5f0;
  --neon: #e3f40c;
  --coffee: #28211c;
  --cream: #f7f3e6;

  --bg: var(--cream);
  --paper: #fffdf6;
  --ink: var(--blue);
  --text: var(--coffee);
  --muted: #6d6a8c;
  --line: var(--blue);
  --on-ink: var(--cream);
  --soft: #ecebf7;
  --good: #1f8a4c;
  --bad: #d4462f;
  --r: 20px;
  --bw: 2px;
  --font: "Space Grotesk", "Golos Text", system-ui, sans-serif;
  --logo: "Permanent Marker", "Space Grotesk", cursive;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--coffee); --paper: #332a24; --ink: var(--sky); --text: var(--cream); --muted: #b7b0a4;
    --line: var(--sky); --on-ink: var(--coffee); --soft: #3b322b;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 var(--font);
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 28px);
  max-width: 560px; margin: 0 auto; min-height: 100dvh;
}
h1, h2, h3, .num { font-family: var(--font); color: var(--ink); margin: 0; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input {
  font: inherit; color: var(--text); width: 100%; padding: 14px 16px; border-radius: 14px;
  border: var(--bw) solid var(--line); background: var(--paper); outline: none;
}
input:focus { box-shadow: 4px 4px 0 var(--neon); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); font-weight: 500; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.top { padding: 16px 0 8px; }

.logo { font-family: var(--logo); color: var(--ink); line-height: .9; font-weight: 400; letter-spacing: -.01em; transform: rotate(-3deg); display: inline-block; }
.logo.big { font-size: 58px; }
.logo.sm { font-size: 22px; }

.card { background: var(--paper); border: var(--bw) solid var(--line); border-radius: var(--r); padding: 18px; position: relative; }
.rule { border: 0; border-top: 1.5px solid var(--line); opacity: .5; margin: 4px 0; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; border-radius: 99px; font-weight: 700; background: var(--ink); color: var(--on-ink);
  border: var(--bw) solid var(--line); box-shadow: 3px 3px 0 var(--neon); transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--neon); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.soft { background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--line); }
.btn.neon { background: var(--neon); color: var(--blue); box-shadow: 3px 3px 0 var(--line); }
.btn.orange { background: var(--orange); color: var(--blue); box-shadow: 3px 3px 0 var(--line); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; font-weight: 500; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px;
  font-size: 13px; font-weight: 700; border: 1.5px solid var(--line); color: var(--ink); background: var(--paper);
}
.chip.neon { background: var(--neon); color: var(--blue); }
.chip.orange { background: var(--orange); color: var(--blue); }
.chip.sky { background: var(--sky); color: var(--blue); }
.chip.ink { background: var(--ink); color: var(--on-ink); }

.bar { height: 14px; border-radius: 99px; border: var(--bw) solid var(--line); background: var(--paper); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--neon); border-right: var(--bw) solid var(--line); transition: width .5s; }

/* цветные плашки с паттерном */
.tile { border: var(--bw) solid var(--line); border-radius: 24px; padding: 20px; position: relative; overflow: hidden; color: var(--blue); }
.tile h1, .tile h2, .tile h3, .tile .num, .tile .label { color: var(--blue); }
.tile .muted { color: #3b3b7a; }
.tile.orange { background-color: var(--orange); }
.tile.sky { background-color: var(--sky); }
.tile.neon { background-color: var(--neon); }
.tile.cream { background-color: var(--cream); }
.tile > * { position: relative; }
.tile .bar { background: var(--cream); }
.tile .btn { background: var(--blue); color: var(--cream); border-color: var(--blue); box-shadow: 3px 3px 0 var(--cream); }
.tile .chip { border-color: var(--blue); color: var(--blue); background: var(--cream); }
.tile .chip.neon { background: var(--neon); }

.doodle { color: var(--ink); display: block; }
.deco { position: absolute; pointer-events: none; }
.tile .doodle { color: var(--blue); }
.hero { display: grid; gap: 14px; }
.hero .big { font-size: 40px; line-height: 1; }

.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel .who { padding: 14px; border-radius: 18px; border: var(--bw) solid var(--blue); background: var(--cream); display: grid; gap: 4px; color: var(--blue); }
.duel .who.lead { background: var(--neon); }
.duel .num { font-size: 30px; color: var(--blue); }

.map { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.map i {
  aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 11px; font-style: normal; color: var(--ink); font-weight: 700;
}
.map i.done { background: var(--ink); color: var(--on-ink); }
.map i.next { background: var(--neon); color: var(--blue); border-color: var(--blue); }

.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.ach div { padding: 12px 8px; border-radius: 16px; text-align: center; border: 1.5px dashed var(--line); font-size: 12px; opacity: .45; color: var(--ink); }
.ach div.got { opacity: 1; border-style: solid; background: var(--sky); color: var(--blue); }
.ach b { display: block; font-size: 22px; margin-bottom: 2px; }

/* урок */
.steps { display: flex; gap: 6px; padding: 10px 0 14px; }
.steps i { flex: 1; height: 10px; border-radius: 9px; border: 1.5px solid var(--line); }
.steps i.on { background: var(--ink); }
.steps i.cur { background: var(--neon); }
.word { padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); display: grid; gap: 2px; }
.word .en { font-size: 21px; font-weight: 700; color: var(--ink); }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; padding: 14px 16px; border-radius: 16px; border: var(--bw) solid var(--line); background: var(--paper); color: var(--text); font-weight: 500; }
.opt:active { background: var(--soft); }
.opt.right { background: var(--neon); color: var(--blue); }
.opt.wrong { background: var(--orange); color: var(--blue); text-decoration: line-through; }
.scene { font-size: 18px; line-height: 1.6; }
.tip { background: var(--sky); color: var(--blue); border: 1.5px solid var(--blue); border-radius: 16px; padding: 14px; }
.phrase { font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.say { font-size: 15px; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--line); }
.listen { padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; font-size: 14px; background: var(--paper); }
.listen:active { background: var(--neon); color: var(--blue); }

.mic {
  width: 100px; height: 100px; border-radius: 50%; margin: 6px auto; display: grid; place-items: center;
  background: var(--orange); color: var(--blue); border: var(--bw) solid var(--blue); box-shadow: 4px 4px 0 var(--blue);
}
.mic svg { width: 40px; height: 40px; }
.mic.rec { background: var(--neon); animation: wob 1s infinite; }
@keyframes wob { 50% { transform: rotate(-6deg) scale(1.05); } }
.score { font-size: 52px; font-weight: 700; text-align: center; color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%);
  background: var(--blue); color: var(--cream); padding: 12px 18px; border-radius: 99px; font-size: 14px; z-index: 9;
  max-width: calc(100% - 32px); border: 2px solid var(--neon);
}
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 8; }
.confetti i { position: absolute; top: -40px; width: 34px; height: 34px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.confetti .doodle { color: inherit; }

/* разговорный клуб */
.person {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; text-align: left; width: 100%;
  padding: 10px 12px; border-radius: 16px; border: var(--bw) solid var(--blue); background: var(--cream); color: var(--blue);
}
.person .who { display: grid; line-height: 1.25; min-width: 0; }
.person .who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.locked { opacity: .55; border-style: dashed; }
.person:not(.locked):active { transform: translate(2px, 2px); }
.ava { width: 44px; height: 44px; border-radius: 50%; border: var(--bw) solid var(--blue); background: var(--sky); display: grid; place-items: center; padding: 7px; color: var(--blue); }
.ava .doodle { color: var(--blue); width: 100%; }
.ava.big { width: 64px; height: 64px; padding: 10px; background: var(--orange); }
.chat { display: grid; gap: 10px; padding: 14px 0; }
.bubble { max-width: 86%; padding: 12px 14px; border-radius: 20px; border: var(--bw) solid var(--line); font-size: 17px; line-height: 1.4; }
.bubble.them { background: var(--paper); color: var(--ink); border-bottom-left-radius: 6px; justify-self: start; }
.bubble.me { background: var(--ink); color: var(--on-ink); border-bottom-right-radius: 6px; justify-self: end; }
.bubble.skip { opacity: .4; }
.bubble .sc { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--neon); color: var(--blue); font-size: 12px; font-weight: 700; }
.listen.sm { padding: 2px 9px; font-size: 12px; margin-left: 4px; vertical-align: middle; }
details summary { cursor: pointer; color: var(--ink); font-weight: 500; }
.marks { font-size: 18px; line-height: 1.6; text-align: center; }
.marks .ok { color: var(--good); font-weight: 700; }
.marks .miss { color: var(--bad); text-decoration: underline wavy; }
