/* Peene-Angeln - styles
 * Colours come from the river scene: Peene blue-green, reed green, wooden
 * jetty brown and the red of the float. Cards look like soft paper (same
 * family as the other fun games, own colours). The fish book looks like a
 * school exercise book with handwriting (Patrick Hand).
 */

@font-face {
  font-family: 'Andika';
  src: url('assets/fonts/andika-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  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+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Andika';
  src: url('assets/fonts/andika-latin-ext-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Andika';
  src: url('assets/fonts/andika-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  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+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Andika';
  src: url('assets/fonts/andika-latin-ext-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Patrick Hand';
  src: url('assets/fonts/patrick-hand-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  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+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Patrick Hand';
  src: url('assets/fonts/patrick-hand-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fluss: #2f5f72;
  --fluss-tief: #17323d;
  --nacht: #0f2129;
  --schilf: #7c9a52;
  --schilf-hell: #dce8c4;
  --rand: #1f3f4b;
  --papier: #f8f3e6;
  --papier-rand: #e3d9bf;
  --papier-tief: #efe7d2;
  --tinte: #23303a;
  --tinte-hell: #5b6670;
  --holz: #8a6440;
  --schwimmer: #e2553f;
  --schwimmer-hell: #f07a63;
  --schwimmer-dunkel: #9c3324;
  --heft-linie: rgba(80, 130, 170, 0.28);
  --schatten: rgba(8, 20, 26, 0.45);
  --radius: 22px;
  --font: 'Andika', 'Trebuchet MS', system-ui, sans-serif;
  --hand: 'Patrick Hand', 'Comic Sans MS', 'Andika', cursive;
  --hud-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--nacht);
  color: var(--tinte);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(var(--fluss) 0 55%, var(--fluss-tief));
}

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

[hidden] { display: none !important; }

/* While fishing, the finger on the scene is the rod: no scrolling, no zooming. */
.app[data-mode='play'] .field { touch-action: none; }

/* ---------------------------------------------------------------- HUD */

.hud {
  position: absolute;
  top: var(--safe-top);
  left: 0;
  right: 0;
  height: var(--hud-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
  z-index: 3;
}
.hud > * { pointer-events: auto; }

.clock-chip {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 10px;
  background: rgba(248, 243, 230, 0.94);
  border: 3px solid var(--rand);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--rand);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
.clock-icon { width: 22px; height: 22px; fill: #f2b441; stroke: #b07a17; stroke-width: 2; }
.clock-chip[data-part='morgen'] .clock-icon { fill: #f7cf8a; stroke: #c08a3a; }
.clock-chip[data-part='abend'] .clock-icon { fill: #f08a4b; stroke: #a8502a; }
.clock-chip[data-part='nacht'] .clock-icon { fill: #e4ebf7; stroke: #5d6f92; }

.hud-buttons { display: flex; gap: 8px; }

.round-button {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--rand);
  background: var(--papier);
  box-shadow: 0 3px 0 var(--rand);
  color: var(--rand);
  cursor: pointer;
  padding: 0;
}
.round-button svg { width: 22px; height: 22px; fill: currentColor; }
.round-button:hover { background: #fffbef; }
.round-button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rand); }
.round-button:disabled { opacity: 0.45; cursor: default; }
.fullscreen-button .icon-exit { display: none; }
.is-fullscreen .fullscreen-button .icon-enter { display: none; }
.is-fullscreen .fullscreen-button .icon-exit { display: block; }

/* Line tension bar (shown while reeling in) */
.tension {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(248, 243, 230, 0.94);
  border: 3px solid var(--rand);
  z-index: 3;
  pointer-events: none;
}
.tension-label { font-weight: 700; font-size: 0.85rem; }
.tension-track {
  position: relative;
  flex: 1;
  height: 16px;
  border-radius: 999px;
  background: #d9d1bb;
  overflow: hidden;
}
.tension-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #5aa46a, #e6b53e 70%, var(--schwimmer));
}

.toast {
  position: absolute;
  top: calc(var(--safe-top) + var(--hud-height) + 10px);
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--papier);
  border: 3px solid var(--rand);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 4;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Hooked fish: the bar turns red and shakes when the line is close to breaking */
.tension.danger { border-color: var(--schwimmer-dunkel); animation: shake 0.18s linear infinite; }
@keyframes shake { 25% { transform: translate(calc(-50% - 2px), 0); } 75% { transform: translate(calc(-50% + 2px), 0); } }

/* Cast power: three zones (38 %, 34 %, 28 % as in the rules) and a marker */
.power {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  height: 36px;
  display: grid;
  grid-template-columns: 38fr 34fr 28fr;
  border-radius: 999px;
  border: 3px solid var(--rand);
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 3px 0 var(--rand);
}
.power-zone {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--tinte);
  background: rgba(248, 243, 230, 0.94);
}
.power-zone + .power-zone { border-left: 2px dashed rgba(31, 63, 75, 0.35); background: rgba(220, 235, 240, 0.94); }
.power-zone:last-of-type { background: rgba(190, 218, 228, 0.94); }
.power-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: var(--schwimmer);
  box-shadow: 0 0 0 2px #fff;
}

/* What to do next, at the bottom of the scene */
.overlay {
  position: absolute;
  inset: auto 0 calc(66px + var(--safe-bottom)) 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
  padding: 0 16px;
}
.bubble {
  margin: 0;
  max-width: 520px;
  padding: 10px 20px;
  border-radius: 18px;
  background: rgba(248, 243, 230, 0.95);
  border: 3px solid var(--rand);
  font-weight: 700;
  text-align: center;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px); } }

/* While playing with a mouse, the pointer hides after a moment of rest. */
.app.cursor-hidden, .app.cursor-hidden * { cursor: none !important; }

/* ------------------------------------------------------------- Screens */

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: start center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  overflow-y: auto;
  z-index: 5;
  background: rgba(8, 20, 26, 0.28);
}

.card {
  margin-block: auto;
  width: min(540px, 100%);
  background: var(--papier);
  border: 4px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--rand), 0 18px 40px var(--schatten);
  padding: 22px 24px 20px;
  text-align: center;
}
.card > * + * { margin-top: 14px; }

h2 { margin: 0; font-size: 1.8rem; color: var(--rand); line-height: 1.15; }

.logo {
  margin: 0;
  font-size: clamp(2.3rem, 8vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--fluss);
  letter-spacing: 0.01em;
  text-shadow: 0 3px 0 #b9d4d9, 0 6px 0 rgba(35, 48, 58, 0.18);
}
.tagline { margin-top: 8px; color: var(--tinte-hell); }

/* ------------------------------------------------------------- Buttons */

.button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border: 3px solid var(--rand);
  border-radius: 16px;
  background: var(--papier);
  color: var(--rand);
  font: 700 1.05rem/1.2 var(--font);
  box-shadow: 0 4px 0 var(--rand);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.button:hover { background: #fffbef; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rand); }

.button-start {
  min-height: 60px;
  font-size: 1.5rem;
  background: var(--schwimmer);
  border-color: var(--schwimmer-dunkel);
  color: #fff8f0;
  box-shadow: 0 5px 0 var(--schwimmer-dunkel);
  text-shadow: 0 1px 0 rgba(90, 20, 10, 0.4);
}
.button-start:hover { background: var(--schwimmer-hell); }
.button-start:active { box-shadow: 0 2px 0 var(--schwimmer-dunkel); }

.button-quiet {
  min-height: 42px;
  font-size: 0.95rem;
  background: var(--papier-tief);
  border-color: var(--papier-rand);
  box-shadow: 0 3px 0 var(--papier-rand);
}
.button-quiet:active { box-shadow: 0 1px 0 var(--papier-rand); }

.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.link-button {
  border: 0;
  background: none;
  padding: 0 0 0 4px;
  font: inherit;
  font-weight: 700;
  color: var(--rand);
  text-decoration: underline;
  cursor: pointer;
}

:focus-visible {
  outline: 4px solid #2f7fd0;
  outline-offset: 3px;
}

.start-group { display: grid; gap: 6px; justify-items: center; }
.progress { margin: 0; font-size: 0.9rem; color: var(--tinte-hell); }
.progress:empty { display: none; }

.card-small { width: min(380px, 100%); }

/* ---------------------------------------------------------------- Help */

.help-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 12px;
}
.help-list li { display: flex; align-items: center; gap: 14px; }
.help-pic { flex: none; width: 72px; height: 56px; border-radius: 10px; }

/* ----------------------------------------------------------- Fish book */

.screen-book { background: rgba(8, 20, 26, 0.55); }
.book { margin-block: auto; width: min(1080px, 100%); }

/* Tabs stick up from the top edge like the dividers of an exercise book. */
.book-tabs { display: flex; gap: 6px; padding: 0 18px; }
.book-tab {
  min-height: 40px;
  padding: 6px 16px 10px;
  margin-bottom: -6px;
  border: 3px solid var(--rand);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  font: 700 0.95rem var(--font);
  color: var(--tinte);
  cursor: pointer;
  filter: saturate(0.7) brightness(0.92);
}
.book-tab[data-tab='haeufig'] { background: #cfe3d2; }
.book-tab[data-tab='gelegentlich'] { background: #f3dfa6; }
.book-tab[data-tab='selten'] { background: #f2c3b4; }
.book-tab[data-tab='stempel'] { background: #cbd8ee; }
.book-tab[aria-selected='true'] { filter: none; padding-bottom: 14px; margin-top: -4px; position: relative; z-index: 1; }

.book-paper {
  position: relative;
  background: var(--papier);
  border: 4px solid var(--rand);
  border-radius: 14px;
  box-shadow: 0 8px 0 var(--rand), 0 18px 40px var(--schatten);
  padding: 14px 20px 16px;
}
.book-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.book-head h2 { font-family: var(--hand); font-weight: 400; font-size: 2.2rem; }
.book-count { margin: 0; font-family: var(--hand); font-size: 1.35rem; color: var(--tinte-hell); }
.book-progress { height: 8px; border-radius: 999px; background: #e4dcc6; margin: 4px 0 12px; overflow: hidden; }
.book-progress span { display: block; height: 100%; width: 0; background: var(--schilf); border-radius: 999px; }

.book-body { font-family: var(--hand); font-size: 1.25rem; line-height: 32px; }
.book-body.spread { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.page {
  min-height: 300px;
  padding: 8px 18px;
  background-color: #fffdf6;
  background-image: repeating-linear-gradient(transparent 0 31px, var(--heft-linie) 31px 32px);
  border-radius: 8px;
}
.spread .page:first-child { border-right: 2px solid rgba(31, 63, 75, 0.12); box-shadow: inset -14px 0 18px -16px rgba(0, 0, 0, 0.35); }
.spread .page:last-child { box-shadow: inset 14px 0 18px -16px rgba(0, 0, 0, 0.35); }

.entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  font: inherit;
  color: var(--tinte);
  cursor: pointer;
}
.entry:hover { background: rgba(124, 154, 82, 0.12); }
.entry-pic { flex: none; width: 120px; height: 60px; }
.entry-text { display: grid; line-height: 1.2; }
.entry-name { font-size: 1.45rem; }
.entry-info { font-size: 1.05rem; color: var(--tinte-hell); }
.entry.unknown .entry-name { color: var(--tinte-hell); letter-spacing: 0.1em; }

.detail .page { display: flex; flex-direction: column; gap: 6px; }
.page-left { align-items: center; text-align: center; }
.detail-name { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 2.2rem; color: var(--rand); }
.detail-pic { width: 100%; max-width: 340px; aspect-ratio: 2 / 1; }
.detail-rarity { margin: 0; color: var(--tinte-hell); }
.detail-fact { margin: 0; }
.detail-stats { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; margin: 4px 0; }
.detail-stats dt { color: var(--tinte-hell); }
.detail-stats dd { margin: 0; }
.detail-tip { margin: 0; color: #2e5a3a; }
.detail-protect { margin: 0; color: var(--schwimmer-dunkel); }
.detail-nav { margin-top: auto; display: flex; justify-content: space-between; font-family: var(--font); font-size: 0.95rem; }

.stamps .page { padding: 12px 20px 20px; }
.stamps-intro { margin: 0 0 10px; }
.stamp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.stamp {
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  border: 3px dashed rgba(91, 102, 112, 0.35);
  color: rgba(91, 102, 112, 0.6);
  line-height: 1.1;
}
.stamp-name { font-size: 1.35rem; }
.stamp-date { font-size: 0.95rem; }
.stamp.has { border: 5px double currentColor; transform: rotate(-8deg); background: rgba(255, 255, 255, 0.4); }
.stamp-fruehling.has { color: #4f8a3a; }
.stamp-sommer.has { color: #c8742a; }
.stamp-herbst.has { color: #a5502e; }
.stamp-winter.has { color: #3d6f9a; }
.stamp-gold.has { color: #a77a00; background: radial-gradient(#fff4c4, #f2d27a); }

.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.book-foot .key-hint-line { color: rgba(248, 243, 230, 0.85); margin: 0; }
.book-body.spread:not(.detail) .page { background-image: repeating-linear-gradient(transparent 0 31px, rgba(80, 130, 170, 0.14) 31px 32px); }
.book-close { max-width: 260px; margin: 0 0 0 auto; }

@media (max-width: 760px) {
  .book-body.spread { grid-template-columns: 1fr; }
  .spread .page:first-child { border-right: 0; box-shadow: none; padding-bottom: 0; min-height: 0; }
  .spread .page:last-child { box-shadow: none; min-height: 0; }
  .book-tabs { padding: 0 6px; gap: 3px; }
  .book-tab { padding: 6px 9px 10px; font-size: 0.85rem; }
  .stamp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-pic { width: 96px; height: 48px; }
}

/* --------------------------------------------------------- Leaderboard */

.board-intro, .board-own { font-size: 0.9rem; color: var(--tinte-hell); }
.board-note { color: var(--tinte-hell); }
.board-list { min-height: 160px; max-height: min(52vh, 560px); overflow-y: auto; }
.score-table { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; }
.score-table li {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 10px;
}
.score-table li:nth-child(odd) { background: var(--papier-tief); }
.score-table li.mine { background: var(--schilf-hell); outline: 3px solid var(--schilf); }
.score-rank {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--tinte-hell);
}
.score-table li:nth-child(1) .score-rank { background: #f6c945; color: #4a3300; }
.score-table li:nth-child(2) .score-rank { background: #d5d9dc; color: #2f3539; }
.score-table li:nth-child(3) .score-rank { background: #d99b62; color: #3e2410; }
.score-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-points { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Name form on the catch card (only for a pike that gets onto the list) */
.name-form {
  background: var(--papier-tief);
  border: 3px dashed var(--schilf);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
}
.name-form > * + * { margin-top: 6px; }
.name-form p { margin: 0; }
.name-title { font-weight: 700; color: #2e5a3a; text-align: center; }
.name-label { display: block; font-size: 0.85rem; color: var(--tinte-hell); }
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 6px 12px;
  border: 3px solid var(--rand);
  border-radius: 12px;
  background: #fff;
  color: var(--tinte);
  font: 700 1.1rem var(--font);
  user-select: text;
  -webkit-user-select: text;
}
.button-send { width: auto; flex: none; }
.name-message { min-height: 1.2em; font-size: 0.9rem; font-weight: 700; color: var(--schwimmer-dunkel); }
.name-message:empty { display: none; }
.name-message.ok { color: #2f6b22; }
.name-privacy { font-size: 0.75rem; color: var(--tinte-hell); }
.scores-offline { font-size: 0.85rem; color: var(--tinte-hell); }

/* ---------------------------------------------------------- Catch card */

.screen-catch { background: rgba(8, 20, 26, 0.2); }
.card-catch { width: min(460px, 100%); }
.card-catch > * + * { margin-top: 8px; }
.catch-pic { display: block; width: 100%; height: 160px; border-radius: 14px; border: 3px solid var(--rand); }
.catch-size { font-size: 1.6rem; font-weight: 700; color: var(--fluss); margin-bottom: 0; line-height: 1.1; }
.catch-count { font-size: 0.9rem; color: var(--tinte-hell); }
.catch-badge { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.catch-badge:empty { display: none; }
.chip-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid currentColor;
  animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.6, 1) both;
}
.chip-badge.badge-new { color: var(--schwimmer-dunkel); background: #fde6df; }
.chip-badge.badge-record { color: #7a5a10; background: #fbefc4; }
.chip-badge.badge-stamp { color: #2e5a3a; background: var(--schilf-hell); }
.chip-badge.badge-gold { color: #6a4a00; background: linear-gradient(#ffe58a, #f2c240); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.catch-fact { font-family: var(--hand); font-size: 1.3rem; line-height: 1.3; }
.catch-protect { font-size: 0.9rem; color: var(--tinte-hell); }

/* ------------------------------------------------------------ Switches */

.switches { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--tinte);
  font: 400 0.95rem var(--font);
  cursor: pointer;
  padding: 0 4px;
}
.switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cfc6ad;
  border: 2px solid var(--rand);
  transition: background 0.15s;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--papier);
  border: 2px solid var(--rand);
  transition: transform 0.15s;
}
.switch[aria-checked='true'] .switch-track { background: var(--schilf); }
.switch[aria-checked='true'] .switch-thumb { transform: translateX(20px); }

.storage-hint {
  font-size: 0.85rem;
  color: var(--tinte-hell);
  background: var(--papier-tief);
  border-radius: 12px;
  padding: 8px 12px;
}

.title-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.title-links a { color: var(--rand); }
.back-link { font-weight: 700; }
.back-link::before { content: '← '; }
.legal { display: flex; gap: 12px; }
.legal a { color: var(--tinte-hell); }

/* ------------------------------------------- Keyboard hints (desktop) */

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 5px;
  background: var(--papier);
  color: var(--rand);
  font: 700 0.75rem var(--font);
  box-shadow: 0 2px 0 #b5ab8c;
  border: 1px solid #cfc5a6;
}
kbd.wide { padding: 0 8px; }
.key-hints, .key-hint-line { display: none; }
@media (hover: hover) and (pointer: fine) {
  .key-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    font-size: 0.8rem;
    color: var(--tinte-hell);
  }
  .key-hints span { display: inline-flex; align-items: center; gap: 4px; }
  .key-hint-line { display: block; font-size: 0.85rem; color: var(--tinte-hell); }
}

.noscript { position: absolute; inset: 40% 16px auto; text-align: center; color: var(--papier); }

/* ------------------------------------------------- Small and low screens */

@media (max-width: 420px) {
  html, body { font-size: 16px; }
  .card { padding: 18px 16px 16px; }
  .clock-chip { font-size: 0.85rem; padding-right: 12px; }
  .logo { font-size: 2.15rem; }
  .switches { gap: 0 12px; }
  .switch { min-height: 40px; font-size: 0.88rem; gap: 6px; }
  .switch-track { width: 40px; height: 24px; }
  .switch[aria-checked='true'] .switch-thumb { transform: translateX(14px); }
}

/* Small phones: a tighter title card so it fits without scrolling */
@media (max-width: 420px) and (max-height: 700px) {
  .card-title > * + * { margin-top: 9px; }
  .card-title .tagline { font-size: 0.9rem; }
  .card-title .button-start { min-height: 52px; font-size: 1.35rem; }
  .card-title .button { min-height: 44px; padding: 6px 12px; }
  .card-title .storage-hint { font-size: 0.78rem; padding: 6px 10px; }
}

/* Laptops with little height: a more compact title card */
@media (max-height: 820px) and (min-height: 521px) and (min-width: 421px) {
  .card { padding: 16px 22px 14px; }
  .card > * + * { margin-top: 10px; }
  .logo { font-size: 2.9rem; }
  .button-start { min-height: 54px; }
  .switches { gap: 0 16px; }
  .switch { min-height: 38px; }
}

/* Phones held sideways: two columns so the title fits without scrolling */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --hud-height: 44px; }
  html, body { font-size: 15px; }
  .round-button { width: 38px; height: 38px; }
  .clock-chip { padding: 2px 12px 2px 8px; }
  .help-list { gap: 4px; font-size: 0.85rem; margin-top: 8px; }
  .help-pic { width: 54px; height: 42px; }
  .screen { padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .card { padding: 12px 18px 10px; box-shadow: 0 5px 0 var(--rand), 0 12px 30px var(--schatten); }
  .card > * + * { margin-top: 8px; }
  .card-title {
    width: min(800px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 8px 22px;
    align-items: center;
    text-align: left;
  }
  .card-title > * + * { margin-top: 0; }
  .card-title .logo { grid-column: 1; grid-row: 1; font-size: 2.3rem; }
  .card-title .tagline { grid-column: 1; grid-row: 2; margin: 0; font-size: 0.85rem; }
  .card-title .switches { grid-column: 1; grid-row: 3; justify-content: flex-start; gap: 0 10px; }
  .card-title .title-links { grid-column: 1; grid-row: 4; }
  .card-title .start-group { grid-column: 2; grid-row: 1 / span 2; }
  .card-title .button-row { grid-column: 2; grid-row: 3; }
  .card-title .button-quiet { grid-column: 2; grid-row: 4; }
  .card-title .storage-hint { grid-column: 1 / -1; grid-row: 5; padding: 4px 10px; font-size: 0.8rem; }
  .card-title .key-hints { display: none; }
  .button { min-height: 44px; padding: 6px 14px; }
  .button-start { min-height: 52px; }
  .catch-pic { height: 100px; }
  /* Catch card in two columns: the fish on the left, the rest on the right */
  .card-catch {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: 0.9fr 1fr;
    gap: 4px 18px;
    align-items: center;
  }
  .card-catch > * { grid-column: 2; margin-top: 0 !important; }
  .card-catch .catch-pic { grid-column: 1; grid-row: 1 / span 6; height: auto; aspect-ratio: 2 / 1; }
  .card-catch h2 { font-size: 1.5rem; }
  .card-catch .catch-size { font-size: 1.3rem; }
  .card-catch .catch-fact { font-size: 1.05rem; }
  .card-catch .name-form { grid-column: 1 / -1; }
  .card-catch .name-privacy { display: none; }
  /* Little height: the hint moves up under the bar, below the toast. */
  .overlay { inset: calc(var(--safe-top) + var(--hud-height) + 44px) 0 auto 0; }
  .toast { top: calc(var(--safe-top) + var(--hud-height) + 2px); }
  .bubble { padding: 6px 16px; font-size: 0.9rem; }
  .power, .tension { bottom: calc(10px + var(--safe-bottom)); }
}

/* Very large screens at 100 % scaling (4K boards): scale the controls up,
   the landscape scales by itself. */
@media (min-width: 2400px) and (min-height: 1300px) {
  .screen > *, .hud, .overlay, .toast, .tension, .power { zoom: 1.7; }
}
@media (min-width: 3200px) and (min-height: 1750px) {
  .screen > *, .hud, .overlay, .toast, .tension, .power { zoom: 2.1; }
}

/* Big monitors and boards: everything a bit larger */
@media (min-width: 1600px) and (min-height: 900px) {
  :root { --hud-height: 64px; }
  html, body { font-size: 21px; }
  .round-button { width: 54px; height: 54px; }
  .card { width: min(620px, 100%); }
}

/* Less motion: no animations, no transitions */
[data-ruhig='1'] *, [data-ruhig='1'] *::before, [data-ruhig='1'] *::after {
  animation: none !important;
  transition: none !important;
}
