/* X GAME — Had (Nokia 3310) */
.hra-had { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.hra-had .plocha { padding: 2px 12px 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

.hd {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0;
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hd [hidden] { display: none !important; }

/* tělo telefonu kolem displeje */
.hd-telefon {
  width: 100%; max-width: 520px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center;
  padding: 2px 8px 6px; border-radius: 26px 26px 34px 34px;
  background: linear-gradient(160deg, #3a4f78 0%, #22324f 55%, #1a2740 100%);
  box-shadow: inset 0 2px 0 #ffffff22, inset 0 -3px 8px #0006, 0 6px 18px #0008;
}
.hd-horni { width: 100%; display: grid; grid-template-columns: 88px 1fr 88px; align-items: center; height: 34px; }
.hd-skup { display: flex; }
.hd-skup.vpravo { justify-content: flex-end; }
.hd-logo { text-align: center; font: 900 13px/1 system-ui, sans-serif; letter-spacing: 4px; color: #c9d4ea; opacity: .85; }
.hd-ik { height: 34px; width: 44px; border: 0; background: none; color: #c9d4ea; font-size: 17px; padding: 0; cursor: pointer; }
.hd-ik.vyp { opacity: .45; }

.hd-lcd {
  position: relative; line-height: 0; padding: 5px; border-radius: 10px;
  background: #0d1420;
  box-shadow: inset 0 0 0 2px #0a0f18, 0 1px 0 #ffffff18;
}
.hd-lcd::after {
  /* vnitřní stín a lesk skla */
  content: ''; position: absolute; inset: 5px; border-radius: 3px; pointer-events: none;
  box-shadow: inset 0 0 14px 2px #2a3a1888, inset 0 3px 6px #0005;
  background: linear-gradient(155deg, #ffffff16 0%, #ffffff00 38%);
}
.hd-c { display: block; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 3px; touch-action: none; }
.hd-pod { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 5px 8px 0; box-sizing: border-box; font: 700 12px/1.2 system-ui, sans-serif; color: #9fb0cf; min-height: 18px; }
.hd-tip { color: #c9d4ea; }

/* legenda hráčů / výsledky */
.hd-legenda { width: 100%; max-width: 520px; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 6px; }
.hd-lp {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 5px; border-radius: 9px;
  background: #1a1a23; border: 1px solid #2f2f3d; font: 700 13px/1.2 system-ui, sans-serif; max-width: 48%;
}
.hd-lp.ja { border-color: #ffcc00; }
.hd-lp.ja .hd-jm { color: #ffcc00; }
.hd-lp.mrtvy { opacity: .5; }
.hd-vz { width: 38px; height: 8px; flex: none; image-rendering: pixelated; border-radius: 2px; }
.hd-jm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hd-sk { color: #9b9bb0; font-variant-numeric: tabular-nums; flex: none; }
.hd-misto { color: #ffcc00; font-weight: 900; flex: none; }
.hd-legenda.vysl { flex-direction: column; align-items: stretch; max-width: 360px; gap: 4px; }
.hd-legenda.vysl .hd-lp { max-width: none; padding: 6px 10px; font-size: 15px; }
.hd-legenda.vysl .hd-sk { margin-left: auto; color: #f3f3f6; }
.hd-legenda.vysl .hd-lp.mrtvy { opacity: 1; }
.hd-legenda.vysl .hd-lp:first-child { background: #2a2614; border-color: #ffcc00; }

/* klávesnice jako na 3310: 2 / 4 5 6 / 8 */
.hd-klav {
  width: 100%; max-width: 330px; display: grid; grid-template-columns: 1fr 1.15fr 1fr; grid-auto-rows: 54px; gap: 6px 10px;
  margin-top: auto; padding-bottom: calc(8px + var(--safe-b, 0px));
}
.hd-k {
  border: 0; border-radius: 22px / 26px; padding: 0; position: relative;
  background: linear-gradient(#e6e9ef, #b9c0cc); color: #1d2433;
  box-shadow: 0 3px 0 #6d7586, 0 4px 8px #0007, inset 0 1px 0 #fff;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 800 20px/1 system-ui, sans-serif; touch-action: none; cursor: pointer;
}
.hd-k b { font-size: 21px; }
.hd-k i { font-style: normal; font-size: 13px; color: #4a5468; }
.hd-k.stisk, .hd-k:active { transform: translateY(2px); box-shadow: 0 1px 0 #6d7586, 0 2px 4px #0007, inset 0 1px 0 #fff; background: linear-gradient(#cfd4dc, #a8b0bd); }
.hd-k5 { background: linear-gradient(#3a4f78, #22324f); color: #c9d4ea; box-shadow: inset 0 2px 6px #0008; cursor: default; }
.hd-k5 b { opacity: .35; }
.hd-k5 i { color: #ffcc00; font-size: 18px; min-width: 18px; }
.hd-klav.pasivni .hd-k { opacity: .45; }
/* hodně hráčů: 4 na řádek, bez skóre (to je v pruhu nahoře) */
.hd-legenda.hust:not(.vysl) { gap: 4px; }
.hd-legenda.hust:not(.vysl) .hd-lp { max-width: calc(25% - 3px); flex: 0 1 calc(25% - 3px); box-sizing: border-box; padding: 2px 5px 2px 3px; gap: 4px; font-size: 12px; }
.hd-legenda.hust:not(.vysl) .hd-vz { width: 26px; height: 6px; }
.hd-legenda.hust:not(.vysl) .hd-sk { display: none; }
.hd-legenda.hust:not(.vysl) .hd-lp.mrtvy .hd-jm::before { content: '☠ '; }
.hd-jm em { font-style: normal; }
.hd-legenda.hust:not(.vysl) .hd-jm em { display: none; }

/* pauza */
.hd-pz-ik { display: inline-block; width: 14px; height: 16px; vertical-align: middle; border-left: 5px solid #c9d4ea; border-right: 5px solid #c9d4ea; box-sizing: border-box; border-radius: 1px; }
.hd-pauza {
  position: absolute; left: 5px; right: 5px; bottom: 14%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px; line-height: 1.2;
}
.hd-pz-kdo {
  margin: 0; padding: 6px 12px; border-radius: 10px; max-width: 90%; text-align: center;
  background: #16290fe6; color: #d6e6b0; font: 800 15px/1.25 system-ui, sans-serif;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hd-pokracuj {
  min-width: 210px; height: 60px; border: 0; border-radius: 16px; padding: 0 24px;
  background: var(--accent, #ffcc00); color: #1a1a00; font: 900 20px/1 system-ui, sans-serif;
  box-shadow: 0 4px 0 #b38f00, 0 8px 22px #0008; cursor: pointer; touch-action: manipulation;
}
.hd-pokracuj:active { transform: translateY(3px); box-shadow: 0 1px 0 #b38f00, 0 4px 12px #0008; }
