:root {
  --sea-deep: #0a4d6e;
  --sea: #1488a8;
  --sand: #e8c97a;
  --palm: #1f7a45;
  --palm-dark: #145c32;
  --sun: #ffb347;
  --ink: #1a2a22;
  --cream: #fff6d6;
  --fart: #9acd32;
  --fart-hot: #c8e86a;
  --blood-ish: #c45c26;
  --panel: rgba(12, 40, 36, 0.72);
  --stroke: rgba(255, 246, 214, 0.18);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #062636;
  color: var(--cream);
  font-family: "Nunito", sans-serif;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 179, 71, 0.35), transparent 45%),
    radial-gradient(ellipse at 80% 0%, rgba(20, 136, 168, 0.45), transparent 40%),
    linear-gradient(180deg, #08384f 0%, #0a4d6e 40%, #062636 100%);
}

#game {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  display: block;
  border-radius: 0;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px rgba(255, 246, 214, 0.08), 0 30px 80px rgba(0, 0, 0, 0.45);
  cursor: crosshair;
  background: #0a4d6e;
}

#hud {
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  margin: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 18px 22px;
  z-index: 2;
}

.hud-left, .hud-right, .hud-center {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-right {
  align-items: flex-end;
  text-align: right;
}

.hud-center {
  align-items: center;
  justify-content: flex-end;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  font-family: "Bangers", cursive;
  font-size: 28px;
  letter-spacing: 0.06em;
  color: var(--sun);
  text-shadow: 2px 3px 0 #1a2a22;
}

.hud-chip {
  pointer-events: auto;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--cream);
  font: 800 11px Nunito, sans-serif;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  cursor: pointer;
}

.hud-chip.muted {
  color: #ff8fab;
}

#kill-feed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#kill-feed .feed-line {
  opacity: 0.95;
  animation: fadeFeed 4s forwards;
}

@keyframes fadeFeed {
  0%, 70% { opacity: 0.95; }
  100% { opacity: 0; }
}

#scoreboard, #round-timer, #ammo, #weapon, #ability {
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 8px 12px;
  backdrop-filter: blur(6px);
  font-size: 14px;
  line-height: 1.35;
}

#ammo, #weapon, #ability {
  min-width: 180px;
  text-align: center;
  font-weight: 800;
}

#weapon {
  color: var(--fart-hot);
}

.skin-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.skin-btn {
  border: 1px solid rgba(255, 246, 214, 0.22);
  background: rgba(6, 38, 54, 0.7);
  color: var(--cream);
  padding: 10px 8px;
  font: 800 12px Nunito, sans-serif;
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.skin-btn .swatch {
  width: 22px;
  height: 28px;
  border-radius: 50% 50% 45% 45%;
}

.skin-btn.active {
  border-color: var(--sun);
  box-shadow: inset 0 0 0 1px var(--sun);
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 14px !important;
}

.check-row input {
  width: auto;
}

.pause-tip {
  margin: 0 0 14px;
  opacity: 0.8;
  font-size: 14px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: auto;
}

.overlay.hidden, .hidden {
  display: none !important;
}

.menu-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 56, 79, 0.25), rgba(6, 38, 54, 0.55)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%231f7a45' fill-opacity='0.12' d='M0 120c20-20 40-10 60-30s40-10 60-30 40-10 40-30v120H0z'/%3E%3C/svg%3E"),
    radial-gradient(circle at 70% 20%, rgba(255, 179, 71, 0.55), transparent 35%),
    linear-gradient(160deg, #1488a8 0%, #0a4d6e 45%, #145c32 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.08) translateY(-12px); }
}

.menu-content {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 40px));
  text-align: center;
  animation: riseIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.menu-content.compact {
  width: min(420px, calc(100% - 40px));
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 28px 24px;
  backdrop-filter: blur(10px);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo {
  font-family: "Bangers", cursive;
  font-size: clamp(72px, 14vw, 120px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--sun);
  text-shadow:
    4px 6px 0 var(--ink),
    0 0 40px rgba(255, 179, 71, 0.35);
  animation: wobble 2.8s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-1.5deg) scale(1); }
  50% { transform: rotate(1.5deg) scale(1.03); }
}

.tagline {
  margin: 14px auto 28px;
  max-width: 34ch;
  font-size: 18px;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.menu-panel {
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 22px;
  backdrop-filter: blur(10px);
}

.menu-panel label {
  display: grid;
  gap: 6px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 246, 214, 0.8);
}

input, select {
  width: 100%;
  border: 1px solid rgba(255, 246, 214, 0.22);
  background: rgba(6, 38, 54, 0.7);
  color: var(--cream);
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--sun);
}

