
  :root {
    --ground: #171a22;
    --surface: #1e222c;
    --raised: #272c38;
    --thumb: #3a4150;
    --hairline: rgba(255, 255, 255, 0.09);
    --hairline-strong: rgba(255, 255, 255, 0.15);
    --text: #f1f3f6;
    --soft: #d3d8e0;
    --muted: #a9b0bd;
    --accent: #aebbf5;
    --rose: #e8bfc6;
    --amber: #d8bc8a;
    --sage: #aecba0;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 110ms ease both page-out; }
  ::view-transition-new(root) { animation: 150ms ease both page-in; }
  ::view-transition-group(sidebar) { animation-duration: 0s; }
  @keyframes page-out { to { opacity: 0; } }
  @keyframes page-in { from { opacity: 0; } }
  @keyframes settle { from { opacity: 0; transform: translateY(5px); } }
  @keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
  @keyframes fade { from { opacity: 0; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes pulse { 50% { opacity: 0.5; } }
  @keyframes shimmer { to { background-position: -220% 0; } }

  * { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #2a2f3a transparent; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-thumb { border-radius: 8px; background: #2a2f3a; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::selection { background: rgba(174, 187, 245, 0.3); }

  html { background: var(--ground); }
  body {
    margin: 0;
    min-height: 100vh;
    background: var(--ground);
    color: var(--text);
    font-family: Geist, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: "tnum";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  a { color: inherit; }
  h1, h2, p { margin: 0; }
  h1 { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
  h2 { font-size: 14px; font-weight: 500; }
  svg { display: block; width: 16px; height: 16px; flex: none; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 12px 12px;
    border-right: 1px solid var(--hairline);
    background: var(--ground);
    scrollbar-width: none;
    view-transition-name: sidebar;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
  .brand-logo { width: 30px; height: 30px; flex: none; border-radius: 8px; }
  .brand-name { font-weight: 600; line-height: 1.2; }
  .brand-sub { color: var(--muted); font-size: 12px; line-height: 1.3; }
  .nav-groups { display: grid; gap: 16px; }
  .nav-group { display: grid; gap: 1px; }
  .nav-label { padding: 0 10px 4px; color: #8b92a0; font-size: 12px; font-weight: 400; }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    color: #b4bac6;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease;
  }
  .nav-link:hover { background: rgba(255, 255, 255, 0.05); color: #f2f4f8; }
  .nav-link.active { background: rgba(255, 255, 255, 0.07); color: #fff; }
  .nav-link .pill { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
  .profile { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 8px; }
  .avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: #1b1f29;
    font-size: 12px;
    font-weight: 600;
  }
  .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .profile-text { flex: 1; min-width: 0; }
  .profile-name { overflow: hidden; font-weight: 500; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .rank { font-size: 12px; line-height: 1.3; }
  .logout {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease);
  }
  .logout:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
  .logout:active { transform: scale(0.94); }

  .main { min-width: 0; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 40px;
    border-bottom: 1px solid var(--hairline);
    background: var(--ground);
  }
  .search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: 380px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--raised);
    color: var(--muted);
    transition: border-color 180ms ease, box-shadow 180ms ease;
  }
  .search:focus-within { border-color: rgba(174, 187, 245, 0.6); box-shadow: 0 0 0 3px rgba(174, 187, 245, 0.14); }
  .search input { width: 100%; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
  .search input::placeholder { color: #8b92a0; }
  .content { width: 100%; max-width: 1140px; margin: 0 auto; padding: 28px 40px 48px; animation: settle 240ms var(--ease) both; }
  .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
  .page-head p { color: var(--muted); }
  .head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .hero-art { display: block; width: 100%; height: 176px; margin-bottom: 20px; object-fit: cover; object-position: center 12%; border-radius: 14px; filter: saturate(0.5) brightness(0.76); }
  .range { position: relative; display: flex; padding: 3px; border-radius: 10px; background: var(--raised); }
  .range-thumb { position: absolute; top: 3px; left: 3px; width: 56px; height: 38px; border-radius: 8px; background: var(--thumb); transition: transform 320ms cubic-bezier(0.3, 0.9, 0.3, 1); }
  .range a {
    position: relative;
    display: grid;
    place-items: center;
    width: 56px;
    height: 38px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
    transition: color 220ms ease, transform 160ms var(--ease);
  }
  .range a:hover, .range a.active { color: #fff; }
  .range a:active { transform: scale(0.96); }

  .seg { position: relative; display: flex; padding: 3px; border-radius: 10px; background: var(--raised); }
  .seg-thumb { position: absolute; top: 3px; left: 3px; width: 72px; height: 38px; border-radius: 8px; background: var(--thumb); transition: transform 320ms cubic-bezier(0.3, 0.9, 0.3, 1); }
  .seg label { position: relative; display: grid; place-items: center; width: 72px; height: 38px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; transition: color 220ms ease; }
  .seg label:hover { color: #fff; }
  .seg-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  #mod-a:checked ~ .box-head label[for="mod-a"], #mod-b:checked ~ .box-head label[for="mod-b"] { color: #fff; }
  #mod-b:checked ~ .box-head .seg-thumb { transform: translateX(72px); }
  #mod-a:focus-visible ~ .box-head .seg, #mod-b:focus-visible ~ .box-head .seg { outline: 2px solid var(--accent); outline-offset: 2px; }
  #mod-a:checked ~ .form-b, #mod-b:checked ~ .form-a { display: none; }
  .mod-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 4px 20px 20px; animation: fade 200ms ease both; }
  .mod-form .field { flex: 1 1 260px; }
  .mod-form .field.short { flex: 0 1 150px; }
  .mod-note { flex: 1 1 100%; color: var(--muted); }
  .box, .action-form, .empty-card, .stats { border: 1px solid var(--hairline); border-radius: 14px; background: var(--surface); }
  .box { min-width: 0; overflow: hidden; }
  .stack-gap { margin-bottom: 20px; }
  .stack-gap-top { margin-top: 20px; }
  .columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: stretch; margin-bottom: 20px; }
  .box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 10px; }
  .box-head p { color: var(--muted); font-size: 13px; }
  .box-head a { color: var(--soft); font-weight: 500; text-decoration: none; transition: color 180ms ease; }
  .box-head a:hover { color: #fff; }

  .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; overflow: hidden; }
  .stat { min-width: 0; padding: 18px 20px; box-shadow: 1px 0 0 var(--hairline); }
  .stat:last-child { box-shadow: none; }
  .stat-label { color: var(--muted); }
  .stat-row { margin: 6px 0 4px; }
  .stat-value { font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -0.03em; }
  .stat-note { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

  .chart-wrap { position: relative; padding: 6px 20px 14px; }
  .chart { display: block; width: 100%; height: 210px; }
  .chart-grid { stroke: rgba(255, 255, 255, 0.06); }
  .chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: d 520ms cubic-bezier(0.3, 0.9, 0.3, 1); }
  .hit { fill: transparent; transition: fill 160ms ease; }
  .hit:hover { fill: rgba(255, 255, 255, 0.04); }
  .chart-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12px; }

  .row { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 20px; transition: background-color 180ms ease; }
  .row:hover { background: rgba(255, 255, 255, 0.03); }
  .row-main { flex: 1; min-width: 0; }
  .row-title { font-weight: 500; overflow-wrap: anywhere; }
  .row-title a { text-decoration: none; transition: color 180ms ease; }
  .row-title a:hover { color: #fff; }
  .row-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
  .row-meta { display: flex; flex: none; align-items: center; gap: 14px; }
  .row-time { min-width: 70px; color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; }
  th { padding: 10px 20px; border-bottom: 1px solid var(--hairline); color: var(--muted); font-weight: 400; text-align: left; white-space: nowrap; }
  td { padding: 11px 20px; vertical-align: middle; }
  tbody tr { transition: background-color 180ms ease; }
  tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
  td.number, th.number { text-align: right; }
  td a { font-weight: 500; text-decoration: none; }
  td a:hover { color: #fff; }
  .member-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }

  .pill { color: var(--soft); font-weight: 500; white-space: nowrap; }
  .pill.danger { color: var(--rose); }
  .pill.warning { color: var(--amber); }
  .pill.success { color: var(--sage); }
  .pill.info { color: var(--accent); }
  .pill.pulsing { animation: pulse 1400ms ease-in-out infinite; }
  .button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #eceef2;
    color: #0b0d12;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms var(--ease), background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
  }
  .button:hover { background: #fff; box-shadow: 0 6px 20px -8px rgba(255, 255, 255, 0.28); }
  .button:active { transform: scale(0.965); }
  .button.quiet { background: transparent; border-color: rgba(255, 255, 255, 0.1); color: var(--text); font-weight: 500; }
  .button.quiet:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); box-shadow: none; color: #fff; }
  .button.danger { background: transparent; border-color: rgba(212, 154, 163, 0.28); color: var(--rose); }
  .button.danger:hover { background: rgba(212, 154, 163, 0.14); border-color: rgba(212, 154, 163, 0.45); box-shadow: none; color: #f3d5da; }
  .button.success { background: transparent; border-color: rgba(174, 203, 160, 0.3); color: var(--sage); }
  .button.success:hover { background: rgba(174, 203, 160, 0.13); box-shadow: none; }
  .button.discord { width: 100%; min-height: 48px; }
  .button.small { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: 13px; }
  .button.loading { color: transparent; pointer-events: none; }
  .button.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 15px;
    height: 15px;
    margin: auto;
    border: 2px solid rgba(128, 134, 148, 0.4);
    border-top-color: var(--muted);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
  }
  .actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
  .action-form { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
  .action-form p { color: var(--muted); }
  .action-form .button { margin-top: auto; }
  .field { display: grid; gap: 6px; color: var(--muted); }
  .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .field input, .field textarea, .field select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: var(--ground);
    color: var(--text);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease;
  }
  .field textarea { min-height: 110px; padding: 10px 12px; resize: vertical; }
  .field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: rgba(174, 187, 245, 0.7); box-shadow: 0 0 0 3px rgba(174, 187, 245, 0.16); }

  .search-large { display: flex; gap: 8px; margin-bottom: 20px; }
  .search-large > svg { display: none; }
  .search-large input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease;
  }
  .search-large input:focus { outline: 0; border-color: rgba(174, 187, 245, 0.7); box-shadow: 0 0 0 3px rgba(174, 187, 245, 0.16); }

  .filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
  .filter { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; text-decoration: none; transition: background-color 180ms ease, color 180ms ease; }
  .filter:hover { color: #fff; }
  .filter.active { background: var(--raised); color: #fff; }
  .player-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 22px; }
  .player-art { display: grid; place-items: center; width: 150px; height: 150px; flex: none; overflow: hidden; border-radius: 14px; background: #1b1f29; }
  .player-art img { width: 100%; height: 100%; object-fit: contain; }
  .player-art .avatar { width: 64px; height: 64px; font-size: 22px; }
  .player-main { display: grid; align-content: start; gap: 12px; flex: 1 1 300px; min-width: 0; }
  .player-title { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .player-title h2 { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
  .player-title p { color: var(--muted); }
  .counts { display: flex; flex-wrap: wrap; gap: 22px; }
  .count { display: flex; align-items: baseline; gap: 5px; }
  .count strong { font-weight: 600; }
  .count span { color: var(--muted); }
  .player-about { max-height: 96px; overflow-y: auto; color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
  .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 28px; padding: 0 20px 8px; }
  .fact { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
  .fact span { color: var(--muted); }
  .fact strong { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
  .fact .pill { color: var(--soft); }
  .fact .pill.danger { color: var(--rose); }
  .fact .pill.success { color: var(--sage); }
  .fact a { text-decoration: none; }

  .skeleton { min-height: 194px; }
  .bone {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--raised) 25%, #1f232d 50%, var(--raised) 75%);
    background-size: 220% 100%;
    animation: shimmer 1300ms linear infinite;
  }
  .bone-avatar { width: 150px; height: 150px; flex: none; border-radius: 14px; }
  .bone-lines { display: grid; gap: 12px; flex: 1 1 260px; }
  .bone-title { width: 44%; height: 22px; }
  .bone-short { width: 62%; }
  #player-result > * { animation: settle 240ms var(--ease) both; }
  .back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; transition: color 180ms ease; }
  .back:hover { color: #fff; }
  .empty { padding: 28px 20px; color: var(--muted); text-align: center; }
  .empty-card { padding: 26px 20px; color: var(--muted); text-align: center; }
  .empty-card a { color: var(--text); }
  .notice { margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--hairline-strong); border-radius: 12px; background: var(--raised); color: var(--soft); }
  .key { display: block; margin-top: 10px; padding: 11px 12px; overflow-wrap: anywhere; border-radius: 8px; background: var(--ground); color: var(--text); font-family: Consolas, monospace; user-select: all; }
  .settings-body { padding: 2px 20px 18px; color: var(--muted); }
  .quote { padding: 0 20px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .status-card { display: grid; gap: 8px; padding: 18px 20px; }
  .status-card p { color: var(--muted); overflow-wrap: anywhere; }
  .gate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 100vh; padding: 16px; }
  .gate-banner { display: block; width: 100%; height: 100%; min-height: 240px; object-fit: contain; object-position: center bottom; border-radius: 16px; background: #08142a; filter: saturate(0.55) brightness(0.84); }
  .gate-card { justify-self: center; align-self: center; width: 100%; max-width: 340px; padding: 32px 8px; animation: pop 280ms var(--ease) both; }
  .gate-card .brand { padding: 0; margin-bottom: 22px; }
  .gate-card h1 { margin-bottom: 6px; font-size: 26px; letter-spacing: -0.025em; }
  .gate-card p { margin-bottom: 24px; color: var(--muted); }
  .gate-card .notice { overflow-wrap: anywhere; }
  .gate-card .field { margin-bottom: 14px; }
  dialog.confirm { width: min(380px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--hairline-strong); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8); }
  dialog.confirm[open] { animation: pop 200ms var(--ease) both; }
  dialog.confirm::backdrop { background: rgba(5, 6, 10, 0.68); animation: fade 180ms ease both; }
  dialog.confirm h2 { margin-bottom: 16px; font-size: 15px; font-weight: 500; line-height: 1.45; }
  .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

  @media (max-width: 1080px) {
    .columns { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { box-shadow: 1px 1px 0 var(--hairline); }
  }
  @media (max-width: 820px) {
    .app { display: block; }
    .sidebar { position: static; height: auto; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--hairline); overflow: visible; }
    .brand { padding: 0; }
    .nav-groups { display: flex; gap: 2px; margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
    .nav-groups::-webkit-scrollbar { display: none; }
    .nav-group { display: flex; flex: none; }
    .nav-label { display: none; }
    .nav-link { flex: none; }
    .nav-link .pill { margin-left: 0; }
    .profile { margin-top: 0; padding: 4px 0; }
    .topbar { position: static; padding: 10px 16px; }
    .topbar .pill { display: none; }
    .search { max-width: none; }
    .content { padding: 22px 16px 36px; }
    .hero-art { height: 112px; object-position: center 20%; }
    .stat { padding: 14px 16px; }
    .stat-note { white-space: normal; }
    .row { flex-wrap: wrap; }
    .row-meta { width: 100%; justify-content: space-between; }
    .gate { grid-template-columns: minmax(0, 1fr); align-content: start; }
    .gate-banner { height: 150px; min-height: 0; }
  }

  .nav-label { color: #98a0ae; }
  .nav-link { color: #c3c9d3; }
  .nav-link.active { background: rgba(255, 255, 255, 0.1); }
  .avatar { background: var(--raised); }
  .player-art { background: var(--raised); }
  .search-large input, .field input, .field textarea, .field select { background: #171a22; }
  .key { background: #171a22; }
  .button { background: #f1f3f6; color: #171a22; }
  .box, .action-form, .empty-card, .stats {
    border-radius: 16px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 34px -26px rgba(0, 0, 0, 0.75);
  }
  .box { transition: border-color 220ms ease; }
  .box:hover { border-color: var(--hairline-strong); }
  .action-form { transition: border-color 220ms ease; }
  .action-form:hover { border-color: var(--hairline-strong); }
  .stat { transition: background-color 200ms ease; }
  .stat:hover { background: rgba(255, 255, 255, 0.025); }
  .hero-art { border-radius: 16px; filter: saturate(0.62) brightness(0.86); box-shadow: 0 14px 34px -26px rgba(0, 0, 0, 0.75); }
  .row { border-radius: 10px; margin: 0 8px; padding: 8px 12px; }
  .row:last-child { margin-bottom: 8px; }
  .stat-value { letter-spacing: -0.035em; }
  .box-head h2 { color: var(--soft); }
  .gate { position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: 100vh; padding: 32px clamp(20px, 3.5vw, 56px); overflow: hidden; }
  .gate-banner { position: absolute; inset: 0; min-height: 0; border-radius: 0; object-fit: cover; object-position: 30% center; filter: none; background: none; }
  .gate-card {
    position: relative;
    max-width: 360px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(34, 38, 49, 0.93);
    box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.85);
  }
  .gate-card p { margin-bottom: 20px; color: #c3c9d3; }
  .gate-card .brand-logo { width: 36px; height: 36px; border-radius: 10px; }
  .gate-card .brand-sub { color: #b4bac6; }
  .gate-divider { margin: 20px 0 10px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: #c3c9d3; }
  .button.wide { width: 100%; min-height: 46px; }
  .gate-card .button.quiet { border-color: rgba(255, 255, 255, 0.18); }
  .button.plain { margin-top: 10px; background: transparent; color: #c3c9d3; font-weight: 500; }
  .button.plain:hover { background: rgba(255, 255, 255, 0.08); box-shadow: none; color: #fff; }

  @media (max-width: 820px) {
    .gate { flex-direction: column; justify-content: flex-start; padding: 0 16px 28px; }
    .gate-banner { position: static; flex: none; width: calc(100% + 32px); height: 220px; margin: 0 -16px -28px; object-position: 25% center; }
    .row { margin: 0 4px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
      animation-duration: 1ms !important;
      animation-delay: 0ms !important;
      transition-duration: 1ms !important;
    }
    .bone { animation: none; }
  }
  .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .board-col { min-height: 180px; padding: 12px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--surface); }
  .board-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; color: var(--soft); font-weight: 500; }
  .board-head span { color: var(--muted); font-weight: 400; }
  .board-empty { padding: 18px 4px; color: var(--muted); font-size: 13px; text-align: center; }
  .task-card { display: grid; gap: 6px; margin-top: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--raised); transition: border-color 180ms ease; }
  .task-card:hover { border-color: var(--hairline-strong); }
  .task-title { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
  .task-title:hover { color: #fff; }
  .task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13px; }
  .task-card .button { justify-self: start; margin-top: 4px; }
  .form-card { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--surface); }
  .form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .detail-text { padding: 0 20px 18px; color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
  .inline-form { margin: 0; }
  .message-cell { font-family: Consolas, monospace; font-size: 13px; }
  .compose { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
  .drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 1px dashed rgba(255, 255, 255, 0.18); border-radius: 12px; color: var(--soft); text-align: center; cursor: pointer; transition: border-color 180ms ease, background-color 180ms ease; }
  .drop:hover, .drop.dragging { border-color: rgba(174, 187, 245, 0.7); background: rgba(174, 187, 245, 0.06); }
  .drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .drop strong { font-weight: 500; }
  .drop span { color: var(--muted); font-size: 13px; }
  .file-list { display: grid; gap: 6px; }
  .file-row { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-radius: 10px; background: var(--raised); }
  .file-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .file-info small { display: block; color: var(--muted); font-size: 13px; }
  .file-remove { width: 44px; height: 44px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 18px; cursor: pointer; }
  .file-remove:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
  .form-error { color: var(--rose); }
  .form-note { color: var(--muted); }
  .form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  .button:disabled { background: var(--thumb); color: var(--muted); box-shadow: none; cursor: not-allowed; }
  .preview-title { margin-bottom: 10px; color: var(--soft); font-weight: 500; }
  .discord-card { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--raised); }
  .discord-post { display: flex; gap: 12px; }
  .discord-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; }
  .discord-body { display: grid; flex: 1; gap: 4px; min-width: 0; }
  .discord-name { font-weight: 600; }
  .discord-heading { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
  .discord-text { color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
  .discord-sub { color: var(--muted); font-size: 13px; }
  .discord-file { padding: 10px 12px; border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
  .mention { justify-self: start; padding: 1px 4px; border-radius: 4px; background: rgba(174, 187, 245, 0.2); color: #cdd6fb; font-weight: 500; }
  .update-entry { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .update-entry:last-child { border-bottom: 0; }
  .update-entry summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 64px; padding: 12px 20px; cursor: pointer; list-style: none; }
  .update-entry summary::-webkit-details-marker { display: none; }
  .update-entry summary:hover { background: rgba(255, 255, 255, 0.03); }
  .update-summary { flex: 1 1 240px; min-width: 0; }
  .update-body { display: grid; gap: 12px; padding: 0 20px 18px; }
  .switch-row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 20px; cursor: pointer; }
  .switch-row:hover { background: rgba(255, 255, 255, 0.03); }
  .switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .switch-text { flex: 1; min-width: 0; font-weight: 500; }
  .switch-text small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
  .switch { display: block; width: 40px; height: 24px; flex: none; padding: 3px; border-radius: 12px; background: var(--thumb); transition: background-color 200ms ease; }
  .switch::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #f1f3f6; transition: transform 240ms cubic-bezier(0.3, 0.9, 0.3, 1); }
  .switch-row input:checked + .switch { background: var(--accent); }
  .switch-row input:checked + .switch::after { transform: translateX(16px); }
  .switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
  .connection { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
  @media (max-width: 1080px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 820px) {
    .board { grid-template-columns: minmax(0, 1fr); }
    .board-col { min-height: 0; }
  }

  @font-face { font-family: "Barlow"; src: url("/fonts/barlow.woff2") format("woff2"); font-style: italic; font-weight: 900; font-display: swap; }
  @font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

  :root {
    color-scheme: dark;
    --ground: #08070c;
    --ground-2: #0c0b11;
    --surface: #121018;
    --raised: #1d1a26;
    --thumb: #2c2836;
    --hairline: rgba(234, 226, 255, 0.08);
    --hairline-strong: rgba(234, 226, 255, 0.16);
    --silver: #c9c6d2;
    --text: #f5f2ee;
    --soft: #d6d1db;
    --muted: #a39dae;
    --faint: #6f6a7a;
    --accent: #ee2f47;
    --accent-hi: #ff6b78;
    --accent-grad: linear-gradient(180deg, #ff5d6b 0%, #ee2f47 55%, #c4162f 100%);
    --rose: #ff7a85;
    --amber: #e6c47e;
    --sage: #8fd3ae;
    --display: "Barlow", "Arial Black", Impact, system-ui, sans-serif;
    --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  }

  * { scrollbar-color: #2a2533 transparent; }
  ::-webkit-scrollbar-thumb { background: #2a2533; }
  ::selection { background: rgba(238, 47, 71, 0.35); }
  body { font-family: var(--body); font-size: 14.5px; }
  :focus-visible { outline-color: var(--silver); }

  h1, .gate-card h1, .player-title h2 {
    font-family: var(--display);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.005em;
    line-height: 1;
  }
  h1 { font-size: clamp(26px, 22px + 1vw, 32px); }
  .page-head h1::before {
    content: "";
    display: block;
    width: 22px;
    height: 2px;
    margin-bottom: 12px;
    border-radius: 2px;
    background: var(--accent);
  }

  .sidebar { background: linear-gradient(180deg, var(--ground-2), var(--ground) 70%); }
  .brand-logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
  .brand-name { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: 0; line-height: 1; }
  .brand-accent { color: var(--accent); }
  .brand-sub { margin-top: 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
  .nav-label { color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
  .nav-link { position: relative; color: var(--muted); }
  .nav-link:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }
  .nav-link.active { background: rgba(255, 255, 255, 0.055); color: var(--text); box-shadow: inset 0 0 0 1px var(--hairline); }
  .nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); }

  .box, .action-form, .empty-card, .stats, .board-col, .form-card {
    border: 1px solid var(--hairline);
    background: linear-gradient(180deg, rgba(232, 230, 240, 0.035), rgba(232, 230, 240, 0) 140px), var(--surface);
    box-shadow: inset 0 1px 0 rgba(232, 230, 240, 0.1), 0 18px 40px -30px rgba(0, 0, 0, 0.9);
  }
  .box:hover, .action-form:hover { border-color: var(--hairline-strong); }
  .task-card { border-color: var(--hairline); background: var(--raised); }
  .stat-value { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 34px; letter-spacing: 0; }
  th { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
  .fact { border-bottom-color: var(--hairline); }
  .notice { border-color: var(--hairline-strong); background: var(--raised); }

  .button { border-radius: 10px; background: var(--accent-grad); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(90, 0, 18, 0.35); }
  .button:hover { background: var(--accent-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(90, 0, 18, 0.35), 0 8px 22px -12px rgba(238, 47, 71, 0.7); }
  .button.quiet { background: rgba(255, 255, 255, 0.03); border-color: var(--hairline-strong); box-shadow: none; color: var(--text); }
  .button.quiet:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(234, 226, 255, 0.26); }
  .button.danger { background: transparent; border-color: rgba(255, 122, 133, 0.3); box-shadow: none; color: var(--rose); }
  .button.danger:hover { background: rgba(255, 122, 133, 0.12); border-color: rgba(255, 122, 133, 0.5); color: #ffd3d7; }
  .button.success { background: transparent; border-color: rgba(143, 211, 174, 0.3); box-shadow: none; color: var(--sage); }
  .button.success:hover { background: rgba(143, 211, 174, 0.12); }
  .button.plain { background: transparent; box-shadow: none; color: var(--soft); }
  .button.plain:hover { background: rgba(255, 255, 255, 0.07); box-shadow: none; color: #fff; }
  .switch::after { background: #f5f2ee; }

  .search-large input, .field input, .field textarea, .field select, .key { background: var(--ground-2); border-color: var(--hairline-strong); }
  .search:focus-within, .search-large input:focus, .field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--silver);
    box-shadow: 0 0 0 3px rgba(201, 198, 210, 0.12);
  }
  .search input::placeholder { color: var(--faint); }
  .filter.active, .range a.active { background: var(--raised); box-shadow: inset 0 0 0 1px var(--hairline); color: #fff; }
  .bone { background: linear-gradient(90deg, var(--raised) 25%, #26222f 50%, var(--raised) 75%); background-size: 220% 100%; }
  .avatar, .player-art { background: var(--raised); }

  .gate-card {
    border: 1px solid var(--hairline-strong);
    background: rgba(18, 16, 24, 0.92);
    box-shadow: inset 0 1px 0 rgba(232, 230, 240, 0.12), 0 30px 70px -30px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(14px);
  }
  .gate-card p, .gate-card .brand-sub, .gate-divider { color: var(--soft); }
  .gate-divider { border-top-color: var(--hairline-strong); }
  dialog.confirm { border-color: var(--hairline-strong); background: var(--surface); }
  @media (max-width: 820px) { .nav-link.active::before { display: none; } }
