/* web/static/app.css — темы оформления, пиксельный порт прототипа
   docs/superpowers/prototypes/2026-07-13-style-variants.html
   (#v1 Ruhe, #v3 Tiefsee dunkel, #v3l Tiefsee hell). Значения не изобретать —
   брать из прототипа. Отступления только ради контраста (см. комментарии). */

/* ---------- шрифты из прототипа (woff2, latin-набор как в прототипе) ---------- */
@font-face {
  font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/static/fonts/schibsted-grotesk-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('/static/fonts/schibsted-grotesk-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('/static/fonts/schibsted-grotesk-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/static/fonts/source-serif-4-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/static/fonts/source-serif-4-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('/static/fonts/space-grotesk-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('/static/fonts/space-grotesk-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- токены (прототип v1 / v3 / v3.light) ---------- */
:root, [data-theme="ruhe"] {
  --paper: #FAF9F5; --card: #FFFFFF; --ink: #23282C;
  /* прототип: mut #8A918D — контраст 3.06:1 < 4.0, ближайший проходящий: */
  --mut: #767C79;
  --acc: #2F6B52; --acc-ink: #FAF9F5; --line: #E3E1DA; --btn-border: #C9C6BB;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", -apple-system, "Segoe UI", sans-serif;
  --space: "Space Grotesk", "Schibsted Grotesk", sans-serif;
  --page-bg: #ECEAE2; --g1: var(--paper); --g2: var(--paper); --g3: var(--paper);
  --ru-ink: var(--ink);
  --cardbg: transparent; --cardbrd: var(--btn-border);
  --glow: transparent; --glowsoft: transparent; --navdim: var(--mut);
}
[data-theme="tiefsee-dunkel"] {
  --paper: #08202C; --card: #0E2A38; --ink: #D9F0F4; --mut: #7FA8B3;
  --acc: #53D7E3; --acc-ink: #04222C; --line: #143240; --btn-border: #2C5060;
  --page-bg: #04111A; --g1: #08202C; --g2: #06171F; --g3: #041019;
  --ru-ink: #FF8574;
  --cardbg: rgba(23,56,71,.55); --cardbrd: rgba(83,215,227,.35);
  --glow: rgba(83,215,227,.35); --glowsoft: rgba(83,215,227,.13);
  --navdim: #567884;
}
[data-theme="tiefsee-hell"] {
  --paper: #D8F4F6; --card: #FFFFFF; --ink: #0B3742; --mut: #3F7280;
  /* прототип: acc #0E8C9C — контраст с белым 4.0:1 < 4.5, ближайший проходящий: */
  --acc: #0D8291;
  --acc-ink: #FFFFFF; --line: #AFD9DE; --btn-border: #8FC4CC;
  --page-bg: #BFE0E6; --g1: #D8F4F6; --g2: #A9E2E9; --g3: #7ECBD9;
  --ru-ink: #C74532;
  --cardbg: rgba(255,255,255,.6); --cardbrd: rgba(14,140,156,.4);
  --glow: rgba(14,140,156,.25); --glowsoft: rgba(14,140,156,.12);
  --navdim: #5E8C97;
}

/* ---------- каркас (scaffold прототипа) ---------- */
html { height: 100%; }
body { min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--page-bg); color: var(--ink); font-family: var(--sans); }
.screen { flex: 1; min-height: 100dvh; width: 100%; max-width: 420px; margin: 0 auto;
  padding: 0 20px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%); }
@media (min-width: 720px) {
  .screen { min-height: min(840px, calc(100dvh - 40px)); height: auto; max-height: none;
    margin: 20px auto; border-radius: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
    /* clip, не hidden: hidden делает .screen scroll-контейнером и убивает sticky у .nav */
    overflow: clip; }
}
button { font: inherit; cursor: pointer; border: none; background: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--acc); outline-offset: 3px; }

/* ---------- прогресс-линия (v1) ---------- */
.progressline { height: 2px; background: var(--line); margin: 0 -20px; }
.progressline i { display: block; height: 100%; background: var(--acc);
  transition: width .4s ease; }