.cta, .ghost {
  border: none;
  cursor: pointer;
  font-family: "Bangers", cursive;
  letter-spacing: 0.08em;
  font-size: 28px;
  padding: 14px 18px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cta {
  background: linear-gradient(180deg, #ffd36a, #ff9f1c);
  color: var(--ink);
  box-shadow: 0 6px 0 #b86a00;
}

.cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.cta:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b86a00;
}

.ghost {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--stroke);
  font-size: 22px;
}

.ghost:hover {
  background: rgba(255, 246, 214, 0.08);
}

.controls-hint {
  margin-top: 18px;
  font-size: 13px;
  opacity: 0.8;
}

#end-scores {
  margin: 16px 0 20px;
  text-align: left;
  font-size: 15px;
}

#end-scores .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 246, 214, 0.1);
}

#end h2, #pause h2 {
  font-family: "Bangers", cursive;
  font-size: 48px;
  color: var(--sun);
  letter-spacing: 0.04em;
}

#end-sub {
  margin-top: 6px;
  opacity: 0.85;
}

.tagline-sub {
  margin: -10px auto 22px;
  max-width: 42ch;
  font-size: 14px;
  opacity: 0.85;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.menu-shell {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  max-height: min(92vh, 900px);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  align-items: start;
  animation: riseIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.menu-shell .menu-content {
  width: auto;
  animation: none;
}

.chaos-panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 18px;
  backdrop-filter: blur(10px);
  text-align: left;
}

.chaos-head h2 {
  font-family: "Bangers", cursive;
  font-size: 34px;
  color: var(--sun);
  letter-spacing: 0.04em;
}

.chaos-countdown {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 179, 71, 0.35);
  background: rgba(255, 179, 71, 0.08);
  display: grid;
  gap: 2px;
}

.chaos-countdown-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

#chaos-countdown {
  font-family: "Bangers", cursive;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--sun);
  line-height: 1.1;
}

.chaos-countdown-when {
  font-size: 12px;
  opacity: 0.8;
}

.ad-slot {
  min-height: 0;
  margin: 12px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-slot:not(.ad-slot-empty) {
  min-height: 70px;
  border: 1px dashed rgba(255, 246, 214, 0.12);
  background: rgba(0, 0, 0, 0.15);
}

.ad-slot-empty {
  display: none;
}


.chaos-head p {
  margin: 6px 0 14px;
  font-size: 13px;
  opacity: 0.85;
}

.chaos-form label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: rgba(255, 246, 214, 0.8);
}

.chaos-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 246, 214, 0.22);
  background: rgba(6, 38, 54, 0.7);
  color: var(--cream);
  padding: 12px;
  font: inherit;
  font-weight: 700;
  resize: vertical;
  min-height: 84px;
  outline: none;
}

.chaos-form textarea:focus {
  border-color: var(--sun);
}

.chaos-form-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#chaos-count {
  font-size: 12px;
  opacity: 0.7;
}

.chaos-submit {
  font-size: 20px;
  padding: 10px 14px;
  width: auto;
}

.chaos-status {
  min-height: 1.2em;
  margin-top: 8px;
  font-size: 13px;
  color: var(--fart-hot);
}

.chaos-section {
  margin-top: 16px;
}

.chaos-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  opacity: 0.8;
}

.chaos-ideas, .chaos-drops {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.chaos-idea, .chaos-drop {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px;
  border: 1px solid rgba(255, 246, 214, 0.1);
  background: rgba(6, 38, 54, 0.45);
}

.chaos-drop {
  grid-template-columns: 1fr;
}

.chaos-vote {
  border: 1px solid rgba(255, 246, 214, 0.2);
  background: rgba(255, 179, 71, 0.12);
  color: var(--sun);
  font: 800 12px Nunito, sans-serif;
  padding: 8px 6px;
  cursor: pointer;
  min-width: 48px;
}

.chaos-vote:hover {
  background: rgba(255, 179, 71, 0.22);
}

.chaos-idea p, .chaos-drop p {
  font-size: 14px;
  line-height: 1.35;
}

.chaos-drop time {
  font-size: 11px;
  opacity: 0.65;
}

.chaos-drop a {
  color: var(--sun);
  font-size: 12px;
  font-weight: 800;
}

.chaos-empty {
  font-size: 13px;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .menu-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  #hud {
    padding: 10px 12px;
  }

  .brand-mark {
    font-size: 20px;
  }

  #scoreboard, #round-timer, #ammo {
    font-size: 12px;
    padding: 6px 8px;
  }

  .logo {
    font-size: 64px;
  }
}
