/* =====================================================================
   potapej.cz – vizuální systém „Sešit“
   Lodě na zadní straně čtverečkovaného sešitu: papír, tužka,
   červená a modrá propiska, zvýrazňovač. Jediné téma (papír je papír).
   Převzato z pisqorky.cz, sekce 5 (herní obrazovka) je nová: dvě moře,
   lodě modrou propiskou, zásahy červeně, potopené přes zvýrazňovač.

   Struktura souboru:
   1. tokeny   2. základ   3. komponenty (znovupoužitelné i pro statistiky)
   4. úvodní obrazovka   5. herní obrazovka (moře, lodě, přístav)   6. Potápníček
   7. responzivita   8. multiplayer
   ===================================================================== */

/* ---------- 1. Tokeny ---------- */
:root {
  --paper: #f9f6ee;
  --paper-2: #fffdf6;          /* štítek, bubliny */
  --grid: #c7d5e6;             /* čtverečky */
  --graphite: #3b3b3b;         /* tužka */
  --graphite-soft: #6d6d6d;
  --graphite-faint: #a9a49a;
  --red: #c8342b;              /* červená propiska – zásahy, poznámky na okraji */
  --blue: #1f4db0;             /* modrá propiska – lodě, jméno hráče */
  --blue-soft: rgba(31, 77, 176, .18);
  --marker: #ffe86a;           /* zvýrazňovač – potopená loď */
  --shadow: 2px 3px 0 rgba(59, 59, 59, .15);

  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* velikost čtverečku = pole moře; stránka je stejnou mřížkou podložená.
     Dvě moře vedle sebe (2 × 11 čtverečků + mezera) se musí vejít na šířku i s postavičkou nad nimi. */
  --cell: clamp(24px, min(3.4vw, 5.2vh), 44px);

  /* typografická škála (rukopis je opticky menší než sans, proto větší hodnoty) */
  --fs-body: 1.125rem;         /* 18px */
  --fs-hand: 1.7rem;
  --fs-hand-lg: 2.4rem;
  --fs-hand-xl: clamp(3.2rem, 9vw, 5rem);
}

/* ---------- 2. Základ ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: var(--fs-body)/1.45 var(--text);
  color: var(--graphite);
  background: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: calc(var(--cell) / 2) calc(var(--cell) / 2);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.screen { min-height: 100vh; min-height: 100dvh; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 3. Komponenty ---------- */
/* Rukopisné písmo */
.hand, .hand-title, .name, .say, .note, .margin-note, .link-wavy, .tally, .opt > span, .row .k, .line-input, .btn-graphite, .sea-title, .coords {
  font-family: var(--hand);
}
.hand-title { margin: 0; font-weight: 700; font-size: var(--fs-hand-xl); line-height: 1; letter-spacing: -.01em; }
.hand-title small { display: block; font-weight: 500; font-size: var(--fs-hand); line-height: 1.2; color: var(--graphite-soft); margin-top: 6px; }

/* Štítek na sešitu (červený dvojitý rámeček, mírně nakřivo) */
.label {
  background: var(--paper-2);
  border: 3px solid var(--red);
  outline: 1.5px solid var(--red); outline-offset: 3px;
  padding: 30px 34px 28px;
  box-shadow: var(--shadow);
  display: grid; gap: 20px;
  transform: rotate(-1.2deg);
}

/* Tužkový rámeček (hrací pole, později karty statistik) */
.pencil-box { position: relative; background: var(--paper); }
.pencil-box::after {
  content: ""; position: absolute; inset: -3px; pointer-events: none;
  border: 2.5px solid var(--graphite);
  border-radius: 2px 4px 3px 5px;
  transform: rotate(-.5deg);
}

/* Řádek formuláře „Popisek: ______“ */
.row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: baseline; font-size: var(--fs-hand); font-weight: 500; }
.row .k { color: var(--graphite-soft); }
.line-input {
  width: 100%; background: transparent; border: 0; border-bottom: 2px dotted var(--graphite-soft);
  padding: 0 6px 2px; font-weight: 700; font-size: 2rem; line-height: 1.15; color: var(--blue); border-radius: 0;
}
.line-input::placeholder { color: var(--graphite-faint); font-weight: 500; }
.line-input:focus-visible { outline: none; border-bottom-color: var(--blue); border-bottom-style: solid; }

