:root {
  --bg: #0f0d12;
  --panel: #1a1620;
  --ink: #ece6f0;
  --muted: #9b8fa8;
  --accent: #c9a227;   /* garlic-gold */
  --accent2: #7d5fff;
  --err: #ff6b6b;
  --line: #2c2533;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #211a2b, var(--bg));
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #00000040; padding: 1px 5px; border-radius: 5px; font-size: .9em; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 11px 22px; min-height: 56px;
  background: rgba(17, 14, 22, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800; font-size: 1.18rem; color: var(--ink);
  letter-spacing: .2px; display: inline-flex; align-items: center; gap: .45rem;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 1.25rem; filter: drop-shadow(0 0 6px rgba(201,162,39,.35)); }
.brand-dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.site-nav a {
  margin: 0; padding: 7px 13px; border-radius: 9px;
  color: var(--muted); font-size: .92rem; font-weight: 500; line-height: 1;
  transition: background .15s, color .15s;
}
.site-nav a:hover { color: var(--ink); background: #ffffff10; text-decoration: none; }
.site-nav a.active {
  color: var(--accent); background: rgba(201, 162, 39, 0.14);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.32);
}
.site-nav .nav-util { color: #6c6478; font-size: .86rem; }
.site-nav .nav-util:hover { color: var(--muted); }
.site-nav .nav-util.active { color: var(--accent); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 22px; }
footer { text-align: center; color: var(--muted); padding: 18px; font-size: .85rem; }

.hero h1 { margin: 0 0 .2em; font-size: 2rem; }
.sub { color: var(--muted); margin-top: 0; }
.warn { color: var(--accent); background: #00000033; padding: 8px 12px; border-radius: 8px; }
.hint { color: var(--muted); font-size: .9rem; }

/* chat */
.chat { margin-top: 22px; }
.log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble {
  padding: 10px 14px; border-radius: 14px; max-width: 85%; white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.user { align-self: flex-end; background: var(--accent2); color: white; }
.bubble.ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.bubble.pending { opacity: .6; font-style: italic; }
.bubble.err { border-color: var(--err); color: var(--err); }
.activity { align-self: flex-start; font-size: .82rem; color: var(--muted); }
.activity summary { cursor: pointer; }
.activity .tool { font-family: ui-monospace, monospace; padding: 2px 0; }
.activity .tool.err { color: var(--err); }

#chat-form { display: flex; gap: 8px; }
#chat-form input { flex: 1; }
input, button {
  font: inherit; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
}
button { cursor: pointer; background: var(--accent); color: #1a1300; border: none; font-weight: 600; }
button:hover { filter: brightness(1.08); }
button.big { font-size: 1.1rem; padding: 12px 22px; }

/* tic-tac-toe */
.board {
  display: grid; grid-template-columns: repeat(3, 92px); gap: 8px; margin: 16px 0;
}
.cell {
  width: 92px; height: 92px; font-size: 2.6rem; font-weight: 700;
  background: var(--panel); color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.cell.clickable {
  cursor: pointer;
  border-color: var(--accent2);
}
.cell.clickable:hover {
  background: #2a2040;
  border-color: var(--accent);
}
.cell.filled { color: var(--accent); cursor: default; }
.cell:disabled { opacity: 0.7; cursor: default; }
.status { font-size: 1.2rem; min-height: 1.4em; }
.invite-link { width: 100%; margin-top: 6px; }
.recent ul { list-style: none; padding: 0; }
.recent li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* change log */
.change { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; background: var(--panel); }
.change-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tool-tag { background: var(--accent2); color: #fff; padding: 1px 8px; border-radius: 6px; font-size: .8rem; }
.change .when { color: var(--muted); font-size: .8rem; margin-left: auto; }
.change .detail { background: #00000055; padding: 10px; border-radius: 8px; overflow-x: auto; max-height: 240px; font-size: .8rem; }

/* resume link + uploads */
.resume { margin-top: 8px; font-size: .85rem; color: var(--muted); }
.resume summary { cursor: pointer; }
.upload-form { margin-top: 14px; }
.upload-form p { margin: 8px 0; }
.upload-form input[type=text], .upload-form textarea { width: 100%; }
.gallery .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.asset { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.asset img { width: 100%; height: 160px; object-fit: cover; display: block; }
.asset figcaption { padding: 8px; font-size: .82rem; color: var(--muted); }

/* ── MTG section sub-navigation (tabs) ──────────────────────────── */
.mtg-subnav {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.6rem; padding-bottom: 0;
}
.mtg-subnav a {
  color: var(--muted);
  padding: 0.55rem 1.05rem;
  font-size: 0.92rem; font-weight: 600; margin: 0;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 9px 9px 0 0;
  position: relative; bottom: -1px;
  transition: background .15s, color .15s;
}
.mtg-subnav a:hover { color: var(--ink); background: #ffffff0c; text-decoration: none; }
.mtg-subnav a.active {
  color: var(--accent);
  background: var(--panel);
  border-color: var(--line);
  border-bottom: 1px solid var(--panel);   /* connect the tab to the content */
  box-shadow: inset 0 2px 0 var(--accent);  /* gold cap on the active tab */
}

/* ── Shared themed buttons (used across MTG menu pages) ──────────── */
.ui-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: #1a1300; border: none;
  padding: .5rem 1rem; border-radius: 9px; cursor: pointer;
  font-size: .9rem; font-weight: 600; line-height: 1.1; text-decoration: none;
  transition: filter .15s, background .15s, border-color .15s;
}
.ui-btn:hover { filter: brightness(1.08); text-decoration: none; }
.ui-btn.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.ui-btn.secondary:hover { background: #241f2e; filter: none; }
.ui-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ui-btn.ghost:hover { color: var(--ink); background: #ffffff0a; filter: none; }
.ui-btn.danger { background: #6a2330; color: #ffd9df; }
.ui-btn.danger:hover { background: #7e2a3a; filter: none; }
.ui-btn.sm { padding: .28rem .65rem; font-size: .8rem; border-radius: 7px; }

/* ── Card-ish surfaces shared by the MTG menu pages ─────────────── */
.ui-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; }
.page-title { font-size: 1.7rem; margin: 0 0 .25rem; letter-spacing: .2px; }
.page-sub { color: var(--muted); margin: 0 0 1.5rem; }
