/* ── Reset & Variables ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #1a1a2e;
  --surface:     #16213e;
  --surface2:    #0f3460;
  --accent:      #e94560;
  --accent2:     #53d8fb;
  --text:        #e0e0e0;
  --text-dim:    #8892a4;
  --border:      #2a3a5c;
  --radius:      6px;
  --font-mono:   'Courier New', Courier, monospace;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--surface2);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent2);
  text-decoration: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

nav { display: flex; gap: 0.25rem; overflow-x: auto; min-width: 0; }

nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
nav a:hover { background: var(--surface2); color: var(--text); }
nav a.active { background: var(--accent); color: #fff; }

/* ── Auth area ───────────────────────────────────────────────────────────── */
.auth-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.login-btn {
  background: #4285f4;
  color: #fff;
}
.login-btn:hover { background: #2a6fdb; }

.logout-btn {
  background: var(--surface2);
  color: var(--text-dim);
}
.logout-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Language picker ───────────────────────────────────────────────────────── */
.lang-picker { position: relative; flex-shrink: 0; }
.lang-picker-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface2, var(--surface));
  color: var(--text-dim, var(--text));
  border: 1px solid var(--surface2, var(--border));
  border-radius: var(--radius, 6px);
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.lang-picker-btn:hover,
.lang-picker.open .lang-picker-btn {
  color: var(--accent2, var(--accent));
  border-color: var(--accent2, var(--accent));
  outline: none;
}
.lang-flag  { border-radius: 2px; object-fit: cover; display: block; flex-shrink: 0; }
.lang-caret { font-size: 0.6rem; line-height: 1; opacity: 0.7; }
.lang-picker-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 500;
  min-width: 155px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.25rem 0;
}
.lang-picker.open .lang-picker-menu { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-dim, var(--text));
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.lang-option:hover          { background: var(--surface2, rgba(255,255,255,0.07)); color: var(--text); }
.lang-option.lang-current   { color: var(--accent2, var(--accent)); font-weight: 700; }
.lang-opt-code              { font-weight: 600; min-width: 28px; }
.lang-opt-name              { font-size: 0.75rem; opacity: 0.7; }
.lang-option:hover .lang-opt-name,
.lang-option.lang-current .lang-opt-name { opacity: 1; }

.auth-name {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-lg {
  width: 48px;
  height: 48px;
}

/* ── Ads ─────────────────────────────────────────────────────────────────── */
.ad-container {
  width: 100%;
  max-width: 970px;
  margin: 0.75rem auto;
  text-align: center;
}

/* ── Banners ─────────────────────────────────────────────────────────────── */
.solstice-banner {
  width: 100%;
  background: linear-gradient(90deg, #0a0e1a 0%, #1a2a4a 40%, #0a0e1a 100%);
  color: #c8d8f0;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #2a3f6f;
}

.chess-day-banner {
  width: 100%;
  background: linear-gradient(90deg, #1a120a 0%, #3d2a0a 30%, #5c3e0a 50%, #3d2a0a 70%, #1a120a 100%);
  color: #f5e0a0;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #7a5a10;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
main { flex: 1; padding: 1rem 0.5rem; }

footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--surface2);
}
footer a { color: var(--accent2); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Leaderboard / content wrapper ──────────────────────────────────────── */
.lb-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.lb-wrapper a { color: var(--accent2); text-decoration: none; }
.lb-wrapper a:hover { text-decoration: underline; }

.lb-title {
  font-size: 2rem;
  text-align: center;
  color: var(--accent2);
  letter-spacing: 1px;
}

.lb-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--surface2);
  overflow-x: auto;
}

.lb-table, .help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.lb-table thead tr, .help-table thead tr { background: var(--surface2); }
.lb-table th, .help-table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.lb-table td, .help-table td {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--surface2);
  color: var(--text);
}
.lb-table .top-1 td { color: #FFD700; }
.lb-table .top-2 td { color: #C0C0C0; }
.lb-table .top-3 td { color: #CD7F32; }
.lb-table .top-1, .lb-table .top-2, .lb-table .top-3 { background: rgba(255,255,255,0.03); }

.lb-rank { font-size: 1.1rem; width: 2.5rem; }
.lb-name { font-weight: 600; }
.lb-date { font-size: 0.85rem; color: var(--text-dim); }
.lb-stat { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-dim); text-align: right; }

.lb-back {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.lb-back a {
  color: var(--accent2);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  transition: background 0.15s;
}
.lb-back a:hover { background: var(--surface2); }

/* ── Help sections ───────────────────────────────────────────────────────── */
.help-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.help-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 0.25rem;
}
.help-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.5rem;
}
.help-section p { line-height: 1.7; }
.help-section ul, .help-section ol { padding-left: 1.4rem; }
.help-section li { margin-bottom: 0.35rem; line-height: 1.6; }
.help-section a { color: var(--accent2); text-decoration: underline; }
.help-section em { color: var(--text-dim); }

/* ── Admin dashboard ─────────────────────────────────────────────────────── */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.admin-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 0 0 0.75rem;
  letter-spacing: 0.5px;
}
.admin-total td { border-top: 1px solid var(--surface2); }

.admin-comments-table { width: 100%; table-layout: auto; }
.admin-comment-body-cell {
  max-width: 340px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
}

.admin-btn {
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  margin: 0.15rem 0.1rem;
}
.admin-btn-approve { background: rgba(46,125,50,0.25); color: #81c784; }
.admin-btn-approve:hover { background: rgba(46,125,50,0.45); }
.admin-btn-delete  { background: rgba(198,40,40,0.2);  color: #e57373; }
.admin-btn-delete:hover  { background: rgba(198,40,40,0.4); }

/* ── Admin Kanban Board ──────────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  overflow-x: auto;
  padding: 0.5rem 0 1.5rem;
}
.kanban-col {
  flex: 0 0 220px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.kanban-col-count {
  background: var(--border);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 0.5rem;
  line-height: 1.6;
  min-width: 1.4rem;
  text-align: center;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
}
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: box-shadow 0.15s;
}
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.kanban-card-active { border-left: 3px solid var(--accent2); }
.kanban-card-review { border-left: 3px solid #7ec8e3; }
.kanban-card-done   { opacity: 0.55; }

.kanban-id {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  width: fit-content;
}
.kanban-id-f { background: rgba(100,160,255,0.15); color: #7eb8f7; }
.kanban-id-b { background: rgba(255,100,100,0.15); color: #f77e7e; }
.kanban-id-d { background: rgba(100,220,150,0.15); color: #7eeaaa; }

.kanban-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}
.kanban-assignee {
  font-size: 0.75rem;
  color: var(--accent2);
  margin-top: 0.1rem;
}
.kanban-empty {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  padding: 0.75rem 0;
  font-style: italic;
}

/* ── Coming Soon page ────────────────────────────────────────────────────── */
.home-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* Google Sign-In button */
.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #4285f4;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}
.google-signin-btn:hover { background: #2a6fdb; }

.google-g {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  background: #fff;
  color: #4285f4;
  width: 1.5em;
  height: 1.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

/* Hero */
.home-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.home-piece {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(83,216,251,0.4));
}
.home-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: 1px;
}
.home-tagline {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 480px;
}
.home-tagline strong { color: var(--text); }

/* Feature cards */
.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  width: 100%;
}
a.feature-card { color: inherit; text-decoration: none; cursor: pointer; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.feature-card:hover {
  border-color: var(--accent2);
  box-shadow: 0 2px 12px rgba(83,216,251,0.1);
}
.feature-icon { font-size: 2rem; }
.feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2);
}
.feature-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* ── Blog ────────────────────────────────────────────────────────────────── */
.blog-wrapper {
  max-width: 740px;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}
.blog-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.blog-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.blog-subtitle {
  color: var(--text-dim);
  margin: 0;
}
.blog-post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.blog-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.blog-card:hover {
  border-color: var(--accent2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.blog-card-link {
  display: block;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
}
.blog-card-meta { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.blog-card-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--text); }
.blog-card-excerpt { font-size: 0.95rem; color: var(--text-dim); margin: 0 0 0.75rem; line-height: 1.55; }
.blog-card-read-more { font-size: 0.85rem; color: var(--accent2); font-weight: 600; }
.blog-empty { color: var(--text-dim); }

.blog-breadcrumb { font-size: 0.85rem; margin-bottom: 1.5rem; }
.blog-breadcrumb a { color: var(--accent2); text-decoration: none; }
.blog-breadcrumb a:hover { text-decoration: underline; }

.blog-article-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.blog-article-title { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: 0 0 0.5rem; }
.blog-article-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.blog-article-date { font-size: 0.85rem; color: var(--text-dim); }
.blog-article-byline { font-size: 0.85rem; color: var(--text-dim); }
.blog-author-link { color: var(--accent2); text-decoration: none; }
.blog-author-link:hover { text-decoration: underline; }

.blog-article-picture { display: block; width: 100%; max-width: 520px; margin: 0 auto 1.5rem; }
.blog-article-image { width: 100%; height: auto; border-radius: 6px; display: block; }

.blog-article-body { font-size: 1rem; line-height: 1.7; color: var(--text); }
.blog-article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.6rem; color: var(--text); }
.blog-article-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.blog-article-body p { margin: 0 0 1rem; }
.blog-article-body ul, .blog-article-body ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.blog-article-body li { margin-bottom: 0.35rem; }
.blog-article-body a { color: var(--accent2); text-decoration: underline; }
.blog-article-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.blog-article-body em { color: var(--text-dim); }
.blog-article-body strong { color: var(--text); }
.blog-article-body code { background: var(--surface); border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.9em; }
.blog-article-body blockquote { border-left: 3px solid var(--accent2); margin: 1rem 0; padding: 0.5rem 1rem; color: var(--text-dim); }

