:root {
  --bg: #0e1726;
  --panel: #132034;
  --line: #2d4568;
  --text: #edf4ff;
  --muted: #93aac8;
  --accent: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #19304e 0, var(--bg) 55%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #111827;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  background: #0d1725;
  color: var(--text);
}

.layout {
  min-height: 100vh;
}

.topbar,
.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar {
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 15, 25, 0.7);
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
}

.nav,
.hud {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.content {
  padding: 1.5rem;
}

body.game-page {
  overflow: hidden;
}

body.game-page .layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.game-page .topbar {
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
}

body.game-page .brand {
  font-size: 1rem;
}

body.game-page .nav {
  gap: 0.75rem;
  font-size: 0.9rem;
}

body.game-page .game-header-hud {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  color: var(--muted);
  text-align: center;
}

body.game-page .game-header-line {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

body.game-page .content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.4rem;
}

body.game-page .game-panel {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.panel {
  background: linear-gradient(180deg, rgba(27, 45, 72, 0.9), rgba(19, 32, 52, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.25rem;
}

.narrow {
  max-width: 420px;
  margin: 4rem auto 0;
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.between {
  justify-content: space-between;
}

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

.alert {
  margin-bottom: 1rem;
  color: #fff;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 0.75rem;
}

.success {
  margin-bottom: 1rem;
  color: #fff;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 0.75rem;
}

.room-card,
.stats div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(10, 18, 31, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

#game-canvas,
#open-world-canvas {
  display: block;
  margin: 0;
  width: 1366px;
  height: 768px;
  max-width: none;
  background: linear-gradient(180deg, #09111d, #102338);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.game-start-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 180px;
  text-align: center;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 5;
}

.game-start-overlay--end {
  min-width: 420px;
  display: grid;
  gap: 0.35rem;
  font-size: 3.2rem;
  line-height: 1.1;
}

.game-start-overlay__result {
  font-size: 1em;
  font-weight: 900;
}

.game-start-overlay__exit {
  font-size: 0.45em;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.game-start-overlay__count {
  color: #f59e0b;
}

.mine-cooldown-box {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-96px);
  width: 96px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: rgba(7, 14, 24, 0.75);
  backdrop-filter: blur(3px);
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 6px 5px;
  z-index: 4;
  pointer-events: none;
}

.mine-cooldown-box__label {
  font-size: 9px;
  font-weight: 700;
  color: #93aac8;
  letter-spacing: 0.03em;
}

.mine-cooldown-box__value {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
  white-space: nowrap;
}

.shield-regen-box {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(0);
  width: 96px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: rgba(7, 14, 24, 0.78);
  backdrop-filter: blur(3px);
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 6px 5px;
  z-index: 4;
  pointer-events: none;
}

.shield-regen-box__label {
  font-size: 9px;
  font-weight: 700;
  color: #93aac8;
  letter-spacing: 0.03em;
}

.shield-regen-box__value {
  font-size: 20px;
  font-weight: 800;
  color: #93c5fd;
  line-height: 1;
  white-space: nowrap;
}

.settings-compact-form {
  display: grid;
  gap: 12px;
}

.settings-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px 24px;
  align-items: start;
}

.settings-col {
  display: grid;
  gap: 8px;
  align-content: start;
}

.settings-col h2 {
  margin: 10px 0 0;
  font-size: 15px;
  color: #c9dcf7;
  text-align: left;
}

.settings-compact-form label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 32px;
}

.settings-compact-form label > span {
  font-size: 12px;
  color: #c9dcf7;
  line-height: 1.1;
}

.settings-compact-form input,
.settings-compact-form select {
  width: 180px;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
}

.settings-save-btn {
  width: 220px;
  justify-self: start;
  margin-top: 4px;
}

@media (max-width: 1200px) {
  .settings-columns {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .settings-columns {
    grid-template-columns: 1fr;
  }
}

.open-world-status-box {
  position: absolute;
  left: 24px;
  top: 20px;
  min-width: 250px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(7, 14, 24, 0.78);
  backdrop-filter: blur(3px);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  z-index: 4;
  pointer-events: none;
}

#open-world-status {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

#open-world-stats {
  font-size: 13px;
  font-weight: 600;
  color: #93aac8;
}

.open-world-death-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 420px;
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(7, 14, 24, 0.9);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  z-index: 8;
}

.open-world-death-overlay[hidden] {
  display: none !important;
}

.open-world-death-overlay__message {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.open-world-death-overlay__countdown {
  font-size: 24px;
  font-weight: 700;
  color: #f59e0b;
}

#open-world-respawn-btn {
  min-width: 170px;
  padding: 0.7rem 1rem;
}

