/* EladmaBot's site shell. Dark, system font, no framework. The tokens follow
   the proposal's mockup: neutral dark surfaces, one blue accent, the sea as
   the only colored thing. (The reel at /play keeps its own style.css.) */
:root {
  --canvas: #111113;
  --surface: #1a1a1d;
  --raised: #232327;
  --ink-2: #2a2a2f;
  --ink-3: #35353b;
  --line: rgba(255, 255, 255, 0.08);
  --text: #9d9da1;
  --text-strong: #ececee;
  --text-faint: #6c6c70;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.2);
  --accent-text: #8ab4f8;
  --petal: #f472b6;
  --discord: #5865f2;
  --sky-1: #0e2240;
  --sky-2: #0a1a33;
  --wave-back: #1b4f8f;
  --wave-front: #1e5aa6;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg use, .nav-item svg, .menu-btn svg, .petal svg, .btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Layout ---- */
.shell { display: flex; min-height: 100vh; }

.nav {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  width: 200px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: var(--canvas);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: block;
  padding: 0 10px;
  margin-bottom: 16px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
}
.nav-item:hover { background: var(--ink-2); color: var(--text-strong); text-decoration: none; }
.nav-item svg { flex: none; width: 16px; height: 16px; color: var(--text-faint); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.nav-item.active svg { color: var(--accent-text); }
.nav-gap { height: 10px; }

.main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.topbar { display: none; }

/* ---- The sea ---- */
.sea {
  position: relative;
  flex: none;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(var(--sky-1), var(--sky-2));
}
.cond {
  position: absolute;
  top: 14px;
  left: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #c9d7ea;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 56px;
  display: block;
}
.wave-back { fill: var(--wave-back); opacity: 0.55; height: 66px; animation: drift 19s linear infinite; }
.wave-front { fill: var(--wave-front); z-index: 2; animation: drift 12s linear infinite; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .wave { animation: none; } }

/* ---- The player's card ---- */
.me {
  position: absolute;
  top: 14px;
  right: 20px;
  z-index: 3;
  min-width: 232px;
  max-width: calc(100% - 40px);
}
.me-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 10px;
  padding: 10px 12px 12px;
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  user-select: none;
}
.me-card .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-3);
  object-fit: cover;
}
.me-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.25; }
.me-name { color: var(--text-strong); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-lvl { color: var(--text); font-size: 11.5px; white-space: nowrap; }
.me-petals {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.petal { display: inline-flex; color: var(--petal); }
.petal svg { width: 13px; height: 13px; stroke-width: 2.25; }
.me-xp { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--ink-3); overflow: hidden; }
.me-xp i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.7s cubic-bezier(0.25, 0.8, 0.25, 1); }
.me-menu {
  margin-top: 6px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--raised);
  box-shadow: var(--shadow-card);
}
.me-menu a, .me-menu span {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12.5px;
}
.me-menu span { color: var(--text-faint); }
.me-menu a:hover { background: var(--ink-2); color: var(--text-strong); text-decoration: none; }
.me-note { padding: 10px 12px; border-radius: var(--radius-lg); background: var(--raised); box-shadow: var(--shadow-card); font-size: 12.5px; }
.me-note b { color: var(--text-strong); font-weight: 600; }
.me-note small { display: block; margin-top: 2px; color: var(--text-faint); font-size: 11.5px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { filter: brightness(0.88); transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-discord { background: var(--discord); box-shadow: var(--shadow-card); }
.btn-quiet { background: var(--ink-2); color: var(--text-strong); box-shadow: 0 0 0 1px var(--line) inset; }
.btn-quiet:hover { background: var(--ink-3); filter: none; }

/* ---- Content ---- */
.content { padding: 24px 28px 40px; max-width: 960px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1 { margin: 0; color: var(--text-strong); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge[hidden] { display: none; }
.page-blurb { margin: 6px 0 18px; max-width: 60ch; color: var(--text); font-size: 14.5px; }
.card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--shadow-card);
}
.placeholder { display: grid; gap: 10px; }
.placeholder p { margin: 0; }
.placeholder .muted { color: var(--text-faint); font-size: 13px; }
code { padding: 1px 6px; border-radius: 4px; background: var(--ink-2); color: var(--text-strong); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; color: var(--text-strong); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--raised);
  color: var(--text-strong);
  font-size: 13px;
  box-shadow: var(--shadow-card);
}
.toast[hidden] { display: none; }

/* ---- Phone ---- */
.scrim { display: none; }
.me-compact { display: none; }

@media (max-width: 760px) {
  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 240px;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  body.nav-open .nav { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.45); }
  body.nav-open .scrim { display: block; }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
  }
  .topbar .brand { margin: 0; padding: 0; }
  .topbar-end { display: flex; align-items: center; gap: 8px; }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-strong);
    cursor: pointer;
  }
  .menu-btn svg { width: 20px; height: 20px; }
  .me-compact { display: flex; align-items: center; gap: 8px; }
  .me-compact .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink-3); }
  .me-compact .me-lvl { font-size: 12px; }
  .me-compact .me-petals { font-size: 13px; }
  .me-compact .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
  .me-compact .btn svg { width: 16px; height: 16px; }

  .sea { height: 120px; }
  .me { display: none; }
  .content { padding: 20px 16px 40px; }
  h1 { font-size: 20px; }
}
