:root {
  color-scheme: light;
  --ink: #242534;
  --muted: #858594;
  --soft-ink: #555565;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --line: #eeedf0;
  --purple: #7055e8;
  --purple-dark: #5d43d2;
  --purple-pale: #f0edff;
  --mint: #1caa83;
  --mint-pale: #e7f8f2;
  --orange: #ec8e47;
  --orange-pale: #fff2e7;
  --rose: #da6684;
  --rose-pale: #fff0f4;
  --shadow: 0 14px 42px rgba(48, 44, 73, .055);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(112, 85, 232, .26); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.topbar { height: 78px; max-width: 1320px; margin: 0 auto; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 220px; }
.brand-mark { width: 39px; height: 39px; border-radius: 14px; display: grid; place-items: center; background: #ece8ff; color: var(--purple); }
.brand-mark svg { width: 30px; fill: currentColor; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.brand-copy strong { font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.brand-copy small { color: #a09eac; font-size: 8px; font-weight: 700; letter-spacing: .17em; }
.role-switch { display: flex; align-items: center; padding: 4px; border-radius: 13px; background: #edecf0; gap: 3px; }
.role-btn { border: 0; background: transparent; border-radius: 10px; color: #888796; padding: 9px 15px; display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; transition: .18s ease; }
.role-btn.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(45, 41, 66, .08); }
.nav-icon { font-size: 14px; color: var(--purple); }
.topbar-end { min-width: 220px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.icon-button { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: #858594; font-size: 18px; }
.user-chip { height: 40px; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid #efedf2; border-radius: 14px; padding: 4px 10px 4px 5px; font-size: 12px; font-weight: 700; }
.user-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; color: #a56024; background: #ffe7c8; font-weight: 800; }
.chevron { color: #aaa8b4; font-size: 14px; margin-left: 2px; }
#app { max-width: 1320px; margin: 0 auto; padding: 26px 34px 54px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin: 8px 0 27px; }
.eyebrow { color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 9px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(25px, 3vw, 34px); line-height: 1.28; letter-spacing: -.045em; margin-bottom: 7px; }
.page-head p { color: var(--muted); font-size: 13px; margin: 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.primary-btn, .secondary-btn, .soft-btn { border: 0; border-radius: 12px; padding: 12px 17px; font-size: 12px; font-weight: 800; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-btn { background: var(--purple); color: white; box-shadow: 0 7px 16px rgba(112, 85, 232, .18); }
.primary-btn:hover { background: var(--purple-dark); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(112, 85, 232, .24); }
.secondary-btn { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.secondary-btn:hover { border-color: #d7d1f6; background: #fcfbff; }
.soft-btn { color: var(--purple); background: var(--purple-pale); padding: 10px 13px; }
.btn-plus { font-size: 16px; font-weight: 500; margin-right: 4px; vertical-align: -1px; }
.stats-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.stat-card { min-height: 144px; background: var(--surface); border: 1px solid #efedf0; border-radius: 19px; padding: 20px 22px; box-shadow: 0 4px 16px rgba(48,44,73,.018); position: relative; overflow: hidden; }
.stat-card.primary-stat { color: white; background: #7258e6; border-color: #7258e6; padding: 20px 24px; }
.stat-card.primary-stat:after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -58px; top: -87px; background: rgba(255,255,255,.08); box-shadow: -34px 101px 0 -14px rgba(255,255,255,.07); }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.primary-stat .stat-label { color: rgba(255,255,255,.74); }
.stat-value { font-size: 29px; font-weight: 800; letter-spacing: -.05em; margin: 13px 0 6px; position: relative; z-index: 1; }
.stat-caption { color: #a0a0ad; font-size: 10px; }
.primary-stat .stat-caption { color: rgba(255,255,255,.72); }
.trend-up { color: #ffd796; font-weight: 800; }
.stat-icon { position: absolute; right: 18px; top: 18px; width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; color: var(--purple); background: var(--purple-pale); font-size: 15px; font-weight: 800; }
.stat-icon.mint { color: var(--mint); background: var(--mint-pale); }
.stat-icon.orange { color: var(--orange); background: var(--orange-pale); }
.boss-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(325px, .88fr); gap: 18px; align-items: start; }
.panel { background: #fff; border: 1px solid #efedf0; border-radius: 19px; box-shadow: 0 4px 16px rgba(48,44,73,.018); }
.panel-inner { padding: 21px 22px; }
.panel-head { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 17px; }
.panel-head h2 { font-size: 15px; letter-spacing: -.025em; margin: 0 0 4px; }
.panel-head p { font-size: 10px; color: var(--muted); margin: 0; }
.tiny-link { border: 0; background: transparent; color: var(--purple); font-size: 10px; font-weight: 800; padding: 6px; }
.chart-card { margin-bottom: 18px; }
.chart-summary { display: flex; align-items: baseline; gap: 7px; margin: 5px 0 1px; }
.chart-total { font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.chart-unit { color: var(--muted); font-size: 10px; }
.chart-change { margin-left: auto; color: var(--mint); background: var(--mint-pale); border-radius: 8px; padding: 5px 7px; font-size: 9px; font-weight: 800; }
.chart-area { position: relative; height: 154px; margin: 12px 0 2px; display: flex; align-items: end; justify-content: space-around; padding: 10px 8px 22px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 37px, #f4f3f7 38px, transparent 39px); }
.bar-col { height: 100%; flex: 1; display: flex; align-items: end; justify-content: center; position: relative; }
.bar { width: min(27px, 52%); min-width: 14px; border-radius: 7px 7px 3px 3px; background: #e8e3ff; transition: height .35s, background .2s; position: relative; }
.bar-col.current .bar { background: var(--purple); }
.bar-col:hover .bar { background: #9e8df1; }
.bar-col.current:hover .bar { background: #5f45d8; }
.bar-label { position: absolute; bottom: -18px; color: #a2a0ac; font-size: 9px; }
.bar-value { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); opacity: 0; font-size: 9px; color: var(--soft-ink); background: #fff; border-radius: 4px; padding: 2px 3px; white-space: nowrap; transition: opacity .15s; }
.bar-col:hover .bar-value, .bar-col.current .bar-value { opacity: 1; }
.trend-note { padding: 11px 13px; background: #faf9ff; border-radius: 11px; color: #79758a; display: flex; align-items: center; gap: 9px; font-size: 10px; }
.trend-note strong { color: var(--purple); }
.friend-panel .panel-head { margin-bottom: 10px; }
.friend-count { color: #9896a3; background: #f5f4f7; border-radius: 7px; padding: 4px 7px; font-size: 9px; font-weight: 800; }
.friend-list { display: grid; gap: 9px; }
.friend-order { border: 1px solid #f0eef3; border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: start; transition: border .2s, background .2s; }
.friend-order.added { border-color: #dcefe9; background: #fbfefc; }
.friend-avatar { width: 35px; height: 35px; border-radius: 12px; display: grid; place-items: center; color: #926a40; background: #ffefdc; font-weight: 800; font-size: 12px; }
.friend-avatar.pink { color: #b45976; background: #ffedf2; }
.friend-avatar.blue { color: #5672a9; background: #eaf0ff; }
.friend-meta { min-width: 0; }
.friend-name { color: #92909d; font-size: 9px; margin: 0 0 4px; }
.friend-title { font-size: 11px; line-height: 1.4; font-weight: 800; margin: 0 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-detail { display: flex; gap: 8px; flex-wrap: wrap; color: #9b99a6; font-size: 9px; }
.friend-price { font-size: 11px; color: var(--ink); font-weight: 800; white-space: nowrap; margin-top: 1px; }
.friend-action { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: -1px; }
.friend-action small { color: #a09eaa; font-size: 8px; }
.friend-add { border: 0; background: var(--purple-pale); color: var(--purple); padding: 7px 10px; border-radius: 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.friend-add:hover { background: #e5dfff; }
.friend-add:disabled { color: #7ea89c; background: #e8f6f0; cursor: default; }
.ledger-panel { margin-top: 18px; }
.ledger-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.filter-tabs { display: flex; align-items: center; gap: 4px; padding: 3px; background: #f7f6f9; border-radius: 10px; }
.filter-tab { border: 0; background: transparent; border-radius: 8px; padding: 7px 10px; color: #92909d; font-size: 9px; font-weight: 700; }
.filter-tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 6px rgba(47, 43, 62, .07); }
.search-box { min-width: 142px; max-width: 210px; width: 35%; height: 33px; border: 1px solid #efedf0; border-radius: 9px; display: flex; align-items: center; gap: 7px; padding: 0 9px; color: #a5a3ae; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 10px; background: transparent; }
.order-list { display: grid; gap: 9px; margin-top: 15px; }
.order-row { min-height: 57px; display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: center; gap: 15px; padding: 11px 13px; border: 1px solid #f1eff3; border-radius: 12px; }
.order-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.game-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; font-size: 14px; background: #f0edff; color: var(--purple); }
.game-icon.gold { background: #fff4df; color: #d49035; }
.game-icon.blue { background: #eaf3ff; color: #5480c3; }
.order-name { min-width: 0; }
.order-name strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.order-name small { display: block; color: #9b99a6; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-price { font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 5px 8px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.status-pill:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-complete { background: var(--mint-pale); color: var(--mint); }
.status-pending { background: var(--orange-pale); color: #cf803d; }
.status-active { background: var(--purple-pale); color: var(--purple); }
.status-cancelled { background: #f2f1f4; color: #888691; }
.row-action { border: 0; background: #f1fbf7; color: var(--mint); border-radius: 8px; font-size: 12px; font-weight: 800; padding: 6px 8px; white-space: nowrap; }
.mobile-only-break { display: none; }
.empty-state { text-align: center; padding: 28px 12px; color: #9a98a5; font-size: 11px; }
.empty-state strong { display: block; color: var(--ink); font-size: 12px; margin-bottom: 5px; }
.player-hero { background: #eae6ff; border-radius: 22px; padding: 27px 29px; position: relative; overflow: hidden; margin-bottom: 18px; }
.player-hero:after { content: ""; position: absolute; right: 11%; top: -106px; width: 265px; height: 265px; border-radius: 50%; border: 1px solid rgba(112,85,232,.11); box-shadow: 0 0 0 28px rgba(112,85,232,.035), 0 0 0 59px rgba(112,85,232,.03); }
.player-hero-content { position: relative; z-index: 1; max-width: 570px; }
.player-hero .eyebrow { color: #7762d5; }
.player-hero h1 { max-width: 500px; font-size: clamp(25px, 3.3vw, 38px); margin-bottom: 9px; }
.player-hero p { color: #79758e; font-size: 12px; margin: 0; }
.player-hero .primary-btn { margin-top: 20px; background: #fff; color: var(--purple); box-shadow: 0 6px 18px rgba(70,54,134,.1); }
.player-hero .primary-btn:hover { background: #faf9ff; }
.player-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.player-stats .stat-card { min-height: 112px; }
.player-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(270px,.65fr); gap: 18px; }
.request-list { display: grid; gap: 10px; }
.request-card { border: 1px solid #efedf0; border-radius: 14px; padding: 15px; display: grid; grid-template-columns: 39px minmax(0,1fr) auto; gap: 11px; align-items: start; }
.request-info { min-width: 0; }
.request-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 6px; }
.request-top strong { font-size: 11px; }
.request-info p { color: #898794; font-size: 10px; margin: 0 0 9px; }
.request-sub { display: flex; flex-wrap: wrap; gap: 8px; color: #a09eaa; font-size: 9px; }
.request-actions { grid-column: 2 / 4; display: flex; justify-content: flex-end; gap: 7px; }
.small-action { border: 1px solid #edebf0; border-radius: 9px; padding: 8px 11px; background: #fff; color: #8c8998; font-size: 9px; font-weight: 800; }
.small-action.accept { color: white; border-color: var(--purple); background: var(--purple); }
.small-action.finish { color: var(--mint); border-color: #d9f0e8; background: #f1fbf7; }
.small-action:disabled { opacity: .7; cursor: default; }
.inbox-note { border-radius: 14px; padding: 14px; background: #faf9ff; color: #888497; font-size: 10px; line-height: 1.7; }
.inbox-note strong { display: block; color: var(--ink); font-size: 11px; margin-bottom: 4px; }
.mini-profile { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.mini-profile .user-avatar { width: 39px; height: 39px; border-radius: 14px; font-size: 15px; }
.mini-profile strong { display: block; font-size: 11px; margin-bottom: 3px; }
.mini-profile small { color: var(--muted); font-size: 9px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tags span { padding: 6px 8px; border-radius: 8px; background: #f5f4f8; color: #858291; font-size: 9px; }
.footer { max-width: 1320px; padding: 0 34px 25px; margin: 0 auto; display: flex; gap: 8px; align-items: center; color: #aaa8b3; font-size: 9px; }
.footer-dot { color: #d1cfd7; }
.mobile-reset { display: none; margin-left: auto; border: 0; background: transparent; color: #9996a5; font-size: 9px; }
.toast-region { position: fixed; z-index: 30; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 11px 15px; border-radius: 12px; background: #282638; color: white; box-shadow: 0 8px 25px rgba(34,31,53,.22); font-size: 11px; font-weight: 600; animation: toastIn .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-root:empty { display: none; }
.modal-root { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(34,32,47,.38); backdrop-filter: blur(4px); }
.modal { width: min(100%, 440px); max-height: min(90vh, 720px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 22px 80px rgba(29,25,51,.25); animation: modalIn .18s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 21px 22px 15px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #f1eff3; }
.modal-head h2 { margin: 0 0 5px; font-size: 16px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 9px; background: #f6f5f8; color: #858392; font-size: 17px; }
.modal-body { padding: 18px 22px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 11px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 10px; font-weight: 800; color: #6d6a79; }
.form-field input, .form-field select { width: 100%; height: 40px; border: 1px solid #eae8ef; border-radius: 10px; padding: 0 11px; color: var(--ink); background: #fff; font-size: 11px; }
.form-field input::placeholder { color: #bebcc6; }
.amount-preview { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-radius: 11px; background: #f8f6ff; padding: 11px 13px; color: #89859a; font-size: 10px; }
.amount-preview strong { color: var(--purple); font-size: 14px; }
.form-error { grid-column: 1 / -1; color: #c95068; font-size: 10px; min-height: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.modal-actions .primary-btn, .modal-actions .secondary-btn { padding: 11px 16px; }

@media (max-width: 900px) {
  .topbar { padding: 0 22px; }
  #app { padding-left: 22px; padding-right: 22px; }
  .footer { padding-left: 22px; padding-right: 22px; }
  .brand, .topbar-end { min-width: 160px; }
  .boss-grid { grid-template-columns: minmax(0,1fr); }
  .friend-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .friend-order:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 16px 0; flex-wrap: wrap; gap: 10px; }
  .brand { min-width: 0; gap: 8px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 12px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 7px; }
  .topbar-end { min-width: auto; }
  .user-chip { height: 35px; border: 0; background: transparent; padding: 2px; gap: 6px; }
  .user-avatar { width: 28px; height: 28px; }
  .user-name, .chevron, .desktop-only { display: none; }
  .role-switch { order: 3; width: 100%; border-radius: 12px; }
  .role-btn { flex: 1; justify-content: center; padding: 8px 10px; }
  #app { padding: 22px 15px 35px; }
  .page-head { align-items: flex-start; flex-direction: column; margin: 3px 0 20px; gap: 14px; }
  h1 { font-size: 25px; }
  .page-head p { font-size: 11px; line-height: 1.6; }
  .head-actions { width: 100%; }
  .head-actions .primary-btn { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
  .stat-card { min-height: 113px; border-radius: 15px; padding: 15px; }
  .stat-card.primary-stat { grid-column: 1 / -1; min-height: 126px; padding: 17px 18px; }
  .stat-value { font-size: 24px; margin: 12px 0 5px; }
  .stat-icon { top: 13px; right: 13px; width: 29px; height: 29px; border-radius: 9px; }
  .boss-grid { gap: 12px; }
  .panel { border-radius: 16px; }
  .panel-inner { padding: 16px 15px; }
  .panel-head { margin-bottom: 13px; }
  .chart-card { margin-bottom: 12px; }
  .chart-area { height: 139px; }
  .friend-list { grid-template-columns: 1fr; }
  .friend-order:last-child { grid-column: auto; }
  .friend-title { font-size: 10px; }
  .friend-action small { max-width: 60%; line-height: 1.45; }
  .ledger-panel { margin-top: 12px; }
  .ledger-tools { align-items: stretch; flex-direction: column; }
  .filter-tabs { overflow: auto; width: 100%; }
  .filter-tab { flex: 1; white-space: nowrap; padding: 8px 8px; }
  .search-box { width: 100%; max-width: none; }
  .order-row { grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 10px; }
  .order-row .status-pill { grid-column: 1; grid-row: 2; justify-self: start; margin-left: 41px; }
  .order-row .row-action { grid-column: 2; grid-row: 2; justify-self: end; }
  .order-row .order-price { grid-column: 2; grid-row: 1; justify-self: end; padding-right: 24px; }
  .footer { padding: 0 16px 17px; }
  .mobile-reset { display: block; }
  .player-hero { padding: 22px 19px; border-radius: 18px; margin-bottom: 12px; }
  .player-hero:after { right: -30%; top: -90px; }
  .player-hero h1 { font-size: 26px; max-width: 330px; }
  .mobile-only-break { display: initial; }
  .player-hero p { font-size: 11px; line-height: 1.6; max-width: 290px; }
  .player-hero .primary-btn { margin-top: 15px; }
  .player-stats { gap: 8px; margin-bottom: 12px; }
  .player-stats .stat-card { min-height: 92px; padding: 12px; }
  .player-stats .stat-value { font-size: 20px; }
  .player-stats .stat-label { font-size: 9px; }
  .player-grid { grid-template-columns: 1fr; gap: 12px; }
  .request-card { padding: 12px; gap: 9px; }
  .footer { font-size: 8px; }
  .toast-region { bottom: 18px; width: calc(100% - 30px); justify-items: center; }
  .toast { max-width: 100%; text-align: center; }
  .modal-root { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 91vh; border-radius: 20px 20px 0 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .modal-head { padding: 19px 18px 14px; }
  .modal-body { padding: 16px 18px 20px; }
}
@media (max-width: 370px) {
  .role-btn { font-size: 11px; }
  .role-btn { padding-inline: 6px; }
  .order-name strong { max-width: 160px; }
  .filter-tab { font-size: 8px; padding-inline: 6px; }
}
