:root {
  --accent: #39ff88;
  --bg-deep: #07070f;
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at 50% 0%, #14142a 0%, var(--bg-deep) 70%);
  color: #e8e8f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.home-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(7,7,15,.82);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(57,255,136,.14);
}
.home-link:hover,
.home-link:focus-visible {
  background: var(--accent);
  color: #07070f;
  outline: none;
}

#app {
  width: 100%;
  max-width: 940px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  font-size: clamp(40px, 9vw, 84px);
  letter-spacing: 14px;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(57,255,136,.5), 0 0 40px rgba(57,255,136,.25);
  margin-bottom: 4px;
}

.subtitle { color: #9a9ab5; margin-bottom: 22px; }
.server-record {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: -10px 0 20px;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(57,255,136,.28);
}

.screen { width: 100%; display: flex; flex-direction: column; align-items: center; }
.hidden { display: none !important; }

/* ---------- Mode cards ---------- */
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  margin-bottom: 26px;
}
@media (max-width: 720px){ .modes { grid-template-columns: 1fr; } }

.mode-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  color: inherit;
  text-align: center;
  transition: transform .15s, border-color .15s, background .15s;
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: rgba(57,255,136,.08);
}
.mode-card h2 { font-size: 20px; margin: 12px 0 6px; }
.mode-card p { font-size: 13px; color: #9a9ab5; line-height: 1.45; }

.mode-icon {
  height: 60px;
  background: #0a0a16;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}
.ic-paddle { width: 6px; height: 34px; background: var(--accent); border-radius: 3px; }
.ic-paddle.right { background: #ff5470; }
.ic-wall { width: 6px; height: 100%; background: #ff5470; border-radius: 2px; }
.ic-ball { width: 10px; height: 10px; background: #fff; border-radius: 50%; }
.ic-obstacle {
  width: 8px; height: 40px; border-radius: 2px; background: transparent;
  background-image: repeating-linear-gradient(var(--accent) 0 8px, transparent 8px 16px);
}
.ic-obstacle.right {
  background-image: repeating-linear-gradient(#ff5470 0 8px, transparent 8px 16px);
}

/* ---------- Colors ---------- */
.colors {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.colors h3 { margin-bottom: 12px; font-size: 15px; color: #c8c8e0; }
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
  gap: 12px;
}
.color-grid label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #b5b5cc;
  background: rgba(0,0,0,.25); padding: 8px 10px; border-radius: 8px;
}
input[type=color] {
  width: 38px; height: 26px; border: none; background: none;
  cursor: pointer; border-radius: 4px;
}
.presets { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets span { font-size: 13px; color: #9a9ab5; }
.preset {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: #ddd; border-radius: 20px; padding: 5px 14px; cursor: pointer; font-size: 13px;
  transition: background .15s;
}
.preset:hover { background: rgba(255,255,255,.16); }

.settings-row { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.settings-row label { font-size: 14px; color: #b5b5cc; display: flex; gap: 8px; align-items: center; }
select {
  background: #16162a; color: #fff; border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; padding: 6px 10px; font-size: 14px; cursor: pointer;
}

/* ---------- Game HUD ---------- */
.hud {
  width: 100%; max-width: 900px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.score-box { text-align: center; min-width: 120px; }
.score-label { display: block; font-size: 12px; letter-spacing: 2px; color: #8a8aa5; }
.score-num { font-size: 46px; font-weight: 800; line-height: 1; }
.center-info { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#modeName { font-size: 13px; letter-spacing: 3px; color: #8a8aa5; }
.mini-btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  color: #ddd; border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: 12px;
}
.mini-btn:hover { background: rgba(255,255,255,.16); }

.canvas-wrap { position: relative; width: 100%; max-width: 900px; }
canvas {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

.overlay {
  position: absolute; inset: 0;
  background: rgba(5,5,12,.78); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
}
.overlay-card { text-align: center; padding: 30px; }
.overlay-card h2 { font-size: 34px; margin-bottom: 10px; }
.overlay-card p { color: #b5b5cc; margin-bottom: 20px; max-width: 360px; }
.overlay-initials {
  display: block;
  width: 150px;
  height: 58px;
  margin: 0 auto 18px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #090914;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .25em;
  text-align: center;
  text-transform: uppercase;
  padding-left: .25em;
  outline: none;
  box-shadow: 0 0 18px rgba(57,255,136,.24);
}
.mode-card-btn {
  background: var(--accent); color: #07070f; font-weight: 700;
  border: none; border-radius: 10px; padding: 12px 28px; cursor: pointer; font-size: 15px;
}
.mode-card-btn:hover { filter: brightness(1.1); }

.controls-help {
  margin-top: 14px; font-size: 13px; color: #8a8aa5; text-align: center; line-height: 1.7;
}
.controls-help b { color: #c8c8e0; }
.controls-help kbd {
  background: #16162a; border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px; padding: 1px 7px; font-family: monospace; color: #fff;
}

footer { margin-top: 28px; font-size: 12px; color: #55556e; text-align: center; }