/* ---------- топбар ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center;
  margin: 0 -20px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.brand { font-size: 13px; letter-spacing: .14em; color: var(--mut); font-weight: 500; }
.count { font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.count b { color: var(--ink); }
.brandwrap { display: flex; align-items: center; gap: 10px; }
.theme-btn { width: 40px; height: 40px; border-radius: 99px;
  border: 1px solid var(--cardbrd); color: var(--acc);
  display: flex; align-items: center; justify-content: center; }
.theme-btn svg { display: block; width: 18px; height: 18px; }
[data-theme="tiefsee-dunkel"] .theme-btn .moon { display: none; }
[data-theme="tiefsee-hell"] .theme-btn .sun { display: none; }
.depth { text-align: right; font-variant-numeric: tabular-nums; }
.depth b { font-family: var(--space); font-size: 17px; color: var(--ink); display: block; }
.depth span { font-size: 10.5px; letter-spacing: .14em; }
[data-theme^="tiefsee"] .topbar { border-bottom: none; padding-bottom: 6px;
  color: var(--mut); }
[data-theme^="tiefsee"] .brand { font-family: var(--space); font-weight: 700;
  letter-spacing: .1em; color: var(--acc); }

/* ---------- нижняя навигация ---------- */
.nav { display: flex; justify-content: space-around; border-top: 1px solid var(--line);
  background: var(--paper); margin: auto -20px 0;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  position: sticky; bottom: 0; z-index: 50; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; text-decoration: none; color: var(--mut); min-width: 58px;
  padding: 6px 4px; border-radius: 12px; }
.nav a.on { color: var(--acc); }
.nav a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.nav svg { width: 22px; height: 22px; }
/* при прокрутке контент растворяется в глубине под nav; на review-экране (без скролла) низ градиента = g3, выглядит как прозрачный nav прототипа */
[data-theme^="tiefsee"] .nav { border-top: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--g3) 45%); }
[data-theme^="tiefsee"] .nav a { color: var(--navdim); }
[data-theme^="tiefsee"] .nav a.on { color: var(--acc); }

.btn { display: block; width: 100%; min-height: 52px; border-radius: 4px;
  font-weight: 700; font-size: 16px; text-align: center; line-height: 52px;
  text-decoration: none; }
.btn-primary { background: var(--acc); color: var(--acc-ink); }
.btn-ghost { border: 1px solid var(--btn-border); color: var(--ink); background: transparent; }

/* ---------- сцена и карточка ---------- */
#card-zone { flex: 1; display: flex; flex-direction: column; }
.stage { flex: 1; display: flex; align-items: center; justify-content: center;
  perspective: 1200px; padding: 8px 0; position: relative; }
.motto { display: flex; gap: 10px; justify-content: center; align-items: center;
  color: var(--mut); font-size: 12px; font-style: italic; font-family: var(--serif);
  padding: 4px 0 10px; }
.tap-hint { text-align: center; font-size: 12px; opacity: .55; padding-bottom: 8px; }
.fcard { position: relative; width: 100%; max-width: 340px; touch-action: pan-y;
  cursor: grab; user-select: none; -webkit-user-select: none;
  transform: translateX(var(--dx, 0)) rotate(calc(var(--dx, 0px) / 18 * 1deg)); }
.fcard.snap { transition: transform .25s ease; }
.fcard.out-r { transition: transform .32s ease-in; transform: translateX(130%) rotate(14deg); }
.fcard.out-l { transition: transform .32s ease-in; transform: translateX(-130%) rotate(-14deg); }
.finner { position: relative; transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.2,.7,.3,1.1); }
.fcard.flipped .finner { transform: rotateY(180deg); }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: transparent; min-height: 300px; padding: 12px 6px;
  display: flex; flex-direction: column; justify-content: center; }
.face.back { position: absolute; inset: 0; transform: rotateY(180deg); }
.meta { font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 14px; }
.cardillu { width: 100%; max-height: 150px; object-fit: cover; border-radius: 12px;
  margin-bottom: 14px; }
.word { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 11vw, 46px);
  line-height: 1.08; text-wrap: balance; }
.ru { font-family: var(--serif); font-size: 27px; font-weight: 600; margin-bottom: 16px;
  color: var(--ru-ink); }
.ex { font-size: 15.5px; line-height: 1.6; border-left: 2px solid var(--acc); padding-left: 14px; }
.exru { font-size: 13.5px; color: var(--mut); margin-top: 8px; padding-left: 16px; }
.actions { display: flex; gap: 12px; padding: 6px 0 10px; }
.actions button { flex: 1; min-height: 52px; font-weight: 700; font-size: 16px; border-radius: 4px; }
.btn-again { border: 1px solid var(--btn-border); color: var(--ink); background: transparent; }
.btn-know { background: var(--acc); color: var(--acc-ink); }
.never { display: block; margin: 0 auto 8px; font-size: 12px; color: var(--mut);
  text-decoration: underline; background: none; }
.done { text-align: center; }
.done h2 { font-family: var(--serif); font-size: 28px; margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) {
  .finner, .fcard.snap, .fcard.out-l, .fcard.out-r { transition-duration: .01s; }
}

