* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --s: 48px; /* tile size, set from JS */
  --pink: #ff6f61;
  --purple: #7c4dbe;
  --cream: #fff6ec;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  background: linear-gradient(160deg, #c9ecf7 0%, #a9e8e0 45%, #ffeccb 100%);
  color: #1f4652;
}

#app {
  height: 100vh;        /* fallback pre staršie prehliadače bez dvh */
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* dole je rezervované miesto pre pevne ukotvenú lištu */
  padding: max(8px, env(safe-area-inset-top)) 8px calc(54px + max(10px, env(safe-area-inset-bottom)));
  gap: 10px;
  overflow: hidden;
}

#hud { flex-shrink: 0; }

/* ---------- HUD ---------- */
#hud { width: min(94vw, 480px); }

.hud-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.hud-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 8px 12px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(30, 120, 150, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 64px;
}

.hud-wide { flex: 1; }

.hud-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a8ba0;
}

.hud-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.hud-target {
  font-size: 13px;
  font-weight: 800;
  color: #e8574a;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #d6edf2;
  margin: 4px 0 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb347, var(--pink));
  transition: width 0.4s ease;
}

/* ---------- Board ---------- */
#board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

#board {
  position: relative;
  width: min(94vw, 480px, calc(100vh - 220px));  /* fallback bez dvh */
  width: min(94vw, 480px, calc(100dvh - 220px));
  aspect-ratio: 1 / 1;
  background: rgba(255, 252, 246, 0.65);
  background-image: conic-gradient(
    rgba(110, 205, 230, 0.3) 0 25%, transparent 0 50%,
    rgba(110, 205, 230, 0.3) 0 75%, transparent 0
  );
  background-size: calc(var(--s) * 2) calc(var(--s) * 2);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(20, 110, 145, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
  overflow: hidden;
  touch-action: none;
}

.tile {
  position: absolute;
  top: 0; left: 0;
  width: var(--s);
  height: var(--s);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
  will-change: transform;
}

.fruit {
  font-size: calc(var(--s) * 0.64);
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(15, 85, 110, 0.35));
  transition: transform 0.15s ease;
  pointer-events: none;
}

.tile.sel .fruit {
  transform: scale(1.22);
  animation: wiggle 0.5s ease-in-out infinite alternate;
}

@keyframes wiggle {
  from { rotate: -8deg; }
  to { rotate: 8deg; }
}

.tile.pop .fruit {
  animation: pop 0.24s ease-in forwards;
}

@keyframes pop {
  40% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

.tile.born .fruit {
  animation: born 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes born {
  0% { transform: scale(0); }
  70% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---------- Special tiles: pásikavé (riadok/stĺpec) ---------- */
.tile.sp-h::before {
  content: "";
  position: absolute;
  left: 2%; right: 2%; top: 20%; bottom: 20%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.95), rgba(255, 200, 90, 0.4) 65%, transparent 78%);
  animation: glow 1s ease-in-out infinite alternate;
}

.tile.sp-v::before {
  content: "";
  position: absolute;
  top: 2%; bottom: 2%; left: 20%; right: 20%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.95), rgba(255, 200, 90, 0.4) 65%, transparent 78%);
  animation: glow 1s ease-in-out infinite alternate;
}

.dir-ico {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--s) * 0.68);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 10px rgba(255, 170, 60, 0.95),
    0 0 4px #fff,
    0 2px 3px rgba(120, 60, 20, 0.5);
  z-index: 3;
  pointer-events: none;
}

.tile.sp-h .dir-ico, .tile.sp-v .dir-ico {
  display: flex;
  animation: dirPulse 0.9s ease-in-out infinite;
}

@keyframes dirPulse {
  0%, 100% { transform: scale(0.82); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}

.tile.sp-b::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 60, 0.55), rgba(255, 60, 60, 0.25) 60%, transparent 72%);
  animation: glow 0.6s ease-in-out infinite alternate;
}

.tile.sp-b .fruit { animation: pulse 0.6s ease-in-out infinite alternate; }

.tile.sp-r .fruit {
  font-size: calc(var(--s) * 0.7);
  animation: spin 2.5s linear infinite;
}

@keyframes glow {
  from { opacity: 0.5; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1.05); }
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

