/* ============================================================
   Indiana Jones a chrám zkázy — moderní vzhled (GitHub Pages)
   ============================================================ */
:root {
  --bg: #0e0c09;
  --bg-soft: #17130d;
  --panel: #1c170f;
  --panel-edge: #3a2f1c;
  --gold: #d4af37;
  --gold-soft: #a8862b;
  --text: #e8dfc8;
  --text-dim: #9a8f78;
  --red: #d96a5a;
  --green: #8fae6b;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 50% -10%, #241c10 0%, var(--bg) 60%);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100%;
}

/* ---------------------------------------------------- header */
header {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--gold);
}
.brand h1 em {
  font-style: normal;
  color: var(--text);
  font-weight: 400;
}
.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}
/* graficka tlacitka vpravo v hlavice: prepinac jazyka + zvuk */
.hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  background: transparent;
  border: 1px solid var(--panel-edge);
  color: var(--text-dim);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
  flex: 0 0 auto;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--gold-soft); color: var(--gold); }

/* rozbalovaci nabidka jazyka (pg_dbml styl) */
.lang-dropdown { position: relative; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 158px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 14px 36px rgba(0,0,0,.55), 0 0 0 1px rgba(212,175,55,.06);
  z-index: 40;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}
.lang-option:hover { background: rgba(212, 175, 55, .12); }
.lang-menu[hidden] { display: none; }   /* display:flex nesmi prebit hidden */
.lang-option .flag { font-size: 15px; }
.lang-option .check { margin-left: auto; color: var(--gold); opacity: 0; font-weight: 700; }
.lang-option.active .check { opacity: 1; }

/* ---------------------------------------------------- game panel */
main {
  max-width: 980px;
  margin: 10px auto 30px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  grid-template-areas:
    "term side"
    "inrow side"
    "hint side";
  align-items: start;
  column-gap: 18px;
}

#term {
  grid-area: term;
  background: linear-gradient(180deg, var(--panel) 0%, #171208 100%);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  min-height: 55vh;
  max-height: 68vh;
  overflow-y: auto;
  padding: 26px 28px 18px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.55;
  box-shadow: 0 20px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.03);
  scroll-behavior: smooth;
}
#term::-webkit-scrollbar { width: 10px; }
#term::-webkit-scrollbar-thumb { background: #3a2f1c; border-radius: 8px; }
#term::-webkit-scrollbar-track { background: transparent; }

/* radky vystupu */
.ln { margin: 0; min-height: 1.1em; white-space: pre-wrap; }
.ln + .ln { margin-top: 2px; }

/* popis mistnosti — vizualne odlisen od ostatnich textu */
.ln.room {
  color: #fdf6e0;
  border-left: 3px solid rgba(196, 152, 66, .55);
  padding-left: 10px;
  margin-top: 4px;
}

/* vychody ("Muzes jit ...") — tiche a zavyslane */
.ln.exits {
  color: #a3b896;
  font-style: italic;
  font-size: .95em;
}

/* navod/instrukce (nápověda) — odsazene a zapysane */
.ln.help {
  color: #c3b690;
  font-style: italic;
}

/* echo odeslaneho prikazu — slabe, aby se lisilo od odpovedi hry */
.ln.echo {
  color: #93876a;
}

/* oddelovaci linka mezi mistnostmi */
.sep {
  height: 1px;
  margin: 12px 0 10px;
  background: linear-gradient(90deg, rgba(196, 152, 66, .45), rgba(196, 152, 66, .12) 60%, transparent);
}
.sep + .ln { margin-top: 0; }

/* nahrobek R.I.P. po smrti */
.ln.center { text-align: center; }
img.rip {
  display: block;
  width: min(320px, 82%);
  margin: 6px auto 2px;
  border-radius: 10px;
  border: 1px solid var(--panel-edge);
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}

/* kresba mistnosti v popisu */
img.roompic {
  display: block;
  width: min(440px, 100%);
  height: auto;
  margin: 4px auto 6px;
  border-radius: 10px;
  border: 1px solid var(--panel-edge);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}

/* barvy INK 0..7 (premapovane na moderni paletu) */
.ink0 { color: #6b6353; }
.ink1 { color: #7d92c2; }
.ink2 { color: var(--red); }
.ink3 { color: #b487b4; }
.ink4 { color: var(--green); }
.ink5 { color: var(--gold); }
.ink6 { color: #e5c96d; }
.ink7 { color: #f4ecda; }

/* velky titulek v intro */
.ln.big {
  font-size: 30px;
  letter-spacing: .12em;
  margin-top: 6px;
  font-weight: 700;
}

/* smrt */
.ln.mrtev {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  text-shadow: 0 0 18px rgba(217,106,90,.45);
}

/* vyhra */
.ln.flash { animation: pulse 1.6s ease-in-out infinite; font-weight: 600; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ---------------------------------------------------- input */
#inrow {
  grid-area: inrow;
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 12px 16px;
}
#inrow:focus-within { border-color: var(--gold-soft); }
#inq { color: var(--gold); font-family: var(--serif); white-space: pre; }
#inp {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--serif);
  font-size: 16.5px;
  caret-color: var(--gold);
}
#inp::placeholder { color: #6b6353; font-style: italic; }

/* ---------------------------------------------------- ovladani */
/* postranni panel vedle terminalu; na malych obrazovkach se schova */
.controls {
  grid-area: side;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  position: sticky;
  top: 12px;
}

.compass {
  display: grid;
  /* 2 sloupce x 3 rady: (nahoru, sever) / (zapad, vychod) / (jih, dolu);
     jedna mezera mezi vsemi tlacitky, pul mezery na okraji */
  grid-template-columns: repeat(2, max-content);
  gap: 6px;
  padding: 3px;
}
.compass button {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--panel-edge);
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
  transition: all .12s ease;
}
.compass button small { display: block; color: var(--gold-soft); font-size: 10px; font-weight: 700; }
.compass button:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }

.chips {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}
.chips button {
  background: var(--bg-soft);
  border: 1px solid var(--panel-edge);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-family: var(--sans);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: all .12s ease;
}
.chips button:hover { border-color: var(--gold); color: var(--gold); }
.chips button b { color: var(--gold-soft); font-weight: 700; margin-right: 5px; }
.chips button:hover b { color: var(--gold); }

.hint {
  grid-area: hint;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}
.hint kbd {
  font-family: var(--sans);
  background: var(--bg-soft);
  border: 1px solid var(--panel-edge);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--gold-soft);
}

/* ---------------------------------------------------- footer */
footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px 34px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  border-top: 1px solid #221b10;
  padding-top: 16px;
}
footer a { color: var(--gold-soft); text-decoration: none; }
footer a:hover { color: var(--gold); text-decoration: underline; }

/* ---------------------------------------------------- uzké obrazovky */
@media (max-width: 720px) {
  /* malo mista: postranni panel s tlacitky vubec nezobrazovat */
  main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "term" "inrow" "hint";
  }
  .controls { display: none; }
}

@media (max-width: 540px) {
  #term { padding: 18px 16px 14px; font-size: 15.5px; }
  .brand h1 { font-size: 18px; }
}
