/* =====================================================================
 * Soulforge — warm dark dashboard theme.
 * Deadlock key-art palette: near-black / deep-teal surfaces, sea-green
 * accents, logo-cream highlights, large radii, Poppins.
 * Item category colours follow Deadlock: Weapon amber, Vitality green,
 * Spirit purple. --accent is set per game by js/app.js.
 * ===================================================================== */
:root {
  --bg: #0b0b0c;
  --frame: #121718;
  --surface: #182022;
  --surface-2: #1f292b;
  --surface-3: #283436;
  --border: rgba(220, 255, 240, 0.06);
  --text: #f3f3f4;
  --soft: #bdbdc4;
  --dim: #80808a;
  --accent: #5fb89c;       /* sea green (key-art sky, brightened for contrast) */
  --cream: #f8f0dc;        /* Deadlock logo */
  --on-accent: #f8f0dc;    /* text on sea-green buttons */
  --deep: #163a33;         /* dark teal for icons on cream */
  --grad: linear-gradient(135deg, #4fa58a 0%, #2a6352 100%);
  --radius-lg: 28px;
  --radius: 20px;
  color-scheme: dark;
}

html, body { background: var(--bg); color: var(--text); }
body { font-family: Poppins, system-ui, sans-serif; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

.text-dim { color: var(--dim); }
.text-soft { color: var(--soft); }
.text-accent { color: var(--accent); }
small { font-size: 0.75em; color: var(--dim); }

/* Warm, blurred backdrop behind the app frame */
.bg-scene {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 85% 0%, rgba(46, 107, 86, 0.32), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(16, 48, 64, 0.45), transparent 60%),
    linear-gradient(180deg, #0e1c1f 0%, #0b0b0c 70%);
}

/* ---------------------------- App frame ---------------------------- */
.app-frame {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px;
  max-width: 1640px; margin: 28px auto; padding: 24px;
  background: var(--frame); border: 1px solid var(--border); border-radius: 40px;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.8);
}
.app-main { min-width: 0; padding: 6px 4px 0 0; }

.sidebar {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  min-width: 0; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.sidebar-games { display: flex; align-items: center; gap: 8px; flex: 1; }
.sidebar-btn {
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 16px; border-radius: 16px; white-space: nowrap;
  color: var(--soft); transition: color 0.15s, background 0.15s;
}
.sidebar-btn svg { width: 26px; height: 26px; flex-shrink: 0; }
.sidebar-label { font-size: 0.85rem; font-weight: 500; }
.sidebar-btn:hover { color: var(--text); background: var(--surface-2); }
.sidebar-btn.is-active { color: var(--cream); background: var(--surface-3); }
.sidebar-btn:focus-visible, .sidebar-plus:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.sidebar-plus {
  width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px;
  color: var(--cream); border: 1.5px solid var(--cream); background: rgba(248, 240, 220, 0.06); transition: background 0.15s;
}
.sidebar-plus svg { width: 22px; height: 22px; }
.sidebar-plus:hover { background: rgba(248, 240, 220, 0.14); }

/* ------------------------------ Top bar ----------------------------- */
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.greeting { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.01em; }
#player-name { outline: none; border-radius: 6px; padding: 0 2px; }
#player-name:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.topbar-search {
  margin-left: auto; flex: 1 1 260px; max-width: 460px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 12px 18px;
}
.topbar-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 0.9rem; color: var(--text); }
.topbar-search input::placeholder { color: var(--dim); }
.topbar-search:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.icon-btn {
  position: relative; width: 46px; height: 46px; display: inline-grid; place-items: center; flex-shrink: 0;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--soft); transition: all 0.15s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn-light { width: 44px; height: 44px; background: var(--cream); color: var(--deep); border: 0; }
