@layer app {
/* ============================================================
   Legal pages (Terms / Privacy)
   ============================================================ */
.legal-links {
  font-size: 13px;
  color: var(--page-sub);
  margin-top: 16px;
}

.legal-links a {
  color: var(--page-sub);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-links a:hover {
  color: var(--orange);
}

.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.legal-header {
  text-align: center;
  margin-bottom: 40px;
}

.legal-logo {
  text-decoration: none;
}

.legal-logo .logo-tiles {
  font-size: 14px;
}

.legal-body h1 {
  font-family: var(--font-flap);
  font-size: 32px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 4px;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--page-sub);
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}

.legal-body h2 {
  font-family: var(--font-flap);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--cell-brd);
}

.legal-body h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-body p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--page-text);
  margin-bottom: 14px;
}

.legal-body ul {
  margin: 0 0 14px 20px;
  padding: 0;
}

.legal-body li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 6px;
}

.legal-body a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover {
  color: var(--orange-dim);
}

.legal-body strong {
  font-weight: 600;
}

.delete-request-form {
  margin-top: 16px;
}

.delete-request-field {
  display: flex;
  gap: 8px;
}

.delete-request-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--font-body);
  border: 2px solid var(--page-sub);
  border-radius: 6px;
  background: var(--page-bg);
  color: var(--page-text);
}

.delete-request-input:focus {
  outline: none;
  border-color: var(--orange);
}

.delete-request-button {
  padding: 10px 20px;
  font-size: 15px;
  font-family: var(--font-flap);
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.delete-request-button:hover {
  background: var(--orange-dim);
}

.support-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.support-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.support-form-field label {
  font-family: var(--font-flap);
  font-size: 14px;
  color: var(--page-sub);
}

.support-form-input,
.support-form-textarea {
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--font-body);
  border: 2px solid var(--page-sub);
  border-radius: 6px;
  background: var(--page-bg);
  color: var(--page-text);
  width: 100%;
  box-sizing: border-box;
}

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

.support-form-input:focus,
.support-form-textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.support-form-actions {
  display: flex;
}

/* ── Manual (How to Play pamphlet) ── */

.manual {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.manual-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Cover page — vintage Amtrak timetable inspired */
.manual-cover {
  background: #f5f0e6;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  flex-direction: column;
}

.manual-cover-stripe {
  width: 100%;
  flex-shrink: 0;
}

.manual-cover-stripe-top {
  height: 48px;
  background: var(--orange);
}

.manual-cover-stripe-bottom {
  height: 48px;
  background: #2c2520;
}

.manual-cover-stripe-thin {
  height: 6px;
  background: var(--orange-dim);
}

.manual-cover-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 0;
  position: relative;
  overflow: hidden;
}

.manual-cover-traks {
  position: absolute;
  left: -15%;
  top: 2%;
  width: 110%;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
  transform: rotate(-12deg);
}

.cover-trak {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  position: relative;
}

.cover-trak:last-child {
  border-bottom: none;
}

.cover-trak-label {
  display: none;
}

.cover-trak-slots {
  display: flex;
  gap: 4px;
}

.cover-trak-cell {
  width: min(8vw, 34px);
  height: min(9.5vw, 40px);
  background: rgba(0,0,0,0.09);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  .cover-trak {
    border-bottom-color: rgba(255,255,255,0.07);
  }
  .cover-trak-cell {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.08);
  }
}

.manual-cover-divider {
  width: 80px;
  height: 2px;
  background: var(--orange);
  margin: 20px auto;
  position: relative;
  z-index: 1;
}

.manual-cover .logo-tiles-manual {
  gap: 4px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
}

.manual-cover .logo-tile {
  background: var(--orange);
  border-color: var(--orange-dim);
  color: #fff;
  font-size: min(7vw, 36px);
  width: min(10vw, 48px);
  height: min(12vw, 56px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.manual-cover .logo-tile.accent {
  background: #2c2520;
  border-color: #1a1814;
  color: #fff;
}

.manual-cover .logo-tile::after {
  background: rgba(0,0,0,0.12);
}

.manual-cover-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-flap);
  font-size: min(8vw, 36px);
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #2c2520;
  margin: 0;
}

.manual-cover-sub {
  position: relative;
  z-index: 1;
  font-family: var(--font-flap);
  font-size: min(5vw, 22px);
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin: 4px 0 0;
}