.line-static { border-bottom: 2px dotted var(--graphite-soft); padding: 0 6px 2px; font-size: 2rem; line-height: 1.15; font-weight: 700; display: flex; gap: 14px; align-items: baseline; }
.nick-blue { color: var(--blue); }
.auth-rows { display: grid; gap: 20px; }
.label[data-mode="login"] .register-only { display: none; }
.check { display: flex; gap: 10px; align-items: baseline; font-family: var(--text); font-size: .95rem; color: var(--graphite-soft); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--graphite); flex: none; }
.actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.link-wavy.small { font-size: 1.2rem; }

/* Volba zakroužkovaná tužkou */
.opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.opt { position: relative; padding: 4px 12px; cursor: pointer; display: grid; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt > span { font-size: var(--fs-hand); font-weight: 500; line-height: 1.1; }
.opt small { font-family: var(--text); font-size: .85rem; color: var(--graphite-soft); }
.opt::before {
  content: ""; position: absolute; inset: -6px -12px -8px -10px; pointer-events: none;
  border: 2.5px solid transparent; border-radius: 48% 52% 50% 46% / 58% 42% 56% 44%; transform: rotate(-2deg);
  transition: border-color .15s;
}
.opt:has(input:checked)::before, .opt.checked::before { border-color: var(--graphite); }
.opt:has(input:focus-visible)::before { border-color: var(--blue); }
.opt:hover::before { border-color: var(--graphite-faint); }

/* Tlačítko „vygumovaný“ grafitový blok */
.btn-graphite {
  justify-self: start; font-weight: 700; font-size: 1.9rem; line-height: 1;
  color: var(--paper-2); background: var(--graphite);
  padding: 14px 30px 16px; border-radius: 14px 12px 16px 10px / 10px 16px 12px 14px;
  box-shadow: 2px 2px 0 var(--graphite-soft); transform: rotate(.6deg);
}
.btn-graphite:hover { background: #222; }
.btn-graphite:disabled { opacity: .5; cursor: default; }
.btn-graphite.small { font-size: 1.5rem; padding: 10px 22px 12px; }

/* Odkaz s vlnovkou (propiska) */
.link-wavy {
  font-size: 1.55rem; font-weight: 500; color: var(--graphite);
  text-decoration: underline wavy var(--graphite-soft); text-underline-offset: 4px;
}
.link-wavy:hover { color: var(--blue); text-decoration-color: var(--blue); }
.link-wavy.faint { color: var(--graphite-faint); }
.faint-text { color: var(--graphite-faint); font-size: .85em; }

/* Poznámky: na okraji sešitu (červeně) a volné (tužkou) */
.note { font-size: 1.4rem; font-weight: 500; line-height: 1.15; color: var(--graphite-soft); }
.margin-notes { display: grid; gap: 8px; align-content: start; }
.margin-note { font-size: 1.5rem; font-weight: 500; line-height: 1.1; transform: rotate(-6deg); display: inline-block; }
.margin-note.red { color: var(--red); }

/* Jméno + symbol */
.who { display: flex; gap: 12px; align-items: baseline; }
.name { font-size: var(--fs-hand-lg); font-weight: 700; line-height: 1; }
.name.x { color: var(--red); }
.name.o { color: var(--blue); }

/* Skóre čárkami (po pěti se škrtá) */
.tally { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; font-size: 1.55rem; font-weight: 500; }
.tally .t { display: inline-flex; align-items: center; gap: 10px; }
.tally .t b { font-weight: 700; }
.tally .marks { display: inline-flex; gap: 10px; }
.tally .g { display: inline-flex; gap: 4px; position: relative; height: 26px; }
.tally .g i { display: block; width: 3px; height: 26px; background: var(--graphite); border-radius: 2px; transform: rotate(-3deg); }
.tally .g.full::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; background: var(--graphite); border-radius: 2px; transform: rotate(-32deg); }
.tally .zero { color: var(--graphite-faint); }
.tally .num { font-weight: 700; }

.error { color: var(--red); margin: 0; font-family: var(--text); }

/* ---------- 4. Úvodní obrazovka ---------- */
.screen-start { display: grid; place-items: center; padding: 24px 16px 40px; }
.label-wrap { position: relative; width: min(600px, 100%); margin-bottom: 250px; }
.mascot-start { position: absolute; right: -44px; bottom: -160px; width: 220px; transform: rotate(3deg); pointer-events: none; }
.note-start { position: absolute; left: 4px; top: calc(100% + 26px); max-width: 400px; margin: 0; transform: rotate(-2deg); font-size: 1.55rem; line-height: 1.2; }

/* patička úvodu: provozovatel a povinné odkazy, na mobilu pod sebou */
.screen-start { grid-template-rows: 1fr auto auto; align-content: space-between; }
.site-foot { justify-self: center; align-self: end; display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; align-items: baseline;
  font-family: var(--hand); font-size: 1.25rem; color: var(--graphite-soft); padding-top: 24px; }
.site-foot a { color: var(--graphite-soft); text-decoration: underline wavy var(--graphite-faint); text-underline-offset: 4px; }
.site-foot a:hover, .site-foot a:focus-visible { color: var(--blue); }

.hand-title .h1-tail { display: block; font-weight: 500; font-size: var(--fs-hand-lg); color: var(--red); margin-top: 2px; }
.subtitle { margin: -8px 0 0; font-family: var(--hand); font-weight: 500; font-size: var(--fs-hand); line-height: 1.2; color: var(--graphite-soft); }

/* indexovatelný text „o hře“ pod štítkem – běžný text, rukopisné nadpisy */
.about { justify-self: center; width: min(600px, 100%); display: grid; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 2px dotted var(--graphite-faint); }
.about-title { margin: 0; font-family: var(--hand); font-weight: 700; font-size: 2.1rem; line-height: 1.05; }
.about h3 { margin: 8px 0 0; font-family: var(--hand); font-weight: 700; font-size: 1.6rem; line-height: 1.1; color: var(--red); }
.about p { margin: 0; font-size: 1.02rem; line-height: 1.55; max-width: 66ch; }
.about a { color: var(--blue); }

/* Široký monitor: úvod jako otevřený sešit – vlevo štítek s Potápníčkem, vpravo „zápisky o hře“
   s červenou linkou okraje. Text je součást papíru; na mobilu zůstává pod štítkem. */
@media (min-width: 1100px) {
  .screen-start { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 0; padding: 40px 32px 40px; }
  .label-wrap { grid-column: 1; margin-bottom: 240px; justify-self: center; align-self: center; }
  .note-start { left: 40px; }
  .about {
    grid-column: 2; align-self: center; margin: 0 0 0 40px; padding: 28px 28px 28px 56px; border: 0;
    width: min(520px, 100%); position: relative; box-shadow: inset 1px 0 0 var(--grid);
  }
  .about::before { content: ""; position: absolute; left: 36px; top: 0; bottom: 0; border-left: 2px solid rgba(200, 52, 43, .55); }  /* okraj sešitu */
  .about::after { content: attr(data-margin-note); position: absolute; left: 52px; top: -6px; font-family: var(--hand); color: var(--red); font-size: 1.2rem; transform: rotate(-4deg); }
  .about-title { font-size: 2.3rem; }
  .about p { font-family: var(--hand); font-size: 1.45rem; line-height: 1.25; color: var(--graphite); }
  .site-foot { grid-column: 1 / -1; padding-top: 10px; }
}

/* ---------- 5. Herní obrazovka ---------- */
/* Dvě moře vedle sebe jako v sešitu: vlevo moje (sem střílí soupeř), vpravo soupeřovo (sem střílím já).
   Potápníček stojí nad svým mořem vpravo, hráč pod svým vlevo. */
.screen-game {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "notes  bot"
    "own    enemy"
    "player corner";
  justify-content: center; align-content: start;
  column-gap: calc(var(--cell) * 1.5); row-gap: 12px; padding: 18px 24px 24px;
}
.margin-notes { grid-area: notes; justify-self: start; align-self: end; }
.sea.own { grid-area: own; }
.sea.enemy { grid-area: enemy; }
.dock { grid-area: enemy; }
.bot { grid-area: bot; justify-self: end; align-self: end; }
.player { grid-area: player; justify-self: start; align-self: start; display: grid; gap: 4px; }
.corner { grid-area: corner; justify-self: end; align-self: start; display: grid; gap: 10px; justify-items: end; }
.links { display: flex; gap: 12px 22px; flex-wrap: wrap; justify-content: flex-end; }
.links .link-wavy { white-space: nowrap; }
.status { color: var(--graphite-soft); font-size: 1.05rem; min-height: 1.5em; max-width: calc(var(--cell) * 11); }

/* Moře = kus papíru se stejnou mřížkou, orámovaný tužkou, s písmeny a čísly po okraji */
.sea { display: grid; gap: 6px; justify-items: start; align-content: start; }
.sea-title { margin: 0; font-weight: 500; font-size: 1.5rem; line-height: 1; color: var(--graphite-soft); transform: rotate(-1.5deg); padding-left: calc(var(--cell) * .7); }
.board-frame {
  display: grid;
  grid-template-columns: calc(var(--cell) * .7) auto;
  grid-template-rows: calc(var(--cell) * .7) auto;
}
.coords { color: var(--graphite-faint); font-weight: 500; font-size: calc(var(--cell) * .55); line-height: 1; user-select: none; }
.coords.cols { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--n, 10), var(--cell)); align-items: end; text-align: center; padding-bottom: 3px; }
.coords.rows { grid-column: 1; grid-row: 2; display: grid; grid-auto-rows: var(--cell); align-items: center; text-align: right; padding-right: 5px; }
.board {
  grid-column: 2; grid-row: 2;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 10), var(--cell));
  grid-auto-rows: var(--cell);
  background: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  touch-action: manipulation;
}
.board::after {
  content: ""; position: absolute; inset: -3px; pointer-events: none;
  border: 2.5px solid var(--graphite); border-radius: 2px 4px 3px 5px; transform: rotate(-.5deg);
}
.board.enemy::after { transform: rotate(.4deg); border-radius: 4px 2px 5px 3px; }
.cell {
  position: relative; display: grid; place-items: center; user-select: none;
  font-family: var(--hand); font-weight: 700; font-size: calc(var(--cell) * 1.3); line-height: 1;
}
/* kam se dá střílet / položit loď */
.board.enemy .cell:not(.miss):not(.hit) { cursor: crosshair; }
.board.enemy:not(.locked) .cell:not(.miss):not(.hit):hover { background: rgba(200, 52, 43, .1); }
.board.own.placing .cell { cursor: pointer; }
.board.locked .cell { cursor: default; }
.board.locked .cell:hover { background: transparent; }