.icon-btn-light:hover:not(:disabled) { background: #fffaf0; color: var(--deep); }
.status-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--dim); border: 2px solid var(--surface); }
.is-live .status-dot { background: #22c55e; }

/* Tool pills */
.tool-tab {
  padding: 8px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 500; color: var(--soft);
  background: var(--surface); border: 1px solid var(--border); transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.tool-tab:hover { color: var(--text); background: var(--surface-2); }
.tool-tab-active, .tool-tab-active:hover { color: var(--on-accent); background: var(--grad); border-color: transparent; box-shadow: 0 8px 22px -10px var(--accent); }
.proto { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.25); }

/* ------------------------------ Surfaces ---------------------------- */
.glass, .panel { background: var(--surface); border: 1px solid var(--border); position: relative; }
.panel { border-radius: var(--radius-lg); }
.glass { border-radius: 24px !important; }
.card-title { font-weight: 600; font-size: 1rem; color: var(--text); letter-spacing: -0.005em; }
.section-title { font-size: 1.35rem; font-weight: 500; color: #dcdce0; letter-spacing: -0.01em; }

.stat { background: var(--surface-2); border-radius: 18px; padding: 12px 14px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--stat-color); }
.stat-value { color: var(--text); }

.empty { border: 1px dashed rgba(255, 255, 255, 0.1); border-radius: 18px; padding: 20px; text-align: center; color: var(--dim); font-size: 0.85rem; }

.badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
.btn-ghost { font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--soft); background: var(--surface-2); transition: all 0.15s; }
.btn-ghost:hover { color: var(--text); background: var(--surface-3); }
.btn-cta {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px;
  background: var(--grad); color: var(--on-accent); font-weight: 500; font-size: 0.9rem; box-shadow: 0 10px 26px -12px var(--accent); transition: transform 0.15s, filter 0.15s;
}
.btn-cta svg { width: 16px; height: 16px; }
.btn-cta:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.btn-cta:disabled { background: var(--surface-3); color: var(--dim); box-shadow: none; cursor: not-allowed; }
.pill-solid {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px;
  background: var(--grad); color: var(--on-accent); font-size: 0.85rem; font-weight: 500;
}
.pill-solid svg { width: 17px; height: 17px; }

/* ------------------------------ Controls ---------------------------- */
.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 9px 14px; font-size: 0.85rem; color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); }
select.input option { background: #1c1c1f; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--surface-3); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); border: 3px solid #1d4a40; cursor: pointer; }
.range::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid #1d4a40; border-radius: 50%; background: var(--cream); cursor: pointer; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid #fff; }

.chip {
  --chip: var(--accent);
  font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--soft); background: var(--surface-2); transition: all 0.15s;
}
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip-active { color: var(--text); border-color: var(--chip); background: color-mix(in srgb, var(--chip) 20%, var(--surface-2)); }

.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.bar-fill { transition: width 0.35s ease; }

/* ------------------------- Avatars / pickers ------------------------ */
.avatar { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--ring, #3a3a40); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); }
.avatar-fallback { font-weight: 600; font-size: 12px; color: var(--text); }

.hero-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 16px; font-size: 10px; color: var(--soft); border: 1px solid transparent; transition: all 0.15s; min-width: 0; }
.hero-tile:hover { background: var(--surface-2); color: var(--text); }
.hero-tile-active { border-color: var(--ring); background: color-mix(in srgb, var(--ring) 14%, var(--surface-2)); color: var(--text); }

.pick { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 500; color: var(--soft); transition: all 0.15s; }
.pick:hover { color: var(--text); background: var(--surface-3); }
.pick-active { color: var(--text); border-color: var(--ring); background: color-mix(in srgb, var(--ring) 18%, var(--surface-2)); }

/* ------------------------- Item slots & shop ------------------------ */
.slot {
  --cat: var(--accent);
  aspect-ratio: 1; border-radius: 16px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cat) 24%, transparent), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--cat) 50%, transparent); transition: transform 0.15s; overflow: hidden;
}
button.slot:hover { transform: translateY(-2px); }
button.slot:hover::after { content: '✕'; position: absolute; top: 3px; right: 6px; font-size: 10px; color: var(--text); }
.slot-empty { background: var(--surface-2); border: 1px dashed rgba(255, 255, 255, 0.08); color: var(--dim); font-size: 11px; font-weight: 600; }
.slot-flex { border-color: rgba(248, 240, 220, 0.22); color: rgba(248, 240, 220, 0.6); font-size: 9px; letter-spacing: 0.1em; }
.slot-tier { font-size: 10px; font-weight: 700; color: var(--cat); }
.slot-name { font-size: 9.5px; line-height: 1.15; text-align: center; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.shop-item { --cat: var(--accent); text-align: left; padding: 11px 13px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--cat); transition: all 0.15s; }
.shop-item:hover:not(:disabled) { background: var(--surface-3); }
.shop-owned { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------- Data display -------------------------- */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 0.82rem; }
.kv dt { color: var(--dim); }
.kv dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.tbl { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--dim); font-size: 11px; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-variant-numeric: tabular-nums; }
.tag { font-size: 10px; padding: 1px 7px; border-radius: 6px; background: rgba(167, 139, 250, 0.15); color: #c4b5fd; white-space: nowrap; }

.score { font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.score-pos { color: #2dd4bf; background: rgba(45, 212, 191, 0.12); }
.score-neg { color: #fb7185; background: rgba(251, 113, 133, 0.12); }

.reason { font-size: 12px; color: var(--soft); padding: 7px 12px; border-radius: 12px; background: var(--surface-2); border-left: 2px solid var(--k); }
.reason-kind { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--k); margin-right: 8px; }

.chart-grid { stroke: rgba(255, 255, 255, 0.06); }
.chart-tick { fill: var(--dim); font-size: 11px; font-family: Poppins, sans-serif; }

.ring-label { fill: var(--text); font-size: 12px; font-weight: 600; font-family: Poppins, sans-serif; }
.ring-arc { transition: stroke-dasharray 0.5s ease; }

/* ---------------------------- Soul flowchart ------------------------ */
.flow { display: flex; flex-direction: column; gap: 10px; }
.flow-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.flow-row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: start; }
.flow-row-3 > * { flex: 1 1 0; }
.flow-branch { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 18px; border: 1px dashed rgba(255, 255, 255, 0.08); position: relative; }
.flow-branch::before { content: ''; position: absolute; top: -11px; left: 50%; width: 1px; height: 10px; background: rgba(255, 255, 255, 0.1); }
.flow-node { flex: 1 1 120px; min-width: 0; text-align: center; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--node) 9%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--node) 35%, transparent); }
.flow-split { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; font-size: 11px; color: var(--dim); text-align: center; }

