@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Noto+Sans+KR:wght@400;700&display=swap');

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

body {
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  user-select: none;
}

#game-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  pointer-events: none;
}

.panel {
  background: rgba(0,0,0,0.62);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 110px;
  pointer-events: auto;
}

.panel-title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 4px;
}

.panel-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

#hearts {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.heart {
  font-size: 22px;
  transition: 0.25s;
}

.heart.lost {
  opacity: 0.25;
  transform: scale(0.72);
  filter: grayscale(1);
}

#timer-bar-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 30;
  background: rgba(255,255,255,0.1);
}

#timer-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,#ff3c3c,#ff9900);
  transition: width 0.1s linear, background 0.25s;
}

#controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: none;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  color: #fff;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.2);
  font-weight: 700;
  pointer-events: auto;
  transition: 0.15s;
}

.btn:hover {
  background: rgba(255,255,255,0.08);
}

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

#badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 36px;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 30px rgba(255,255,255,0.5);
}

#badge.flash {
  animation: badgeFlash 1s forwards;
}

@keyframes badgeFlash {
  0% { opacity: 1; transform: translate(-50%, -58%) scale(1.2); }
  60% { opacity: 1; transform: translate(-50%, -53%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

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

.menu-box {
  width: min(840px, 95vw);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 0 40px rgba(0,0,0,0.35);
  text-align: center;
}

#overlay-title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 42px;
  margin-bottom: 10px;
  line-height: 1.1;
}

#overlay-sub {
  color: rgba(255,255,255,0.75);
  margin-bottom: 20px;
  font-size: 15px;
}

.section-title {
  text-align: left;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 18px;
  margin: 10px 0 12px;
}

.kits {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kit-card {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
}

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

.kit-card.active {
  border-color: #00e676;
  box-shadow: 0 0 0 2px rgba(0,230,118,0.15);
}

.kit-preview {
  width: 70px;
  height: 90px;
  margin: 0 auto 10px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.16);
  position: relative;
  overflow: hidden;
}

.kit-name {
  font-size: 13px;
  font-weight: 700;
}

.kit-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.66);
  margin-top: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}

.number-box,
.leaderboard-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px;
  width: min(360px, 92vw);
  text-align: left;
}

.number-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.number-box input {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.45);
  color: white;
  padding: 0 14px;
  font-size: 18px;
  outline: none;
}

.helper {
  font-size: 12px;
  color: rgba(255,255,255,0.62);
  margin-top: 8px;
}

#leaderboard {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.leader-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.leader-rank {
  font-weight: 700;
  color: #ffd54f;
}

.leader-mid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.leader-name {
  font-weight: 700;
}

.leader-sub {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.leader-score {
  font-weight: 700;
  color: #fff;
}

#overlay-btn {
  border: none;
  border-radius: 10px;
  background: #ff3c3c;
  color: white;
  padding: 14px 42px;
  font-size: 18px;
  font-family: 'Black Han Sans', sans-serif;
  cursor: pointer;
  letter-spacing: 2px;
  margin-top: 8px;
}

#overlay-btn:hover {
  background: #ff1b1b;
}

#touch-left,
#touch-right {
  position: absolute;
  top: 0;
  bottom: 60px;
  width: 50%;
  z-index: 10;
}

#touch-left { left: 0; }
#touch-right { right: 0; }

@media (max-width: 760px) {
  .kits {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  #overlay-title {
    font-size: 34px;
  }
  .panel-value {
    font-size: 18px;
  }
}
.custom-colors {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.custom-colors input {
  width: 50px;
  height: 40px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* === BACKPLATE AYAR PANELİ === */
#backplate-panel {
  position: fixed;
  bottom: 70px;
  right: 12px;
  z-index: 99999;
}

#backplate-toggle {
  background: #FFD700;
  border: 4px solid #000;
  border-radius: 14px;
  width: 70px;
  height: 70px;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(0,0,0,0.9);
  font-weight: 900;
  color: #000;
}

#backplate-settings {
  background: rgba(10,10,10,0.97);
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 6px;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.9);
}

#backplate-settings.hidden { display: none; }

.bp-title {
  font-weight: 900;
  font-size: 14px;
  text-align: center;
  margin-bottom: 4px;
  color: #FFD700;
  letter-spacing: 1px;
}

#backplate-settings label {
  font-size: 12px;
  color: #ccc;
}

#backplate-settings input[type=range] {
  width: 100%;
  accent-color: #FFD700;
}

#bp-close {
  margin-top: 4px;
  background: #c00;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}


/* FINAL: forma yazısı ayarı sabitlendi, sağdaki ayar paneli oyuncuya gizlendi */
#backplate-panel,
#backplate-toggle,
#backplate-settings {
  display: none !important;
}


.leader-rank.rank-1 { color: #ffd700; font-size: 20px; }
.leader-rank.rank-2 { color: #c0c0c0; font-size: 20px; }
.leader-rank.rank-3 { color: #cd7f32; font-size: 20px; }
#teamAbbr { text-transform: uppercase; }

/* PixelCheckup geri dönüş linki */
#site-back-link {
  display: inline-block;
  margin-top: 12px;
  color: #ffd700;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.5px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(0, 0, 0, 0.34);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

#site-back-link:hover {
  background: rgba(255, 215, 0, 0.12);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
  transform: translateY(-1px);
}


.game-logo {
  width: min(340px, 82vw);
  display: block;
  margin: 0 auto 14px;
  filter: drop-shadow(0 0 10px #ffd700) drop-shadow(0 0 20px #ffb300);
  user-select: none;
  pointer-events: none;
}