.manual-cover-edition {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: min(3vw, 13px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8a8078;
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .manual-cover {
    background: #1a1814;
  }
  .manual-cover-stripe-bottom {
    background: #2c2520;
  }
  .manual-cover-title {
    color: #e8e4de;
  }
  .manual-cover-edition {
    color: #6a6460;
  }
  .manual-cover-divider {
    background: var(--orange-dim);
  }
}

/* Interior content pages */
.manual-section {
  padding: 32px 24px 80px;
  background: var(--page-bg);
}

.manual-section h2 {
  font-family: var(--font-flap);
  font-size: 26px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--orange);
}

.manual-section p {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: var(--page-text);
  margin: 0 0 16px;
}

.manual-section p:last-child {
  margin-bottom: 0;
}

.manual-section strong {
  font-weight: 600;
  color: var(--page-text);
}

.manual-section ul {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: var(--page-text);
  margin: 0 0 16px;
  padding-left: 24px;
}

.manual-section li {
  margin-bottom: 6px;
}

.manual-mod-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  vertical-align: baseline;
  line-height: 1;
}

.manual-mod-badge.mod-l-2,
.manual-mod-badge.mod-l-3 {
  background: var(--mod-l-bg);
  color: var(--mod-l-badge);
}

.manual-mod-badge.mod-w-2,
.manual-mod-badge.mod-w-3 {
  background: var(--mod-w-bg);
  color: var(--orange-dim);
}

.manual-back-link {
  margin-top: 24px;
  text-align: center;
}

/* Paging nav bar */
.manual-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--page-bg);
  border-top: 2px dashed var(--cell-brd);
}

.manual-nav-btn {
  flex: 1;
  font-family: var(--font-flap);
  font-size: 18px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  padding: 6px 12px;
  text-align: left;
}

.manual-nav-btn:last-child {
  text-align: right;
}

.manual-nav-btn:disabled {
  color: var(--page-sub);
  opacity: 0.4;
  cursor: default;
}

.manual-nav-btn:not(:disabled):hover {
  color: var(--orange-dim);
}

.manual-nav-page {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--page-sub);
  letter-spacing: 1px;
  text-align: center;
  flex-shrink: 0;
}


/* Bag modal link to manual */
.bag-manual-link {
  text-align: center;
  padding: 12px 16px 4px;
}

.bag-manual-link a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bag-manual-link a:hover {
  color: var(--orange-dim);
}

/* Main content wrapper (a11y landmark) */
main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Devblog ── */

.blog-page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-user-select: text;
  user-select: text;
}

.blog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.blog-logo {
  text-decoration: none;
  min-width: 0;
}