/* značky: vedle = tečka tužkou, zásah = křížek červenou propiskou */
.cell.miss::after {
  content: ""; display: block; width: calc(var(--cell) * .2); height: calc(var(--cell) * .2); border-radius: 50% 45% 55% 50%;
  background: var(--graphite-soft); opacity: .85; animation: scribble .18s ease-out;
}
.cell.hit::after {
  content: "x"; color: var(--red); display: block; position: relative; z-index: 2;
  --dx: -.13; --dy: -.345; transform: translate(calc(var(--cell) * var(--dx)), calc(var(--cell) * var(--dy))) rotate(-4deg);
  animation: scribble .18s ease-out;
}
/* značky přesahují do sousedních polí – nesmí chytat kliknutí */
.cell::after, .cell::before { pointer-events: none; }
.cell.last::before {
  content: ""; position: absolute; inset: 6%; border: 2px solid var(--graphite-soft); border-radius: 50% 46% 52% 48% / 48% 52% 46% 54%;
  transform: rotate(8deg); pointer-events: none; z-index: 3;
}
/* zaměření pole před výstřelem – červený kroužek, který se stáhne na pole */
.cell.aim::before {
  content: ""; position: absolute; inset: 8%; border: 2.5px solid var(--red); border-radius: 50% 46% 52% 48% / 48% 52% 46% 54%;
  z-index: 3; animation: aim .8s ease-out forwards;
}
@keyframes aim { 0% { transform: scale(2.2) rotate(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1) rotate(12deg); opacity: 0; } }
.margin-note.small { font-size: 1.15rem; transform: rotate(-3deg); }
/* náhled při rozmisťování */
.cell.preview { background: var(--blue-soft); }
.cell.preview.bad { background: rgba(200, 52, 43, .22); }

