/* Penguin Diner — slupka kolem hry.
   Samotná restaurace se kreslí do canvasu; tady je jen rám, překryvné
   obrazovky (úvod, konec dne, obchod, tabulka) a patička. */

:root {
  --inkoust: #2a211b;
  --papir: #fdfdfb;
  --zlata: #f0a830;
  --zlata-tmava: #c97f14;
  --zelena: #3f9e63;
  --cervena: #e4572e;
  --led: #bfe4f7;
  --led-tmavy: #8fcdea;
  --obloha: #d9f0fb;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Skrytý prvek je skrytý, i když mu nějaké pravidlo nastaví display. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--obloha);
  color: var(--inkoust);
  font: 500 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  background:
    radial-gradient(circle at 12% 0%, #ffffff 0%, transparent 45%),
    radial-gradient(circle at 88% 4%, #ffeec9 0%, transparent 42%),
    linear-gradient(180deg, var(--obloha) 0%, #bfe4f7 58%, #a8d8f0 100%);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- hlavička ---------- */

header { flex: 0 0 auto; text-align: center; padding: 6px 12px 2px; }

h1 {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 9px;
  font-size: clamp(19px, 3.4vmin, 30px);
  line-height: 1;
}

h1 .znak {
  font-size: 1.15em;
  filter: drop-shadow(0 2px 0 rgba(42, 33, 27, .35));
  animation: kolibani 3.4s ease-in-out infinite;
}
@keyframes kolibani {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}
@media (prefers-reduced-motion: reduce) { h1 .znak { animation: none; } }

h1 .nazev {
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--zlata);
  -webkit-text-stroke: 3px var(--inkoust);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--inkoust);
}
h1 .nazev .diner { color: #fff; }
h1 .nazev .cz { font-size: .5em; color: #fff; letter-spacing: 0; }

h1 .sub {
  flex-basis: 100%;
  margin-top: 3px;
  font-size: clamp(10px, 1.5vmin, 12.5px);
  letter-spacing: .02em;
  font-weight: 600;
  color: rgba(42, 33, 27, .55);
  text-shadow: none;
  -webkit-text-stroke: 0;
}

/* ---------- plocha hry ---------- */

.plocha {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 4px 8px;
}

#stage {
  position: relative;
  aspect-ratio: 1120 / 680;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  background: #cfe8f5;
  border: 4px solid var(--inkoust);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 0 rgba(42, 33, 27, .18), 0 18px 40px rgba(42, 33, 27, .22);
}

#stage:fullscreen { border-radius: 0; max-height: 100vh; box-shadow: none; }

#platno { display: block; width: 100%; height: 100%; }

/* ---------- překryvné obrazovky ---------- */

.obrazovka {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 3% 4%;
  text-align: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, .97), rgba(214, 238, 250, .97) 55%, rgba(168, 216, 240, .98));
  color: var(--inkoust);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.obrazovka[hidden] { display: none; }
.obrazovka.siroka { justify-content: flex-start; padding-top: 2.5%; }

.obrazovka h2 {
  margin: 0;
  font-size: clamp(17px, 3.6vmin, 28px);
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--zlata-tmava);
  text-shadow: 0 2px 0 #fff;
}
.obrazovka h2.dobre { color: var(--zelena); }
.obrazovka h2.spatne { color: var(--cervena); }

.obrazovka h3 {
  margin: 4px 0 0;
  font-size: clamp(12px, 2vmin, 15px);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(42, 33, 27, .72);
}
.obrazovka h3 .kase { font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .65; }
.obrazovka h3 .kase b { color: var(--zlata); }

.obrazovka p { margin: 0; max-width: 48ch; font-size: clamp(11.5px, 1.9vmin, 15px); line-height: 1.6; color: rgba(42, 33, 27, .82); }
.obrazovka .drobne { font-size: clamp(10px, 1.5vmin, 12.5px); color: rgba(42, 33, 27, .5); }
.obrazovka .postup { font-size: clamp(10.5px, 1.6vmin, 13px); color: var(--zlata-tmava); font-weight: 700; }
.obrazovka .rada { color: #b03a22; font-size: clamp(11px, 1.7vmin, 13.5px); font-weight: 600; }

.tucnak-velky { font-size: clamp(30px, 8vmin, 58px); line-height: 1; }

/* tlačítka */

.tlacitko {
  appearance: none;
  display: inline-block;
  border: 3px solid var(--inkoust);
  background: var(--zlata);
  color: var(--inkoust);
  font: 900 clamp(12px, 2.2vmin, 18px)/1 system-ui, sans-serif;
  letter-spacing: .12em;
  padding: 13px 30px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--inkoust);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.tlacitko:hover, .tlacitko:focus-visible { background: #ffc766; }
.tlacitko:active { transform: translateY(4px); box-shadow: 0 0 0 var(--inkoust); }

.tlacitko.vedlejsi {
  background: var(--papir);
  color: var(--inkoust);
  border-width: 2px;
  font-size: clamp(10.5px, 1.7vmin, 13px);
  font-weight: 800;
  letter-spacing: .06em;
  padding: 10px 20px;
  box-shadow: 0 3px 0 var(--inkoust);
}
.tlacitko.vedlejsi:hover { background: #fff0d4; }
.tlacitko.vedlejsi:active { transform: translateY(3px); box-shadow: 0 0 0 var(--inkoust); }

.radek { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }

/* návod na úvodu */

.navod {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  max-width: 68ch;
  font-size: clamp(10px, 1.6vmin, 12.5px);
}
.navod span {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 2px solid var(--inkoust); border-radius: 999px;
  padding: 5px 11px; box-shadow: 0 2px 0 rgba(42, 33, 27, .5);
}
.navod b { color: var(--zlata-tmava); font-weight: 800; }

/* ---------- souhrn dne ---------- */

.souhrn {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 620px;
}

.souhrn-radek {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 2px solid var(--inkoust);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(42, 33, 27, .45);
}
.souhrn-radek .popis { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }
.souhrn-radek .hodnota { font-size: 16px; font-weight: 900; color: var(--zlata-tmava); }
.souhrn-radek .pod { font-size: 10px; opacity: .6; }

/* ---------- obchod ---------- */

#obchod-blok { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 7px; align-items: center; }
#obchod-blok[hidden] { display: none; }

.obchod {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 6px;
  width: 100%;
}

.polozka {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--inkoust);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(42, 33, 27, .45);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background .15s, transform .08s, box-shadow .08s;
}
.polozka:hover:not(:disabled) { background: #fff3dc; }
.polozka:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--inkoust); }
.polozka:disabled { opacity: .42; cursor: default; box-shadow: none; }

.polozka .ikona { font-size: 21px; line-height: 1; flex: 0 0 auto; }
.polozka .text { flex: 1 1 auto; min-width: 0; }
.polozka .nazev { display: flex; align-items: baseline; gap: 5px; font-size: 12px; font-weight: 700; }
.polozka .uroven { font-size: 9.5px; opacity: .45; font-weight: 600; }
.polozka .popis { font-size: 10px; opacity: .58; line-height: 1.3; }
.polozka .cena { font-size: 11.5px; font-weight: 900; color: var(--zlata-tmava); white-space: nowrap; }

/* ---------- tlakové lahve ---------- */

.lahve-box {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 2px solid var(--inkoust);
  border-radius: 10px;
  background: linear-gradient(90deg, #ffe9c2, #fff8ec);
  box-shadow: 0 3px 0 rgba(42, 33, 27, .45);
  text-align: left;
}
.lahve-box .ikona { font-size: 22px; }
.lahve-box p { font-size: 11px; line-height: 1.5; color: var(--inkoust); max-width: none; }
.lahve-box a { color: #b5713c; font-weight: 800; text-decoration: none; border-bottom: 2px solid rgba(181, 113, 60, .5); white-space: nowrap; }
.lahve-box a:hover { color: var(--cervena); }

/* ---------- zápis skóre ---------- */

.zapis { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }

input.jmeno {
  appearance: none;
  background: #fff;
  border: 2px solid var(--inkoust);
  border-radius: 8px;
  color: var(--inkoust);
  font: 600 13px/1 system-ui, sans-serif;
  padding: 10px 13px;
  width: min(100%, 190px);
  text-align: center;
}
input.jmeno:focus { outline: none; border-color: var(--zlata-tmava); box-shadow: 0 0 0 3px rgba(240,168,48,.35); }

.cenik {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 5px;
  width: 100%;
  max-width: 620px;
}
.cenik .radek {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 2px solid var(--inkoust);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(42, 33, 27, .4);
  text-align: left;
}
.cenik .ikona { font-size: 19px; }
.cenik .jmeno { flex: 1 1 auto; font-size: 12px; font-weight: 700; min-width: 0; }
.cenik .jmeno small { display: block; font-size: 9.5px; font-weight: 500; opacity: .6; }
.cenik .castka { font-size: 12.5px; font-weight: 900; color: var(--zlata-tmava); white-space: nowrap; }
.cenik .skupina {
  grid-column: 1 / -1;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 800; opacity: .55; margin-top: 4px;
}

/* ---------- tabulka ---------- */

.tabulka {
  width: 100%;
  max-width: 420px;
  border-collapse: collapse;
  font-size: clamp(10.5px, 1.7vmin, 13px);
}
.tabulka th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .42;
  padding: 0 6px 4px;
  font-weight: 600;
}
.tabulka td { padding: 4px 6px; border-top: 1px solid rgba(42, 33, 27, .14); }
.tabulka td:last-child, .tabulka th:last-child { text-align: right; }
.tabulka tr.ja td { color: var(--zlata-tmava); font-weight: 800; }
.tabulka .poradi { opacity: .42; width: 1.6em; }
.tabulka .prazdno { opacity: .42; font-style: italic; text-align: center; padding: 12px 0; }

#tabulka-lig { width: 100%; max-width: 420px; }

/* ---------- lišta pod hrou ---------- */

.ovladani {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 12px 4px;
}

.ovladani button {
  appearance: none;
  border: 2px solid var(--inkoust);
  background: #fff;
  color: var(--inkoust);
  font: 800 10.5px/1 system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(42, 33, 27, .5);
}
.ovladani button:hover { background: #fff0d4; }
.ovladani button:active { transform: translateY(2px); box-shadow: none; }

/* Na výšku se restaurace nevejde — hráče slušně požádáme o otočení.
   Viditelnost řídí shell přes atribut hidden, ne CSS.
   Rám přitom vyplní displej, aby se do něj vešlo menu i výsledky;
   samotné plátno si uprostřed drží svůj poměr stran. */
body.portret #stage {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}
body.portret #platno { height: auto; max-height: 100%; }

body.portret header { padding: 4px 10px 1px; }
body.portret h1 { font-size: clamp(16px, 5.5vw, 24px); }
body.portret h1 .sub { display: none; }
body.portret .ovladani { padding: 3px 6px; gap: 4px; }
body.portret .ovladani button { padding: 6px 10px; font-size: 9.5px; letter-spacing: .03em; }
body.portret footer {
  font-size: 9px;
  line-height: 1.55;
  padding: 3px 8px calc(4px + env(safe-area-inset-bottom));
}
body.portret footer .uvodem { display: none; }
body.portret footer a.s-logem img { height: 11px; }

.otoc-telefon .telefon {
  font-size: clamp(42px, 14vw, 72px);
  line-height: 1;
  animation: otaceni 2.6s ease-in-out infinite;
}
@keyframes otaceni {
  0%, 35% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) { .otoc-telefon .telefon { animation: none; } }

body.portret 
/* ---------- patička ---------- */

footer {
  flex: 0 0 auto;
  padding: 5px 12px calc(7px + env(safe-area-inset-bottom));
  border-top: 2px solid rgba(42, 33, 27, .12);
  text-align: center;
  font-size: 10.5px;
  line-height: 1.9;
  color: rgba(42, 33, 27, .5);
}
footer .uvodem { display: block; margin-bottom: 1px; font-weight: 600; }
footer a {
  color: #8a5a28;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
footer a:hover { color: var(--cervena); border-bottom-color: rgba(228, 87, 46, .5); }
footer .oddel { opacity: .3; padding: 0 4px; }
footer a.s-logem { display: inline-flex; align-items: center; gap: 4px; }
footer a.s-logem img { height: 15px; width: auto; vertical-align: middle; }

/* Při hraní se patička jen zúží, ale zůstane na očích. */
body.hraje body.hraje footer { font-size: 9.5px; line-height: 1.6; padding-top: 3px; }
body.hraje footer .uvodem { display: none; }

@media (max-height: 560px) {
  header { padding: 3px 10px 1px; }
  h1 .sub { display: none; }
  footer { line-height: 1.6; font-size: 9.5px; }
}
