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

html, body {
  min-height: 100%;
  -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;
  overflow-x: hidden;
}

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

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

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

/* ---------- layout ---------- */
#wrap {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
}

#head { text-align: center; margin-bottom: 22px; }

#head h1 {
  font-size: 30px;
  font-weight: 900;
  color: #e8574a;
  text-shadow: 0 2px 0 #fff;
}

#head p {
  font-size: 14px;
  color: #3f7286;
  margin: 4px 0 14px;
}

#player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #e8574a;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 120, 150, 0.2);
  transition: transform 0.12s ease;
}

#player-chip:active { transform: scale(0.95); }

#player-mode {
  font-weight: 600;
  font-size: 12px;
  color: #55889c;
}

#player-mode:not(:empty)::before { content: "· "; }

/* ---------- karty hier ---------- */
#games { display: flex; flex-direction: column; gap: 12px; }

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  border-radius: 22px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 20px rgba(30, 120, 150, 0.18);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.game-card:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(30, 120, 150, 0.22);
}

.gc-art {
  font-size: 26px;
  line-height: 1.1;
  width: 66px;
  flex-shrink: 0;
  text-align: center;
  white-space: nowrap;
  filter: drop-shadow(0 2px 3px rgba(15, 85, 110, 0.3));
}

.gc-body { flex: 1; min-width: 0; }

.gc-title {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #1f4f63;
}

.gc-desc {
  display: block;
  font-size: 13px;
  color: #55889c;
  line-height: 1.35;
  margin-top: 2px;
}

.gc-prog {
  display: inline-block;
  margin-top: 7px;
  background: #fff0ee;
  color: #e8574a;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.gc-go {
  font-size: 18px;
  color: #ff6f61;
  flex-shrink: 0;
}

.game-card.soon {
  opacity: 0.55;
  box-shadow: none;
  border: 2px dashed #b5e2ec;
  background: rgba(255, 255, 255, 0.45);
}

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 60, 85, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  transition: opacity 0.25s ease;
}

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

.panel {
  background: linear-gradient(170deg, #fbfeff, #fff5e3);
  border-radius: 26px;
  padding: 24px 20px;
  width: min(88vw, 360px);
  max-height: 86dvh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 18px 50px rgba(10, 60, 90, 0.45);
}

.panel-emoji { font-size: 38px; }

.panel h2 {
  font-size: 22px;
  font-weight: 900;
  color: #e8574a;
  margin: 4px 0 14px;
}

.p-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 700;
  color: #1f4f63;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 120, 150, 0.1);
}

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

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

.p-row span { flex: 1; }

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

#new-name: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: 14px; }

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

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

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

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

.big-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #ffb347, #ff6f61);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 111, 97, 0.45);
  margin-top: 6px;
}

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

.big-btn.ghost {
  background: transparent;
  color: #55889c;
  box-shadow: none;
  font-size: 15px;
}

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

/* skrývanie prvkov v paneli (musí byť za pravidlami s display) */
#new-form.hidden, .mini-btn.hidden { display: none; }
