:root {
  --blue: #075ed1;
  --orange: #ff6b00;
  --green: #58ad19;
  --purple: #7a39c2;
  --ink: #111827;
  --muted: #5b6475;
  --line: #dbe4f0;
  --paper: #ffffff;
  --wash: #f4f8ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(7, 94, 209, 0.35);
  outline-offset: 3px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(14px, 3vw, 34px);
  background: #fff;
  border-bottom: 3px solid var(--line);
}

.brand img {
  width: min(320px, 70vw);
  height: auto;
  display: block;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-actions a,
.header-actions button,
.editor-actions a,
.editor-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.admin-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 34px);
}

.admin-hero,
.admin-tools,
.admin-grid > * {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 8px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 22px;
}

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

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats div {
  min-height: 110px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
}

.stats div:first-child { background: var(--green); }
.stats div:last-child { background: var(--purple); }

.stats strong {
  font-size: 38px;
  line-height: 1;
}

.stats span {
  font-weight: 900;
}

.admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  margin: 20px 0;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.game-table-wrap {
  overflow: auto;
  max-height: 720px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #f8fbff;
  z-index: 1;
}

tr {
  cursor: pointer;
}

tr:hover,
tr.is-selected {
  background: #eaf3ff;
}

td a {
  color: var(--blue);
  font-weight: 900;
}

.editor {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-actions button {
  background: var(--green);
}

#editorHint {
  margin: 0;
}

@media (max-width: 980px) {
  .admin-hero,
  .admin-tools,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
  }
}

@media (max-width: 640px) {
  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    overflow-x: auto;
  }

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