/* X GAME — Ďoura */
.hra-doura { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.hra-doura .hlavicka, .hra-doura .pruh-hracu { position: relative; z-index: 3; }
.hra-doura .hlavicka { background: linear-gradient(#0f0f14f0, #0f0f14b8); padding-top: 8px; padding-bottom: 6px; }
.hra-doura .pruh-hracu { background: linear-gradient(#0f0f14b8, #0f0f1400); padding-bottom: 10px; }
.hra-doura .ph { background: #1a1a23cc; padding: 3px 9px; }
.hra-doura .plocha { padding: 0; flex: none; }
.hra-doura .konec-lista { z-index: 6; }

.dr {
  --dr-top: 110px;
  position: fixed; inset: 0; z-index: 1; overflow: hidden;
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  background: #bfe6ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.dr-c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.dr-hud { position: absolute; inset: 0; pointer-events: none; }
.dr-hud [hidden] { display: none !important; }

/* načítání */
.dr-nacitam { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: linear-gradient(#bfe6ff, #a6e08a); color: #23324a; font-weight: 800; }
.dr-nac-dira { width: 92px; height: 34px; border-radius: 50%; background: radial-gradient(#000 55%, #1d1d2b 70%, #ffcc00 72%, #ffcc00 78%, transparent 80%); animation: dr-nac 1s ease-in-out infinite alternate; }
@keyframes dr-nac { to { transform: scale(1.18); } }
.dr-chyba { position: absolute; inset: 40% 20px auto; color: #23324a; font-weight: 700; }

/* čas */
.dr-horni { position: absolute; top: calc(var(--dr-top) + 2px); left: 0; right: 0; display: flex; justify-content: center; }
.dr-cas {
  min-width: 104px; text-align: center; padding: 4px 16px 6px; border-radius: 18px;
  background: #141826b8; color: #fff; box-shadow: 0 4px 0 #0b0e1866;
  font: 900 34px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.dr-cas.dochazi { background: #ff3b5cdd; animation: dr-tep .5s ease-in-out infinite alternate; }
@keyframes dr-tep { to { transform: scale(1.09); } }

/* žebříček */
.dr-top {
  position: absolute; top: calc(var(--dr-top) + 58px); right: 10px; margin: 0; padding: 6px 8px; list-style: none;
  background: #141826a6; border-radius: 14px; min-width: 112px; max-width: 46vw;
  display: grid; gap: 2px; color: #fff; font-size: 13px; font-weight: 700;
}
.dr-top li { display: grid; grid-template-columns: 12px 10px 1fr auto; align-items: center; gap: 5px; line-height: 19px; }
.dr-top li.ja { color: #ffcc00; }
.dr-top li.mrtvy { opacity: .45; }
.dr-p { font-size: 11px; color: #9aa3c0; text-align: right; }
.dr-top i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px #0006; }
.dr-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-top b { font-variant-numeric: tabular-nums; font-weight: 900; }

/* log */
.dr-log { position: absolute; top: calc(var(--dr-top) + 58px); left: 10px; right: 150px; display: grid; gap: 5px; justify-items: start; }
.dr-lg {
  background: #141826c4; color: #fff; padding: 6px 11px; border-radius: 12px; font-size: 13px; font-weight: 800;
  animation: dr-lg 4.2s ease both; max-width: 100%;
}
@keyframes dr-lg { 0% { opacity: 0; transform: translateX(-14px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* moje úroveň a skóre dole */
.dr-ja {
  position: absolute; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 22px;
  background: #141826cc; color: #fff; box-shadow: 0 5px 0 #0b0e1866; width: max-content; max-width: calc(100vw - 20px);
}
.dr-ja-ur {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; line-height: 1;
  background: linear-gradient(160deg, #ffd84d, #ff9f1c); color: #2a1a00; box-shadow: inset 0 -4px 0 #0002;
}
.dr-ja-ur span { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.dr-ja-ur b { font-size: 26px; font-weight: 900; margin-top: -6px; }
.dr-ja.tep .dr-ja-s b { animation: dr-bump .3s ease; }
@keyframes dr-bump { 40% { transform: scale(1.25); color: #ffe066; } }
.dr-ja-s { display: grid; justify-items: center; line-height: 1; min-width: 50px; }
.dr-ja-s b { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dr-ja-s span { font-size: 11px; color: #9aa3c0; font-weight: 700; margin-top: 2px; }
.dr-ja-pr { display: grid; gap: 6px; min-width: 150px; }
.dr-ja-bar { height: 11px; border-radius: 9px; background: #ffffff22; overflow: hidden; box-shadow: inset 0 1px 2px #0006; }
.dr-ja-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcc00, #ff8a2b); border-radius: inherit; transform-origin: left; transition: transform .35s ease; }
.dr-ja-dalsi { font-size: 12.5px; color: #c8cee0; font-weight: 600; white-space: nowrap; }
.dr-ja-dalsi b { color: #fff; }
.dr-ja-dalsi em { font-style: normal; color: #ffcc00; font-weight: 800; }

/* postup na další úroveň */
.dr-level { position: absolute; left: 0; right: 0; top: 30%; display: grid; place-items: center; }
.dr-level span {
  font: 900 46px/1 system-ui, sans-serif; color: #ffd84d; letter-spacing: .02em;
  -webkit-text-stroke: 3px #1b2236; paint-order: stroke fill; text-shadow: 0 6px 0 #1b223688;
}
.dr-level.jed span { animation: dr-lv 1.5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes dr-lv { 0% { transform: scale(.3); opacity: 0; } 18% { transform: scale(1.12); opacity: 1; } 30% { transform: scale(1); } 80% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-30px); } }

/* jemná vinětace přes scénu */
.dr-vinet { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 75% at 50% 52%, transparent 58%, rgba(20, 30, 60, .28) 100%); }

/* body nad dírou */
.dr-popy { position: absolute; inset: 0; }
.dr-pop {
  position: absolute; left: 50%; top: var(--py, 44%); transform: translate(-50%, 0);
  font: 900 26px/1 system-ui, sans-serif; color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 #1b2236, 0 0 10px #0006; -webkit-text-stroke: 1px #1b2236; paint-order: stroke fill;
  animation: dr-pop 1s cubic-bezier(.2, .9, .3, 1) both;
}
.dr-pop.stredni { font-size: 34px; color: #ffe066; }
.dr-pop.velky { font-size: 24px; color: #ffcc00; top: calc(var(--py, 44%) - 50px); animation-duration: 1.7s; }
@keyframes dr-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }

/* jména u děr */
.dr-jmena { position: absolute; inset: 0; }
.dr-jm { position: absolute; left: 0; top: 0; will-change: transform; }
.dr-jm span {
  display: block; padding: 2px 9px 3px; border-radius: 10px; font-size: 12.5px; font-weight: 900; color: #fff; white-space: nowrap;
  background: #141826c8; box-shadow: inset 0 -3px 0 var(--b); max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}

/* odpočet */
.dr-odpocet { position: absolute; inset: 0; display: grid; place-items: center; }
.dr-odpocet span {
  font: 900 120px/1 system-ui, sans-serif; color: #fff; -webkit-text-stroke: 4px #1b2236; paint-order: stroke fill;
  text-shadow: 0 8px 0 #1b223688; animation: dr-od .9s cubic-bezier(.2, 1.5, .4, 1) both;
}
.dr-odpocet span.jed { font-size: 84px; color: #ffcc00; }
@keyframes dr-od { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .9; } }
.dr-tip {
  position: absolute; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%);
  background: #ffffffe6; color: #1b2236; padding: 9px 16px; border-radius: 99px; font-weight: 800; font-size: 15px; white-space: nowrap;
  box-shadow: 0 4px 0 #1b223633; animation: dr-tip 1.4s ease-in-out infinite alternate;
}
.dr-tip::before { content: "👆 "; }
@keyframes dr-tip { to { transform: translate(-50%, -6px); } }

/* joystick */
.dr-joy { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.dr-joy::before {
  content: ""; position: absolute; left: -62px; top: -62px; width: 124px; height: 124px; border-radius: 50%;
  border: 3px solid #ffffffb0; background: radial-gradient(#ffffff10, #ffffff30); box-shadow: 0 0 0 2px #1b223633;
}
.dr-knob { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; background: #ffffffe6; box-shadow: 0 3px 0 #1b223655; }

/* sežrán */
.dr-sezran { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(transparent 30%, #0b0e1888); }
.dr-sz-k { text-align: center; color: #fff; animation: dr-sz .5s cubic-bezier(.2, 1.4, .4, 1) both; padding: 0 20px; }
.dr-sz-t { font: 900 34px/1.1 system-ui, sans-serif; -webkit-text-stroke: 2px #1b2236; paint-order: stroke fill; text-shadow: 0 5px 0 #1b223688; }
.dr-sz-t b { -webkit-text-stroke: 2px #1b2236; }
.dr-sz-p { margin-top: 10px; font-weight: 800; background: #141826c4; display: inline-block; padding: 6px 14px; border-radius: 99px; }
@keyframes dr-sz { from { transform: scale(.5); opacity: 0; } }

/* výsledky */
.dr-vysl {
  position: absolute; inset: 0; pointer-events: auto; overflow-y: auto; touch-action: pan-y;
  display: grid; align-items: center; justify-items: center;
  padding: calc(var(--dr-top) + 8px) 14px calc(100px + var(--safe-b));
  background: linear-gradient(#0b0e1866, #0b0e18cc);
  animation: dr-fade .3s ease both;
}
@keyframes dr-fade { from { opacity: 0; } }
.dr-v-karta {
  width: 100%; max-width: 420px; background: linear-gradient(170deg, #262a3d, #181b28); border: 1px solid #3a3f58;
  border-radius: 24px; padding: 18px 14px 14px; color: #fff; box-shadow: 0 10px 0 #0a0c14aa;
  animation: dr-sz .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.dr-v-nad { text-align: center; font: 900 28px/1.1 system-ui, sans-serif; letter-spacing: .01em; }
.dr-v-sub { text-align: center; color: #c8cee0; font-weight: 700; margin: 6px 0 14px; font-size: 15px; text-wrap: balance; }
.dr-v-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.dr-v-list li {
  display: grid; grid-template-columns: 30px 30px 1fr auto; align-items: center; gap: 8px;
  background: #ffffff0d; border-radius: 14px; padding: 8px 12px 8px 8px;
  animation: dr-vli .4s ease both; animation-delay: var(--d);
}
@keyframes dr-vli { from { opacity: 0; transform: translateY(8px); } }
.dr-v-list li.ja { background: #ffcc0022; box-shadow: inset 0 0 0 2px #ffcc00aa; }
.dr-v-m { font-size: 20px; text-align: center; font-weight: 900; color: #9aa3c0; }
.dr-v-dira { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(#000 52%, #1c1c28 62%, var(--b) 66%); }
.dr-v-jm { min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: grid; }
.dr-v-jm small { color: #9aa3c0; font-weight: 600; font-size: 12px; }
.dr-v-bar { height: 4px; border-radius: 4px; background: #ffffff14; margin-top: 4px; overflow: hidden; }
.dr-v-bar i { display: block; height: 100%; background: var(--b); transform-origin: left; }
.dr-v-list b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .dr-tip, .dr-cas.dochazi { animation: none; } }
.dr-konec .dr-top, .dr-konec .dr-ja, .dr-konec .dr-log, .dr-konec .dr-jmena, .dr-konec .dr-horni, .dr-konec .dr-tip, .dr-konec .dr-level { display: none; }
.dr > .dr-nacitam { z-index: 4; transition: opacity .35s ease; }
.dr > .dr-nacitam.pryc { opacity: 0; pointer-events: none; }
