@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap');

:root {
  --bg-1: #081226;
  --bg-2: #0f1f3d;
  --accent: #ff6b35;
  --accent-2: #ffd166;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.84);
  --ink: #101828;
  --muted: #4b5565;
  --outline: rgba(13, 27, 59, 0.2);
  --shadow: 0 12px 30px rgba(3, 10, 23, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Sora", "Segoe UI", sans-serif;
  margin: 0;
  padding: 24px 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #e8eefc;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(255, 209, 102, 0.15), transparent 60%),
    radial-gradient(900px 500px at 85% 20%, rgba(255, 107, 53, 0.18), transparent 65%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

#gameCanvas {
  width: min(1280px, 95vw);
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  background: #0b1428;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: min(1280px, 95vw);
  align-items: stretch;
}

#fireControls,
#playerInfo,
#chat {
  background-color: var(--panel);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

#fireControls {
  flex: 1 1 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

#playerInfo {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#playerInfo input {
  width: 100%;
}

#playerInfo div {
  display: flex;
  gap: 8px;
}

#playerInfo div button {
  white-space: nowrap;
}

.sliders {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-row {
  display: grid;
  grid-template-columns: 70px 1fr 60px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.control-row span {
  font-weight: 600;
}

.control-row input[type="range"] {
  width: 100%;
}

input[type="range"] {
  accent-color: var(--accent);
}

button {
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}

button:active {
  transform: translateY(1px);
}

#fireBtn {
  background: linear-gradient(135deg, var(--accent), #ff3b30);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 75, 49, 0.35);
}

#fireBtn.cooldown {
  background: #6b7280;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
  box-shadow: none;
}

#fireBtn:hover {
  opacity: 0.95;
}

#submitNameBtn,
#chat-send,
#credzBtn,
#helpBtn {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.28);
}

#submitNameBtn:hover,
#chat-send:hover,
#credzBtn:hover,
#helpBtn:hover {
  opacity: 0.92;
}

#playerInfo input,
#chat-input {
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
}

#chat {
  width: min(1280px, 95vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#chat-messages {
  height: 140px;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--outline);
  font-size: 13px;
}

#chat-messages div {
  margin-bottom: 4px;
}

#chat-input {
  width: 100%;
}

#chat-send {
  align-self: flex-start;
}

.button-container {
  display: flex;
  gap: 10px;
  width: min(1280px, 95vw);
  justify-content: flex-end;
}

#versionTag {
  position: fixed;
  right: 14px;
  bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(232, 238, 252, 0.7);
  background: rgba(8, 18, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  pointer-events: none;
  z-index: 12;
}

.modal {
  display: none;
  position: fixed;
  z-index: 10;
  inset: 0;
  background-color: rgba(7, 13, 26, 0.7);
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: #fefefe;
  color: var(--ink);
  margin: 10vh auto;
  padding: 20px 24px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  width: min(760px, 92vw);
  box-shadow: var(--shadow);
}

.close {
  color: #6b7280;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #111827;
  text-decoration: none;
  cursor: pointer;
}

#helpText {
  white-space: pre-wrap;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  #fireControls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-row {
    grid-template-columns: 60px 1fr 50px;
  }

  #chat-send {
    width: 100%;
  }

  .button-container {
    justify-content: center;
  }
}
