/* Additions to the 27 Sep styles.css: nav button, news, forms, status, admin, phone nav. */
.site-nav a.active { color: var(--text-main); font-weight: 600; }
.site-nav a.nav-cta { background: var(--primary); color: var(--text-inverse); padding: 6px 14px; border-radius: var(--radius-sm); }
.site-nav a.nav-cta:hover { background: var(--primary-hover); color: var(--text-inverse); }
.narrow-page { max-width: 760px; margin: 120px auto 80px; padding: 0 16px; }
.muted { color: var(--text-muted); }
.news-list { display: grid; gap: 16px; margin: 24px 0; }
.news-item { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px 24px; background: var(--bg-main); }
.news-item h3 { margin: 0 0 10px; font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.01em; }
.news-date { color: var(--text-muted); font-size: 0.875rem; margin: 0 0 12px; }
.news-item p { margin: 0 0 8px; line-height: 1.6; }
/* Richer news posts (common.js newsItem): kind label + date, lead, topic chips, one tinted block per section. */
.news-item { padding: 24px 28px; box-shadow: var(--shadow-sm); --topic: #6b7280; --topic-bg: #f3f4f6; }
.news-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.news-meta .news-date { margin: 0; }
.news-kind { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--primary); color: var(--text-inverse); }
.news-kind.kind-hotfix { background: #b91c1c; }
.news-kind.kind-patch { background: #1d4ed8; }
.news-kind.kind-client-update { background: #6d28d9; }
.news-body > p { margin: 0; }
.news-kind.kind-world-editor { background: #047857; }
.news-item p.news-lead { font-size: 1.02rem; color: #374151; margin: 0 0 14px; }
.news-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.news-topic { font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--topic); background: var(--topic-bg); }
.news-body { margin-top: 16px; display: grid; gap: 10px; }
.news-item.folded .news-body { display: none; }
.news-section { border-left: 3px solid var(--topic); background: var(--bg-gray); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 16px 12px 18px; }
.news-section h4 { margin: 0 0 6px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--topic); }
.news-section ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.news-section li { line-height: 1.55; }
.news-section li::marker { color: var(--topic); }
.news-item p.news-note { color: var(--text-muted); font-size: 0.92rem; margin: 4px 0 0; }
.news-item p.news-cta { margin: 4px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; font-weight: 600; }
.news-more { margin-top: 12px; padding: 7px 14px; font: inherit; font-size: 0.875rem; font-weight: 600; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-main); cursor: pointer; }
.news-more:hover { background: var(--bg-gray); }
/* Same green as the account PTR block's .pill.approved; live card styles are unchanged. */
.news-item.news-ptr { border-color: #86efac; border-left: 4px solid #166534; }
.news-realm { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px; background: #dcfce7; color: #166534; }
.news-item p.news-realm-note { color: #166534; font-size: 0.85rem; margin: 0 0 12px; }
.news-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.news-filter-link { padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 999px; font-size: 0.875rem; font-weight: 600; }
.news-filter-link:hover { background: var(--bg-gray); }
.news-filter-link.active { background: var(--text-main); color: var(--text-inverse); border-color: var(--text-main); }
.news-ptr .news-meta { flex-wrap: wrap; }
/* Post titles link to the post's own page (/news/<id>); older posts are a folded list of links (src/routes/news.js). */
.news-item h3 a { color: inherit; text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.news-archive { margin: 8px 0 24px; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px 20px; background: var(--bg-main); }
.news-archive summary { cursor: pointer; font-weight: 600; }
.news-archive ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.news-archive li { line-height: 1.5; }
.news-archive .news-date { margin: 0; font-size: 0.82rem; }
.news-back { margin: 0 0 32px; font-weight: 600; }
.news-archive a, .news-back a { text-decoration: underline; text-underline-offset: 3px; }
.news-archive a:hover, .news-back a:hover { color: var(--text-muted); }
.topic-quests { --topic: #b45309; --topic-bg: #fef3c7; }
.topic-skills { --topic: #6d28d9; --topic-bg: #ede9fe; }
.topic-monsters { --topic: #b91c1c; --topic-bg: #fee2e2; }
.topic-world, .topic-maps { --topic: #047857; --topic-bg: #d1fae5; }
.topic-items, .topic-mail { --topic: #0f766e; --topic-bg: #ccfbf1; }
.topic-client, .topic-launcher, .topic-website { --topic: #1d4ed8; --topic-bg: #dbeafe; }
.topic-recovery { --topic: #be185d; --topic-bg: #fce7f3; }
@media (max-width: 768px) { .news-item { padding: 18px 16px; } .news-item h3 { font-size: 1.2rem; } }
.server-status { font-weight: 600; }
.server-status.online::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #16a34a; margin-right: 8px; }
.server-status.offline::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; margin-right: 8px; }
.roadmap h2 { margin-top: 32px; }
.roadmap-item { border-left: 3px solid var(--border-color); padding: 4px 0 4px 16px; margin: 12px 0; }
.roadmap-item.stage-in_progress { border-left-color: #2563eb; }
.roadmap-item.stage-done { border-left-color: #16a34a; }
.form { display: grid; gap: 18px; margin: 24px 0; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form textarea, .form select {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-main); }
.form textarea { min-height: 110px; resize: vertical; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
td .check { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; white-space: nowrap; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.form legend { font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 2px; }
.form .hint { font-weight: 400; color: var(--text-muted); font-size: 0.85rem; }
/* status page, Mac download on: a button per system with its first-start note under it */
.download-choice { margin: 0 0 18px; }
.download-choice p { margin: 0; }
.download-choice .hint { margin-top: 6px; color: var(--text-muted); font-size: 0.9rem; }
.field-error { color: #b91c1c; font-weight: 500; font-size: 0.85rem; min-height: 1em; }
.notice { border: 1px solid var(--border-color); background: var(--bg-gray); border-radius: var(--radius-md); padding: 16px 20px; margin: 16px 0; }
.notice.ok { border-color: #86efac; background: #f0fdf4; }
.notice.warn { border-color: #fcd34d; background: #fffbeb; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.copy-row code { word-break: break-all; background: var(--bg-gray); padding: 6px 8px; border-radius: 6px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.admin-tabs button.active { background: var(--primary); color: var(--text-inverse); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; border-bottom: 1px solid var(--border-color); padding: 8px 6px; vertical-align: top; }
.admin-table td.msg { max-width: 280px; white-space: pre-wrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; background: var(--bg-gray); }
.pill.pending { background: #fef3c7; } .pill.approved { background: #dcfce7; } .pill.denied { background: #fee2e2; }
.admin-page .container { max-width: 1100px; }
@media (max-width: 768px) {
  /* phones: the nav folds behind a menu button (common.js adds it) and opens as a list under the header */
  .header-container { padding: 0 16px; }
  .site-header.nav-open .site-nav {
    display: flex !important; flex-direction: column; gap: 0; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-main); border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-md);
    padding: 4px 16px 16px; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .site-header.nav-open .site-nav a { padding: 14px 4px; font-size: 1rem; border-bottom: 1px solid var(--border-color); }
  .site-header.nav-open .site-nav a.nav-cta { margin-top: 14px; padding: 12px; text-align: center; border-bottom: 0; }
  .narrow-page { margin-top: 96px; }
  .form input:not([type=checkbox]):not([type=radio]), .form textarea, .form select { min-width: 0; width: 100%; box-sizing: border-box; }
  .admin-table { font-size: 0.8rem; display: block; overflow-x: auto; }
}
/* Public notice banner (inserted by common.js when /api/config has a non-empty notice). */
.site-notice {
  background: #fffbeb;
  border-bottom: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  text-align: center;
}
/* The phone menu button (common.js); hidden on wider screens where the nav shows. */
.nav-toggle {
  display: none; align-items: center; justify-content: center; order: 2; width: 40px; height: 40px; margin-left: 8px;
  padding: 0; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-main);
  color: var(--text-main); cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.site-header.nav-open .nav-toggle .icon-open { display: none; }
.site-header.nav-open .nav-toggle .icon-close { display: block; }
@media (max-width: 768px) { .nav-toggle { display: inline-flex; } }
/* Homepage refresh (30 Sep): a caption under a bento picture, the editor 2x2 picture not wider than it needs */
.bento-card .img-caption { padding: 10px 40px 20px; font-size: 0.8125rem; margin: 0; }
.editor-showcase img.editor-grid { width: 100%; max-width: 860px; display: block; margin: 0 auto; }
[data-wiki-link][hidden] { display: none !important; }
/* The Features link adds to the menu row. Use the compact menu through 1200 px so the signed-in Wiki link
   and account button also fit. Same rules as the 768 px blocks here and in styles.css. */
@media (max-width: 1200px) {
  .site-nav { display: none; }
  .header-account { order: 1; margin-left: auto; }
  .header-discord { order: 1; margin-left: 14px; }
  .header-container .site-nav { order: 3; }
  .nav-toggle { display: inline-flex; }
  .site-header.nav-open .site-nav {
    display: flex !important; flex-direction: column; gap: 0; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-main); border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-md);
    padding: 4px 16px 16px; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .site-header.nav-open .site-nav a { padding: 14px 4px; font-size: 1rem; border-bottom: 1px solid var(--border-color); }
  .site-header.nav-open .site-nav a.nav-cta { margin-top: 14px; padding: 12px; text-align: center; border-bottom: 0; }
}

/* The owner's live stream sits above the news only while its playlist is fresh. */
.live-block { width: 100%; max-width: 1152px; min-width: 0; margin: 0 auto 48px; }
.live-block[hidden] { display: none; }
.live-heading { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; }
.live-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #dc2626; animation: live-pulse 1.5s ease-in-out infinite; }
.live-description, .live-message { margin: 0 0 18px; text-align: center; overflow-wrap: anywhere; }
/* The player sits on the screen of a Steam Deck (Valve's press picture, 1940x760, screen blacked out): the video's box is
   that screen's place in the picture in percent (479,67 982x614 = 16:10), so it scales with the picture at every width. */
.deck { position: relative; width: 100%; aspect-ratio: 1940 / 760; }
.deck-art { display: block; width: 100%; height: 100%; }
.live-block video { position: absolute; left: 24.691%; top: 8.816%; width: 50.619%; height: 80.789%; background: #000; object-fit: contain; }
.live-credit { margin: 6px 0 0; text-align: center; font-size: 0.75rem; color: var(--text-muted); }
.live-message { margin-top: 16px; }
@keyframes live-pulse { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