/* ---------------------------- Synergy matrix ------------------------ */
.matrix { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.matrix th { color: var(--dim); font-weight: 500; }
.matrix-col { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: 4px 0; height: 84px; text-align: left; }
.matrix-row { text-align: right; padding-right: 8px; white-space: nowrap; }
.matrix-cell { width: 28px; height: 28px; border-radius: 7px; font-weight: 600; font-size: 11px; border: 1px solid rgba(255, 255, 255, 0.04); transition: transform 0.1s; color: var(--text); }
.matrix-cell:hover { transform: scale(1.18); border-color: rgba(255, 255, 255, 0.4); }
.matrix-sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.matrix-self { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 3px, transparent 3px 6px); border-radius: 7px; }

/* ============================ OVERVIEW ============================= */
.ov-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 84px; gap: 20px; margin-top: 44px; }

/* Banner: background art clipped to the card, portrait allowed to pop out above it */
.ov-banner { position: relative; min-height: 340px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.ov-banner-bg {
  position: absolute; inset: 0; border-radius: inherit; background-size: cover; background-position: 85% center; opacity: 0.6;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 75%); mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
}
.ov-banner-bg-fallback { background: radial-gradient(circle at 80% 50%, color-mix(in srgb, var(--hero) 45%, transparent), transparent 60%); }
.ov-banner-hero {
  position: absolute; right: 3%; bottom: 0; height: 122%; max-width: 48%; object-fit: contain; object-position: bottom; z-index: 1; pointer-events: none;
  /* Portrait art has hard edges: fade the left side and the bottom into the card */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(0deg, transparent 0%, #000 12%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(0deg, transparent 0%, #000 12%); mask-composite: intersect;
}
.ov-banner-initials { display: grid; place-items: center; width: 40%; height: 100%; font-size: 6rem; font-weight: 700; color: color-mix(in srgb, var(--hero) 60%, transparent); }
.ov-banner-body { position: relative; z-index: 2; padding: 32px; max-width: 58%; }
.ov-title { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 600; line-height: 1.05; margin-top: 22px; letter-spacing: -0.02em; }
.ov-tagline { color: var(--accent); font-weight: 500; font-size: 0.9rem; margin-top: 6px; }
.ov-blurb { color: #e4e4e7; font-size: 0.95rem; line-height: 1.6; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ov-banner .avatar { box-shadow: 0 0 0 2px var(--surface); }

.ov-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ov-live { display: flex; align-items: center; gap: 16px; padding: 14px; }
.ov-live-thumb { position: relative; width: 46%; max-width: 180px; aspect-ratio: 16 / 9; flex-shrink: 0; border-radius: 16px; background: var(--surface-3) center / cover; background-position: 80% center; }
.live-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 6px; background: #ef4444; color: #fff; }
.live-badge-off { background: var(--surface-3); color: var(--soft); }

.ov-table { flex: 1; padding: 8px; overflow-x: auto; }
.ov-table table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; }
.ov-table th { font-weight: 500; color: var(--dim); font-size: 12px; text-align: right; padding: 12px 14px; background: var(--surface-2); }
.ov-table th:first-child { text-align: left; color: var(--text); border-radius: 14px 0 0 14px; }
.ov-table th:last-child { border-radius: 0 14px 14px 0; }
.ov-table td { padding: 10px 14px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.ov-table td:first-child { text-align: left; max-width: 140px; }
.ov-table tbody tr { cursor: pointer; transition: background 0.15s; }
.ov-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.ov-table tbody tr.is-active td { color: var(--accent); }

.ov-rail { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rail-avatar { position: relative; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, #f8f0dc, #3b7066); transition: transform 0.15s; }
.rail-avatar:hover { transform: scale(1.06); }
.rail-avatar .avatar { box-shadow: 0 0 0 2px var(--surface); }
.rail-avatar.is-active { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--cream); }
.online-dot { position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }

.ov-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; margin-top: 36px; }

/* Carousel */
.carousel { position: relative; }
.carousel-track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 48px 4px 4px; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-arrow {
  position: absolute; top: calc(50% + 22px); transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; background: var(--cream); color: var(--deep); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.8); transition: transform 0.15s;
}
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow:hover { transform: translateY(-50%) scale(1.08); }
.carousel-prev { left: -12px; }
.carousel-next { right: -12px; }
.char-card {
  position: relative; flex: 0 0 auto; width: 270px; height: 240px; scroll-snap-align: start; text-align: left;
  border-radius: 26px; background: var(--surface); border: 1px solid var(--border); transition: border-color 0.15s, transform 0.15s;
}
.char-card:hover { transform: translateY(-3px); }
.char-card.is-active { border-color: color-mix(in srgb, var(--cream) 70%, transparent); }
.char-name {
  position: absolute; left: 20px; right: 12px; top: 50%; transform: translateY(-50%); z-index: 1;
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif; font-size: 4.4rem; line-height: 0.82; text-transform: uppercase; overflow: hidden;
  background: linear-gradient(180deg, #f8f0dc 10%, #8fd0b6); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.char-img {
  position: absolute; right: -4px; bottom: 0; height: 118%; max-width: 70%; object-fit: contain; object-position: bottom; z-index: 2; pointer-events: none;
  border-bottom-right-radius: 26px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%); mask-image: linear-gradient(90deg, transparent 0%, #000 28%);
}
.char-initials { display: grid; place-items: center; width: 45%; height: 100%; font-size: 3rem; font-weight: 700; color: color-mix(in srgb, var(--hero) 70%, white); }
.char-stat { position: absolute; left: 16px; bottom: 14px; z-index: 3; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: var(--soft); }

/* Ring-gauge statistics */
.ov-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 24px; }
.stat-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 22px; background: var(--surface-2); }

