/* Admin, sign-in and survey pages. Same navy and gold as the game, but laid
   out for reading and typing on a laptop or phone rather than a TV. */

:root {
  --navy-950: #030820;
  --navy-900: #050b2b;
  --navy-800: #0a1650;
  --navy-700: #12246f;
  --gold: #ffcf3f;
  --gold-deep: #e0a106;
  --ink: #06102e;
  --cream: #fff8e6;
  --muted: rgba(255, 248, 230, 0.68);
  --line: rgba(255, 248, 230, 0.16);
  --field: rgba(3, 8, 32, 0.6);
  --red: #ff6b61;
  --green: #4bd987;
  --radius: 12px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% -20%, var(--navy-700), var(--navy-900) 60%) fixed, var(--navy-900);
  color: var(--cream);
  font: 16px/1.5 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--gold);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

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

.small {
  font-size: 0.875rem;
}

.brand {
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.01em;
  text-decoration: none;
  font-size: 1.25rem;
  white-space: nowrap;
}

.brand span {
  color: var(--cream);
}

/* ---------------------------------------------------------------- layout */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 16px;
  background: rgba(3, 8, 32, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.topbar nav a {
  color: var(--cream);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.topbar nav a[aria-current='page'],
.topbar nav a:hover {
  background: rgba(255, 248, 230, 0.1);
}

.page {
  width: min(100%, 64rem);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.narrow {
  width: min(100%, 30rem);
}

.card {
  background: rgba(5, 11, 43, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

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

.row > .grow {
  flex: 1;
  min-width: 0;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.9rem;
}

.center-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 2.5rem;
  padding: 0.45em 1.1em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 230, 0.08);
  color: var(--cream);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 248, 230, 0.16);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--ink);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe07a, var(--gold));
}

.btn-danger {
  color: var(--red);
  border-color: rgba(255, 107, 97, 0.5);
}

.btn-small {
  min-height: 2rem;
  padding: 0.2em 0.8em;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  min-width: 2rem;
  padding: 0.2em 0.5em;
}

/* ---------------------------------------------------------------- forms */

label {
  font-weight: 700;
  font-size: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='datetime-local'],
select,
textarea {
  font: inherit;
  width: 100%;
  color: var(--cream);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55em 0.75em;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 400;
}

.check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--gold);
}

.error {
  color: var(--red);
  font-weight: 700;
}

.ok {
  color: var(--green);
  font-weight: 700;
}

/* ---------------------------------------------------------------- lists */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.list-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 248, 230, 0.03);
}

.list-item .grow {
  flex: 1;
  min-width: 0;
}

.list-item .title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.list-item.inactive {
  opacity: 0.55;
}

.game-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card:hover .card {
  border-color: var(--gold);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.badge.gold {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.badge.green {
  color: var(--green);
  border-color: rgba(75, 217, 135, 0.5);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  font-size: 0.8rem;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.08);
  border: 1px solid var(--line);
}

/* ----------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  scrollbar-width: none;
}

.tabs button {
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.tabs button[aria-selected='true'] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* --------------------------------------------------------------- results */

.bar-row {
  display: grid;
  grid-template-columns: minmax(6rem, 12rem) 1fr 2.5rem;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
}

.bar {
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.08);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}

.qr {
  width: 10rem;
  height: 10rem;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}

.copy-field {
  display: flex;
  gap: 0.5rem;
}

.copy-field input {
  flex: 1;
  min-width: 0;
}

/* ---------------------------------------------------------------- modal */

dialog {
  width: min(94vw, 38rem);
  max-height: 88dvh;
  color: var(--cream);
  background: var(--navy-900);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 34rem);
  background: var(--navy-950);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.55);
}

.toast.bad {
  border-color: var(--red);
}

/* ---------------------------------------------------------------- survey */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
}

.choice {
  font: inherit;
  font-weight: 700;
  min-height: 3rem;
  padding: 0.5em 0.7em;
  color: var(--cream);
  background: rgba(255, 248, 230, 0.06);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.choice[aria-pressed='true'] {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.choice:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.progress {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.1);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 0.25s ease;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: linear-gradient(transparent, var(--navy-900) 35%);
}

@media (max-width: 40rem) {
  .bar-row {
    grid-template-columns: 1fr 2.5rem;
  }

  .bar-row .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar nav {
    margin-left: 0;
  }
}
