:root {
  --bg: #0a1222;
  --surface: #14213d;
  --surface-2: #1a2d56;
  --line: rgba(148,163,184,0.24);
  --text: #e2e8f0;
  --muted: #94a3b8;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #1c3159, #0a1222 62%);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
}

.shell {
  width: min(980px, 100vw);
  margin: 0 auto;
  padding: 12px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.top h1 { margin: 0; font-size: 1.35rem; }
.top p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

#restartBtn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.chip span { color: var(--muted); }

#game {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  background: #091628;
  touch-action: none;
}

.tip {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.attack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  border: 0;
  border-radius: 999px;
  width: 82px;
  height: 82px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(220,38,38,0.3);
}

@media (min-width: 900px) {
  .attack {
    display: none;
  }
}

@media (max-width: 640px) {
  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
