:root {
  --bg-0: #111416;
  --bg-1: #1a1f23;
  --bg-2: #232a30;
  --bg-3: #2c353d;
  --text: #e8edf1;
  --muted: #9ba7b1;
  --accent: #2db56f;
  --accent-2: #2a84c6;
  --danger: #cc4a4a;
  --radius: 10px;
  --border: 1px solid #364049;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: #111416;
  background: radial-gradient(circle at 20% 0%, #20262b, #111416 45%);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  min-height: 100dvh;
}

html {
  height: 100%;
  background-color: #111416;
}

body {
  position: relative;
  overscroll-behavior-y: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 20% 0%, #20262b, #111416 45%);
  pointer-events: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input {
  font: inherit;
}

input {
  width: 100%;
  padding: 11px 12px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #3b4650;
  background: #29313a;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: #5f7385;
}

.app-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px;
}

.view-hidden {
  display: none !important;
}

.view-visible {
  display: block !important;
}

.btn-action {
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.bg-blue {
  background: var(--accent-2);
}

.bg-red {
  background: var(--danger);
}

.bg-green {
  background: var(--accent);
}

@media (max-width: 1100px) {
  .app-shell {
    padding: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lobby-grid {
    grid-template-columns: 1fr;
  }

  #main-container.view-visible {
    flex-direction: column;
    align-items: stretch;
  }

  .board-container,
  .sidebar {
    width: 100%;
    max-width: none;
  }

  #myBoard {
    width: 100%;
  }
}

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