/* Pexeso E-Bezpečí */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: #0b1a33 url('img/pozadi.webp') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  text-align: center;
  padding: 72px 16px 40px;
}
.bar { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: rgba(8, 20, 40, .72); backdrop-filter: blur(6px); }
.bar a, .bar button { font: inherit; font-weight: 800; color: #fff; text-decoration: none; background: transparent; border: 1px solid rgba(255,255,255,.45); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
.bar a:hover, .bar button:hover { background: rgba(255,255,255,.12); }
.bar .home { border: 0; display: inline-flex; align-items: center; gap: 8px; padding-left: 4px; }
.bar .home b { color: #ffc940; }
.bar .tools { display: flex; gap: 8px; align-items: center; }
.bar .new { background: #ffc940; color: #0a1c34; border-color: #ffc940; }
.bar .new:hover { background: #ffd666; }
.hud { display: flex; gap: 18px; font-weight: 700; font-size: 14px; }
.hud span b { color: #ffc940; }
h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.game { display: flex; justify-content: center; align-items: flex-start; gap: clamp(8px, 1.6vw, 20px); }
.board { --c: min(160px, calc((100vw - 2 * 125px - 80px) / 6)); display: grid; grid-template-columns: repeat(6, var(--c)); gap: 10px; }
.found { display: grid; grid-template-rows: repeat(6, calc(var(--c, 160px) * .68)); gap: 10px; --c: min(160px, calc((100vw - 2 * 125px - 80px) / 6)); }
.slot { width: calc(var(--c) * .68); height: calc(var(--c) * .68); max-width: 108px; max-height: 108px; border: 2px dashed rgba(255,255,255,.55); border-radius: 8px; background: rgba(0,0,0,.15) center/cover no-repeat; padding: 0; cursor: default; }
.slot.full { border-style: solid; border-color: #ffc940; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,.35); }

.card { width: var(--c); height: var(--c); padding: 0; border: 0; background: none; perspective: 1000px; cursor: pointer; border-radius: 6px; box-shadow: 0 4px 8px rgba(0,0,0,.3); }
.card:focus-visible { outline: 4px solid #ffc940; outline-offset: 3px; }
.card-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s; transform-style: preserve-3d; }
.card.flipped .card-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-size: cover; border-radius: 6px; }
.back { background-image: url('img/rub.webp'); background-color: rgba(0,0,0,.12); }
.front { transform: rotateY(180deg); }
.card.gone { visibility: hidden; }
@media (hover: hover) { .card:not(.flipped):hover .card-inner { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .card-inner { transition: none; } }

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; cursor: pointer; outline: none; padding: 16px; }
.ov-in { width: min(640px, 92vw); }
.ov-in img { width: 100%; height: auto; display: block; }
.ov-in p { margin: 4px 0 0; font-size: 18px; font-weight: 700; }
.count { position: fixed; left: 12px; bottom: 10px; font-size: 13px; color: rgba(255,255,255,.8); }
.status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* tablet a mobil: 4 sloupce, nalezené dvojice v řadě pod plochou */
@media (max-width: 900px) {
  body { padding-top: 64px; }
  .game { flex-direction: column; align-items: center; }
  .board { --c: min(140px, calc((100vw - 32px - 30px) / 4)); grid-template-columns: repeat(4, var(--c)); order: 1; }
  .found { --c: min(140px, calc((100vw - 32px - 30px) / 4)); grid-template-rows: none; grid-template-columns: repeat(6, 1fr); gap: 6px; order: 2; width: min(100%, calc(4 * var(--c) + 30px)); }
  #foundLeft { order: 2; margin-top: 12px; }
  #foundRight { order: 3; }
  .slot { width: 100%; height: auto; aspect-ratio: 1; max-width: none; max-height: none; }
  .hud { display: none; }
  .bar .home span { display: none; }
}
