:root {
  color-scheme: dark;
  --ink: #f8eedb;
  --muted: #cabda2;
  --panel: rgba(34, 42, 34, 0.84);
  --panel-strong: rgba(53, 61, 48, 0.92);
  --line: rgba(248, 238, 219, 0.16);
  --gold: #f0b84f;
  --green: #7fc08a;
  --danger: #f18a75;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 8%, rgba(240, 184, 79, 0.24), transparent 30rem),
    radial-gradient(circle at 84% 0%, rgba(127, 192, 138, 0.18), transparent 28rem),
    linear-gradient(135deg, #101812 0%, #172018 52%, #0c1110 100%);
}

a {
  color: inherit;
}

button,
a.button-link,
.quiet-link {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  color: #20180f;
  background: var(--gold);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
a.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

button:disabled,
a.disabled {
  opacity: 0.46;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E");
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.hero {
  min-height: 430px;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 16%, rgba(240, 184, 79, 0.22), transparent 24rem),
    linear-gradient(120deg, rgba(20, 26, 20, 0.84), rgba(20, 26, 20, 0.95));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.compact-hero {
  min-height: 300px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #24190e;
  background: var(--gold);
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-status strong {
  color: var(--ink);
}

.hero-copy {
  align-self: end;
  max-width: 780px;
  padding: 38px;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.7rem, 8vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.hero-copy p:last-child {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.65;
}

.panel {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.quiet-link {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.game-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 32px;
}

.game-badge {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #20180f;
  background: var(--gold);
  font-weight: 1000;
  font-size: 1.45rem;
}

.game-status {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
}

.game-card h3 {
  margin-bottom: 0.65rem;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.game-card p {
  color: var(--muted);
  line-height: 1.55;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 18px;
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.architecture article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.architecture span {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
}

.architecture h3 {
  margin: 0.55rem 0;
}

.architecture p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.notice-panel {
  color: var(--green);
  font-weight: 800;
}

.notice-panel.danger {
  color: var(--danger);
}

.helper-copy {
  color: var(--muted);
  line-height: 1.55;
}

.admin-list {
  display: grid;
  gap: 14px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-row h3 {
  margin-bottom: 0.35rem;
}

.admin-row p,
.admin-row small {
  color: var(--muted);
}

.admin-row p {
  margin-bottom: 0.35rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.platform-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.platform-form h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.platform-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.platform-form textarea,
.platform-form input,
.platform-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.78rem 0.9rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.24);
  font: inherit;
}

.platform-form textarea {
  min-height: 92px;
  resize: vertical;
}

.platform-form button {
  justify-self: start;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.auth-form {
  margin-top: 0;
}

.auth-form p {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 680px) {
  .topline,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy {
    padding: 24px;
  }

  .admin-row,
  .platform-form {
    grid-template-columns: 1fr;
  }

  .admin-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-actions {
    justify-content: flex-start;
  }
}
