/* ============ eFoot Arena — design system ============ */
:root {
  --bg: #060a14;
  --bg2: #0a1120;
  --panel: #0e1626;
  --panel2: #131d33;
  --panel3: #182b43;
  --line: rgba(110, 165, 255, 0.14);
  --line2: rgba(110, 165, 255, 0.28);
  --txt: #e9effc;
  --muted: #8fa2c4;
  --dim: #5f7296;
  --cyan: #00e5ff;
  --cyan-d: #0aa8c9;
  --gold: #ffc24b;
  --gold-d: #d99a1f;
  --red: #ff4d5e;
  --green: #2ee6a8;
  --purple: #a78bfa;
  --blue: #4d9fff;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(0, 229, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(77, 159, 255, 0.07), transparent 55%),
    var(--bg);
  color: var(--txt);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(0, 229, 255, 0.3); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #223352; border-radius: 6px; border: 2px solid var(--bg2); }

/* ============ layout ============ */
#app { display: flex; flex-direction: column; min-height: 100vh; }
.view { flex: 1; width: 100%; max-width: 1220px; margin: 0 auto; padding: 22px 20px 60px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 13, 24, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1220px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-ball {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(135deg, #00e5ff, #0a58ca);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.55);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.5px; }
.brand-name span { color: var(--cyan); margin-left: 3px; }

.mainnav { display: flex; gap: 4px; margin-left: 8px; }
.mainnav a {
  padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14.5px;
  color: var(--muted); transition: all 0.15s;
}
.mainnav a:hover { color: var(--txt); background: rgba(255, 255, 255, 0.05); }
.mainnav a.active { color: var(--cyan); background: rgba(0, 229, 255, 0.1); box-shadow: inset 0 -2px 0 var(--cyan); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 1; transition: all 0.15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-cyan { background: linear-gradient(135deg, #00e5ff, #00a6d8); color: #04121f; box-shadow: 0 4px 16px rgba(0, 229, 255, 0.35); }
.btn-cyan:hover { filter: brightness(1.1); }
.btn-gold { background: linear-gradient(135deg, #ffd76a, #e8a32a); color: #231703; box-shadow: 0 4px 16px rgba(255, 194, 75, 0.3); }
.btn-gold:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: var(--line2); color: var(--txt); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-red { background: linear-gradient(135deg, #ff4d5e, #d82f43); color: #fff; }
.btn-red:hover { filter: brightness(1.08); }
.btn-green { background: linear-gradient(135deg, #2ee6a8, #12b07a); color: #03231a; }
.btn-green:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-block { width: 100%; }

/* ============ badges / chips ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.badge-cyan { background: rgba(0, 229, 255, 0.12); color: var(--cyan); border: 1px solid rgba(0, 229, 255, 0.35); }
.badge-gold { background: rgba(255, 194, 75, 0.12); color: var(--gold); border: 1px solid rgba(255, 194, 75, 0.35); }
.badge-red { background: rgba(255, 77, 94, 0.12); color: var(--red); border: 1px solid rgba(255, 77, 94, 0.35); }
.badge-green { background: rgba(46, 230, 168, 0.12); color: var(--green); border: 1px solid rgba(46, 230, 168, 0.35); }
.badge-purple { background: rgba(167, 139, 250, 0.12); color: var(--purple); border: 1px solid rgba(167, 139, 250, 0.35); }
.badge-blue { background: rgba(77, 159, 255, 0.12); color: var(--blue); border: 1px solid rgba(77, 159, 255, 0.35); }
.badge-dim { background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
}
.chip.on { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 229, 255, 0.08); }

/* ============ cards ============ */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px;
}
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.4px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.5px; margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .sub { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 500; }

/* ============ hero ============ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid rgba(0, 229, 255, 0.25);
  background:
    radial-gradient(700px 300px at 80% -20%, rgba(0, 229, 255, 0.25), transparent 60%),
    radial-gradient(500px 300px at 10% 120%, rgba(77, 159, 255, 0.18), transparent 60%),
    linear-gradient(120deg, #0b1428, #0d1c38 55%, #0a1222);
  padding: 44px 40px;
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 30px; align-items: center;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(600px 300px at 70% 30%, black, transparent);
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.05; letter-spacing: 0.5px; position: relative; z-index: 1;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #00e5ff, #7c9dff, #ffc24b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin: 14px 0 22px; max-width: 520px; font-size: 15.5px; line-height: 1.6; position: relative; z-index: 1; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stat b { font-family: var(--font-display); font-size: 24px; color: var(--cyan); display: block; }
.hero-stat span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.hero-icon { position: relative; z-index: 1; display: flex; justify-content: center; }
.hero-icon .cover-img { width: min(200px, 100%); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12); transform: rotate(2deg); }

/* iconic player cards */
.icon-card {
  width: 150px; border-radius: 14px; text-align: center; overflow: hidden;
  background: linear-gradient(165deg, var(--c1), var(--c2));
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff; position: relative; flex-shrink: 0;
  display: flex; flex-direction: column;
  transition: transform 0.2s;
}
.icon-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.05) 28%, rgba(255,255,255,0) 40%);
}
.icon-card:hover { transform: translateY(-4px) scale(1.02); }
.icon-card .ic-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 5px; }
.icon-card .ic-type { font-size: 9px; letter-spacing: 1.6px; font-weight: 800; opacity: 0.92; text-shadow: 0 1px 3px rgba(0,0,0,0.55); }
.icon-card .ic-ovr { background: rgba(0, 0, 0, 0.5); border-radius: 7px; padding: 2px 7px; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.icon-card .ic-face {
  position: relative; z-index: 2; width: calc(100% - 18px); aspect-ratio: 1 / 1; margin: 0 auto;
  border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.18); display: grid; place-items: center; font-size: 34px; font-weight: 800;
  font-family: var(--font-display); text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.icon-card .ic-face .face-img { transform: scale(1.1); }
.icon-card .ic-body { position: relative; z-index: 2; padding: 8px 10px 11px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.icon-card .ic-name { font-weight: 800; font-size: 13px; line-height: 1.2; text-shadow: 0 1px 4px rgba(0,0,0,0.5); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-card .ic-meta { font-size: 10.5px; opacity: 0.92; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-card .ic-pos { padding: 2px 9px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.icon-lg { width: 190px; }
.bracket-round .b-round-date { display: block; font-size: 10px; opacity: 0.6; font-weight: 600; margin-top: 2px; }
.champ-card { min-width: 150px; border-radius: 14px; padding: 14px 12px; text-align: center; cursor: pointer;
  background: linear-gradient(160deg, #f7d154, #c9900f); border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 10px 26px rgba(0,0,0,0.5); color: #231400; flex-shrink: 0; transition: transform 0.15s; }
.champ-card:hover { transform: translateY(-3px); }
.champ-trophy { font-size: 30px; }
.champ-name { font-weight: 800; font-size: 12px; margin-top: 6px; }
.champ-winner { font-weight: 800; font-size: 13px; background: rgba(0,0,0,0.2); border-radius: 8px; padding: 3px 10px; margin-top: 7px; display: inline-block; }
.champ-date { font-size: 10px; margin-top: 6px; }
.sched-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sched-label { font-weight: 700; font-size: 13px; }
.sched-input { max-width: 210px; }
.sched-auto { font-size: 11px; white-space: nowrap; }
@media (max-width: 600px) { .sched-row { grid-template-columns: 1fr; gap: 6px; } }
.sched-overview { padding: 14px 16px; }
.sched-ov-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.sched-ov-row:last-child { border-bottom: 0; }
.sched-ov-label { font-weight: 700; }
.sched-ov-dl { color: var(--muted); white-space: nowrap; }
.sched-ov-cd { color: var(--cyan); }
@media (max-width: 600px) { .sched-ov-row { grid-template-columns: 1fr auto; } .sched-ov-dl { display: none; } }
.icon-lg .ic-face { width: 96px; height: 96px; font-size: 44px; }

.icon-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 14px; }

/* ============ grids ============ */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.grid-tourney { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ============ room card ============ */
.room-card { position: relative; transition: transform 0.15s, border-color 0.15s; cursor: pointer; }
.room-card:hover { transform: translateY(-3px); border-color: var(--line2); }
.room-card .rc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-card h3 { font-family: var(--font-display); font-size: 17px; margin: 10px 0 4px; letter-spacing: 0.3px; }
.room-card .rc-host { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.room-card .rc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.seats { margin-top: 4px; }
.seats .seats-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.seats .seat-label { width: 92px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.seats .seat-avatars { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; min-height: 30px; align-items: center; }
.seats .seat-empty { width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed var(--line2); display: grid; place-items: center; color: var(--dim); font-size: 13px; }
.seat-avatar { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; border: 2px solid rgba(255,255,255,0.55); background: linear-gradient(135deg, var(--c1), var(--c2)); }
.seat-avatar .ready-dot { position: absolute; bottom: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); }
.seat-avatar .ready-dot.yes { background: var(--green); }
.seat-avatar .ready-dot.no { background: var(--dim); }
.seat-avatar.bot-avatar::after { content: "🤖"; position: absolute; top: -7px; right: -7px; font-size: 11px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }

.bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue)); border-radius: 99px; transition: width 0.4s; }

/* ============ forms ============ */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 5px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line2); color: var(--txt);
  font-size: 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15); }
input::placeholder, textarea::placeholder { color: var(--dim); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.range-wrap { display: flex; align-items: center; gap: 14px; }
input[type="range"] { flex: 1; padding: 0; background: transparent; border: none; accent-color: var(--cyan); }
.range-val { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--cyan); min-width: 60px; text-align: center; }
.form-error { background: rgba(255, 77, 94, 0.1); border: 1px solid rgba(255, 77, 94, 0.4); color: var(--red); padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; display: none; }
.form-error.show { display: block; }

.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.avatar-pick .ap-item { cursor: pointer; text-align: center; border-radius: 10px; padding: 7px 4px; border: 2px solid var(--line); transition: all 0.12s; background: var(--panel2); }
.avatar-pick .ap-item:hover { border-color: var(--line2); }
.avatar-pick .ap-item.sel { border-color: var(--cyan); background: rgba(0, 229, 255, 0.08); box-shadow: 0 0 0 3px rgba(0,229,255,0.15); }
.avatar-pick .ap-ic { width: 42px; height: 42px; margin: 0 auto 5px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.avatar-pick .ap-name { font-size: 10px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.face-fb { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-weight: 800; line-height: 1; }
img.face-img + .face-fb { display: none; }
.ap-ovr { color: var(--gold); font-size: 10px; }

/* ============ avatars / user chips ============ */
.user-chip { display: flex; align-items: center; gap: 9px; }
.mini-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); border: 2px solid rgba(255,255,255,0.4); }
.mini-av.sm { width: 26px; height: 26px; font-size: 11px; }
.user-chip .uc-name { font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.user-chip .uc-sub { font-size: 11.5px; color: var(--muted); }

/* ============ tables / standings ============ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 520px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); padding: 11px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); font-weight: 700; }
.tbl td { padding: 10px 12px; font-size: 13.5px; border-bottom: 1px solid rgba(110,165,255,0.07); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(0, 229, 255, 0.03); }
.tbl .rank { font-family: var(--font-display); font-weight: 700; width: 42px; color: var(--muted); }
.tbl .rank.r1 { color: var(--gold); }
.tbl .rank.r2 { color: #cfd6e6; }
.tbl .rank.r3 { color: #c98a5a; }
.tbl .pts { font-weight: 800; color: var(--cyan); }
.tbl .team-cell { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.tbl .team-cell .tname { font-weight: 700; }
.tbl .team-cell .tovr { color: var(--dim); font-size: 12px; }
.pos-row { background: rgba(0, 229, 255, 0.07); }

/* ============ bracket ============ */
.bracket { display: flex; gap: 26px; overflow-x: auto; padding: 10px 2px 20px; }
.bracket-round { display: flex; flex-direction: column; gap: 18px; min-width: 220px; }
.bracket-round h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--dim); margin-bottom: 2px; text-align: center; }
.bmatch { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); overflow: hidden; }
.bmatch .bslot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; }
.bmatch .bslot + .bslot { border-top: 1px solid var(--line); }
.bmatch .bslot .bname { display: flex; align-items: center; gap: 7px; overflow: hidden; }
.bmatch .bslot .bname .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bmatch .bslot .bscore { font-family: var(--font-display); font-weight: 700; color: var(--muted); }
.bmatch .bslot.win { background: rgba(0, 229, 255, 0.09); }
.bmatch .bslot.win .bscore { color: var(--cyan); }
.bmatch .bslot.bye { opacity: 0.5; font-style: italic; }
.bmatch.pending { border-color: rgba(255, 194, 75, 0.5); }
.bmatch.you { box-shadow: 0 0 0 1.5px var(--gold); }

/* ============ chat ============ */
.chat-box { display: flex; flex-direction: column; height: 460px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.chat-box.sm { height: 340px; }
.chat-head { padding: 12px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; }
.chat-head .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 15px; display: flex; flex-direction: column; gap: 10px; }
.chat-msgs .empty { color: var(--dim); text-align: center; margin: auto; font-size: 13px; }
.msg { max-width: 78%; align-self: flex-start; }
.msg.own { align-self: flex-end; }
.msg .m-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 12px; }
.msg.own .m-head { flex-direction: row-reverse; }
.msg .m-author { font-weight: 700; color: var(--cyan); font-size: 12.5px; }
.msg .m-time { color: var(--dim); font-size: 10.5px; }
.msg .m-bubble { background: var(--panel2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 12px; border-top-left-radius: 4px; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.msg.own .m-bubble { background: rgba(0, 229, 255, 0.12); border-color: rgba(0, 229, 255, 0.35); border-radius: 12px; border-top-right-radius: 4px; }
.msg.sys .m-bubble { background: rgba(255, 194, 75, 0.08); border-color: rgba(255, 194, 75, 0.3); color: var(--gold); font-size: 12.5px; }
.msg .m-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.msg.bot .m-author::after { content: " 🤖"; font-size: 10px; }
.chat-input { display: flex; gap: 9px; padding: 11px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; }
.chat-input .btn { padding: 11px 16px; }

/* ============ feed ============ */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item { display: flex; gap: 12px; padding: 10px 4px; align-items: flex-start; }
.feed-item + .feed-item { border-top: 1px solid rgba(110,165,255,0.07); }
.feed-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.feed-ic.cyan { background: rgba(0,229,255,0.1); }
.feed-ic.gold { background: rgba(255,194,75,0.1); }
.feed-ic.red { background: rgba(255,77,94,0.1); }
.feed-ic.green { background: rgba(46,230,168,0.1); }
.feed-ic.purple { background: rgba(167,139,250,0.1); }
.feed-item .f-text { font-size: 13.5px; line-height: 1.45; }
.feed-item .f-time { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ============ notifications ============ */
.bell-wrap { position: relative; }
.bell-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); font-size: 17px; display: grid; place-items: center; position: relative;
}
.bell-btn:hover { border-color: var(--cyan); }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg);
}
.bell-panel {
  position: absolute; right: 0; top: 46px; width: 330px; max-height: 420px; overflow-y: auto;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; z-index: 60;
}
.bell-item { display: flex; gap: 10px; padding: 10px; border-radius: 9px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.bell-item:hover { background: rgba(255,255,255,0.05); }
.bell-item.unread { background: rgba(0, 229, 255, 0.06); }
.bell-item .b-time { color: var(--dim); font-size: 11px; }
.bell-item .b-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); margin-top: 5px; flex-shrink: 0; }
.bell-empty { color: var(--dim); text-align: center; padding: 22px 10px; font-size: 13px; }

/* ============ tournament card ============ */
.tourney-card { position: relative; overflow: hidden; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.tourney-card:hover { transform: translateY(-3px); border-color: var(--line2); }
.tourney-card .tc-banner {
  height: 84px; border-radius: 10px; margin-bottom: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, rgba(0,229,255,0.14), rgba(77,159,255,0.1));
  border: 1px solid var(--line);
}
.tourney-card .tc-banner.gold { background: linear-gradient(120deg, rgba(255,194,75,0.18), rgba(255,77,94,0.1)); }
.tourney-card h3 { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.3px; }
.tourney-card .tc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 9px 0 12px; }
.tourney-card .tc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.tourney-card .tc-foot .slots { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ============ tabs ============ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-weight: 700; font-size: 13.5px; transition: all 0.13s;
}
.tab-btn:hover { color: var(--txt); border-color: var(--line2); }
.tab-btn.active { background: linear-gradient(135deg, rgba(0,229,255,0.16), rgba(77,159,255,0.1)); border-color: var(--cyan); color: var(--cyan); }

/* ============ modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(3, 6, 13, 0.75); backdrop-filter: blur(5px); padding: 20px;
  animation: fadein 0.15s;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 24px;
}
.modal.wide { max-width: 700px; }
.modal h2 { font-family: var(--font-display); font-size: 21px; margin-bottom: 4px; letter-spacing: 0.4px; }
.modal .m-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.modal-close { position: sticky; float: right; top: 0; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 16px; }
.modal-close:hover { color: var(--red); border-color: var(--red); }

/* ============ toasts ============ */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--cyan);
  color: var(--txt); padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastin 0.2s; max-width: 420px; text-align: center;
}
.toast.gold { border-left-color: var(--gold); }
.toast.red { border-left-color: var(--red); }
.toast.green { border-left-color: var(--green); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } }

/* ============ auth ============ */
.auth-wrap { max-width: 460px; margin: 30px auto 0; }
.auth-card { padding: 30px; }
.auth-card h1 { font-family: var(--font-display); font-size: 26px; margin-bottom: 4px; }
.auth-card .a-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.demo-box { margin-top: 18px; background: rgba(255, 194, 75, 0.07); border: 1px dashed rgba(255, 194, 75, 0.4); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--gold); line-height: 1.6; }

/* ============ player profile ============ */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile-head .big-av { width: 92px; height: 92px; border-radius: 20px; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #fff; background: linear-gradient(140deg, var(--c1), var(--c2)); border: 3px solid rgba(255,255,255,0.35); box-shadow: 0 10px 26px rgba(0,0,0,0.45); }
.profile-head h1 { font-family: var(--font-display); font-size: 26px; }
.profile-head .ph-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 22px; }
.pstat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 13px; text-align: center; }
.pstat b { font-family: var(--font-display); font-size: 22px; display: block; }
.pstat.green b { color: var(--green); } .pstat.red b { color: var(--red); } .pstat.gold b { color: var(--gold); } .pstat.cyan b { color: var(--cyan); } .pstat.purple b { color: var(--purple); }
.pstat span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.badges-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ============ misc ============ */
.divider { height: 1px; background: var(--line); margin: 22px 0; border: none; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.mb-14 { margin-bottom: 14px; } .mb-20 { margin-bottom: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.center { text-align: center; }
.empty-state { text-align: center; color: var(--dim); padding: 46px 16px; }
.empty-state .e-ic { font-size: 40px; margin-bottom: 10px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hl { color: var(--cyan); font-weight: 700; }
.hl-gold { color: var(--gold); font-weight: 700; }
.score-big { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--txt); display: inline-flex; align-items: center; gap: 14px; }
.score-big .vs { font-size: 15px; color: var(--dim); }
.pill-status { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dot.red { background: var(--red); } .dot.gold { background: var(--gold); } .dot.dim { background: var(--dim); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv b { color: var(--muted); font-weight: 600; }
.alert { border-radius: 11px; padding: 12px 15px; font-size: 13.5px; line-height: 1.5; margin-bottom: 14px; }
.alert-cyan { background: rgba(0,229,255,0.08); border: 1px solid rgba(0,229,255,0.35); color: var(--cyan); }
.alert-gold { background: rgba(255,194,75,0.08); border: 1px solid rgba(255,194,75,0.35); color: var(--gold); }
.alert-red { background: rgba(255,77,94,0.08); border: 1px solid rgba(255,77,94,0.35); color: var(--red); }
.footer { border-top: 1px solid var(--line); background: var(--bg2); margin-top: auto; }
.footer-inner { max-width: 1220px; margin: 0 auto; padding: 26px 20px; display: flex; flex-direction: column; gap: 8px; }
.footer p { color: var(--dim); font-size: 12.5px; max-width: 620px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--cyan); }

/* ============ responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 30px 24px; }
  .hero-icon { margin-top: 4px; }
  .mainnav { gap: 0; overflow-x: auto; margin-left: 0; }
  .mainnav a { padding: 8px 10px; font-size: 13.5px; }
  .topbar-inner { gap: 12px; padding: 0 14px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .view { padding: 16px 12px 50px; }
  .field-row { grid-template-columns: 1fr; }
  .topbar-inner { height: 58px; }
  .brand-name { font-size: 16px; }
  .bell-panel { width: 290px; right: -60px; }
}