/* Fortschritt (dataviz: одна серия, без легенд, текст — чернильные токены) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.tile b { display: block; font-family: var(--serif); font-size: 30px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--mut); font-size: 12.5px; }
.sect { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
  margin: 22px 0 10px; }
.mutnote { color: var(--mut); letter-spacing: 0; text-transform: none; font-weight: 400; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px);
  gap: 3px; justify-content: start; }
.heatmap i { width: 12px; height: 12px; border-radius: 2px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.barrow { display: flex; align-items: center; gap: 10px; }
.barlabel { width: 72px; font-size: 12.5px; color: var(--mut); }
.bartrack { flex: 1; }
.bar { height: 12px; background: var(--acc); border-radius: 0 4px 4px 0; min-width: 2px; }
.barval { min-width: 28px; text-align: right; font-size: 12.5px; color: var(--mut);
  font-variant-numeric: tabular-nums; }
.cols { display: flex; gap: 8px; align-items: flex-end; height: 96px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line); position: relative; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; position: relative; }
.colval { font-size: 11.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.colbar { width: 60%; background: var(--acc); border-radius: 4px 4px 0 0; min-height: 2px; }
.collabel { position: absolute; bottom: -18px; font-size: 11px; color: var(--mut); }
.probrow { display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 15px; }
/* Einstellungen (Task 7) */
.step-chip { display: inline-flex; align-items: center; gap: 4px; }
/* Wörterbuch — Mit-KI-übersetzen Spinner */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.spinner { width: 28px; height: 28px; margin: 18px auto; border: 3px solid var(--line);
  border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tiefsee identity — только в tiefsee-темах, Ruhe остаётся тихой ---------- */
.sea { display: none; margin-top: auto; }
[data-theme^="tiefsee"] .sea { display: block; position: relative; height: 66px;
  margin: auto -20px 0; overflow: hidden; pointer-events: none; }
[data-theme^="tiefsee"] .sea-turtle { position: absolute; bottom: 2px; left: -90px;
  animation: seaswim 38s linear infinite; animation-delay: -16s; }
@keyframes seaswim { to { transform: translateX(calc(100vw + 220px)); } }
@media (min-width: 720px) { @keyframes seaswim { to { transform: translateX(640px); } } }
.trail { position: absolute; top: 4px; left: 0; right: 0; display: flex; gap: 14px;
  justify-content: center; }
.trail i { width: 5px; height: 5px; border-radius: 99px; background: var(--acc); opacity: .25; }
.trail i.on { opacity: .9; box-shadow: 0 0 8px var(--glow); }
[data-theme^="tiefsee"] .fcard { animation: cardfloat 6s ease-in-out infinite; }
@keyframes cardfloat { 50% { translate: 0 -9px; } }
[data-theme^="tiefsee"] .face { border-radius: 20px; border: 1px solid var(--cardbrd);
  background: var(--cardbg); padding: 30px 24px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 0 34px var(--glowsoft), inset 0 0 24px rgba(255,255,255,.04); }
[data-theme^="tiefsee"] .meta { font-size: 10.5px; letter-spacing: .22em; margin-bottom: 12px; }
[data-theme^="tiefsee"] .word { font-family: var(--space); font-weight: 700;
  font-size: clamp(34px, 10vw, 42px); line-height: 1.1;
  text-shadow: 0 0 22px var(--glow); }
[data-theme^="tiefsee"] .ru { font-family: var(--space); font-size: 25px; font-weight: 700;
  margin-bottom: 14px; }
[data-theme^="tiefsee"] .ex { font-size: 15px; line-height: 1.65; border-left: none;
  padding-left: 0; }
[data-theme^="tiefsee"] .exru { font-size: 13px; padding-left: 0; }
[data-theme^="tiefsee"] .done h2 { font-family: var(--space); font-weight: 700; }
[data-theme^="tiefsee"] .actions button { border-radius: 14px; }
[data-theme^="tiefsee"] .btn { border-radius: 14px; }
[data-theme^="tiefsee"] .btn-again { border-color: var(--cardbrd); }
[data-theme^="tiefsee"] .btn-know { box-shadow: 0 0 24px var(--glow); }
@media (prefers-reduced-motion: reduce) {
  [data-theme^="tiefsee"] .fcard, [data-theme^="tiefsee"] .sea-turtle { animation: none !important; }
}

/* ---------- Heute: живая сцена с черепахой ---------- */
.heute-stage { display: flex; flex-direction: column; justify-content: center;
  align-items: stretch; /* перебивает center базового .stage: иначе .scene схлопывается в 0 */ }
.heute-stage .done { flex: 0 0 auto; }
.scene { width: 100%; }
.mehr-neue { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.mehr-neue .btn { width: auto; min-height: 46px; padding: 0 22px; }

.scene { position: relative; height: 190px; margin-top: 8px; overflow: hidden; }
.turtle-tap { position: absolute; background: none; border: none; padding: 6px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.turtle-tap:focus-visible { outline: none; }
.blub { position: absolute; top: -16px; left: 50%; transform: translateX(-50%) scale(.6);
  opacity: 0; white-space: nowrap; font-size: 13px; font-style: italic;
  font-family: var(--serif); color: var(--ink); pointer-events: none;
  transition: opacity .25s, transform .25s; }
.turtle-tap.happy .blub { opacity: 1; transform: translateX(-50%) scale(1) translateY(-4px); }

/* Tiefsee: подводная сцена — черепаха уходит глубже с прогрессом дня */
.scene-sea { display: none; }
[data-theme^="tiefsee"] .scene-sea { display: block; }
.scene-sea .turtle-tap { left: 50%; margin-left: -60px;
  top: calc(14px + var(--pct, 0) * 0.9px); transition: top 1.2s ease; }
.scene-sea .scene-turtle { animation: heute-schwimmen 7s ease-in-out infinite; display: block; }
.turtle-tap.happy .scene-turtle { animation: heute-rolle 1.2s ease; }
.scene-sea .bub { position: absolute; bottom: -12px; border-radius: 99px;
  background: var(--acc); opacity: 0; }
.scene-sea .b1 { left: 18%; width: 5px; height: 5px; animation: bub-auf 6s linear infinite; }
.scene-sea .b2 { left: 34%; width: 8px; height: 8px; animation: bub-auf 8s linear 1.6s infinite; }
.scene-sea .b3 { left: 58%; width: 4px; height: 4px; animation: bub-auf 5.5s linear 3s infinite; }
.scene-sea .b4 { left: 74%; width: 6px; height: 6px; animation: bub-auf 7s linear 4.2s infinite; }
.scene-sea .b5 { left: 88%; width: 5px; height: 5px; animation: bub-auf 6.4s linear .8s infinite; }
.scene-sea .ray { position: absolute; top: -20px; width: 46px; height: 130%;
  background: linear-gradient(180deg, var(--acc), transparent 70%);
  opacity: .04; transform: skewX(-14deg); filter: blur(7px); display: none; }
[data-theme="tiefsee-dunkel"] .scene-sea .ray { display: block; }
.scene-sea .r1 { left: 22%; animation: ray-schaukel 9s ease-in-out infinite; }
.scene-sea .r2 { left: 60%; width: 30px; animation: ray-schaukel 11s ease-in-out 2s infinite; }
@keyframes heute-schwimmen {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(12px, -7px) rotate(-2deg); }
  60% { transform: translate(-10px, 5px) rotate(2deg); }
}
@keyframes heute-rolle { to { transform: rotate(360deg); } }
@keyframes bub-auf {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: .35; }
  85% { opacity: .25; }
  100% { transform: translateY(-185px); opacity: 0; }
}
@keyframes ray-schaukel { 50% { transform: skewX(-9deg) translateX(10px); } }

/* Ruhe: прогулка по тропе — точки пути заполняются прогрессом дня */
.scene-walk { height: 130px; color: var(--ink); }
[data-theme^="tiefsee"] .scene-walk { display: none; }
.scene-walk .ground { position: absolute; left: 6%; right: 6%; bottom: 26px;
  border-bottom: 1px solid var(--line); }
.scene-walk .turtle-tap { left: 50%; margin-left: -44px; bottom: 22px;
  opacity: .82; animation: heute-spazieren 9s ease-in-out infinite; }
.turtle-tap.happy .scene-turtle { transform-origin: 60% 80%; }
.scene-walk .turtle-tap.happy .scene-turtle { animation: heute-nicken .9s ease; }
.scene-walk .tuft { position: absolute; bottom: 27px; color: var(--mut); opacity: .5; }
.scene-walk .t1 { left: 12%; }
.scene-walk .t2 { right: 14%; }
.walk-track { position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 8px; display: flex; gap: 9px; }
.wdot { width: 5px; height: 5px; border-radius: 99px; border: 1px solid var(--mut);
  opacity: .5; }
.wdot.full { background: var(--acc); border-color: var(--acc); opacity: .9; }
@keyframes heute-spazieren {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(16px); }
}
@keyframes heute-nicken {
  30% { transform: rotate(-7deg); }
  60% { transform: rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .scene-turtle, .scene-sea .bub, .scene-sea .ray, .scene-walk .turtle-tap {
    animation: none !important; }
  .scene-sea .bub { opacity: .18; bottom: auto; }
  .scene-sea .b1 { top: 30%; } .scene-sea .b2 { top: 55%; } .scene-sea .b3 { top: 20%; }
  .scene-sea .b4 { top: 65%; } .scene-sea .b5 { top: 42%; }
}