.blog-title {
  margin: 0;
  margin-left: auto;
  line-height: 1;
  display: flex;
  justify-content: flex-end;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.blog-header .logo-tiles {
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .blog-page {
    padding: 16px 14px 48px;
    gap: 24px;
  }
  .blog-header {
    gap: 10px;
  }
  .blog-header .logo-tile {
    width: 26px;
    height: 30px;
    font-size: 17px;
  }
}

.blog-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-index-item {
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.blog-index-item:last-child {
  border-bottom: none;
}

.blog-index-link {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  color: inherit;
}

.blog-index-link:hover .blog-index-title {
  color: var(--orange);
}

.blog-index-date {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 4px;
}

.blog-index-title {
  font-family: 'Fjalla One', sans-serif;
  font-size: 1.5rem;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.blog-index-excerpt {
  margin: 0;
  opacity: 0.85;
  line-height: 1.5;
}

.blog-index-empty {
  padding: 32px 0;
  text-align: center;
  opacity: 0.6;
}

.blog-post-header {
  margin-bottom: 24px;
}

.blog-post-title {
  font-family: 'Fjalla One', sans-serif;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  margin: 0 0 12px;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.blog-post-meta {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  opacity: 0.65;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.blog-post-meta-sep {
  opacity: 0.6;
}

.blog-post-tag {
  display: inline-block;
}

.blog-post-tag + .blog-post-tag {
  margin-left: 6px;
}

.blog-post-body {
  line-height: 1.65;
  font-size: 1.05rem;
}

.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4 {
  font-family: 'Fjalla One', sans-serif;
  letter-spacing: 0.01em;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.blog-post-body h2 { font-size: 1.6rem; }
.blog-post-body h3 { font-size: 1.3rem; }
.blog-post-body h4 { font-size: 1.1rem; }

.blog-post-body p {
  margin: 0 0 1em;
}

.blog-post-body a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-post-body a:hover {
  color: var(--orange-dim);
}

.blog-post-body ul,
.blog-post-body ol {
  margin: 0 0 1em 1.4em;
  padding: 0;
}

.blog-post-body li {
  margin-bottom: 0.4em;
}

/* Ordered lists get oversized italic Fjalla numerals — same family as
   the in-game track watermark, sized up and pulled left as the marker. */
.blog-post-body ol {
  list-style: none;
  counter-reset: blog-ol;
  margin: 1.4em 0;
  padding: 0;
}

.blog-post-body ol > li {
  counter-increment: blog-ol;
  position: relative;
  padding: 12px 0 12px 64px;
  min-height: 56px;
  margin-bottom: 0.4em;
  line-height: 1.45;
}

.blog-post-body ol > li::before {
  content: counter(blog-ol);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  text-align: center;
  font-family: var(--font-flap);
  font-style: italic;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--orange);
  opacity: 0.85;
  user-select: none;
  pointer-events: none;
}

.blog-post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
  cursor: zoom-in;
}

/* Modal lightbox spawned by image-lightbox controller. */
.blog-lightbox {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 100vw;
  max-height: 100dvh;
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.blog-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.blog-lightbox-img {
  max-width: 95vw;
  max-height: 95dvh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

/* Side-by-side row of images. Each item targets ~1/3 of the row width
   but can shrink and wrap once it would get smaller than 120px, so 1, 2,
   3, or 4-up all behave reasonably. */
.blog-post-body .blog-image-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  margin: 1.5em 0;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 4%, transparent);
}

.blog-post-body .blog-image-stack img {
  display: block;
  flex: 1 1 calc(33.333% - 12px);
  min-width: 120px;
  max-width: 360px;
  height: auto;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Single column for landscape shots — each image fills the post width. */
.blog-post-body .blog-image-wide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 1.5em 0;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 4%, transparent);
}

.blog-post-body .blog-image-wide img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.blog-post-body blockquote {
  border-left: 3px solid var(--orange);
  margin: 1em 0;
  padding: 0.4em 1em;
  opacity: 0.9;
  font-style: italic;
}

.blog-post-body code {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.92em;
  background: color-mix(in srgb, currentColor 8%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.blog-post-body pre {
  background: #1f1d1a;
  color: #f5f0e6;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 1em 0;
}

.blog-post-body pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.blog-post-body table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}

.blog-post-body th,
.blog-post-body td {
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  padding: 8px 12px;
  text-align: left;
}

.blog-post-body th {
  background: color-mix(in srgb, currentColor 6%, transparent);
}

.blog-post-body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  margin: 1em 0;
}

/* Wraps a video embed (wistia-player, iframe, etc.) at a comfortable
   width on a portrait/vertical clip so it doesn't dominate the column. */
.blog-post-body .blog-video {
  width: 60%;
  margin: 1.5em auto;
}

.blog-post-body .blog-video wistia-player,
.blog-post-body .blog-video iframe {
  display: block;
  width: 100%;
  margin: 0;
}

.blog-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
  opacity: 0.75;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.blog-footer-link {
  color: inherit;
  text-decoration: none;
}

.blog-footer-link:hover {
  color: var(--orange);
}

.blog-footer-sep {
  opacity: 0.5;
}

.homepage-footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  font-size: 0.9rem;
  opacity: 0.75;
}

.homepage-footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: center;
}

.homepage-footer-link:hover {
  color: var(--orange);
  opacity: 1;
}

.homepage-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 20px;
}

.homepage-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.homepage-social-link:hover {
  color: var(--orange);
  opacity: 1;
}

.homepage-social-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Rouge syntax highlighting (subset, dark theme) */
.highlight .k, .highlight .kd, .highlight .kr, .highlight .kn { color: #e08aa6; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sr { color: #c4d39d; }
.highlight .c, .highlight .c1, .highlight .cm { color: #8a8275; font-style: italic; }
.highlight .nf, .highlight .nc, .highlight .nb { color: #f4b860; }
.highlight .mi, .highlight .mf { color: #d6a3e0; }
.highlight .o, .highlight .p { color: #f5f0e6; }
.highlight .nv, .highlight .vi { color: #88c0d0; }


}
