@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --bg-1: #eef3f8;
  --bg-2: #e9eff6;
  --ink: #0f172a;
  --muted: #526070;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --accent-3: #38bdf8;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #38bdf8 100%);
  --accent-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
  --panel: #ffffff;
  --stroke: #d2dbe5;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  --play-bg: #e8f3ff;
  --spectate-bg: #eaf2ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(520px 320px at 10% 5%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(560px 360px at 90% 0%, rgba(14, 165, 233, 0.14), transparent 60%),
    radial-gradient(620px 420px at 70% 85%, rgba(251, 191, 36, 0.18), transparent 65%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  min-height: 100vh;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
  gap: 16px;
}

.brand h1 {
  margin: 0 0 6px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  letter-spacing: 0.5px;
}

.brand {
  flex: 1;
  min-width: 0;
}

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

.status-block {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.status {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  font-weight: 600;
}

.status--open {
  background: #e7f7f7;
  border-color: #7ccbd1;
  color: #0b5b66;
}

.status--closed {
  background: #eef2f7;
  border-color: #c3cfdd;
  color: #3b4a5a;
}

.status--inplay {
  background: #eaf2ff;
  border-color: #9fbaf5;
  color: #1e3a8a;
}

.status--offline {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.status--player {
  background: #e7f0ff;
  border-color: #9cb7f4;
  color: #1d4ed8;
}

.status--spectator {
  background: #eef2ff;
  border-color: #b5c2f6;
  color: #4338ca;
}

.status--registered {
  background: #e6f4ff;
  border-color: #86c5f5;
  color: #0b4f7a;
}

.status--guest {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.status--simulation {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

.layout {
  display: grid;
  grid-template-columns: 0.95fr 2.15fr;
  gap: 24px;
  padding: 32px 40px 48px;
}

.panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-body {
  display: grid;
  gap: 16px;
}

h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.tab-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #9c9c9c;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--accent-2);
  color: #ffffff;
}

.panel-block {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px;
  background: #f8fbff;
}

.panel-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.field.inline {
  flex-direction: row;
  gap: 6px;
  align-items: center;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  margin-bottom: 6px;
}

.field-row .field {
  margin-bottom: 0;
}

label {
  font-weight: 600;
}

input, select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  font-family: inherit;
}

button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--accent-shadow);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
  box-shadow: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.note {
  background: #f1f5fb;
  border: 1px dashed var(--stroke);
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  white-space: pre-line;
}

.game-panel {
  background: var(--panel);
}

.game-panel.playing {
  background: var(--play-bg);
}

.game-panel.spectating {
  background: var(--spectate-bg);
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.round-info {
  text-align: right;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid var(--stroke);
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: var(--accent-2);
  color: white;
}

.tab-content {
  display: grid;
  gap: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  border-bottom: 1px solid var(--stroke);
  padding: 8px 6px;
  text-align: left;
}

.minimized .field,
.minimized .field.inline {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 18px 16px 28px;
}

.admin-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.75;
  cursor: pointer;
}

.admin-link:hover,
.admin-link:focus {
  opacity: 1;
  color: var(--ink);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .round-info {
    text-align: left;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }
  .top {
    padding: 16px 20px;
  }
  .brand h1 {
    font-size: 22px;
  }
  .layout {
    gap: 16px;
    padding: 20px 20px 28px;
  }
  .panel {
    padding: 16px;
    border-radius: 14px;
  }
  .panel-head {
    margin-bottom: 8px;
  }
  h2 {
    font-size: 18px;
  }
  .panel-block {
    padding: 10px;
    border-radius: 10px;
  }
  .panel-title {
    margin-bottom: 6px;
  }
  .field {
    gap: 6px;
    margin-bottom: 6px;
  }
  .field.inline {
    gap: 8px;
  }
  label {
    font-size: 13px;
  }
  input, select {
    padding: 8px 10px;
    border-radius: 8px;
  }
  button {
    padding: 8px 12px;
    border-radius: 8px;
  }
  .tab-btn,
  .tab {
    padding: 6px 10px;
    font-size: 13px;
  }
  .status {
    padding: 4px 10px;
    font-size: 13px;
  }
  .tabs {
    gap: 8px;
    margin-bottom: 12px;
  }
  .tab-content {
    gap: 12px;
  }
  .note {
    padding: 10px;
    border-radius: 10px;
    font-size: 12px;
  }
  .table {
    font-size: 13px;
  }
}