/* Loď: obrys modrou propiskou přes několik polí, uvnitř lehké šrafování. Pozice v jednotkách polí (CSS proměnné). */
.ship {
  position: absolute; pointer-events: none; z-index: 1;
  left: calc(var(--cell) * var(--x) + var(--cell) * .1);
  top: calc(var(--cell) * var(--y) + var(--cell) * .1);
  width: calc(var(--cell) * var(--w) - var(--cell) * .2);
  height: calc(var(--cell) * var(--h) - var(--cell) * .2);
  border: 2.5px solid var(--blue); border-radius: calc(var(--cell) * .45) / calc(var(--cell) * .5);
  background: repeating-linear-gradient(-48deg, transparent 0 4px, var(--blue-soft) 4px 5.5px);
  transform: rotate(-.6deg); animation: scribble .25s ease-out;
}
.ship:nth-child(even) { transform: rotate(.7deg); }
.ship.h { border-radius: calc(var(--cell) * .5) / calc(var(--cell) * .45); }
/* odhalená po konci hry (nepotopená soupeřova loď): tečkovaný obrys tužkou, bez výplně */
.ship.revealed { border: 2.5px dotted var(--graphite-soft); background: none; opacity: .85; }
/* potopená: červený obrys a přetažení zvýrazňovačem */
.ship.sunk { border-color: var(--red); background: var(--marker); mix-blend-mode: multiply; opacity: .95; animation: swipe .5s ease-out; }
.board.enemy .ship.sunk { z-index: 1; }

