@font-face {
  font-family: BitPoolDisplay;
  src: url('/pool/css/Montserrat-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg: #070908;
  --bg-soft: #0b0e0c;
  --surface: #101411;
  --surface-raised: #151a17;
  --surface-hover: #1a211d;
  --line: rgba(228, 238, 232, .10);
  --line-strong: rgba(228, 238, 232, .17);
  --text: #f5f7f5;
  --text-soft: #c9d0cc;
  --muted: #89948e;
  --green: #68d391;
  --green-bright: #8be3aa;
  --green-deep: #173b28;
  --gold: #d9b45d;
  --red: #f07d73;
  --blue: #76afe0;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .18);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, .44);
  --font-body: 'DM Sans', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: Manrope, 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; letter-spacing: 0; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; z-index: -1; inset: 0; pointer-events: none; background: radial-gradient(circle at 88% 5%, rgba(74, 150, 103, .08), transparent 30%); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, strong { font-family: var(--font-heading); }

.loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 2px solid var(--line-strong); border-top-color: var(--green); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.85); } }

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-heading); font-size: 17px; font-weight: 800; letter-spacing: 0; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(0, 255, 159, .12)); }

.landing { min-height: 100vh; background: var(--bg); }
.landing-hero { min-height: min(88vh, 860px); position: relative; display: flex; align-items: flex-end; overflow: hidden; background: url('/pool/sprites/pool_table.png') calc(100% + 190px) 47%/min(76vw, 1040px) auto no-repeat, #0c100e url('/pool/sprites/bg_game.jpg') center/cover no-repeat; }
.landing-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,6,5,.98) 0%, rgba(4,6,5,.86) 38%, rgba(4,6,5,.24) 74%), linear-gradient(0deg, var(--bg), transparent 36%); }
.landing-nav { position: absolute; z-index: 2; inset: 0 0 auto; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1220px)/2)); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.landing-actions, .hero-actions { display: flex; gap: 10px; }
.hero-copy { position: relative; z-index: 1; width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 12vh; }
.eyebrow, .topbar-kicker, .sidebar-label { color: var(--green); font-family: var(--font-heading); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.hero-copy h1 { margin: 18px 0 22px; max-width: 700px; font-family: BitPoolDisplay, var(--font-heading); font-size: clamp(64px, 9vw, 124px); line-height: .84; }
.hero-copy p { max-width: 570px; margin: 0 0 30px; color: var(--text-soft); font-size: 19px; line-height: 1.6; }
.landing-band { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 68px 0 96px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px; }
.landing-point { position: relative; border-top: 1px solid var(--line-strong); padding: 25px 0 0 22px; }
.landing-point::before { content: ''; position: absolute; top: 25px; left: 0; width: 2px; height: 34px; background: var(--green); }
.landing-point strong { display: block; margin-bottom: 9px; font-size: 17px; }
.landing-point p { margin: 0; color: var(--muted); line-height: 1.65; }

.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 0 18px; background: var(--green); color: #07120b; box-shadow: 0 6px 20px rgba(104,211,145,.10); font-family: var(--font-heading); font-weight: 800; transition: background .18s, border-color .18s, transform .18s, color .18s; }
.btn:hover { background: var(--green-bright); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .42; transform: none; }
.btn-secondary { background: var(--surface-hover); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn-secondary:hover { background: #222a25; border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.04); color: var(--text); }
.btn-danger { background: transparent; color: #ffaaa3; border-color: rgba(240,125,115,.28); box-shadow: none; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(410px, 520px) 1fr; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 7vw, 84px); background: #0c100e; border-right: 1px solid var(--line); }
.auth-panel .brand { margin-bottom: 72px; }
.auth-panel h1 { margin: 0 0 10px; max-width: 380px; font-size: 38px; line-height: 1.15; }
.auth-panel > p { margin: 0 0 32px; color: var(--muted); line-height: 1.65; }
.auth-visual { min-height: 520px; background: #111 url('/pool/sprites/pool_table.png') center 42%/92% auto no-repeat, url('/pool/sprites/bg_game.jpg') center/cover; position: relative; overflow: hidden; }
.auth-visual::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,8,6,.86), transparent 65%); }
.auth-visual::after { content: 'POOL. WITH STAKES.'; position: absolute; left: 7%; bottom: 7%; max-width: 620px; font: 900 clamp(44px, 6vw, 86px)/.94 BitPoolDisplay; }
.auth-switch { margin-top: 25px; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--green); font-weight: 700; }
.google-auth { width: 100%; min-height: 52px; display: grid; grid-template-columns: 24px 1fr 18px; align-items: center; gap: 12px; margin-bottom: 20px; padding: 0 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; background: #f5f7f6; color: #161a18; box-shadow: 0 9px 28px rgba(0,0,0,.2); font-family: var(--font-heading); font-weight: 750; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.google-auth:hover { transform: translateY(-1px); border-color: #fff; background: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.28); }
.google-auth:active { transform: translateY(0); }
.google-auth:focus-visible { outline: 3px solid rgba(104,211,145,.28); outline-offset: 2px; }
.google-auth:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; transform: none; }
.google-auth i { color: #66706a; font-family: var(--font-body); font-size: 14px; font-style: normal; }
.google-mark { width: 20px; height: 20px; }
.auth-divider { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; color: #68736c; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-divider span { white-space: nowrap; }
.auth-error { margin-bottom: 18px; }

.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 8px; }
.field label { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.input, .select, .textarea { width: 100%; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 6px; background: #090c0a; color: var(--text); padding: 0 14px; outline: 0; transition: border-color .18s, box-shadow .18s, background .18s; }
.textarea { min-height: 110px; padding-top: 13px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { background: #0c100e; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(104,211,145,.7); box-shadow: 0 0 0 3px rgba(104,211,145,.09); }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-error { border: 1px solid rgba(240,125,115,.3); background: rgba(240,125,115,.07); color: #ffc0bb; border-radius: 6px; padding: 11px 13px; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 27px 18px 20px; border-right: 1px solid var(--line); background: #0a0d0b; }
.sidebar .brand { padding: 0 10px 36px; }
.sidebar-label { margin: 0 11px 10px; color: #536059; font-size: 9px; }
.nav-list { display: grid; gap: 3px; }
.nav-link { position: relative; min-height: 43px; display: flex; align-items: center; border-radius: 5px; padding: 0 12px; color: #949e98; font-size: 13px; font-weight: 600; transition: background .18s, color .18s, padding .18s; }
.nav-link::before { content: ''; width: 3px; height: 3px; margin-right: 11px; border-radius: 50%; background: #455048; transition: .18s; }
.nav-link:hover { background: rgba(255,255,255,.025); color: var(--text); padding-left: 15px; }
.nav-link.active { background: #151b17; color: var(--text); }
.nav-link.active::before { width: 7px; height: 7px; background: var(--green); box-shadow: 0 0 12px rgba(104,211,145,.7); }
.sidebar-user { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 8px 0; display: flex; align-items: center; gap: 11px; }
.profile-chevron { margin-left: auto; color: #55615a; font-size: 20px; }
.app-main { min-width: 0; }
.topbar { position: sticky; z-index: 10; top: 0; height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(22px, 4vw, 50px); border-bottom: 1px solid var(--line); background: rgba(7,9,8,.86); backdrop-filter: blur(18px); }
.topbar-kicker { margin-bottom: 3px; color: #59645e; font-size: 8px; }
.topbar-title { font-family: var(--font-heading); font-size: 16px; font-weight: 750; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.balance-pill { min-height: 38px; display: inline-flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); color: var(--gold); font-family: var(--font-heading); font-size: 12px; font-weight: 800; }
.balance-pill span { color: var(--muted); font: 500 10px var(--font-body); }
.match-ready-link { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border-radius: 6px; background: var(--green); color: #06100a; font-family: var(--font-heading); font-size: 11px; font-weight: 800; }
.live-pip { width: 6px; height: 6px; border-radius: 50%; background: #092010; animation: pulse 1.4s infinite; }
.topbar-profile { display: block; }
.notification-link { position: relative; }
.chat-link { position: relative; }
.chat-icon { position: relative; width: 17px; height: 13px; border: 1.5px solid currentColor; border-radius: 4px; }
.chat-icon::after { content: ''; position: absolute; left: 3px; bottom: -4px; width: 5px; height: 5px; border-left: 1.5px solid currentColor; transform: skewY(-38deg); }
.icon-count { position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--bg); border-radius: 9px; padding: 0 4px; background: var(--red); color: #170706; font-size: 9px; }
.icon-count[hidden] { display: none; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 2px solid var(--surface); background: var(--red); border-radius: 50%; box-sizing: content-box; }
.bell-icon { width: 14px; height: 14px; display: block; border: 1.5px solid currentColor; border-radius: 7px 7px 4px 4px; border-bottom: 0; opacity: .8; }
.page { width: min(1240px, 100%); margin: 0 auto; padding: 38px clamp(22px, 4vw, 50px) 104px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header h1 { margin: 0; font-size: clamp(29px, 3vw, 40px); line-height: 1.1; }
.page-header p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.section { margin-top: 42px; }
.section-heading { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.text-link { color: var(--green); font-size: 12px; font-weight: 700; }

.lobby-hero { min-height: 280px; display: grid; align-items: end; position: relative; overflow: hidden; padding: 36px; background: linear-gradient(90deg, #101512 0%, rgba(16,21,18,.97) 39%, rgba(16,21,18,.32) 68%, rgba(16,21,18,.08) 100%), url('/pool/sprites/pool_table.png') calc(100% + 70px) 43%/70% auto no-repeat, #111713; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.lobby-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 58%, rgba(4,7,5,.24)); pointer-events: none; }
.lobby-hero::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--green); }
.lobby-hero-content { position: relative; z-index: 1; max-width: 620px; }
.lobby-hero h1 { margin: 9px 0 11px; font-size: clamp(34px, 4.2vw, 52px); line-height: 1.04; }
.lobby-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.quick-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 27px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-title { margin: 0; font-size: 15px; }
.card-muted { color: var(--muted); font-size: 12px; }
.challenge-card { padding: 18px; display: grid; gap: 17px; transition: border-color .18s, transform .18s, background .18s; }
.challenge-card:hover { border-color: var(--line-strong); background: var(--surface-raised); transform: translateY(-2px); }
.active-match-card { min-height: 92px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 17px; border-color: rgba(104,211,145,.32); background: linear-gradient(110deg, #101612, #111512); }
.active-match-score { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.active-match-score strong { color: var(--gold); font-size: 21px; }
.challenge-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(104,211,145,.18); border-radius: 50%; background: #14241a; color: var(--green-bright); font: 800 12px var(--font-heading); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 78px; height: 78px; font-size: 21px; }
.onboarding-panel { text-align: left; }
.onboarding-form { margin-top: 24px; }
.avatar-picker { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.avatar-preview { width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(104,211,145,.3); border-radius: 50%; background: #14241a; color: var(--green-bright); font: 800 23px var(--font-heading); box-shadow: 0 0 0 5px rgba(104,211,145,.045); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker p { margin: 5px 0 12px; color: var(--muted); font-size: 12px; }
.avatar-upload { cursor: pointer; }
.avatar-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.player-name { min-width: 0; }
.player-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.player-name span { color: var(--muted); font-size: 11px; }
.challenge-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.meta-block { padding: 11px; border: 1px solid rgba(255,255,255,.035); border-radius: 5px; background: #0c100e; }
.meta-block span { display: block; color: #66716b; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.meta-block strong { display: block; margin-top: 5px; font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 19px; }
.filter { min-height: 35px; border: 1px solid var(--line); border-radius: 5px; padding: 0 13px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter.active { border-color: rgba(104,211,145,.32); background: rgba(104,211,145,.1); color: var(--green-bright); }

.stat-card { position: relative; overflow: hidden; padding: 20px; }
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; width: 38px; height: 1px; background: var(--green); opacity: .6; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 10px; font-size: 27px; }
.status { min-height: 23px; display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 12px; padding: 0 8px; background: var(--surface-hover); color: var(--muted); font-size: 10px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.status-open, .status-registration { border-color: rgba(104,211,145,.16); background: rgba(104,211,145,.08); color: var(--green-bright); }
.status-live, .status-in_progress { border-color: rgba(240,125,115,.15); background: rgba(240,125,115,.07); color: #f5a49d; }
.status-completed { border-color: rgba(118,175,224,.15); background: rgba(118,175,224,.07); color: #a8cff0; }

.list { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.list-row { min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 17px; background: transparent; border-bottom: 1px solid var(--line); transition: background .16s; }
.list-row:hover { background: rgba(255,255,255,.018); }
.list-row:last-child { border-bottom: 0; }
.notification-row { width: 100%; border-width: 0 0 1px; color: var(--text); text-align: left; }
.clubhouse-chat .section-heading h2 { margin-top: 4px; }
.chat-panel { overflow: hidden; }
.chat-feed { height: 440px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 18px; scrollbar-color: #354139 transparent; }
.chat-message { min-height: 72px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.chat-message:last-child { border-bottom: 0; }
.chat-message .avatar { width: 34px; height: 34px; }
.chat-message-body { min-width: 0; }
.chat-message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-message-head time, .dm-message time { color: #66716b; font-size: 10px; white-space: nowrap; }
.chat-message p { margin: 6px 0 0; color: var(--text-soft); line-height: 1.5; overflow-wrap: anywhere; }
.chat-user { position: relative; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.chat-user::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #435048; }
.chat-user.is-online::before { background: var(--green); box-shadow: 0 0 8px rgba(104,211,145,.6); }
.chat-user-actions { position: absolute; z-index: 4; top: calc(100% + 7px); left: 0; min-width: 220px; display: none; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #171d19; box-shadow: var(--shadow-lg); }
.chat-user:hover .chat-user-actions, .chat-user:focus-within .chat-user-actions { display: grid; }
.chat-user-actions a, .chat-user-actions button { min-height: 34px; display: grid; place-items: center; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.chat-user-actions :last-child { border-right: 0; }
.chat-user-actions a:hover, .chat-user-actions button:hover { background: var(--surface-hover); color: var(--green-bright); }
.chat-event { min-height: 70px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 10px 0; padding: 13px; border: 1px solid rgba(104,211,145,.13); border-left: 2px solid var(--green); border-radius: 6px; background: rgba(104,211,145,.035); }
.chat-event > .avatar { width: 36px; height: 36px; }
.chat-event-title { color: var(--text-soft); font-size: 13px; }
.chat-event-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.chat-composer { min-height: 72px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: #0c100e; }
.chat-composer .input { min-height: 44px; }
.chat-empty { min-height: 150px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 28px; }
.conversation-list { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.conversation-row { min-height: 76px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.conversation-row:last-child { border-bottom: 0; }
.conversation-row:hover { background: rgba(255,255,255,.018); }
.conversation-row .player-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row > b { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: #07120b; font-size: 10px; }
.conversation-unread { background: rgba(104,211,145,.035); }
.chat-directory-row { width: 100%; grid-template-columns: 34px minmax(0, 1fr) auto; border: 0; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; }
.chat-directory-row:last-child { border-bottom: 0; }
.chat-directory-row .avatar { width: 34px; height: 34px; }
.chat-directory-row span { display: grid; gap: 3px; }
.chat-directory-row small { color: var(--muted); }
.chat-directory-row > b { color: var(--green); font-size: 10px; }
.dm-page { max-width: 980px; margin: 0 auto; }
.dm-header { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 20px; }
.dm-header h1 { margin: 0 0 4px; font-size: 24px; }
.dm-header span { color: var(--muted); font-size: 12px; }
.dm-shell { overflow: hidden; }
.dm-thread { height: min(62vh, 650px); overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: end; gap: 9px; padding: 24px; }
.dm-message { display: flex; justify-content: flex-start; }
.dm-message > div { max-width: min(72%, 560px); padding: 11px 13px 8px; border: 1px solid var(--line); border-radius: 7px 7px 7px 2px; background: var(--surface-raised); }
.dm-message p { margin: 0; color: var(--text-soft); line-height: 1.5; overflow-wrap: anywhere; }
.dm-message time { display: block; margin-top: 5px; }
.dm-own { justify-content: flex-end; }
.dm-own > div { border-color: rgba(104,211,145,.18); border-radius: 7px 7px 2px 7px; background: rgba(104,211,145,.09); }
.leaderboard-row { grid-template-columns: 40px minmax(0, 1fr) 90px 80px; }
.rank-number { color: var(--gold); font: 800 13px var(--font-heading); }
.empty { min-height: 190px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--muted); padding: 28px; background: rgba(255,255,255,.012); }
.empty strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 15px; }
.skeleton { height: 120px; border-radius: 7px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-raised) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.match-stage { min-height: calc(100vh - 155px); display: grid; place-items: center; text-align: center; }
.versus { width: min(790px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(circle at 50% 30%, rgba(104,211,145,.07), transparent 38%), var(--surface); box-shadow: var(--shadow-lg); }
.versus > h1 { margin: 12px 0 0; font-size: 40px; }
.versus-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; margin: 36px 0; }
.versus-player { display: grid; justify-items: center; gap: 9px; }
.series-score { min-width: 38px; color: var(--gold); font: 800 25px var(--font-heading); }
.versus-mark { color: var(--gold); font: 900 22px BitPoolDisplay; }
.result-brand { width: 86px; height: 86px; margin: 0 auto 16px; object-fit: contain; filter: drop-shadow(0 12px 28px rgba(0, 255, 159, .14)); }
.match-details { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px 25px; color: var(--muted); font-size: 12px; }

.tournament-card { overflow: hidden; transition: transform .18s, border-color .18s; }
.tournament-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tournament-art { height: 124px; background: #0d120f url('/pool/sprites/pool_table.png') center 39%/92% auto no-repeat; border-bottom: 1px solid var(--line); }
.progress { height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-hover); }
.progress span { display: block; height: 100%; background: var(--green); }
.bracket { display: flex; gap: 18px; overflow-x: auto; padding: 12px 2px 26px; }
.bracket-round { flex: 0 0 230px; display: grid; align-content: center; gap: 13px; }
.bracket-round h3 { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.bracket-match { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.bracket-current { border-color: rgba(104,211,145,.48); box-shadow: 0 0 0 1px rgba(104,211,145,.1); }
.bracket-player { display: flex; justify-content: space-between; padding: 11px; border-bottom: 1px solid var(--line); font-size: 12px; }
.bracket-player:last-child { border-bottom: 0; }

.wallet-balance { position: relative; overflow: hidden; padding: 32px; border-bottom: 1px solid var(--line); }
.wallet-balance::after { content: '8'; position: absolute; right: 35px; top: -30px; color: rgba(104,211,145,.045); font: 900 180px BitPoolDisplay; }
.wallet-balance > span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.wallet-balance > strong { position: relative; z-index: 1; display: block; margin: 8px 0 21px; font-size: clamp(42px, 6vw, 66px); }
.wallet-breakdown { position: relative; z-index: 1; display: flex; gap: 34px; }
.wallet-breakdown div span { display: block; color: var(--muted); font-size: 10px; }
.wallet-breakdown div strong { font-size: 15px; }
.admin-user-row, .admin-withdrawal { min-height: 76px; }
.demo-notice { padding: 13px 15px; border: 1px solid rgba(217,180,93,.22); background: rgba(217,180,93,.055); color: #dfcc9f; border-radius: 6px; font-size: 12px; line-height: 1.5; }

.profile-hero { display: flex; align-items: center; gap: 21px; padding: 27px; background: linear-gradient(110deg, #131814, #0f1310); }
.profile-actions { margin-left: auto; display: flex; gap: 8px; }
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 680px); gap: 30px; }
.settings-menu { display: grid; align-content: start; gap: 4px; }
.toggle-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.toggle { width: 42px; height: 23px; padding: 2px; border: 0; border-radius: 12px; background: #242b27; }
.toggle::after { content: ''; display: block; width: 19px; height: 19px; border-radius: 50%; background: #77817b; transition: .2s; }
.toggle.on { background: var(--green-deep); }
.toggle.on::after { transform: translateX(19px); background: var(--green); }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.78); backdrop-filter: blur(7px); }
.modal { width: min(500px, 100%); max-height: 88vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: 8px; background: #111512; box-shadow: var(--shadow-lg); }
.modal-header, .modal-body, .modal-footer { padding: 20px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.025); color: var(--text-soft); }
.toast-root { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { max-width: 370px; padding: 14px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--green); border-radius: 6px; background: #151a17; box-shadow: var(--shadow-lg); font-size: 13px; }
.toast.error { border-left-color: var(--red); }
.mobile-nav { display: none; }

@media (max-width: 1040px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar .brand-name, .sidebar-label, .nav-link span, .sidebar-user .player-name, .profile-chevron { display: none; }
  .sidebar .brand { justify-content: center; padding-inline: 0; }
  .nav-link { justify-content: center; padding: 0; }
  .nav-link::before { width: 6px; height: 6px; margin: 0; }
  .nav-link:hover { padding-left: 0; }
  .sidebar-user { justify-content: center; padding-inline: 0; }
  .chat-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .landing-nav { height: 66px; padding: 0 18px; }
  .landing-nav .btn-ghost { display: none; }
  .landing-hero { min-height: 780px; background-position: 61% 19%, center; background-size: 155% auto, cover; }
  .landing-hero::before { background: linear-gradient(0deg, rgba(5,8,6,.99) 8%, rgba(5,8,6,.72) 62%, rgba(5,8,6,.30) 100%); }
  .hero-copy { width: calc(100% - 36px); padding-bottom: 66px; }
  .hero-copy h1 { font-size: 58px; }
  .hero-copy p { font-size: 16px; }
  .landing-band { width: calc(100% - 36px); grid-template-columns: 1fr; padding: 46px 0 76px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-panel { min-height: 100vh; padding: 28px 20px 80px; }
  .auth-panel .brand { margin-bottom: 48px; }
  .auth-visual { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 64px; padding: 0 15px; }
  .topbar-kicker { display: none; }
  .topbar-title { font-size: 14px; }
  .balance-pill { display: none; }
  .match-ready-link { min-height: 34px; padding-inline: 10px; }
  .topbar-profile { display: none; }
  .page { padding: 24px 15px 94px; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }
  .lobby-hero { min-height: 330px; margin: -24px -15px 0; padding: 25px 17px 30px; border-width: 0 0 1px; border-radius: 0; background: linear-gradient(0deg, #101512 10%, rgba(16,21,18,.91) 32%, rgba(16,21,18,.18) 78%), url('/pool/sprites/pool_table.png') 72% 9%/130% auto no-repeat, #111713; }
  .lobby-hero::before { background: none; }
  .lobby-hero h1 { font-size: 35px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .challenge-meta { grid-template-columns: repeat(3, 1fr); }
  .active-match-card { grid-template-columns: minmax(0, 1fr) auto; }
  .active-match-score { display: none; }
  .leaderboard-row { grid-template-columns: 30px minmax(0, 1fr) 60px; }
  .leaderboard-row > :last-child { display: none; }
  .versus { padding: 26px 16px; border: 0; background-color: transparent; box-shadow: none; }
  .versus-players { gap: 10px; }
  .match-details { display: grid; gap: 8px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-menu { display: none; }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; }
  .profile-actions { width: 100%; margin: 4px 0 0; }
  .chat-feed { height: 390px; padding-inline: 12px; }
  .chat-event { grid-template-columns: 32px minmax(0, 1fr); }
  .chat-event > :last-child { grid-column: 2; justify-self: start; }
  .chat-composer { grid-template-columns: minmax(0, 1fr) auto; padding: 10px; }
  .chat-composer .btn { min-width: 68px; padding-inline: 12px; }
  .chat-user-actions { position: static; min-width: 0; margin-top: 5px; }
  .chat-user .chat-user-actions { display: grid; }
  .dm-header { grid-template-columns: 46px minmax(0, 1fr); }
  .dm-header .quick-actions { grid-column: 1 / -1; }
  .dm-thread { height: 56vh; padding: 14px 11px; }
  .dm-message > div { max-width: 86%; }
  .avatar-picker { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .avatar-preview { width: 72px; height: 72px; }
  .mobile-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: 70px; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: rgba(10,13,11,.98); backdrop-filter: blur(18px); }
  .mobile-nav a { display: grid; place-items: center; color: var(--muted); font-size: 9px; font-weight: 700; }
  .mobile-nav a.active { color: var(--green); }
  .mobile-nav .play-link { align-self: center; justify-self: center; width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: #07110b; font-size: 10px; box-shadow: 0 8px 24px rgba(104,211,145,.2); }
  .toast-root { left: 12px; right: 12px; bottom: 82px; }
  .toast { max-width: none; }
}
