:root {
  color-scheme: dark;
  --bg: #080806;
  --bg-2: #0d0f0a;
  --panel: #11130d;
  --panel-2: #17150f;
  --line: #3a3526;
  --line-strong: #6b5423;
  --text: #efe3bd;
  --muted: #9c946f;
  --dim: #686348;
  --amber: #d99a24;
  --amber-2: #ffbf3d;
  --green: #92c36d;
  --red: #e05a3e;
  --blue: #6b8b9c;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --mono: "DM Mono", "IBM Plex Mono", "Courier New", monospace;
  --display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 191, 61, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, rgba(146, 195, 109, 0.12), transparent 42rem),
    var(--bg);
  background-size: 100% 3px, auto, auto;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: soft-light;
  opacity: 0.2;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  background: var(--amber);
  color: #140f05;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  transition: top 0.16s ease;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  min-height: 72px;
  padding: 0.8rem clamp(1rem, 4vw, 2rem);
  background: rgba(8, 8, 6, 0.88);
  border-bottom: 1px solid rgba(217, 154, 36, 0.28);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--amber);
  border-radius: 4px;
  color: var(--amber-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  box-shadow: inset 0 0 18px rgba(217, 154, 36, 0.12);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3.5rem);
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.83rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--amber-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.donate-link,
.account-chip,
.primary-cta,
.secondary-cta,
.ghost-btn,
.danger-btn,
.vote-btn {
  min-height: 42px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  padding: 0.7rem 1rem;
  color: var(--text);
  background: rgba(217, 154, 36, 0.06);
  text-decoration: none;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.1;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.donate-link:hover,
.account-chip:hover,
.primary-cta:hover,
.secondary-cta:hover,
.ghost-btn:hover,
.danger-btn:hover,
.vote-btn:hover {
  transform: translateY(-1px);
  border-color: var(--amber-2);
}

.primary-cta {
  background: linear-gradient(180deg, #e8a735, #b87617);
  color: #140f05;
  border-color: #ffc35a;
  font-weight: 800;
  text-transform: uppercase;
}

.secondary-cta {
  background: rgba(146, 195, 109, 0.08);
  border-color: #54713d;
  color: #c6e1a8;
}

.account-chip {
  color: var(--green);
  background: transparent;
}

.compact {
  width: 100%;
}

.menu-toggle {
  display: none;
  justify-self: end;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  background: transparent;
  color: var(--text);
}

.app-shell {
  min-height: calc(100vh - 72px);
}

.hero-section {
  position: relative;
  min-height: min(760px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(217, 154, 36, 0.24);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 6, 0.78), rgba(8, 8, 6, 0.32) 46%, rgba(8, 8, 6, 0.82)),
    linear-gradient(0deg, rgba(8, 8, 6, 0.86), transparent 36%),
    url("./assets/brand/new-meridian-arrival.png") center / cover no-repeat;
  opacity: 0.86;
}

.hero-content,
.invite-terminal {
  position: relative;
  z-index: 1;
}

.hero-content {
  align-self: center;
  min-width: 0;
  max-width: 780px;
  padding: clamp(2rem, 8vw, 7rem) 0 clamp(3rem, 9vw, 7rem) clamp(0rem, 4vw, 4rem);
}

.terminal-line {
  color: var(--green);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  margin: 0 0 1rem;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-family: var(--display);
  font-size: clamp(4rem, 11vw, 9rem);
  line-height: 0.86;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.hero-copy {
  max-width: 610px;
  margin: 1.35rem 0 0;
  color: #d7c99d;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-actions .primary-cta,
.hero-actions .secondary-cta {
  min-width: min(270px, 100%);
}

.invite-terminal,
.panel,
.form-panel,
.game-panel,
.admin-detail,
.roadmap-card,
.feedback-row,
.gem-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(146, 195, 109, 0.05) 1px, transparent 1px),
    rgba(10, 13, 8, 0.9);
  background-size: 100% 4px, auto;
  box-shadow: var(--shadow);
}

.invite-terminal {
  align-self: center;
  min-width: 0;
  padding: 1.35rem;
  min-height: 300px;
}

.terminal-title,
.section-label {
  color: var(--amber-2);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.82rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(217, 154, 36, 0.16);
  color: var(--muted);
  font-size: 0.78rem;
}

.status-row strong {
  color: var(--green);
  font-weight: 700;
  text-align: right;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 4vw, 2rem);
  max-width: 1400px;
  margin: 0 auto;
}