@keyframes spin {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

/* ---------- Floating score ---------- */
.float-score {
  position: absolute;
  font-weight: 900;
  font-size: calc(var(--s) * 0.42);
  color: #fff;
  text-shadow: 0 2px 6px rgba(230, 90, 60, 0.9), 0 0 2px #e8574a;
  pointer-events: none;
  z-index: 5;
  animation: floatUp 0.9s ease-out forwards;
}

.float-score.combo {
  font-size: calc(var(--s) * 0.55);
  color: #fff3b0;
  text-shadow: 0 2px 8px rgba(230, 120, 30, 0.95);
}

@keyframes floatUp {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(calc(var(--s) * -1.4)); opacity: 0; }
}

/* ---------- Bottom bar ---------- */
/* lišta je ukotvená k spodku okna – nezávisí od výpočtu výšky #app */
#bottom-bar {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(94vw, 480px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#total-score {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  color: #3f7286;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 120, 150, 0.25);
  transition: transform 0.1s ease;
}

.icon-btn:active { transform: scale(0.88); }

/* ---------- Overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  /* bez backdrop-filter – na Androide spôsoboval preblikávanie pri prekreslení pozadia */
  background: rgba(10, 60, 85, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  background: linear-gradient(170deg, #fbfeff, #fff5e3);
  border-radius: 28px;
  padding: 30px 26px;
  width: min(86vw, 360px);
  text-align: center;
  box-shadow: 0 18px 50px rgba(10, 60, 90, 0.45);
  animation: panelIn 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes panelIn {
  from { transform: scale(0.7) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.panel-emoji { font-size: 44px; margin-bottom: 6px; }

.panel h1 {
  font-size: 26px;
  font-weight: 900;
  color: #e8574a;
  margin-bottom: 8px;
}

.panel p {
  font-size: 15px;
  color: #3f7286;
  line-height: 1.5;
  margin-bottom: 14px;
}

.stars { font-size: 34px; min-height: 10px; margin-bottom: 10px; letter-spacing: 4px; }
.stars:empty { display: none; }

.big-btn {
  background: linear-gradient(135deg, #ffb347, #ff6f61);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 40px;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 111, 97, 0.5);
  transition: transform 0.12s ease;
}

.big-btn:active { transform: scale(0.93); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  background: rgba(12, 75, 95, 0.88);
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 700;
  z-index: 90;
  animation: toastIn 1.6s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes toastIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  12%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ================= Vizuálne efekty ================= */

/* častice pri zmiznutí */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}

/* otras plochy */
.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -7px 4px; }
  40% { translate: 6px -4px; }
  60% { translate: -5px 3px; }
  80% { translate: 3px -2px; }
}

/* lúč pásikavého kúska */
.beam {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fff8, #fff, #ffe27a, #fff, #fff8, transparent);
  box-shadow: 0 0 22px #ffdf6e, 0 0 8px #fff;
  animation: beamFade 0.45s ease-out forwards;
}

@keyframes beamFade {
  0% { opacity: 0; scale: 0.4; }
  25% { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: 1; }
}

/* tlaková vlna bomby */
.ring {
  position: absolute;
  border: 5px solid #ffd76e;
  border-radius: 50%;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 24px rgba(255, 160, 60, 0.9), inset 0 0 14px rgba(255, 200, 90, 0.7);
  animation: ringGrow 0.55s ease-out forwards;
}

@keyframes ringGrow {
  from { transform: scale(0.15); opacity: 1; }
  to { transform: scale(1); opacity: 0; }
}

/* dúhový záblesk */
.rflash {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #b967ff, #ff6b6b);
  animation: rflash 0.65s ease-out forwards;
}

@keyframes rflash {
  0% { opacity: 0; }
  20% { opacity: 0.7; }
  100% { opacity: 0; }
}

/* pochvala pri kombe */
.praise {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 8;
  font-size: calc(var(--s) * 0.75);
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 1px #e8574a;
  text-shadow: 0 3px 0 #e8574a, 0 8px 20px rgba(220, 90, 50, 0.6);
  pointer-events: none;
  white-space: nowrap;
  animation: praiseIn 0.95s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

@keyframes praiseIn {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.15) rotate(3deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}

/* konfety */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.conf {
  position: absolute;
  top: -20px;
  border-radius: 2px;
}

/* squish pri dopade */
.tile.land .fruit {
  animation: landSquish 0.24s ease;
}

@keyframes landSquish {
  40% { transform: scale(1.25, 0.7) translateY(10%); }
}

/* pulz skóre */
.hud-value { display: inline-block; }

.bump { animation: bump 0.3s ease; }

@keyframes bump {
  50% { transform: scale(1.35); color: #ff6f61; }
}

/* lesk na progres bare */
.progress-fill {
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.75) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shine 1.8s ease-in-out infinite;
}

@keyframes shine {
  to { transform: translateX(100%); }
}

/* šťavnatejšie kombo */
.float-score.combo {
  animation: comboPop 1s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

@keyframes comboPop {
  0% { transform: scale(0) rotate(-12deg); opacity: 0; }
  25% { transform: scale(1.45) rotate(4deg); opacity: 1; }
  55% { transform: scale(1) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) translateY(calc(var(--s) * -1)); opacity: 0; }
}

/* hviezdy naskakujú postupne */
.stars span {
  display: inline-block;
  animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.stars span:nth-child(2) { animation-delay: 0.18s; }
.stars span:nth-child(3) { animation-delay: 0.36s; }

@keyframes starPop {
  from { transform: scale(0) rotate(-120deg); }
}

/* plávajúce dobroty na pozadí */
#ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#ambient span {
  position: absolute;
  top: 0;
  opacity: 0.3;
  animation: floatDrift linear infinite;
}

@keyframes floatDrift {
  from { transform: translateY(108vh) rotate(0deg); }
  to { transform: translateY(-12vh) rotate(340deg); }
}

#app { position: relative; z-index: 1; }

/* ================= Sieň slávy ================= */

#hall-overlay, #name-overlay, #help-overlay { z-index: 120; }

#help-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 14px;
  text-align: left;
}

#help-content .hall-name small { white-space: normal; }

#total-score {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.icon-btn.confirm {
  background: #e8574a;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

#player-label { font-weight: 700; color: #e8574a; }

#player-label:not(:empty)::after { content: " · "; color: #86aebb; font-weight: 400; }

.hall-panel {
  width: min(90vw, 400px);
  max-height: 84dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
}

.hall-panel h1 { margin-bottom: 12px; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  color: #55889c;
  background: #ddf1f5;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab.active {
  background: linear-gradient(135deg, #ffb347, #ff6f61);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 111, 97, 0.4);
}

#hall-content {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
  margin-bottom: 14px;
  text-align: left;
}

.hall-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(30, 120, 150, 0.1);
  animation: rowIn 0.3s ease both;
}

.hall-row:nth-child(2) { animation-delay: 0.04s; }
.hall-row:nth-child(3) { animation-delay: 0.08s; }
.hall-row:nth-child(4) { animation-delay: 0.12s; }
.hall-row:nth-child(5) { animation-delay: 0.16s; }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
}

.hall-row.me {
  background: linear-gradient(135deg, #def4f8, #fff2da);
  box-shadow: 0 2px 10px rgba(86, 194, 214, 0.35), inset 0 0 0 2px rgba(86, 194, 214, 0.55);
}

.hall-row.clickable { cursor: pointer; }

.hall-row.clickable:active { transform: scale(0.97); }

.hall-rank {
  font-size: 20px;
  min-width: 30px;
  text-align: center;
  font-weight: 800;
  color: #7fb4c4;
}

.hall-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #1f4f63;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hall-name small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #86aebb;
}

.hall-score {
  font-size: 16px;
  font-weight: 900;
  color: #e8574a;
}

.hall-empty, .hall-sub {
  text-align: center;
  color: #55889c;
  font-size: 14px;
  padding: 10px 0;
  line-height: 1.5;
}

.hall-sub { padding: 0 0 8px; font-weight: 700; }

.mini-btn {
  display: block;
  width: 100%;
  border: 2px dashed #b5e2ec;
  border-radius: 14px;
  padding: 10px;
  background: transparent;
  color: #e8574a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 2px;
}

.mini-btn:active { background: #e4f6fa; }

.del-btn {
  border: none;
  background: #f2e4e0;
  border-radius: 999px;
  min-width: 30px;
  height: 30px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.del-btn.confirm {
  background: #e8574a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.del-btn:active { transform: scale(0.9); }

/* ---------- Banner cieľa levelu ---------- */
#goal-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  background: linear-gradient(170deg, #fbfeff, #fff5e3);
  border-radius: 24px;
  padding: 20px 32px;
  text-align: center;
  box-shadow: 0 16px 44px rgba(10, 60, 90, 0.4);
  pointer-events: none;
  max-width: 86vw;
  animation: gbIn 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

#goal-banner.out { animation: gbOut 0.3s ease forwards; }

#goal-banner.hidden { display: none; }

.gb-level {
  font-size: 13px;
  font-weight: 700;
  color: #55889c;
  margin-bottom: 4px;
}

.gb-goal {
  font-size: 24px;
  font-weight: 900;
  color: #e8574a;
}

.gb-sub {
  font-size: 16px;
  font-weight: 700;
  color: #3f7286;
  margin-top: 5px;
}

.gb-hint {
  font-size: 13px;
  font-weight: 600;
  color: #55889c;
  margin-top: 6px;
}

.gb-hint:empty { display: none; }

@keyframes gbIn {
  from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
}

@keyframes gbOut {
  to { transform: translate(-50%, -62%) scale(0.85); opacity: 0; }
}

/* ---------- Destinácie ---------- */
#dest-banner {
  margin: 6px auto 0;
  width: fit-content;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #3f7286;
  box-shadow: 0 2px 8px rgba(30, 120, 150, 0.15);
}

#dest-banner:empty { display: none; }

/* ---------- Kufor (drop cieľ) ---------- */
.tile.sp-d::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 24%;
  background: radial-gradient(circle, rgba(255, 220, 120, 0.5), transparent 72%);
  box-shadow: 0 0 12px rgba(255, 200, 80, 0.8);
  animation: glow 1s ease-in-out infinite alternate;
}

/* ---------- Ľad (zamrznuté políčko) ---------- */
.tile.foam .fruit {
  opacity: 0.6;
  filter: saturate(0.45) brightness(1.12);
  transform: scale(0.82);
}

.tile.foam::before {
  /* ľadová kocka cez celé políčko */
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 18%;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(190, 232, 250, 0.45) 38%,
    rgba(110, 185, 235, 0.55) 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.9),
    inset -4px -4px 10px rgba(80, 155, 210, 0.5),
    0 2px 10px rgba(70, 145, 200, 0.55);
  z-index: 2;
}

.tile.foam::after {
  /* odlesk na ľade */
  content: "";
  position: absolute;
  top: 13%;
  left: 14%;
  width: 32%;
  height: 16%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-25deg);
  z-index: 3;
  animation: iceShine 2.4s ease-in-out infinite;
}

