/* BMEC brand palette */
:root {
  --bg: #080808;
  --bg-raised: #0d0d0d;
  --accent: #FF6600;
  --accent-deep: #FF5722;
  --neutral-mid: #9E9E9E;
  --neutral-dark: #5F6360;
  --white: #FFFFFF;
  --card-bg: rgba(255, 255, 255, 0.025);
  --card-border: rgba(255, 102, 0, 0.35);
  --card-border-soft: rgba(158, 158, 158, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--white);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Dot grid as a fixed pseudo-element layer - more reliable than
   background-attachment: fixed, which is buggy on iOS. */
body {
  position: relative;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 24%, rgba(255, 102, 0, 0.13) 0%, rgba(255, 102, 0, 0) 48%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='20' cy='20' r='1' fill='%23FF6600' fill-opacity='0.12'/></svg>");
  background-size: auto, 40px 40px;
  pointer-events: none;
  z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.accent-bar {
  height: 3px;
  background: var(--accent);
  opacity: 0.9;
}

/* Header - compact, sticky on desktop, static on mobile */
.site-header {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(95, 99, 96, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 24px; width: auto; display: block; }
.brand-suffix {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent);
  line-height: 1;
  transform: translateY(1px);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  color: var(--neutral-mid);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.icon-btn:hover {
  background: rgba(255, 102, 0, 0.12);
  color: var(--accent);
  text-decoration: none;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }

.hamburger {
  margin-left: 4px;
  border: 1px solid var(--neutral-dark);
}
.hamburger:hover { border-color: var(--accent); }

/* Accent variant: used for the daily-post download button so it stands
   out slightly from the neutral social icons. */
.icon-btn-accent {
  color: var(--accent);
  border: 1px solid rgba(255, 102, 0, 0.4);
}
.icon-btn-accent:hover {
  background: rgba(255, 102, 0, 0.16);
  color: var(--accent);
  border-color: var(--accent);
}

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  max-width: 88vw;
  background: var(--bg-raised);
  border-left: 1px solid var(--card-border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 70;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(95, 99, 96, 0.25);
}
.drawer-header .title {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.drawer-close {
  background: transparent;
  border: 0;
  color: var(--neutral-mid);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.drawer-close:hover { color: var(--accent); }

.drawer-body {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0 12px;
}

.drawer-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  color: var(--white);
  text-decoration: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.drawer-item:hover {
  background: rgba(255, 102, 0, 0.06);
  border-left-color: rgba(255, 102, 0, 0.6);
  text-decoration: none;
}
.drawer-item.active {
  background: rgba(255, 102, 0, 0.09);
  border-left-color: var(--accent);
}
.drawer-item .date {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: var(--neutral-mid);
  letter-spacing: 1px;
}
.drawer-item .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.drawer-item .tagline {
  grid-column: 2 / -1;
  font-size: 12px;
  color: var(--neutral-mid);
  line-height: 1.35;
  margin-top: 2px;
}
.drawer-item .pill {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 6px;
  border-radius: 2px;
  align-self: center;
}

.drawer-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(95, 99, 96, 0.25);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Page */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* Preview banner: shown only when viewing a future-dated game via direct URL */
.preview-banner {
  background: rgba(255, 102, 0, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 3px;
  margin: 0 0 14px;
  text-align: center;
  font-weight: 700;
}

/* Explainer panel */
.explainer {
  position: relative;
  background: rgba(255, 102, 0, 0.04);
  border: 1px solid rgba(255, 102, 0, 0.28);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 42px 12px 14px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #d5d5d5;
}
.explainer .title {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 4px;
}
.explainer p { margin: 2px 0; }
.explainer strong { color: var(--white); font-weight: 700; }
.explainer .bug-line { color: var(--neutral-mid); font-size: 12px; margin-top: 4px; }
.explainer .bug-line a { color: var(--accent); }
.explainer-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: 0;
  color: var(--neutral-mid);
  cursor: pointer;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  border-radius: 3px;
}
.explainer-close:hover { color: var(--accent); background: rgba(255, 102, 0, 0.08); }

/* Compact game header */
.game-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.game-head .game-meta {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--neutral-mid);
}
.game-head .game-meta .accent { color: var(--accent); font-weight: 700; }
.game-head .game-meta .sep { opacity: 0.4; margin: 0 8px; }
.game-head .game-title {
  font-size: clamp(22px, 5.2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.1;
  color: var(--white);
}
.game-head .game-title .accent { color: var(--accent); }

.game-tagline {
  color: var(--neutral-mid);
  font-size: 13px;
  margin: 0 0 12px;
  line-height: 1.45;
}

.game-frame-wrap {
  background: #050505;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  overflow: hidden;
}
.game-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
  background: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--accent);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  border-radius: 3px;
}
.btn:hover { background: rgba(255, 102, 0, 0.12); text-decoration: none; }
.btn.primary { background: var(--accent); color: #111; font-weight: 700; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.ghost { border-color: var(--neutral-dark); color: var(--neutral-mid); }
.btn.ghost:hover { border-color: var(--neutral-mid); color: var(--white); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.small { padding: 7px 12px; font-size: 11px; letter-spacing: 1.5px; }

/* Archive list */
.archive-heading {
  font-size: clamp(22px, 5.2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 4px;
}
.archive-heading .accent { color: var(--accent); }
.archive-intro {
  color: var(--neutral-mid);
  font-size: 13px;
  margin: 0 0 16px;
}
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.archive-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border-soft);
  border-radius: 4px;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.15s ease;
}
.archive-item:hover {
  border-color: var(--card-border);
  text-decoration: none;
}
.archive-item .date {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: var(--neutral-mid);
  letter-spacing: 1px;
}
.archive-item .title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.archive-item .tagline {
  grid-column: 2;
  font-size: 12px;
  color: var(--neutral-mid);
  margin-top: 2px;
}
.archive-item .arrow { color: var(--accent); font-weight: 700; }

.empty-state {
  color: var(--neutral-mid);
  font-size: 13px;
  padding: 16px 0;
}

/* Post-game CTA panel */
.cta-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 18px 0 0;
  background: rgba(255, 102, 0, 0.05);
  border: 1px solid rgba(255, 102, 0, 0.32);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  flex-wrap: wrap;
}
.cta-panel .cta-copy {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--neutral-mid);
}
.cta-panel .cta-copy strong {
  display: block;
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.cta-panel .cta-sub { display: inline; }
.cta-panel .cta-btn { flex: 0 0 auto; }
@media (max-width: 520px) {
  .cta-panel { padding: 12px 14px; }
  .cta-panel .cta-btn { width: 100%; justify-content: center; }
}

/* Footer - minimal */
.site-footer {
  text-align: center;
  padding: 16px 16px 20px;
  color: var(--neutral-dark);
  font-size: 11px;
  letter-spacing: 1px;
  margin-top: 20px;
}
.site-footer .copy { opacity: 0.6; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #111;
  color: var(--white);
  border: 1px solid var(--accent);
  padding: 14px 14px 14px 18px;
  font-size: 14px;
  letter-spacing: 0.3px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: min(460px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-msg {
  line-height: 1.5;
  flex: 1 1 auto;
  min-width: 0;
}
.toast-actions {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}
.toast-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  color: var(--neutral-mid);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.toast-action:hover {
  color: var(--accent);
  background: rgba(255, 102, 0, 0.14);
  text-decoration: none;
}
.toast-action svg { width: 18px; height: 18px; display: block; }

/* Mobile */
@media (max-width: 640px) {
  .site-header { padding: 10px 12px; }
  .container { padding: 12px 12px 20px; }
  .game-frame-wrap iframe { height: 500px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .archive-item {
    grid-template-columns: 82px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .archive-item .title { font-size: 14px; }
  .archive-item .tagline { font-size: 11px; }
}