/* ── SMS Thread ─────────────────────────────────────────────────────────────── */
.sms-screenshots { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 1.5rem 0 2rem; }
.sms-screenshot { max-width: 240px; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,0.45); }
.sms-thread { max-width: 420px; margin: 1.5rem auto 2rem; display: flex; flex-direction: column; gap: 0.45rem; }
.sms-bubble { max-width: 78%; padding: 0.55rem 0.9rem; border-radius: 18px; font-size: 0.95rem; line-height: 1.45; }
.sms-bubble.them { background: var(--surface2); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.sms-bubble.me { background: #1d7d35; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.sms-label { font-size: 0.72rem; color: var(--text-dim); text-align: center; margin: 0.5rem 0 0.15rem; letter-spacing: 0.02em; text-transform: uppercase; }

.blog-post-nav { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; }
.blog-post-nav-link { color: var(--accent2); text-decoration: none; }
.blog-post-nav-link:hover { text-decoration: underline; }

/* ── Blog Comments ─────────────────────────────────────────────────────────── */
.blog-comments { max-width: 720px; margin: 2.5rem auto 0; padding: 0 1rem; }
.blog-comments-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }
.blog-comments-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.blog-comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.blog-comment-meta { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.blog-comment-author { font-size: 0.9rem; color: var(--text); }
.blog-comment-date { font-size: 0.78rem; color: var(--text-dim); }
.blog-comment-body { font-size: 0.9rem; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.blog-comments-empty { color: var(--text-dim); font-style: italic; margin-bottom: 1.5rem; }

.blog-comment-form-wrap { margin-top: 1.5rem; }
.blog-comment-form-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.blog-comment-form { display: flex; flex-direction: column; gap: 0.75rem; }
.blog-comment-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
}
.blog-comment-textarea:focus { outline: 2px solid var(--accent2); border-color: var(--accent2); }
.blog-comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.blog-comment-as { font-size: 0.85rem; color: var(--text-dim); }
.blog-comment-submit {
  padding: 0.45rem 1.2rem;
  background: var(--accent2);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}
.blog-comment-submit:hover { opacity: 0.85; }
.blog-comment-submit:disabled { opacity: 0.5; cursor: default; }
.blog-comment-msg {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.blog-comment-msg-ok  { background: rgba(46,125,50,0.18); color: #81c784; }
.blog-comment-msg-err { background: rgba(198,40,40,0.18);  color: #e57373; }

.blog-comments-login-prompt {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.blog-login-link { color: var(--accent2); text-decoration: none; font-weight: 600; }
.blog-login-link:hover { text-decoration: underline; }

/* ── FICS Terminal ────────────────────────────────────────────────────────── */
.fics-heading { font-size: 1.4rem; margin: 0 0 0.25rem; color: var(--text); }

/* Pre-connect landing section */
.fics-landing {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}
.fics-landing-intro { display: flex; flex-direction: column; gap: 0.35rem; }
.fics-landing-intro p { margin: 0; }
.fics-landing a { color: var(--accent2); }
.fics-landing code { background: var(--surface2); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.85em; color: var(--text); }
.fics-about-tip { color: var(--text-dim); font-size: 0.82rem; }
.fics-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.fics-feature-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text);
}
.fics-signin-nudge {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}
.fics-signin-nudge a { color: var(--accent2); }

/* Quick reference panel */
.fics-quick-ref {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  flex-shrink: 0;
}
.fics-ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}
.fics-ref-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 130px;
}
.fics-ref-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}
.fics-cmd-chip {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 4px;
  color: #a5d6a7;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}
.fics-cmd-chip:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }
.fics-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.fics-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  flex-shrink: 0;
}