/* Tool hub (chat-style) */
.ov-hub { display: flex; flex-direction: column; padding: 20px; min-height: calc(100% - 3.1rem); }
.hub-row { display: flex; align-items: flex-start; gap: 10px; }
.hub-row-right { flex-direction: row-reverse; }
.hub-icon {
  width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, var(--g), color-mix(in srgb, var(--g) 50%, #000)); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--g) 60%, transparent);
}
.hub-icon svg { width: 19px; height: 19px; }
.hub-bubble { flex: 1; max-width: 86%; padding: 11px 14px; border-radius: 18px; background: var(--surface-2); transition: background 0.15s; }
.hub-row:hover .hub-bubble { background: var(--surface-3); }
.hub-search { margin-top: 18px; position: relative; }
.hub-input { width: 100%; border: 0; outline: 0; border-radius: 999px; padding: 13px 20px; background: var(--grad); color: var(--on-accent); font-size: 0.85rem; font-family: inherit; }
.hub-input::placeholder { color: rgba(248, 240, 220, 0.85); }

/* Search dropdown */
.search-wrap { position: relative; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; padding: 6px; max-height: 360px; overflow-y: auto;
  background: #1f1f23; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}
.search-up { top: auto; bottom: calc(100% + 8px); }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 12px; color: var(--text); }
.search-item:hover, .search-item.is-active { background: var(--surface-3); }
.search-kind { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: var(--on-accent); font-size: 11px; font-weight: 600; }

/* ------------------------------- Misc ------------------------------- */
.scroll-thin { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 6px; }

.toast { pointer-events: auto; background: #1f1f23; border: 1px solid var(--accent); color: var(--text); padding: 9px 16px; border-radius: 999px; font-size: 13px; animation: toast-in 0.2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.fade-in { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------------------------- Responsive ---------------------------- */
@media (max-width: 1280px) {
  .ov-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .ov-rail { grid-column: 1 / -1; flex-direction: row; justify-content: center; flex-wrap: wrap; padding: 14px; }
}
@media (max-width: 1100px) {
  .ov-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ov-top { grid-template-columns: minmax(0, 1fr); }
  .ov-banner-body { max-width: 62%; }
}
@media (max-width: 768px) {
  .app-frame { margin: 0; padding: 16px; border: 0; border-radius: 0; background: transparent; box-shadow: none; gap: 20px; }
  .sidebar { gap: 8px; padding: 8px; border-radius: 20px; }
  .sidebar-games { gap: 6px; }
  .sidebar-btn { gap: 8px; padding: 10px 12px; }
  .topbar-search { order: 3; max-width: none; flex-basis: 100%; }
  .ov-banner { min-height: 0; }
  .ov-banner-body { max-width: 100%; padding: 24px; }
  .ov-banner-hero { height: 70%; max-width: 45%; opacity: 0.35; }
  .ov-stats { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .flow-row-2, .flow-split { grid-template-columns: 1fr; }
  .char-card { width: 220px; height: 210px; }
  .char-name { font-size: 3.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