.section-copy h2,
.page-title h1 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.section-copy p,
.page-title p,
.panel p {
  color: var(--muted);
  line-height: 1.75;
}

.media-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.7rem;
}

.media-strip img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  filter: saturate(0.88) contrast(1.05);
}

.media-strip img:first-child {
  grid-row: span 2;
}

.loop-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.loop-band article {
  min-height: 200px;
  padding: clamp(1.1rem, 3vw, 2rem);
  background: #0b0c08;
}

.loop-band span {
  color: var(--amber);
  font-weight: 800;
}

.loop-band h3 {
  margin: 0.8rem 0 0.5rem;
  font-size: 1.2rem;
}

.loop-band p {
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.65;
}

.page-wrap {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 4rem;
}

.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.page-title p {
  max-width: 760px;
  margin: 0;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.form-panel,
.game-panel,
.admin-detail {
  padding: clamp(1rem, 2.5vw, 1.4rem);
}

.form-panel form,
.stack {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.72rem 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber-2);
  outline-offset: 2px;
}

.notice {
  border-left: 3px solid var(--amber);
  padding: 0.85rem 1rem;
  background: rgba(217, 154, 36, 0.08);
  color: #e9d49b;
  line-height: 1.6;
}

.verified-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(146, 195, 109, 0.35);
  border-radius: 6px;
  background: rgba(146, 195, 109, 0.08);
  color: #cae6aa;
}

.game-frame-shell {
  display: grid;
  gap: 0.85rem;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.game-frame {
  width: 100%;
  min-height: min(74vh, 760px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #0f0d0a;
}

.game-frame iframe {
  width: 100%;
  height: min(74vh, 760px);
  min-height: 620px;
  border: 0;
  display: block;
  background: #0f0d0a;
}

.roadmap-list,
.feedback-list,
.gem-list,
.session-list {
  display: grid;
  gap: 0.75rem;
}

.roadmap-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
}

.vote-count {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--amber-2);
  font-weight: 800;
}

.roadmap-card h3,
.feedback-row h3,
.gem-row h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.roadmap-card p,
.feedback-row p,
.gem-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.82rem;
}

.vote-btn.voted {
  border-color: var(--green);
  color: var(--green);
}

.feedback-row,
.gem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  padding: 0.85rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.22rem 0.42rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tag.open,
.tag.pending {
  color: var(--amber-2);
  border-color: rgba(217, 154, 36, 0.45);
}

.tag.approved,
.tag.resolved {
  color: var(--green);
  border-color: rgba(146, 195, 109, 0.45);
}

.tag.rejected,
.tag.critical,
.tag.duplicate {
  color: var(--red);
  border-color: rgba(224, 90, 62, 0.45);
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.admin-nav button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.7rem 0.8rem;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.admin-nav button.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(217, 154, 36, 0.06);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.danger-btn {
  color: #ff957f;
  border-color: rgba(224, 90, 62, 0.45);
  background: rgba(224, 90, 62, 0.08);
}

.ghost-btn {
  background: transparent;
}

.empty-state {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: min(380px, calc(100% - 2rem));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  background: #101008;
  color: var(--text);
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .site-nav,
  .header-actions {
    grid-column: 1 / -1;
    display: none;
    justify-content: start;
    flex-wrap: wrap;
  }

  .site-header.menu-open .site-nav,
  .site-header.menu-open .header-actions {
    display: flex;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-content {
    padding: 4rem 0 1rem;
  }

  .invite-terminal {
    align-self: stretch;
  }

  .section-grid,
  .grid-2,
  .grid-3,
  .admin-layout,
  .page-title {
    grid-template-columns: 1fr;
  }

  .loop-band {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 64px;
    gap: 0.7rem;
    overflow: hidden;
  }

  .brand {
    min-width: 0;
    font-size: 1.05rem;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark {
    width: 2.1rem;
    height: 2.1rem;
  }

  h1 {
    max-width: calc(100vw - 2rem);
    font-size: clamp(3rem, 15vw, 3.85rem);
    overflow-wrap: break-word;
  }

  .hero-copy,
  .terminal-line {
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    overflow-wrap: break-word;
  }

  .hero-actions,
  .game-toolbar,
  .verified-banner,
  .feedback-row,
  .gem-row,
  .roadmap-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .roadmap-card {
    align-items: stretch;
  }

  .vote-count {
    width: 100%;
    height: 2.8rem;
  }

  .media-strip {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .media-strip img:first-child {
    grid-row: auto;
  }

  .game-frame,
  .game-frame iframe {
    min-height: 560px;
  }

  .status-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .status-row strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
