/* Atribut hidden musi vyhrat nad display pravidly trid (.zamek ma display:grid). */
[hidden] { display: none !important; }

:root {
  --pozadi: #0b0b0d;
  --panel: #141418;
  --text: #ddd8cf;
  --tlumene: #8b857c;
  --akcent: #9a6b3f;
  --akcent-svetly: #c08a55;
  --cara: #26262c;
  --krev: #7a2e22;
  --gutter: 16px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--pozadi);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.65;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) var(--gutter) calc(72px + env(safe-area-inset-bottom));
}

/* zamek */
.zamek {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 30%, #17171c 0%, #08080a 70%);
  padding: var(--gutter);
}
.zamek-panel { width: 100%; max-width: 340px; text-align: center; }
.zamek h1 { font-size: 2rem; letter-spacing: .08em; margin: 0 0 .2em; font-weight: normal; }
.podtitul { color: var(--tlumene); font-style: italic; margin: 0 0 2em; }

input[type=password], input[type=text] {
  width: 100%; padding: 14px; margin-bottom: 12px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cara); border-radius: 4px;
  font-family: inherit; font-size: 1rem;
}
input:focus { outline: 1px solid var(--akcent); }

button {
  font-family: inherit; font-size: 1rem; cursor: pointer;
  border-radius: 4px; border: 1px solid var(--cara);
  background: var(--panel); color: var(--text);
  padding: 14px; transition: background .15s, border-color .15s;
}
button:active { background: #1e1e24; }
.hlavni { width: 100%; background: var(--akcent); border-color: var(--akcent); color: #140d06; }
.hlavni:active { background: var(--akcent-svetly); }
.vedlejsi { width: 100%; margin-top: 10px; color: var(--tlumene); }

/* hlavni text */
.text { padding: 24px 0 8px; white-space: pre-wrap; min-height: 40vh; }
.text .nadpis-casti {
  display: block; text-align: center; letter-spacing: .18em;
  color: var(--tlumene); font-size: .85rem; margin: 2em 0; text-transform: uppercase;
}

/* volby */
.volby { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.volby button { text-align: left; border-left: 2px solid var(--akcent); padding-left: 16px; }

/* kostky */
.kostky { margin: 20px 0; padding: 16px; background: var(--panel); border: 1px solid var(--cara); border-radius: 4px; }
.kostky-duvod { margin: 0 0 .4em; color: var(--text); }
.kostky-vyzva { margin: 0 0 14px; color: var(--tlumene); font-style: italic; font-size: .9rem; }
.kostky-mrizka { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 8px; }
.kostky-mrizka button { padding: 16px 0; text-align: center; font-size: 1.15rem; }

/* vlastni akce */
.vlastni { display: flex; gap: 8px; margin: 16px 0; }
.vlastni input { margin: 0; }
.vlastni button { width: 52px; flex: 0 0 52px; padding: 0; font-size: 1.3rem; }

/* cekani */
.cekam { display: flex; gap: 8px; justify-content: center; padding: 28px 0; }
.cekam span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--tlumene);
  animation: puls 1.3s infinite ease-in-out;
}
.cekam span:nth-child(2) { animation-delay: .18s; }
.cekam span:nth-child(3) { animation-delay: .36s; }
@keyframes puls { 0%, 70%, 100% { opacity: .2; } 35% { opacity: 1; } }

.chyba { color: var(--krev); font-size: .9rem; padding: 10px 0; }

/* listva */
.listva {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 8px; align-items: center;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--pozadi) 70%, transparent);
  border-top: 1px solid var(--cara);
}
.ikona { width: 52px; flex: 0 0 52px; padding: 12px 0; text-align: center; }
.ikona.siroke { flex: 1; width: auto; }
.ikona.aktivni { border-color: var(--akcent); color: var(--akcent-svetly); }

/* stavovy panel */
.stav-panel {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 5, 7, .9);
  display: grid; place-items: end stretch;
  padding: var(--gutter);
}
.stav-obsah {
  background: var(--panel); border: 1px solid var(--cara); border-radius: 6px;
  padding: 20px; max-height: 82dvh; overflow-y: auto; position: relative;
  margin-bottom: 72px;
}
.zavrit {
  position: absolute; top: 8px; right: 8px;
  width: 40px; height: 40px; padding: 0; border: none; background: none;
  font-size: 1.6rem; color: var(--tlumene);
}
.stav-radek { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--cara); }
.stav-radek .popis { color: var(--tlumene); font-size: .9rem; }
.stav-nadpis { color: var(--tlumene); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; margin: 18px 0 6px; }
.stav-seznam { margin: 0; padding-left: 1.2em; font-size: .95rem; }
.stav-seznam li { padding: 3px 0; }
.mericka { height: 4px; background: var(--cara); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.mericka i { display: block; height: 100%; background: var(--akcent); }
.mericka.nizka i { background: var(--krev); }

@media (min-width: 680px) {
  body { max-width: 640px; margin: 0 auto; font-size: 19px; }
  .stav-panel { place-items: center; }
  .stav-obsah { max-width: 560px; width: 100%; margin-bottom: 0; }
}
