/* style.css — Curve Royale neon-look UI */

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05050a;
  color: #e8ecff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* iOS Safari: a body-szintű user-select:none / touch-action:none megakadályozza
   az input fókuszát és a billentyűzet megnyílását — az inputok kivételek. */
input,
textarea {
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

#game-canvas {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none; /* játék közbeni scroll/zoom tiltás — csak a canvason, nem a body-n */
}

.hidden {
  display: none !important;
}

/* ---- képernyők ---- */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 12, 0.72);
  backdrop-filter: blur(3px);
  z-index: 20;
}

.panel {
  background: rgba(14, 14, 30, 0.94);
  border: 1px solid rgba(120, 160, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(80, 120, 255, 0.18), inset 0 0 30px rgba(80, 120, 255, 0.05);
  padding: 36px 44px;
  text-align: center;
  min-width: 320px;
  max-width: 92vw;
}

.title {
  font-size: 44px;
  letter-spacing: 3px;
  font-weight: 800;
  color: #2affe0;
  text-shadow: 0 0 18px rgba(42, 255, 224, 0.6);
}

.title-accent {
  color: #ff5ec8;
  text-shadow: 0 0 18px rgba(255, 94, 200, 0.6);
}

.tagline {
  margin: 10px 0 24px;
  color: #9aa5d0;
  font-size: 14px;
}

.panel-title {
  font-size: 26px;
  letter-spacing: 2px;
  margin-bottom: 14px;
  color: #cdd6ff;
}

input[type='text'] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 17px;
  color: #e8ecff;
  background: rgba(30, 34, 66, 0.8);
  border: 1px solid rgba(120, 160, 255, 0.4);
  border-radius: 8px;
  outline: none;
  text-align: center;
}

input[type='text']:focus {
  border-color: #2affe0;
  box-shadow: 0 0 12px rgba(42, 255, 224, 0.3);
}

.btn {
  padding: 11px 22px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #05050a;
  background: #7c8cff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(124, 140, 255, 0.6);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-big {
  background: #2affe0;
  font-size: 18px;
  padding: 13px 34px;
  box-shadow: 0 0 20px rgba(42, 255, 224, 0.35);
}

.btn-big:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(42, 255, 224, 0.65);
}

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.hint {
  margin-top: 14px;
  font-size: 12px;
  color: #7d87b5;
}

/* ---- lobby ---- */

#player-list {
  list-style: none;
  margin: 14px 0 18px;
  text-align: left;
}

#player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 16px;
  border-bottom: 1px solid rgba(120, 160, 255, 0.12);
}

#player-list .me {
  font-weight: 700;
  color: #2affe0;
}

.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 8px currentColor;
}

/* ---- countdown ---- */

#countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 40px rgba(124, 140, 255, 0.9);
  z-index: 15;
  pointer-events: none;
}

.pop {
  animation: pop 0.5s ease-out;
}

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

/* ---- HUD ---- */

#screen-game {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#hud-top {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: #9aa5d0;
  text-shadow: 0 1px 3px #000;
}

#scoreboard {
  position: absolute;
  top: 12px;
  right: 14px;
  min-width: 170px;
  background: rgba(10, 10, 24, 0.6);
  border: 1px solid rgba(120, 160, 255, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 2px;
}

.score-row .sc-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row .sc-pts {
  font-weight: 700;
}

.score-row.dead {
  opacity: 0.42;
}

.score-row.alive .sc-name {
  color: #ffffff;
}

.score-row.me .sc-name {
  color: #2affe0;
}

#killfeed {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 340px;
}

.kf-row {
  background: rgba(10, 10, 24, 0.65);
  border-left: 3px solid #fff;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  color: #cdd6ff;
  transition: opacity 0.7s;
}

.kf-row.fade {
  opacity: 0;
}

#effect-icons {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.fx-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 10, 24, 0.7);
  border: 1px solid rgba(120, 160, 255, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 20px;
}

.fx-time {
  font-size: 12px;
  color: #9aa5d0;
  min-width: 26px;
}

#pickup-label {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  color: #ffe9a0;
  text-shadow: 0 0 10px rgba(255, 233, 160, 0.6), 0 1px 3px #000;
}

#round-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 14px 34px;
  background: rgba(10, 10, 24, 0.82);
  border: 2px solid #fff;
  border-radius: 12px;
  text-shadow: 0 0 16px currentColor;
  white-space: nowrap;
}

/* ---- V2: kör-mutátor banner (NAGY, a countdown alatt) ---- */

#modifier-banner {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 18px 48px;
  color: #ffe9a0;
  background: rgba(10, 10, 24, 0.85);
  border: 3px solid #ffe9a0;
  border-radius: 14px;
  text-shadow: 0 0 26px rgba(255, 233, 160, 0.8);
  box-shadow: 0 0 40px rgba(255, 233, 160, 0.35), inset 0 0 24px rgba(255, 233, 160, 0.12);
  white-space: nowrap;
}

/* ---- V2: TÜKÖR! felirat a sújtottnak ---- */

#mirror-label {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ff5ec8;
  text-shadow: 0 0 18px rgba(255, 94, 200, 0.9), 0 1px 3px #000;
  animation: mirror-blink 0.5s steps(2) infinite;
}

@keyframes mirror-blink {
  50% {
    opacity: 0.35;
  }
}

/* ---- V2: ugrás-cooldown ikon (conic-gradient töltés a JS-ből) ---- */

#jump-cd {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #05050a;
  border: 2px solid rgba(120, 160, 255, 0.4);
  background: rgba(40, 44, 80, 0.55);
  opacity: 0.85;
}

#jump-cd.ready {
  border-color: #2affe0;
  box-shadow: 0 0 16px rgba(42, 255, 224, 0.55);
  opacity: 1;
}

/* ---- meccs vége ---- */

#final-scores {
  margin: 16px 0 8px;
}

.final-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 17px;
  border-bottom: 1px solid rgba(120, 160, 255, 0.12);
}

.final-row.winner {
  font-size: 21px;
  font-weight: 800;
  color: #ffe9a0;
}

.fr-place {
  width: 26px;
  color: #7d87b5;
}

.fr-name {
  flex: 1;
  text-align: left;
}

/* ---- kapcsolat ---- */

#conn-status {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 60, 90, 0.9);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 40;
}

/* Visszalink a játékválasztóra — meccs közben rejtve */
#home-link {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 30;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #fff;
  opacity: 0.55;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}
#home-link:hover { opacity: 1; }
body:has(#screen-game:not(.hidden)) #home-link { display: none; }
