/* YRC Games: one stylesheet for the landing page and the admin pages. Dark, warm amber on ink. */
:root {
  --ink: #0d0f17;
  --panel: #171a26;
  --panel-2: #1f2333;
  --line: #333a55;
  --text: #f1f3f9;
  --muted: #b1b7cb;
  --amber: #ffc53d;
  --amber-ink: #1c1400;
  --teal: #5ad1c5;
  --red: #ff8f8f;
  --red-bg: #3a1620;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(255, 197, 61, 0.13), transparent 60%),
    radial-gradient(900px 480px at -10% 10%, rgba(90, 209, 197, 0.1), transparent 60%),
    var(--ink);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 0.8em;
}

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

code,
.sample,
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

/* ---- Top and bottom ---- */

.top {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.mark {
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wordmark b {
  color: var(--amber);
}

.foot {
  border-top: 1px solid var(--line);
  padding: 18px var(--gutter);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.foot p {
  margin: 0;
}

/* ---- Buttons and fields ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid var(--amber);
  border-radius: 10px;
  background: var(--amber);
  color: var(--amber-ink);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.12s ease;
}

.button:hover {
  background: #ffd76e;
  border-color: #ffd76e;
}

.button:active {
  transform: translateY(1px);
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button.secondary:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.button.danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

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

.button.small {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 0.92rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input[type='text'],
input[type='password'],
input[type='number'] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #0b0d14;
  color: var(--text);
  font: inherit;
}

input::placeholder {
  color: #8d94ab;
}

input:focus-visible {
  border-color: var(--teal);
  outline-offset: 1px;
}

input[aria-invalid='true'] {
  border-color: var(--red);
}

.help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.error,
.note {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--teal);
  background: rgba(90, 209, 197, 0.1);
}

.error {
  border-left-color: var(--red);
  background: var(--red-bg);
  color: #ffd9d9;
}

.note:empty {
  display: none;
}

.banner {
  margin: 0 0 20px;
}

/* ---- Landing ---- */

.hero {
  padding: clamp(20px, 6vw, 64px) 0 clamp(20px, 4vw, 40px);
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.1rem, 7vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.hero h1 span {
  color: var(--amber);
}

.lede {
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  color: var(--muted);
  max-width: 60ch;
}

.access {
  display: grid;
  gap: 20px;
  align-items: center;
  grid-template-columns: 1fr;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  scroll-margin-top: 16px;
}

.access h2 {
  font-size: 1.35rem;
}

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

.access.is-open {
  border-color: var(--teal);
}

.sample {
  color: var(--text);
  white-space: nowrap;
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-row input::placeholder {
  letter-spacing: 0.08em;
}

@media (min-width: 820px) {
  .access {
    grid-template-columns: 1fr minmax(360px, 440px);
  }

  .access.is-open {
    grid-template-columns: 1fr auto;
  }
}

.section-title {
  margin: clamp(28px, 5vw, 48px) 0 16px;
  font-size: 1.5rem;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel-2);
}

.card.is-soon img {
  filter: saturate(0.7);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
}

.card h3 {
  font-size: 1.3rem;
}

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

.badge {
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-play {
  background: rgba(90, 209, 197, 0.16);
  color: var(--teal);
}

.badge-soon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.card-action {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.card-action .button {
  min-width: 140px;
}

.needs,
.soon {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.soon {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  font-weight: 700;
}

/* ---- Panels (admin, messages) ---- */

.panel {
  margin: 0 0 24px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel.narrow {
  max-width: 460px;
  margin: clamp(24px, 8vw, 80px) auto;
}

.panel h1 {
  font-size: 1.7rem;
}

.panel h2 {
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.stack > * + * {
  margin-top: 14px;
}

.stack label {
  margin-bottom: -8px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 24px;
}

.admin-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.grid-form {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.field.submit {
  display: flex;
  align-items: flex-end;
}

@media (min-width: 720px) {
  .grid-form {
    grid-template-columns: repeat(4, 1fr);
  }

  .field.wide {
    grid-column: span 3;
  }

  .field.submit {
    grid-column: span 2;
    justify-content: flex-end;
  }
}

.fresh {
  border-color: var(--amber);
}

.fresh-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.fresh-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #0b0d14;
  border: 1px solid var(--line);
}

.fresh-list .code {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--amber);
  user-select: all;
}

.fresh-list .button {
  margin-left: auto;
}

.table-wrap {
  overflow-x: auto;
}

table.codes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.codes th,
table.codes td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

table.codes thead th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

table.codes tbody th {
  min-width: 9em;
  font-weight: 700;
  overflow-wrap: break-word;
}

.table-note {
  margin: -8px 0 12px;
}

table.codes time {
  white-space: nowrap;
}

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.status-active {
  background: rgba(90, 209, 197, 0.16);
  color: var(--teal);
}

.status-revoked {
  background: var(--red-bg);
  color: var(--red);
}

/* On a phone every code becomes a small card with its own labels. */
@media (max-width: 760px) {
  table.codes thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  table.codes,
  table.codes tbody,
  table.codes tr,
  table.codes th,
  table.codes td {
    display: block;
  }

  table.codes tr {
    margin-bottom: 14px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0b0d14;
  }

  table.codes th,
  table.codes td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    text-align: right;
  }

  table.codes tbody th {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  table.codes tr > :last-child {
    border-bottom: 0;
  }

  table.codes [data-label]::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
  }

  .code-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
