/* Sumo Splash — jeges party game UI (desktop fókusz) */

:root {
  --ice: #6fc7f2;
  --ice-dark: #2a7fae;
  --deep: #16405c;
  --gold: #ffc93c;
  --danger: #e5433f;
  --panel-bg: rgba(10, 30, 46, 0.9);
  --hud-bg: rgba(8, 24, 38, 0.62);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #14344d;
  font-family: 'Trebuchet MS', 'Segoe UI', Verdana, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

/* iOS Safari: a body-szintű user-select:none blokkolja az input fókuszát */
input,
textarea {
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

.hidden {
  display: none !important;
}

/* --- Canvas: teljes képernyő --- */

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Képernyők (join / lobby / end) --- */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(111, 199, 242, 0.16), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(42, 127, 174, 0.2), transparent 55%),
    rgba(6, 18, 28, 0.72);
  animation: screenFade 0.35s ease-out;
}

@keyframes screenFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.panel {
  background: var(--panel-bg);
  border: 4px solid var(--ice);
  border-radius: 24px;
  padding: 42px 56px;
  text-align: center;
  min-width: 380px;
  max-width: 620px;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 18px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(111, 199, 242, 0.08);
  animation: panelPop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes panelPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.title {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.05;
  color: var(--ice);
  text-shadow:
    0 3px 0 var(--ice-dark),
    0 8px 24px rgba(111, 199, 242, 0.5);
  transform: rotate(-2deg);
  margin-bottom: 6px;
}

.title-accent {
  display: block;
  color: var(--gold);
  text-shadow:
    0 3px 0 #b8860b,
    0 8px 24px rgba(255, 201, 60, 0.45);
}

.tagline {
  font-size: 16px;
  color: #cfe8f5;
  margin-bottom: 28px;
  font-style: italic;
}

.panel-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a5a00, 0 6px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
}

#name-input {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-size: 20px;
  border: 3px solid var(--ice-dark);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #14344d;
  margin-bottom: 18px;
  outline: none;
  text-align: center;
  font-weight: 700;
}

#name-input:focus {
  border-color: var(--ice);
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ice), var(--ice-dark));
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 2px;
  padding: 12px 26px;
  box-shadow: 0 5px 0 #1c5878, 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1c5878;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn-big {
  font-size: 26px;
  padding: 14px 44px;
  background: linear-gradient(180deg, #ffd75e, #d9a616);
  box-shadow: 0 5px 0 #96700a, 0 8px 18px rgba(0, 0, 0, 0.4);
}

.btn-big:active {
  box-shadow: 0 2px 0 #96700a;
}

.lobby-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 14px 0;
}

.hint {
  font-size: 13px;
  color: #9fc6da;
  margin-top: 14px;
}

#player-list {
  list-style: none;
  margin-bottom: 8px;
}

#player-list li {
  font-size: 20px;
  font-weight: 700;
  padding: 7px 0;
  border-bottom: 1px solid rgba(111, 199, 242, 0.2);
}

/* --- Countdown --- */

#countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  font-size: 160px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 6px 0 #7a5a00, 0 14px 50px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

#countdown-overlay.pop {
  animation: countPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes countPop {
  from { transform: scale(1.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

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

#scoreboard {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--hud-bg);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 190px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  font-weight: 700;
  padding: 2px 0;
}

.score-row.me .sr-name {
  color: var(--gold);
}

.score-row.dead {
  opacity: 0.45;
  text-decoration: line-through;
}

.sr-pts {
  color: #bfe6f7;
}

#shrink-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 24px;
  background: var(--hud-bg);
  border-radius: 12px;
  overflow: hidden;
}

#shrink-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ice), #a5e0fa);
  width: 100%;
  transition: width 0.2s linear;
}

#shrink-bar.sudden #shrink-fill {
  background: linear-gradient(90deg, #e5433f, #ff8a5e);
  animation: suddenPulse 0.6s infinite alternate;
}

@keyframes suddenPulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

#shrink-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

#killfeed {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.kf-entry {
  background: var(--hud-bg);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  animation: kfIn 0.25s ease-out;
}

@keyframes kfIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 4px 0 #7a5a00, 0 10px 34px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
}

.banner.danger {
  color: var(--danger);
  text-shadow: 0 4px 0 #7a1410, 0 10px 34px rgba(0, 0, 0, 0.6);
}

.banner.gold {
  color: var(--gold);
}

.banner.pop,
#round-banner.pop {
  animation: bannerPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes bannerPop {
  from { transform: translateX(-50%) scale(1.6); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

#powerup-ind {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hud-bg);
  border-radius: 12px;
  padding: 6px 14px;
  font-size: 26px;
  display: flex;
  gap: 10px;
}

#spectate-note {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hud-bg);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: 700;
}

#inter-overlay {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

#inter-count {
  font-size: 90px;
  color: var(--gold);
  text-shadow: 0 5px 0 #7a5a00, 0 10px 34px rgba(0, 0, 0, 0.6);
}

/* --- Kör vége overlay --- */

#roundend-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
}

.re-panel {
  background: var(--panel-bg);
  border: 3px solid var(--ice);
  border-radius: 18px;
  padding: 26px 40px;
  text-align: center;
  animation: panelPop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

#roundend-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 14px;
  text-shadow: 0 2px 0 #7a5a00;
}

.re-row {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  font-size: 18px;
  font-weight: 700;
  padding: 3px 0;
}

.re-row.me {
  color: var(--gold);
}

/* --- Dobogó --- */

#podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}

.podium-av {
  font-size: 42px;
  animation: bounceAv 1s infinite alternate ease-in-out;
}

@keyframes bounceAv {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.podium-name {
  font-weight: 900;
  font-size: 16px;
  margin: 4px 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-block {
  width: 100%;
  background: linear-gradient(180deg, var(--ice), var(--ice-dark));
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 17px;
}

.place-1 .podium-block {
  background: linear-gradient(180deg, #ffd75e, #d9a616);
}

.podium-rest {
  width: 100%;
  margin-top: 12px;
  font-size: 15px;
  color: #bcdcec;
}

/* --- Kapcsolat-státusz --- */

#conn-status {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(180, 40, 30, 0.92);
  padding: 8px 22px;
  border-radius: 20px;
  font-weight: 700;
  animation: connPulse 1.2s infinite alternate;
}

@keyframes connPulse {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

/* 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; }