.fics-panel-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fics-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-dim);
}
.fics-dot-connecting    { background: #f9a825; animation: fics-pulse 1s infinite; }
.fics-dot-connected     { background: #43a047; }
.fics-dot-disconnected  { background: var(--text-dim); }
.fics-dot-error         { background: #e53935; }

@keyframes fics-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.fics-status-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  min-width: 5rem;
}

.fics-creds {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.fics-input {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.3rem 0.6rem;
  font-size: 0.88rem;
  font-family: inherit;
  min-width: 0;
}
.fics-input:focus { outline: 2px solid var(--accent2); border-color: var(--accent2); }
.fics-input::placeholder { color: var(--text-dim); }

.fics-btn {
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.fics-btn:hover  { opacity: 0.85; }
.fics-btn:disabled { opacity: 0.45; cursor: default; }
.fics-btn-connect    { background: var(--accent2); color: #000; }
.fics-btn-disconnect  { background: #c62828; color: #fff; }
.fics-btn-send        { background: var(--accent); color: #000; }
.fics-btn-autoscroll  { background: #2e7d32; color: #fff; font-size: 0.75rem; flex-shrink: 0; }
.fics-btn-autoscroll.fics-autoscroll-off { background: #444; color: #888; }
.fics-btn-ref         { background: var(--surface2); color: var(--text); font-size: 0.78rem; margin-left: auto; }
.fics-btn-ref.fics-ref-active { background: var(--accent); color: #000; }

.fics-terminal {
  flex: 1;
  overflow-y: auto;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
}

.fics-line { display: block; }
.fics-info  { color: #90caf9; }
.fics-echo  { color: #a5d6a7; }
.fics-error { color: #ef9a9a; }

.fics-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}

.fics-prompt {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  color: #a5d6a7;
  flex-shrink: 0;
}

.fics-cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  min-width: 0;
}
.fics-cmd-input::placeholder { color: var(--text-dim); }
.fics-cmd-input:disabled { opacity: 0.5; }

/* ── Admin Analysis ─────────────────────────────────────────────────────── */
.analysis-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 1rem;
}
.analysis-sidebar {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.analysis-doc-link {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: capitalize;
  transition: background 0.12s, color 0.12s;
}
.analysis-doc-link:hover { background: var(--surface2); color: var(--text); }
.analysis-doc-active { background: var(--surface2); color: var(--accent2); font-weight: 600; }
.analysis-content {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}
.analysis-empty { color: var(--text-dim); font-style: italic; font-size: 0.9rem; }
.analysis-download-bar { margin-bottom: 0.75rem; }
.analysis-download-btn { display: inline-block; padding: 0.35rem 0.85rem; background: var(--accent, #2563eb); color: #fff; border-radius: 6px; font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.analysis-download-btn:hover { opacity: 0.85; }
.analysis-iframe { width: 100%; min-height: 70vh; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.analysis-sheet-title { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--text); }
.analysis-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.analysis-slide { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.analysis-slide-num { font-size: 0.75rem; font-weight: 700; color: var(--accent2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.analysis-slide p { margin: 0.25rem 0; font-size: 0.9rem; color: var(--text); white-space: pre-wrap; }
.analysis-table { border-collapse: collapse; font-size: 0.85rem; width: 100%; }
.analysis-table th { background: var(--surface2); color: var(--text); font-weight: 600; text-align: left; padding: 0.45rem 0.75rem; border: 1px solid var(--border); white-space: nowrap; }
.analysis-table td { padding: 0.4rem 0.75rem; border: 1px solid var(--border); color: var(--text); vertical-align: top; }
.analysis-table tr:nth-child(even) td { background: var(--surface); }

/* ── Puzzles hub ────────────────────────────────────────────────────────── */
.openings-grid { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; margin-bottom: 2rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.opening-card {
  width: 260px; padding: 1.25rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color 0.15s, transform 0.15s;
  color: var(--text); text-decoration: none;
}
a.opening-card { color: var(--text); text-decoration: none; }
a.opening-card:hover { text-decoration: none; }
.opening-card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.opening-moves { font-family: monospace; font-size: 0.8rem; color: var(--accent2); }
.opening-name  { font-size: 1rem; font-weight: 700; color: var(--text); }
.opening-desc  { font-size: 0.83rem; color: var(--text-dim); line-height: 1.55; }
.puzzle-grid { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; margin-bottom: 2rem; }
.puzzle-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  width: 220px; padding: 1.75rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.puzzle-card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.puzzle-card-icon  { font-size: 3rem; line-height: 1; }
.puzzle-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.puzzle-card-desc  { font-size: 0.85rem; color: var(--text-dim); text-align: center; line-height: 1.5; }

/* ── Knight's Tour ───────────────────────────────────────────────────────── */
.kt-page { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.kt-header { margin-bottom: 1.25rem; }
.kt-title-row { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.kt-title { font-size: 1.75rem; font-weight: 800; margin: 0; color: var(--text); }
.kt-back-link { font-size: 0.85rem; color: var(--accent2); text-decoration: none; }
.kt-back-link:hover { text-decoration: underline; }
.kt-description { color: var(--text-dim); font-size: 0.9rem; margin: 0; max-width: 600px; }

.kt-controls {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 1.25rem;
}
.kt-control-group { display: flex; align-items: center; gap: 0.5rem; }
.kt-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kt-timer { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); min-width: 6ch; }
.kt-moves { font-size: 1rem; font-weight: 600; color: var(--text); min-width: 7ch; }
.kt-select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 0.3rem 0.6rem;
  font-size: 0.9rem; cursor: pointer;
}

.kt-main { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.kt-board-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

.kt-board {
  display: grid;
  width: min(480px, 90vw);
  border: 3px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.kt-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: clamp(0.8rem, 3.5vw, 1.6rem);
  transition: filter 0.1s;
  user-select: none;
  position: relative;
}
.kt-cell:hover { filter: brightness(1.15); }

/* Board colours */
.kt-light { background: #f0d9b5; }
.kt-dark  { background: #b58863; }

/* Visited */
.kt-visited.kt-light { background: #6baed6; }
.kt-visited.kt-dark  { background: #3182bd; }

/* Current knight */
.kt-knight { background: var(--accent2) !important; color: #000 !important; font-size: clamp(1rem, 4.5vw, 2rem) !important; }

/* Valid move highlight */
.kt-valid.kt-light { background: #74c476; color: rgba(0,0,0,0.35); }
.kt-valid.kt-dark  { background: #41ab5d; color: rgba(0,0,0,0.35); }

.kt-status { font-size: 0.85rem; color: var(--text-dim); text-align: center; margin: 0; min-height: 1.2em; }

.kt-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.25rem; }
.kt-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-dim); }
.kt-legend-swatch { width: 20px; height: 20px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.kt-legend-knight  { background: var(--accent2); color: #000; }
.kt-legend-valid   { background: #74c476; }
.kt-legend-visited { background: #6baed6; }

/* Leaderboard */
.kt-lb-section { flex: 1; min-width: 260px; }
.kt-lb-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text); }

/* Modals */
.kt-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.kt-modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem 2.5rem; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.kt-modal-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 1rem; }
.kt-modal-body  { font-size: 0.95rem; line-height: 1.6; color: var(--text); margin-bottom: 0.5rem; }
.kt-modal-body p { margin: 0.4rem 0; }

.kt-score-form  { display: flex; gap: 0.5rem; margin: 1rem 0; }
.kt-name-input  {
  flex: 1; background: var(--surface); border: 1px solid var(--surface2);
  border-radius: 6px; color: var(--text); padding: 0.5rem 0.75rem;
  font-size: 0.95rem; font-family: inherit;
}
.kt-name-input:focus { outline: 2px solid var(--accent2); border-color: var(--accent2); }
.kt-score-note  { font-size: 0.8rem; color: var(--text-dim); margin: 0; }
.kt-score-note a { color: var(--accent2); text-decoration: none; }

.kt-btn {
  padding: 0.5rem 1.1rem; border: none; border-radius: 6px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.kt-btn:hover   { opacity: 0.85; }
.kt-btn:disabled { opacity: 0.5; cursor: default; }
.kt-btn-reset   { background: var(--surface2); color: var(--text); }
.kt-btn-submit  { background: var(--accent2); color: #000; white-space: nowrap; }

/* ── Links page ─────────────────────────────────────────────────────────── */
.links-section { margin-bottom: 2rem; }
.links-section-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
.links-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.links-item { font-size: 0.95rem; }
.links-link { color: var(--accent2); text-decoration: none; font-weight: 600; }
.links-link:hover { text-decoration: underline; }
.links-desc { color: var(--text-dim); }

/* ── Kriegspiel ──────────────────────────────────────────────────────────── */

/* Page / Layout */
.ks-page { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.ks-layout { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.ks-board-section { flex: 0 0 auto; min-width: 0; }
.ks-panel { flex: 1 1 280px; min-width: 260px; display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* Top bar */
.ks-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.ks-topbar-left  { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ks-topbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ks-game-info { font-size: 0.9rem; color: var(--text-dim); }
.ks-game-id-label { font-size: 0.8rem; color: var(--text-dim); }
.ks-game-id { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent2); background: var(--surface); padding: 0.15rem 0.4rem; border-radius: 3px; }
.ks-spectator-badge { background: var(--surface2); color: var(--text-dim); font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: var(--radius); }

/* Clock bar */
.ks-clock-bar { display: flex; gap: 1rem; margin-bottom: 0.5rem; }
.ks-clock-white,
.ks-clock-black { display: flex; flex-direction: column; align-items: center; padding: 0.4rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 80px; transition: background 0.2s; }
.ks-clock-active { background: var(--surface2) !important; border-color: var(--accent2) !important; }
.ks-clock-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.ks-clock-time  { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; color: var(--text); }
.ks-clock-low   { color: var(--accent) !important; }

/* Board */
.ks-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(480px, 90vw);
  border: 3px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.ks-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: clamp(0.8rem, 3.5vw, 1.7rem);
  transition: filter 0.1s;
  user-select: none;
  position: relative;
}
.ks-cell:hover { filter: brightness(1.12); }

/* Square colors */
.ks-light { background: #f0d9b5; }
.ks-dark  { background: #b58863; }

/* Highlights */
.ks-selected.ks-light,
.ks-selected.ks-dark  { background: #f5d050 !important; }
.ks-valid.ks-light { background: #7bc96f; }
.ks-valid.ks-dark  { background: #4e9a45; }
.ks-last-move.ks-light { background: #cdd85a; }
.ks-last-move.ks-dark  { background: #9db537; }

/* Piece text — solid dark for both colors, unicode pieces give visual contrast */
.ks-white-piece { color: #1a1a1a; text-shadow: 0 0 3px rgba(255,255,255,0.6); }
.ks-black-piece { color: #1a1a1a; }

/* Coordinate labels */
.ks-coord { position: absolute; font-size: clamp(0.45rem, 1.2vw, 0.65rem); font-weight: 700; color: rgba(0,0,0,0.45); line-height: 1; }
.ks-coord-rank { top: 2px; left: 2px; }
.ks-coord-file { bottom: 2px; right: 3px; }

/* Controls */
.ks-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }

/* Status bar */
.ks-status-bar { margin-top: 0.4rem; min-height: 1.4em; }
.ks-status-text { font-size: 0.85rem; color: var(--text-dim); }

/* Buttons */
.ks-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.9rem; border: none; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}
.ks-btn:hover   { opacity: 0.85; }
.ks-btn:disabled { opacity: 0.45; cursor: default; }
.ks-btn-primary   { background: var(--accent2); color: #000; }
.ks-btn-secondary { background: var(--surface2); color: var(--text); }
.ks-btn-join      { background: var(--accent2); color: #000; }
.ks-btn-copy      { background: var(--surface2); color: var(--text-dim); font-size: 0.8rem; }
.ks-btn-query     { background: #2a4a6a; color: var(--accent2); }
.ks-btn-draw      { background: #2a5a4a; color: #7de8c4; }
.ks-btn-resign    { background: #5a2a2a; color: #e87d7d; }
.ks-btn-chat-send { background: var(--surface2); color: var(--text); padding: 0.35rem 0.7rem; }
.ks-btn-icon      { background: transparent; border: none; color: var(--text-dim); font-size: 1rem; cursor: pointer; padding: 0.2rem 0.4rem; }
.ks-btn-icon:hover { color: var(--text); }

/* Announcements panel */
.ks-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; background: var(--surface2); border-bottom: 1px solid var(--border); }
.ks-panel-title  { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }

.ks-announcements {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  max-height: 350px;
  overflow-y: auto;
  padding: 0.5rem;
  background: #0d1a2a;
  display: flex; flex-direction: column; gap: 0.25rem;
}

.ks-ann-entry { padding: 0.2rem 0.4rem; border-radius: 3px; line-height: 1.4; }
.ks-ann-time  { color: #4a6080; margin-right: 0.4rem; font-size: 0.72rem; }
.ks-ann-text  { }

/* Announcement type styles */
.ks-ann-check    { background: rgba(255,200,0,0.12); color: #ffd700; }
.ks-ann-capture  { background: rgba(220,50,50,0.12); color: #ff7070; }
.ks-ann-no       { background: rgba(200,100,0,0.12); color: #ffa040; }
.ks-ann-hellno   { background: rgba(200,0,0,0.15); color: #ff5555; }
.ks-ann-query    { background: rgba(80,180,255,0.12); color: var(--accent2); }
.ks-ann-draw     { background: rgba(80,120,255,0.12); color: #809fff; }
.ks-ann-gameover { background: rgba(150,0,200,0.15); color: #c87fff; font-weight: 700; }
.ks-ann-system   { color: var(--text-dim); font-style: italic; }
.ks-ann-move     { color: #607090; }
.ks-ann-default  { color: var(--text-dim); }

/* Chat */
.ks-chat-area { border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.ks-chat-log  { max-height: 160px; overflow-y: auto; padding: 0.5rem 0.75rem; font-size: 0.82rem; display: flex; flex-direction: column; gap: 0.2rem; }
.ks-chat-entry { line-height: 1.4; }
.ks-chat-white { color: #c0c8d8; }
.ks-chat-black { color: #a8b8c8; }
.ks-chat-spectator { color: var(--text-dim); font-style: italic; }
.ks-chat-form  { display: flex; gap: 0; border-top: 1px solid var(--border); }
.ks-chat-input { flex: 1; background: var(--surface); border: none; border-radius: 0; padding: 0.4rem 0.6rem; color: var(--text); font-size: 0.85rem; font-family: inherit; outline: none; }
.ks-chat-input:focus { background: var(--surface2); }

/* Overlays / Modals */
.ks-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 1rem;
}
.ks-modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem 2.5rem; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.ks-modal-title   { font-size: 1.6rem; font-weight: 800; margin-bottom: 1rem; }
.ks-modal-body    { font-size: 0.95rem; color: var(--text); margin-bottom: 1.5rem; line-height: 1.6; }
.ks-modal-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* Waiting overlay */
.ks-waiting-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 250; padding: 1rem;
}
.ks-waiting-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem 2.5rem; max-width: 440px; width: 100%;
  text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.ks-waiting-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.75rem; }
.ks-waiting-desc  { color: var(--text-dim); margin-bottom: 0.75rem; font-size: 0.9rem; }
.ks-share-link-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.ks-share-input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent2); padding: 0.4rem 0.6rem; font-family: var(--font-mono); font-size: 0.8rem; }

/* Back link */
.ks-back-link { color: var(--accent2); text-decoration: none; font-size: 0.85rem; }
.ks-back-link:hover { text-decoration: underline; }

/* ── Kriegspiel Lobby ─────────────────────────────────────────────────────── */
.ks-lobby-page { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem; }
.ks-lobby-header { margin-bottom: 2rem; }
.ks-lobby-title  { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.ks-subtitle     { font-size: 1rem; font-weight: 400; color: var(--text-dim); }
.ks-lobby-desc   { color: var(--text-dim); font-size: 0.92rem; line-height: 1.7; margin-bottom: 1rem; max-width: 680px; }
.ks-lobby-section { margin-bottom: 2rem; }
.ks-lobby-section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
.ks-no-games { color: var(--text-dim); font-size: 0.9rem; }
.ks-no-games a { color: var(--accent2); text-decoration: none; }

.ks-lobby-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ks-lobby-table th,
.ks-lobby-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.ks-lobby-table th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ks-lobby-table tr:hover td { background: var(--surface); }
.ks-time-dim { color: var(--text-dim); font-size: 0.8rem; }

.ks-rules-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.ks-rules-list { margin: 0; padding-left: 1.25rem; color: var(--text-dim); font-size: 0.88rem; line-height: 1.8; }
.ks-rules-list li { margin-bottom: 0.25rem; }
.ks-rules-list strong { color: var(--text); }

/* ── Knight vs. 16 Pawns ─────────────────────────────────────────────────── */
.kp-page { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.kp-header { margin-bottom: 1.25rem; }
.kp-title-row { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.kp-title { font-size: 1.8rem; margin: 0; }
.kp-back-link { font-size: 0.85rem; color: var(--text-dim); text-decoration: none; }
.kp-back-link:hover { color: var(--accent2); }
.kp-description { color: var(--text-dim); margin: 0; font-size: 0.9rem; }

.kp-layout { display: flex; flex-direction: column; gap: 1rem; }

.kp-controls {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 1rem;
}
.kp-control-group { display: flex; align-items: center; gap: 0.5rem; }
.kp-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.kp-moves { font-size: 1rem; font-weight: 700; color: var(--accent2); min-width: 4rem; }
.kp-timer { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent2); min-width: 5rem; }

.kp-main { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }

.kp-board-wrap { display: grid; grid-template-areas: "ranks board" ". files"; gap: 0; }
.kp-rank-labels { grid-area: ranks; display: grid; grid-template-rows: repeat(8, 50px); width: 20px; margin-right: 4px; align-items: center; }
.kp-rank-labels span { font-size: 0.7rem; color: var(--text-dim); text-align: center; }
.kp-board { grid-area: board; display: grid; grid-template-columns: repeat(8, 50px); grid-template-rows: repeat(8, 50px); border: 1px solid var(--border); }
.kp-file-labels { grid-area: files; display: grid; grid-template-columns: repeat(8, 50px); margin-left: 24px; }
.kp-file-labels span { font-size: 0.7rem; color: var(--text-dim); text-align: center; }

.kp-cell { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; cursor: pointer; transition: filter 0.1s; user-select: none; }
.kp-cell:hover { filter: brightness(1.15); }
.kp-light { background: #f0d9b5; }
.kp-dark  { background: #b58863; }
.kp-piece-w { color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.kp-piece-b { color: #1a1a1a; text-shadow: 0 0 1px rgba(255,255,255,0.6); }
.kp-valid { outline: 3px solid #4caf50; outline-offset: -3px; }
.kp-captured { opacity: 0.35; }

.kp-status { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--text-dim); min-height: 1.2em; }

.kp-side { display: flex; flex-direction: column; gap: 1rem; min-width: 220px; flex: 1; }

.kp-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.9rem; }
.kp-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-dim); }
.kp-legend-swatch { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; font-size: 1rem; }
.kp-legend-pawn    { background: #b58863; }
.kp-legend-knight  { background: #b58863; }
.kp-legend-valid   { background: #b58863; outline: 2px solid #4caf50; outline-offset: -2px; }
.kp-legend-captured { background: #b58863; opacity: 0.4; }

.kp-lb-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.kp-lb-title { font-size: 1rem; margin: 0 0 0.75rem; }

.kp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 100; }
.kp-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; max-width: 420px; width: 90%; text-align: center; }
.kp-modal-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.kp-modal-body { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.kp-modal-body p { margin: 0 0 0.75rem; }
.kp-modal-body strong { color: var(--text); }

.kp-score-form { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-top: 0.75rem; }
.kp-name-input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.4rem 0.75rem; font-size: 0.9rem; font-family: inherit; flex: 1; min-width: 0; }
.kp-name-input:focus { outline: 2px solid var(--accent2); }
.kp-score-note { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem; }
.kp-score-note a { color: var(--accent2); }

.kp-btn { border: none; border-radius: var(--radius); padding: 0.45rem 1rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.15s; }
.kp-btn:hover { opacity: 0.85; }
.kp-btn-reset  { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.kp-btn-reset:hover { border-color: var(--accent2); }
.kp-btn-submit { background: var(--accent2); color: #000; }

.kp-explainer { max-width: 720px; margin: 2.5rem auto 0; padding: 0 1rem; }
.kp-explainer h2 { font-size: 1.3rem; margin: 0 0 0.75rem; }
.kp-explainer h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; color: var(--accent2); }
.kp-explainer p  { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin: 0 0 0.75rem; }
.kp-explainer ul { padding-left: 1.25rem; margin: 0 0 0.75rem; }
.kp-explainer li { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 0.3rem; }
.kp-explainer strong { color: var(--text); }
.kp-explainer a { color: var(--accent2); }

/* ── Kriegspiel Create ────────────────────────────────────────────────────── */
.ks-create-page { max-width: 520px; margin: 0 auto; padding: 1.5rem 1rem; }
.ks-create-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; }
.ks-create-title  { font-size: 1.6rem; font-weight: 800; }
.ks-create-form   { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.ks-form-group    { display: flex; flex-direction: column; gap: 0.35rem; }
.ks-form-label    { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.ks-form-value    { font-size: 0.95rem; color: var(--accent2); }
.ks-form-input    { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.45rem 0.75rem; font-size: 0.95rem; font-family: inherit; }
.ks-form-input:focus { outline: 2px solid var(--accent2); border-color: var(--accent2); }
.ks-form-select   { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.45rem 0.75rem; font-size: 0.95rem; font-family: inherit; }
.ks-form-select:focus { outline: 2px solid var(--accent2); border-color: var(--accent2); }

.ks-radio-group  { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ks-radio-label  { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.35rem 0.75rem; font-size: 0.9rem; transition: border-color 0.15s; }
.ks-radio-label:hover { border-color: var(--accent2); }
.ks-radio-label input[type=radio] { accent-color: var(--accent2); }

.ks-checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; color: var(--text-dim); }
.ks-checkbox-label input[type=checkbox] { accent-color: var(--accent2); }

.ks-form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* ── Team page ───────────────────────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.team-card-mascot { text-align: center; }
.team-heading { font-size: 1.15rem; font-weight: 700; color: var(--accent2); margin: 0 0 0.5rem; }
.team-photo { width: 100%; max-width: 140px; border-radius: 8px; margin: 0.75rem auto 0.25rem; display: block; }
.team-bio { font-size: 0.9rem; color: var(--text-dim); line-height: 1.6; }
.team-bio p { margin: 0 0 0.5rem; }
.team-bio a { color: var(--accent2); }

/* ── Auth avatar link ────────────────────────────────────────────────────── */
.auth-profile-link {
  display: flex; align-items: center; gap: 0.4rem;
  text-decoration: none; color: inherit;
}
.auth-profile-link:hover .auth-name { text-decoration: underline; }

/* ── Profile settings page ───────────────────────────────────────────────── */
.profile-settings-wrap {
  max-width: 640px; margin: 2rem auto; padding: 0 1rem;
}
.profile-settings-header { margin-bottom: 1.5rem; }
.profile-settings-title  { font-size: 1.6rem; margin: 0 0 0.3rem; }
.profile-settings-sub    { color: var(--muted); margin: 0; }

.profile-alert {
  padding: 0.7rem 1rem; border-radius: var(--radius);
  margin-bottom: 1.2rem; font-size: 0.9rem;
}
.profile-alert-ok  { background: #1b5e20; color: #a5d6a7; }
.profile-alert-err { background: #7f0000; color: #ef9a9a; }

.profile-public-link {
  font-size: 0.9rem; color: var(--muted); margin-bottom: 1.4rem;
}
.profile-public-url { color: var(--accent2); }

.profile-form { display: flex; flex-direction: column; gap: 1.8rem; }

.profile-form-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
}
.profile-form-section-title {
  font-size: 1rem; font-weight: 600; margin: 0 0 1rem; color: var(--accent2);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.profile-field        { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.profile-field:last-child { margin-bottom: 0; }
.profile-label        { font-size: 0.875rem; font-weight: 600; color: var(--fg); }
.profile-label-hint   { font-weight: 400; color: var(--muted); margin-left: 0.5rem; font-size: 0.8rem; }
.profile-input        {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); padding: 0.45rem 0.7rem; font-size: 0.9rem; font-family: inherit;
}
.profile-input:focus  { outline: none; border-color: var(--accent2); }
.profile-textarea     {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); padding: 0.45rem 0.7rem; font-size: 0.9rem; font-family: inherit;
  resize: vertical;
}
.profile-textarea:focus { outline: none; border-color: var(--accent2); }
.profile-input-hint     { font-size: 0.78rem; color: var(--muted); }

.profile-privacy-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; }

.profile-toggle-row {
  display: flex; align-items: center; gap: 1rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.profile-toggle-row:last-child { border-bottom: none; }

.profile-toggle       { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.profile-toggle input { opacity: 0; width: 0; height: 0; }
.profile-toggle-slider {
  position: absolute; inset: 0; background: #444; border-radius: 24px; cursor: pointer;
  transition: background 0.2s;
}
.profile-toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px; transition: transform 0.2s;
}
.profile-toggle input:checked + .profile-toggle-slider { background: #2e7d32; }
.profile-toggle input:checked + .profile-toggle-slider::before { transform: translateX(18px); }

.profile-toggle-label        { display: flex; flex-direction: column; gap: 0.1rem; }
.profile-toggle-label strong { font-size: 0.9rem; }
.profile-toggle-label span   { font-size: 0.8rem; color: var(--muted); }

.profile-form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-save-btn {
  background: var(--accent); color: #000; border: none; border-radius: var(--radius);
  padding: 0.55rem 1.4rem; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.profile-save-btn:hover { opacity: 0.9; }
.profile-view-btn {
  color: var(--accent2); font-size: 0.9rem; text-decoration: none;
}
.profile-view-btn:hover { text-decoration: underline; }

/* ── Public profile page ─────────────────────────────────────────────────── */
.pub-profile-wrap { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }

.pub-profile-card {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.2rem;
}
.pub-profile-avatar      { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pub-profile-avatar-placeholder {
  width: 80px; height: 80px; border-radius: 50%; background: #1e3a2f;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; flex-shrink: 0;
}
.pub-profile-name   { font-size: 1.4rem; margin: 0 0 0.15rem; }
.pub-profile-handle { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.3rem; }
.pub-profile-location { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.2rem; }
.pub-profile-since  { font-size: 0.82rem; color: var(--muted); margin: 0 0 0.6rem; }
.pub-profile-edit-btn {
  display: inline-block; font-size: 0.8rem; color: var(--accent2);
  border: 1px solid var(--accent2); border-radius: var(--radius);
  padding: 0.2rem 0.7rem; text-decoration: none;
}
.pub-profile-edit-btn:hover { background: var(--accent2); color: #000; }

.pub-profile-bio {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  font-style: italic; color: var(--muted); margin-bottom: 1.2rem;
}
.pub-profile-bio p { margin: 0; }

.pub-profile-section        { margin-bottom: 1.8rem; }
.pub-profile-section-title  {
  font-size: 1rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent2); margin: 0 0 0.8rem;
}
.pub-profile-table-wrap { overflow-x: auto; }
.pub-profile-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
.pub-profile-table th {
  text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.pub-profile-table td {
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
}
.pub-profile-table tr:last-child td { border-bottom: none; }
.pub-result-win  { color: #a5d6a7; font-weight: 600; }
.pub-result-loss { color: #ef9a9a; }
.pub-result-draw { color: #ffe082; }
.pub-profile-empty { color: var(--muted); font-size: 0.9rem; font-style: italic; }

/* ── Zugzwang Endgame Challenge ──────────────────────────────────────────── */
.ez-page { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.ez-header { margin-bottom: 1.25rem; }
.ez-title-row { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.ez-title { font-size: 1.6rem; margin: 0; }
.ez-hash { font-size: 1rem; font-family: monospace; color: var(--accent2); font-weight: 400; }
.ez-back-link { font-size: 0.85rem; color: var(--text-dim); text-decoration: none; }
.ez-back-link:hover { color: var(--accent2); }
.ez-description { color: var(--text-dim); margin: 0; font-size: 0.9rem; }

.ez-layout { display: flex; flex-direction: column; gap: 1rem; }

.ez-controls {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 1rem;
}
.ez-control-group { display: flex; align-items: center; gap: 0.5rem; }
.ez-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.ez-stat  { font-size: 1rem; font-weight: 700; color: var(--accent2); min-width: 2rem; }
.ez-timer { font-variant-numeric: tabular-nums; min-width: 5rem; }

.ez-main { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }

.ez-board-wrap { display: grid; grid-template-areas: "ranks board" ". files"; gap: 0; }
.ez-rank-labels { grid-area: ranks; display: grid; grid-template-rows: repeat(8, 56px); width: 22px; margin-right: 4px; align-items: center; }
.ez-rank-labels span { font-size: 0.7rem; color: var(--text-dim); text-align: center; }
.ez-board { grid-area: board; display: grid; grid-template-columns: repeat(8, 56px); grid-template-rows: repeat(8, 56px); border: 2px solid var(--border); }
.ez-file-labels { grid-area: files; display: grid; grid-template-columns: repeat(8, 56px); margin-left: 26px; margin-top: 2px; }
.ez-file-labels span { font-size: 0.7rem; color: var(--text-dim); text-align: center; }

.ez-cell { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 2rem; cursor: pointer; user-select: none; position: relative; transition: filter 0.08s; }
.ez-cell:hover { filter: brightness(1.15); }
.ez-light { background: #f0d9b5; }
.ez-dark  { background: #b58863; }
.ez-piece-w { color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.ez-piece-b { color: #1a1a1a; text-shadow: 0 0 1px rgba(255,255,255,0.6); }
.ez-selected { outline: 3px solid #1976d2; outline-offset: -3px; }
.ez-valid { outline: 3px solid #388e3c; outline-offset: -3px; }
.ez-valid::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: rgba(56,142,60,0.45); }

.ez-status { grid-area: status; margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--text-dim); min-height: 1.2em; }

.ez-side { display: flex; flex-direction: column; gap: 1rem; min-width: 220px; flex: 1; max-width: 320px; }

.ez-legend { display: flex; flex-wrap: wrap; gap: 0.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.9rem; }
.ez-legend-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--text-dim); }
.ez-lswatch { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; font-size: 1.1rem; }
.ez-ls-white    { background: #f0d9b5; }
.ez-ls-black    { background: #b58863; }
.ez-ls-selected { background: #b58863; outline: 2px solid #1976d2; outline-offset: -2px; }
.ez-ls-valid    { background: #b58863; outline: 2px solid #388e3c; outline-offset: -2px; }

.ez-log-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.ez-log-title { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.5rem; }
.ez-move-log { max-height: 140px; overflow-y: auto; font-size: 0.85rem; font-family: monospace; }
.ez-log-row { display: flex; gap: 0.4rem; padding: 0.1rem 0; }
.ez-log-num { color: var(--text-dim); min-width: 2rem; }
.ez-log-w { color: var(--text); }
.ez-log-b { color: var(--text-dim); }

.ez-lb-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.ez-lb-title { font-size: 1rem; margin: 0 0 0.75rem; }

.ez-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 100; }
.ez-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; max-width: 440px; width: 90%; text-align: center; }
.ez-modal-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.ez-modal-body  { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.ez-modal-body p { margin: 0 0 0.75rem; }
.ez-modal-body strong { color: var(--text); }

.ez-score-form { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-top: 0.75rem; }
.ez-name-input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.4rem 0.75rem; font-size: 0.9rem; font-family: inherit; flex: 1; min-width: 0; }
.ez-name-input:focus { outline: 2px solid var(--accent2); }
.ez-score-note { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem; }
.ez-score-note a { color: var(--accent2); }

.ez-btn { border: none; border-radius: var(--radius); padding: 0.45rem 1rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.15s; }
.ez-btn:hover { opacity: 0.85; }
.ez-btn-reset  { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.ez-btn-reset:hover { border-color: var(--accent2); }
.ez-btn-submit { background: var(--accent2); color: #000; }

.ez-explainer { max-width: 720px; margin: 2.5rem auto 0; padding: 0 1rem; }
.ez-explainer h2 { font-size: 1.3rem; margin: 0 0 0.75rem; }
.ez-explainer h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; color: var(--accent2); }
.ez-explainer p  { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin: 0 0 0.75rem; }
.ez-explainer ul { padding-left: 1.25rem; margin: 0 0 0.75rem; }
.ez-explainer li { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 0.3rem; }
.ez-explainer strong { color: var(--text); }

/* ── Starchess ───────────────────────────────────────────────────────────── */
.sc-wrapper { max-width: 960px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.sc-title    { font-size: 2rem; text-align: center; margin-bottom: 0.4rem; }
.sc-subtitle { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }
.sc-subtitle a { color: var(--accent2); text-decoration: none; }
.sc-subtitle a:hover { text-decoration: underline; }

/* Mode tabs */
.sc-mode-tabs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sc-tab { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-dim); padding: 0.4rem 1rem; font-size: 0.88rem; cursor: pointer; font-family: inherit; transition: border-color 0.15s; }
.sc-tab.active { border-color: var(--accent2); color: var(--accent2); }
.sc-tab.disabled { opacity: 0.4; cursor: default; }

/* Setup toggle row */
.sc-setup-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.sc-setup-label { font-size: 0.88rem; color: var(--text-dim); }
.sc-setup-hint  { font-size: 0.85rem; color: var(--text-dim); }
.sc-toggle-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.88rem; color: var(--text); }
.sc-toggle-label input { display: none; }
.sc-toggle-track { width: 36px; height: 20px; background: var(--border); border-radius: 10px; position: relative; transition: background 0.2s; }
.sc-toggle-label input:checked + .sc-toggle-track { background: var(--accent2); }
.sc-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left 0.2s; }
.sc-toggle-label input:checked + .sc-toggle-track .sc-toggle-thumb { left: 19px; }

/* Status bar */
.sc-status { text-align: center; font-size: 0.92rem; color: var(--accent2); min-height: 1.4em; margin-bottom: 0.75rem; }

/* Game area */
.sc-game-area { display: flex; gap: 1.5rem; align-items: flex-start; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.sc-board-wrap { flex: 0 0 auto; }
.sc-board { width: 100%; max-width: 440px; display: block; }

/* SVG cells */
.sc-cell { fill: var(--surface2); stroke: var(--border); stroke-width: 1.5; cursor: pointer; transition: fill 0.1s; }
.sc-cell:hover   { fill: #1a3a60; }
.sc-cell.sc-selected { fill: #7c2d48; stroke: var(--accent); stroke-width: 2; }
.sc-cell.sc-legal    { fill: rgba(83,216,251,0.22); stroke: var(--accent2); stroke-width: 1.5; }
.sc-cell.sc-last     { fill: rgba(83,216,251,0.1); }
.sc-cell-num { font-size: 8px; fill: var(--text-dim); text-anchor: middle; pointer-events: none; user-select: none; }
.sc-piece { font-size: 22px; text-anchor: middle; dominant-baseline: central; pointer-events: none; user-select: none; }
.sc-piece-w { fill: #fff; filter: drop-shadow(0 0 2px #000); }
.sc-piece-b { fill: #111; filter: drop-shadow(0 0 1px rgba(255,255,255,0.4)); }

/* Side panel */
.sc-panel { flex: 0 1 200px; min-width: 160px; display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.5rem; }
.sc-panel-section { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.sc-setup-prompt { font-size: 0.85rem; color: var(--text-dim); width: 100%; }
.sc-setup-piece { font-size: 2rem; cursor: default; }
.sc-btn-row { display: flex; flex-direction: column; gap: 0.5rem; }
.sc-btn { border: none; border-radius: var(--radius); padding: 0.45rem 1rem; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: opacity 0.15s; }
.sc-btn:hover { opacity: 0.85; }
.sc-btn-primary { background: var(--accent2); color: #000; }
.sc-btn-ghost   { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.sc-btn-ghost:hover { border-color: var(--accent2); }
.sc-captured { font-size: 1.1rem; min-height: 1.5em; }

/* Rules section */
.sc-rules { max-width: 680px; margin: 0 auto; }
.sc-rules h2 { font-size: 1.4rem; margin: 0 0 0.75rem; }
.sc-rules h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; color: var(--accent2); }
.sc-rules h4 { font-size: 1rem; margin: 1rem 0 0.35rem; }
.sc-rules p  { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin: 0 0 0.6rem; }
.sc-rules strong { color: var(--text); }
.sc-rules em     { color: var(--text); }

/* Responsive */
@media (max-width: 560px) {
  .sc-board { max-width: 98vw; }
  .sc-panel { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; }
}

/* === Möbius Chess =========================================================== */
.mc-wrapper  { max-width: 960px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.mc-title    { font-size: 2rem; text-align: center; margin-bottom: 0.4rem; }
.mc-subtitle { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }
.mc-subtitle a { color: var(--accent2); text-decoration: none; }
.mc-subtitle a:hover { text-decoration: underline; }

.mc-status { text-align: center; font-size: 0.92rem; color: var(--accent2); min-height: 1.4em; margin-bottom: 0.75rem; }

.mc-game-area  { display: flex; gap: 1.5rem; align-items: flex-start; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.mc-board-wrap { flex: 0 0 auto; overflow-y: auto; overflow-x: hidden; max-height: 82vh; border: 1px solid rgba(0,0,0,0.08); border-radius: 4px; }
.mc-board      { display: block; width: 100%; max-width: 432px; touch-action: manipulation; }
.mc-panel      { flex: 0 1 180px; min-width: 140px; display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.5rem; }
.mc-btn-row    { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Board cells */
.mc-cell-bg                 { fill: #e8d9b5; }
.mc-cell-bg.mc-dark         { fill: #b58863; }
.mc-cell-bg.mc-selected     { fill: #f6f669; }
.mc-cell-bg.mc-legal        { fill: #cdd26a; }
.mc-cell-bg.mc-last-move    { fill: #aaa23a; }
.mc-cell-bg.mc-check        { fill: #e84040; }
/* Promotion row highlight — visual cue that pawns promote here */
.mc-cell-bg.mc-promote      { fill: #9abfdf; }
.mc-cell-bg.mc-promote.mc-dark { fill: #6a9dbf; }

/* Piece text */
.mc-piece      { font-size: 24px; text-anchor: middle; dominant-baseline: central; pointer-events: none; user-select: none; }
.mc-piece.mc-white { fill: #fff;    stroke: #333; stroke-width: 0.7px; paint-order: stroke fill; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.mc-piece.mc-black { fill: #111;    stroke: #e8d9b5; stroke-width: 0.6px; paint-order: stroke fill; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }

/* Pawn direction arrow */
.mc-pawn-dir   { font-size: 9px; text-anchor: end; dominant-baseline: auto; fill: rgba(0,0,0,0.45); pointer-events: none; user-select: none; }

/* Coord labels */
.mc-coord      { font-size: 8px; fill: var(--text-dim); opacity: 0.6; pointer-events: none; user-select: none; }

/* Seam indicator lines */
.mc-seam-line  { stroke: #e0a020; stroke-width: 2; stroke-dasharray: 4 3; fill: none; }
.mc-seam-label { font-size: 9px; fill: #e0a020; text-anchor: middle; }

/* Move history */
.mc-move-history { font-size: 0.8rem; color: var(--text-dim); max-height: 300px; overflow-y: auto; line-height: 1.6; }
.mc-history-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.mc-history-table th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 2px 4px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mc-history-table td { padding: 2px 4px; font-variant-numeric: tabular-nums; }
.mc-history-num { color: var(--text-dim); opacity: 0.5; width: 1.6em; }
.mc-history-table tr:last-child td { font-weight: 600; color: var(--text); }

/* Captured pieces */
.mc-captured-row   { display: flex; align-items: center; gap: 0.3rem; min-height: 1.4em; }
.mc-captured-label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.mc-captured       { font-size: 1rem; letter-spacing: -0.05em; line-height: 1; }

/* Game-over board dim */
.mc-board-wrap.mc-game-over { opacity: 0.7; }

/* Rules reuse sc-rules with mc-rules override for list items */
.mc-rules ul { margin: 0 0 0.6rem 1.2rem; }
.mc-rules li { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; }

@media (max-width: 600px) {
  /* Stack board above panel on narrow screens */
  .mc-game-area  { flex-direction: column; align-items: stretch; gap: 1rem; }
  .mc-board-wrap { flex: none; max-height: 60vh; width: 100%; }
  .mc-board      { max-width: 100%; }
  .mc-panel      { flex: none; flex-direction: row; flex-wrap: wrap; align-items: flex-start; padding-top: 0; }
  .mc-move-history { max-height: 150px; flex: 1 1 100%; }
  .mc-captured-row { flex: 1 0 auto; }
}

/* === Minesweeper Chess ====================================================== */
.ms-wrapper    { max-width: 900px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.ms-title      { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 0.3rem; }
.ms-subtitle   { text-align: center; color: var(--text-dim); margin-bottom: 1.5rem; }
.ms-status     { text-align: center; font-size: 1.05rem; font-weight: 600; min-height: 1.8rem; margin-bottom: 1rem; color: var(--accent); }
.ms-game-area  { display: flex; flex-direction: row; gap: 1.5rem; align-items: flex-start; justify-content: center; }
.ms-board-wrap { flex: 0 0 auto; }
.ms-panel      { flex: 1 1 220px; display: flex; flex-direction: column; gap: 0.8rem; min-width: 180px; max-width: 260px; }
.ms-btn-row    { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ms-mine-counter { font-size: 1rem; font-weight: 600; color: var(--text-dim); }
.ms-captured-row { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.85rem; }
.ms-captured-label { color: var(--text-dim); white-space: nowrap; }
.ms-captured   { font-size: 1rem; letter-spacing: 0.05em; }
.ms-move-history { list-style: decimal; margin: 0; padding: 0 0 0 1.4rem; max-height: 320px; overflow-y: auto; font-size: 0.82rem; color: var(--text-dim); line-height: 1.8; }

/* Board SVG */
.ms-board { display: block; width: 100%; max-width: 468px; touch-action: manipulation; }

/* Cell backgrounds */
.ms-cell-bg         { fill: #e8d9b5; }
.ms-cell-bg.ms-dark { fill: #b58863; }
.ms-cell-bg.ms-promote-row       { fill: #9abfdf; }
.ms-cell-bg.ms-dark.ms-promote-row { fill: #6a9dbf; }

/* Highlight overlay — semi-transparent so it shows over fog as well as clear squares */
.ms-cell-hl               { fill: transparent; }
.ms-cell-hl.ms-selected   { fill: #f6f669; fill-opacity: 0.70; visibility: visible; }
.ms-cell-hl.ms-legal      { fill: #7ec850; fill-opacity: 0.60; visibility: visible; }
.ms-cell-hl.ms-last-move  { fill: #aaa23a; fill-opacity: 0.55; visibility: visible; }
.ms-cell-hl.ms-check      { fill: #e84040; fill-opacity: 0.70; visibility: visible; }

/* Fog overlay */
.ms-fog-overlay { fill: #7a7a7a; }

/* Mine-count numbers */
.ms-mine-num {
  font-size: 18px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}
.ms-mine-num.ms-count-1 { fill: #1a6fff; }
.ms-mine-num.ms-count-2 { fill: #2a9a2a; }
.ms-mine-num.ms-count-3 { fill: #dd2222; }
.ms-mine-num.ms-count-4 { fill: #000080; }
.ms-mine-num.ms-count-5 { fill: #800000; }
.ms-mine-num.ms-count-6 { fill: #008080; }
.ms-mine-num.ms-count-7 { fill: #111111; }
.ms-mine-num.ms-count-8 { fill: #555555; }
.ms-mine-num.ms-mine    { fill: #cc0000; font-size: 20px; }

/* Piece glyphs */
.ms-piece {
  font-size: 34px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}
.ms-piece.ms-white { fill: #fff;    stroke: #333;    stroke-width: 0.7px; paint-order: stroke fill; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.ms-piece.ms-black { fill: #111;    stroke: #e8d9b5; stroke-width: 0.6px; paint-order: stroke fill; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }

/* Sapper bomb icon */
.ms-sapper-circle { fill: #222; stroke: #f6f669; stroke-width: 1.5; }
.ms-sapper-glyph  { font-size: 11px; text-anchor: middle; dominant-baseline: central; pointer-events: none; user-select: none; }

/* Coordinate labels */
.ms-coord-label {
  font-size: 10px;
  fill: var(--text-dim);
  opacity: 0.7;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}

.ms-invite-panel { margin: 0 auto 1.5rem; max-width: 540px; padding: 1rem 1.2rem; background: var(--surface2); border-radius: 8px; border: 1px solid var(--border); }
.ms-invite-label { font-size: 0.9rem; color: var(--text-dim); margin: 0 0 0.6rem; }
.ms-invite-row   { display: flex; gap: 0.5rem; align-items: center; }
.ms-invite-url   { flex: 1; font-size: 0.82rem; padding: 0.35rem 0.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); min-width: 0; }

.ms-rules { margin-top: 3rem; }
.ms-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 1rem 0;
}
.ms-rules-table th,
.ms-rules-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.ms-rules-table th {
  background: var(--surface2);
  font-weight: 600;
  color: var(--text-dim);
}
.ms-rules-table tr:nth-child(even) td { background: var(--surface2); }

@media (max-width: 600px) {
  .ms-game-area  { flex-direction: column; align-items: center; }
  .ms-board-wrap { width: 100%; max-width: 100vw; }
  .ms-panel      { width: 100%; max-width: 100%; }
  .ms-move-history { max-height: 150px; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .header-inner { height: auto; padding: 0.5rem 0; flex-wrap: wrap; gap: 0.4rem; }
  .home-title { font-size: 1.8rem; }
  .home-piece { font-size: 3.5rem; }
  nav a { padding: 0.3rem 0.6rem; font-size: 0.82rem; }
  .blog-article-title { font-size: 1.5rem; }
  .kanban-board { flex-direction: column; }
  .kanban-col { flex: none; width: 100%; }
  .fics-layout { height: auto; min-height: calc(100vh - 140px); }
  .fics-terminal { min-height: 300px; }
  .ks-layout { flex-direction: column; }
  .ks-panel { min-width: 0; width: 100%; }
  .pub-profile-card { flex-direction: column; align-items: center; text-align: center; }
  .ez-main { flex-direction: column; }
  .ez-side { max-width: 100%; }
  .ez-board { grid-template-columns: repeat(8, 44px); grid-template-rows: repeat(8, 44px); }
  .ez-rank-labels { grid-template-rows: repeat(8, 44px); }
  .ez-file-labels { grid-template-columns: repeat(8, 44px); }
  .ez-cell { width: 44px; height: 44px; font-size: 1.6rem; }
  .pg-layout { flex-direction: column; }
  .pg-side { width: 100%; }
}

/* ── Puzzle Generator (F19) ──────────────────────────────────────────────── */
.pg-layout { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.pg-board-area { display: flex; flex-direction: column; gap: 0.5rem; }

.pg-fen-row { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.25rem; }
.pg-fen-value { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); word-break: break-all; }

.pg-validation { font-size: 0.85rem; padding: 0.4rem 0.75rem; border-radius: var(--radius); }
.pg-validation-idle  { background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); }
.pg-validation-ok    { background: rgba(56,142,60,0.15); color: #81c784; border: 1px solid #388e3c; }
.pg-validation-error { background: rgba(198,40,40,0.15); color: #ef9a9a; border: 1px solid #c62828; }

.pg-side { display: flex; flex-direction: column; gap: 1rem; flex: 1; min-width: 280px; max-width: 360px; }

.pg-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.pg-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.75rem; }

.pg-palette { display: flex; flex-direction: column; gap: 0.5rem; }
.pg-palette-group { display: flex; flex-direction: column; gap: 0.3rem; }
.pg-group-label { font-size: 0.72rem; color: var(--text-dim); }
.pg-palette-row { display: flex; gap: 4px; }
.pg-palette-piece { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; cursor: grab; border-radius: 3px; user-select: none; transition: filter 0.08s; }
.pg-palette-piece:hover { filter: brightness(1.2); }
.pg-palette-piece:active { cursor: grabbing; }

.pg-drag-over { outline: 3px solid var(--accent2) !important; outline-offset: -3px; }

.pg-trash { margin-top: 0.75rem; padding: 0.5rem 0.75rem; border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; font-size: 0.82rem; color: var(--text-dim); cursor: default; transition: border-color 0.15s, color 0.15s; }
.pg-trash.pg-drag-over { border-color: var(--accent); color: var(--accent); outline: none !important; }

.pg-form { display: flex; flex-direction: column; gap: 0.6rem; }
.pg-field { display: flex; flex-direction: column; gap: 0.25rem; }
.pg-label { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); }
.pg-optional { font-weight: 400; }
.pg-input, .pg-textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 0.4rem 0.65rem; font-size: 0.9rem; font-family: inherit;
}
.pg-input:focus, .pg-textarea:focus { outline: 2px solid var(--accent2); }
.pg-textarea { resize: vertical; min-height: 64px; }

.pg-save-btn {
  margin-top: 0.25rem; padding: 0.5rem 1.1rem; font-size: 0.9rem; font-weight: 700;
  font-family: inherit; border: none; border-radius: var(--radius); cursor: pointer;
  background: var(--accent2); color: #000; transition: opacity 0.15s;
}
.pg-save-btn:hover:not(:disabled) { opacity: 0.85; }
.pg-save-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pg-save-result { font-size: 0.85rem; color: var(--text-dim); padding: 0.4rem 0; line-height: 1.5; }
.pg-result-link { color: var(--accent2); word-break: break-all; }
.pg-copy-btn {
  font-size: 0.78rem; padding: 0.15rem 0.5rem; border-radius: var(--radius); cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim);
  font-family: inherit; transition: color 0.15s;
}
.pg-copy-btn:hover { color: var(--text); }

/* ── Custom Puzzle Player ─────────────────────────────────────────────────── */
.cp-last-move { outline: 3px solid rgba(255, 193, 7, 0.75); outline-offset: -3px; }

/* ── Custom Puzzles on Profile ────────────────────────────────────────────── */
.cp-puzzles-section { margin-top: 2rem; }
.cp-puzzles-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text); }
.cp-puzzle-list { display: flex; flex-direction: column; gap: 0.5rem; }
.cp-puzzle-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem 0.9rem;
}
.cp-puzzle-title { font-size: 0.9rem; font-weight: 600; flex: 1; min-width: 0; }
.cp-puzzle-hash  { font-size: 0.75rem; font-family: monospace; color: var(--accent2); }
.cp-puzzle-meta  { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }
.cp-puzzle-link  { font-size: 0.8rem; color: var(--accent2); text-decoration: none; }
.cp-puzzle-link:hover { text-decoration: underline; }
.cp-puzzle-delete {
  font-size: 0.78rem; padding: 0.2rem 0.5rem; border-radius: var(--radius); cursor: pointer;
  background: transparent; border: 1px solid #c62828; color: #ef9a9a;
  font-family: inherit; transition: background 0.15s;
}
.cp-puzzle-delete:hover { background: rgba(198,40,40,0.15); }
.cp-no-puzzles { font-size: 0.85rem; color: var(--text-dim); }


/* ── Random Chess ──────────────────────────────────────────────────────────── */

/* Lobby */
.rc-lobby-page { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem; }
.rc-lobby-header { text-align: center; margin-bottom: 2rem; }
.rc-lobby-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.rc-lobby-desc  { color: var(--text-dim); max-width: 600px; margin: 0 auto; }
.rc-lobby-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.rc-lobby-section-title { font-size: 1rem; font-weight: 700; margin: 0 0 1rem; }
.rc-lobby-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rc-lobby-table th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--border); }
.rc-lobby-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
.rc-lobby-table tr:last-child td { border-bottom: none; }
.rc-time-dim { color: var(--text-dim); font-size: 0.82rem; }
.rc-no-games { color: var(--text-dim); font-size: 0.88rem; }
.rc-guest-form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.rc-guest-input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.4rem 0.75rem; font-size: 0.9rem; min-width: 180px; }
.rc-guest-note { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.5rem; }
.rc-rules-section { }
.rc-rules-list { color: var(--text-dim); font-size: 0.9rem; line-height: 1.7; padding-left: 1.25rem; }

/* Shared buttons */
.rc-btn { display: inline-block; padding: 0.45rem 1rem; border-radius: var(--radius); font-family: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: opacity 0.15s, background 0.15s; text-decoration: none; }
.rc-btn-primary   { background: var(--accent); color: #fff; }
.rc-btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.rc-btn-danger    { background: transparent; border-color: #c62828; color: #ef9a9a; }
.rc-btn-join      { background: var(--accent2); color: #fff; padding: 0.3rem 0.75rem; font-size: 0.82rem; }
.rc-btn-sm        { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.rc-btn:disabled, .rc-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.rc-btn:hover:not(:disabled) { opacity: 0.85; }

/* Game page */
.rc-game-page { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.rc-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rc-topbar-left  { display: flex; align-items: center; gap: 1rem; }
.rc-topbar-right { display: flex; align-items: center; gap: 0.6rem; }
.rc-back-link    { font-size: 0.85rem; color: var(--accent2); text-decoration: none; }
.rc-back-link:hover { text-decoration: underline; }
.rc-game-info    { font-size: 0.9rem; color: var(--text-dim); }
.rc-game-id-label { font-size: 0.78rem; color: var(--text-dim); }
.rc-game-id      { font-size: 0.82rem; font-family: monospace; color: var(--accent2); }
.rc-dim          { color: var(--text-dim); }

/* Banners */
.rc-banner      { padding: 0.55rem 1rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; text-align: center; margin: 0.5rem 1rem; }
.rc-banner-warn { background: rgba(245,127,23,0.18); border: 1px solid rgba(245,127,23,0.5); color: #ffb300; }

/* Overlays */
.rc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 200; display: flex; align-items: center; justify-content: center; }
.rc-overlay-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 460px; width: 90%; text-align: center; }
.rc-overlay-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.rc-overlay-desc  { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.6rem; }
.rc-share-row  { display: flex; gap: 0.5rem; align-items: center; justify-content: center; }
.rc-share-input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.4rem 0.6rem; font-size: 0.82rem; flex: 1; min-width: 0; }

/* Piece selection */
.rc-piece-select-area { padding: 0.75rem 1rem; flex: 1; overflow-y: auto; }
.rc-negotiate-layout  { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: flex-start; }
.rc-piece-pool-wrap, .rc-inplay-wrap { flex: 0 0 220px; }
.rc-settings-wrap     { flex: 1; min-width: 220px; }
.rc-pool-label        { font-size: 0.85rem; font-weight: 700; color: var(--text-dim); margin: 0 0 0.5rem; }
.rc-piece-pool, .rc-piece-inplay {
  min-height: 120px; border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem;
  background: var(--bg);
}
.rc-piece-inplay { border-style: solid; border-color: var(--accent2); background: var(--surface); }
.rc-piece-tile { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); user-select: none; }
.rc-piece-draggable { cursor: grab; color: #e53935; border-color: #e53935; }
.rc-piece-draggable:hover { background: rgba(229,57,53,0.12); }
.rc-piece-inactive { opacity: 0.4; cursor: not-allowed; }
.rc-piece-locked   { color: var(--text-dim); cursor: not-allowed; opacity: 0.5; border-style: dashed; }

/* Settings */
.rc-settings-block  { margin-bottom: 1.1rem; }
.rc-setting-label   { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-dim); margin-bottom: 0.35rem; }
.rc-radio-row       { display: flex; gap: 1.1rem; font-size: 0.9rem; }
.rc-radio-row label { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.rc-time-inputs     { display: flex; gap: 0.75rem; margin-top: 0.5rem; flex-wrap: wrap; }
.rc-spinner-group   { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.rc-spinner-group label { font-size: 0.75rem; color: var(--text-dim); }
.rc-spinner         { display: flex; flex-direction: column; align-items: center; }
.rc-spinner input   { width: 52px; text-align: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 0.25rem 0; font-size: 0.92rem; }
.rc-spinner button  { background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 52px; padding: 0.1rem; cursor: pointer; font-size: 0.7rem; line-height: 1; }
.rc-spinner button:hover { background: var(--border); }
.rc-negotiation-status { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 0.75rem; font-style: italic; }
.rc-negotiate-buttons  { display: flex; flex-direction: column; gap: 0.5rem; }

/* Gameplay */
.rc-clock-bar   { display: flex; gap: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rc-clock-side  { flex: 1; display: flex; gap: 0.6rem; align-items: center; justify-content: center; padding: 0.4rem 1rem; }
.rc-clock-label { font-size: 0.82rem; color: var(--text-dim); font-weight: 600; }
.rc-clock-time  { font-size: 1.1rem; font-family: monospace; font-weight: 700; color: var(--text-dim); }
.rc-clock-active .rc-clock-time { color: var(--accent2); }
.rc-play-layout { display: flex; gap: 1.25rem; flex: 1; overflow: hidden; padding: 0.75rem 1rem; }
.rc-board-wrap  { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.rc-board       { display: grid; grid-template-columns: repeat(8, 1fr); width: min(480px, 90vw); height: min(480px, 90vw); border: 2px solid var(--border); }
.rc-cell        { display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; font-size: clamp(1.4rem, 5vw, 2.1rem); }
.rc-light       { background: #f0d9b5; }
.rc-dark        { background: #b58863; }
.rc-selected    { outline: 3px solid #7fc97f; outline-offset: -2px; }
.rc-legal::after { content: ''; position: absolute; inset: 30%; border-radius: 50%; background: rgba(0,180,0,0.45); pointer-events: none; }
.rc-wpiece      { color: #fff; text-shadow: 0 0 2px #333, 0 1px 3px rgba(0,0,0,0.7); }
.rc-bpiece      { color: #1a1a1a; text-shadow: 0 0 2px #fff; }
.rc-status-bar  { width: 100%; text-align: center; }
.rc-status-text { font-size: 0.88rem; color: var(--text-dim); }
.rc-play-panel  { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; min-width: 180px; }
.rc-play-banner { margin: 0; }
.rc-play-buttons { display: flex; flex-direction: column; gap: 0.4rem; }
.rc-move-list-label { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); }
.rc-move-list   { flex: 1; overflow-y: auto; font-size: 0.82rem; font-family: monospace; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem 0.5rem; line-height: 1.8; }
.rc-move-num    { color: var(--text-dim); margin-right: 0.2rem; }
.rc-move-white  { color: var(--text); margin-right: 0.5rem; }
.rc-move-black  { color: var(--text-dim); margin-right: 0.5rem; }

/* Modal */
.rc-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 300; display: flex; align-items: center; justify-content: center; }
.rc-modal         { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 400px; width: 90%; text-align: center; }
.rc-modal-title   { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.6rem; }
.rc-modal-body    { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 1.25rem; }
.rc-modal-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