@keyframes scribble { from { opacity: 0; } to { opacity: 1; } }
@keyframes swipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* flotila pod mořem: lodě jako řady čtverečků modrou propiskou, potopené škrtnuté červeně */
.fleet { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding-left: calc(var(--cell) * .7); min-height: 16px; max-width: calc(var(--cell) * 11); }
.fship { display: inline-flex; gap: 2px; position: relative; }
.fship i { display: block; width: 12px; height: 12px; border: 1.6px solid var(--blue); border-radius: 3px; background: var(--blue-soft); }
.fship.sunk i { border-color: var(--graphite-faint); background: transparent; }
.fship.sunk::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: var(--red); transform: rotate(-8deg); border-radius: 2px; }

/* Přístav – lístek s loděmi k rozmístění (na místě soupeřova moře); .slip je absolutní, tady musí sedět v mřížce */
.slip.dock { position: static; width: min(400px, calc(var(--cell) * 11 + 24px)); align-self: start; justify-self: start; margin-top: 14px; }
.dock-ships { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.dock-ship { display: grid; gap: 4px; padding: 6px 10px; position: relative; cursor: pointer; text-align: left; }
.dock-ship .fship i { width: 14px; height: 14px; }
.dock-ship small { font-family: var(--text); font-size: .8rem; color: var(--graphite-soft); }
.dock-ship small b { color: var(--graphite); }
.dock-ship::before {
  content: ""; position: absolute; inset: -4px -8px -6px -6px; pointer-events: none;
  border: 2.5px solid transparent; border-radius: 48% 52% 50% 46% / 58% 42% 56% 44%; transform: rotate(-2deg); transition: border-color .15s;
}
.dock-ship.sel::before { border-color: var(--graphite); }
.dock-ship:hover::before { border-color: var(--graphite-faint); }
.dock-ship.done { opacity: .4; cursor: default; }
.dock-ship.done::before { border-color: transparent !important; }

/* ---------- 6. Potápníček ---------- */
/* Kresba a nálady jsou v potapnicek.css (SVG se vkládá do .figure-slot). Tady jen umístění a poznámka. */
.bot { position: relative; width: min(200px, 24vw); display: grid; justify-items: center; gap: 2px; }
.bot-img { width: 100%; }
.figure-slot svg { width: 100%; height: auto; display: block; overflow: visible; }
.say {
  position: absolute; right: 90%; top: 6px; width: 190px; text-align: right;
  font-size: 1.45rem; font-weight: 500; line-height: 1.1; color: var(--graphite);
  transform: rotate(-4deg); transition: opacity .3s;
}
.say::after { content: ""; position: absolute; right: -32px; top: 60%; width: 28px; border-top: 2px solid var(--graphite-soft); transform: rotate(-25deg); }
.say:empty { opacity: 0; }

/* ---------- 7. Responzivita ---------- */
@media (max-width: 820px) {
  :root { --cell: min(8vw, 5vh); --fs-body: 1rem; --fs-hand: 1.45rem; --fs-hand-lg: 2rem; }
  .screen-game {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas: "notes bot" "enemy enemy" "player player" "own own" "corner corner";
    padding: 12px; gap: 10px; justify-content: stretch;
  }
  .sea, .slip.dock { justify-self: center; }
  .slip.dock { width: min(400px, 100%); margin-top: 16px; }
  .player, .corner { justify-self: center; text-align: center; }
  .player .who { justify-content: center; }
  .status { max-width: none; }
  .bot { width: min(150px, 40vw); }
  .say { width: 130px; font-size: 1.15rem; right: 80%; }
  .mascot-start { width: 130px; right: -10px; bottom: -110px; }
  .site-foot { padding-top: 20px; font-size: 1.15rem; }
  .label-wrap { margin-bottom: 130px; }
  .about { margin-top: 10px; }
  .note-start { display: none; }
  .label { padding: 22px 20px; }
  .link-wavy { font-size: 1.3rem; }
  .tally { font-size: 1.3rem; gap: 14px; justify-content: center; }
  .links { justify-content: center; }
  .fleet { max-width: none; }
}

/* ---------- 8. Multiplayer ---------- */
.margin-note.link { cursor: pointer; text-decoration: underline wavy var(--graphite-soft); text-underline-offset: 4px; color: var(--graphite); }
.margin-note.link:hover { color: var(--blue); }
.margin-note .count { color: var(--blue); }
.margin-note.faint { color: var(--graphite-faint); font-size: 1.15rem; transform: none; }

/* Lístek – kus papíru přilepený přes stránku */
.slip {
  position: absolute; z-index: 5; background: var(--paper-2); padding: 20px 24px; box-shadow: var(--shadow);
  border: 1.5px solid var(--graphite-soft); border-radius: 3px 6px 4px 5px; width: min(380px, calc(100vw - 32px));
  display: grid; gap: 12px; transform: rotate(-.8deg);
}
.slip::before { /* izolepa */
  content: ""; position: absolute; top: -12px; left: 50%; width: 70px; height: 22px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 232, 106, .45); border: 1px solid rgba(59, 59, 59, .08);
}
.slip-title { margin: 0; font-family: var(--hand); font-weight: 700; font-size: 1.9rem; line-height: 1.05; }
.slip-text { margin: 0; font-size: .95rem; color: var(--graphite-soft); }
.slip-text.hand-note { font-family: var(--hand); font-size: 1.35rem; color: var(--graphite); }
.slip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--hand); font-size: 1.55rem; }
.slip-list li { display: flex; gap: 14px; align-items: baseline; }
.slip-list .nick { font-weight: 700; color: var(--blue); }
.slip-list .muted { color: var(--graphite-faint); font-size: 1.2rem; }
.slip-blocked { font-size: .9rem; color: var(--graphite-soft); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.slip-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mp-panel { left: 24px; top: 90px; }
.invite-note { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(1deg); }

/* soupeř vpravo nahoře, Potápníček vedle něj jako menší divák */
.opp { grid-area: bot; justify-self: end; align-self: end; display: grid; gap: 4px; justify-items: end; text-align: right; margin-right: calc(min(200px, 24vw) * .9); }
.screen-game.human .bot { width: min(130px, 16vw); }
.screen-game.human .bot .who { display: none; }
.screen-game.human .bot .say { width: 130px; font-size: 1.15rem; }
.opp .status.turn { color: var(--red); font-weight: 600; }

/* chat – lístek v pravém dolním rohu */
.chat { display: grid; gap: 8px; width: min(340px, calc(var(--cell) * 11)); justify-items: stretch; margin-bottom: 8px; }
.chat-title { margin: 0; font-family: var(--hand); font-weight: 700; font-size: 1.5rem; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 150px; overflow-y: auto; font-size: .95rem; }
.chat-list li { padding: 2px 0; border-bottom: 1px dotted var(--grid); }
.chat-list li b { font-family: var(--hand); font-size: 1.15rem; font-weight: 700; margin-right: 6px; color: var(--blue); }
.chat-list li.mine b { color: var(--red); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chat-quick button { font-family: var(--hand); font-size: 1.15rem; color: var(--graphite-soft); text-decoration: underline dotted; text-underline-offset: 3px; }
.chat-quick button:hover { color: var(--blue); }
.chat-form { display: flex; gap: 10px; align-items: baseline; }
.chat-input { font-size: 1.35rem; font-weight: 500; color: var(--graphite); }

@media (max-width: 820px) {
  .mp-panel { left: 12px; top: 70px; }
  .chat { width: 100%; }
  .opp { margin-right: calc(min(150px, 40vw) * .9); }
  .screen-game.human .bot { width: 90px; }
}

/* vlajka jazyka hráče (CZ / EN) – malý „razítkový“ obdélník, inline SVG z app.js */
.flag { display: inline-block; width: 26px; height: 18px; vertical-align: -2px; border: 1px solid var(--graphite-soft); border-radius: 2px; overflow: hidden; box-shadow: 1px 1px 0 rgba(59,59,59,.15); transform: rotate(-3deg); }
.flag svg { display: block; width: 100%; height: 100%; }
.flag:empty { display: none; }
.slip-list .flag { width: 22px; height: 15px; }