@keyframes iceShine {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.4; }
}

.tile.deny .fruit {
  animation: denyShake 0.3s ease;
}

@keyframes denyShake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- Cestovný pas ---------- */
.hall-row.locked { opacity: 0.55; }

.hall-row.stamped {
  background: linear-gradient(135deg, #e2f8e8, #f4fcf2);
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ach {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(30, 120, 150, 0.1);
}

.ach.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.ach-e { display: block; font-size: 22px; }

.ach-n {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #1f4f63;
}

.ach-d {
  display: block;
  font-size: 9px;
  color: #55889c;
  line-height: 1.2;
}

/* ---------- Časovka ---------- */
#hud-moves.low-time {
  box-shadow: 0 4px 14px rgba(232, 87, 74, 0.45);
  background: #fff0ee;
}

#hud-moves.low-time .hud-value {
  color: #e8574a;
  animation: lowTime 1s ease infinite;
}

@keyframes lowTime {
  50% { transform: scale(1.22); }
}

#name-input {
  display: block;
  width: 100%;
  border: 3px solid #b5e2ec;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #1f4f63;
  background: #fff;
  outline: none;
  margin-bottom: 16px;
}

#name-input:focus { border-color: #ffb347; }

.diff-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #55889c;
  margin-bottom: 8px;
}

.diff-pick {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.diff-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 3px solid #d6edf2;
  border-radius: 16px;
  padding: 10px 4px;
  font-size: 22px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.diff-btn span {
  font-size: 12px;
  font-weight: 700;
  color: #55889c;
}

.diff-btn.active {
  border-color: #ff6f61;
  background: #fff0ee;
}

.diff-btn.active span { color: #e8574a; }

.diff-btn:active { transform: scale(0.95); }

.ver-line {
  font-size: 11px !important;
  color: #9bb4bf !important;
  margin: 2px 0 10px !important;
}
