:root {
  --bg: #061222;
  --bg-deep: #030b15;
  --panel: #0b1a2d;
  --panel-2: #10223a;
  --panel-3: #132946;
  --line: #203a5c;
  --line-soft: rgba(83, 125, 175, .22);
  --text: #eef6ff;
  --muted: #9db0c7;
  --blue: #168cff;
  --blue-2: #1bc7ff;
  --violet: #7a46ff;
  --green: #29e6a4;
  --red: #ff6275;
  --yellow: #ffc95a;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 75% 0%, rgba(71, 54, 255, .15), transparent 26%),
    radial-gradient(circle at 15% 18%, rgba(0, 183, 255, .09), transparent 22%),
    linear-gradient(180deg, #061326 0%, #06101d 55%, #040b13 100%);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { max-width: 100%; display: block; }

.site-header {
  min-height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(4, 14, 27, .86);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.brand img { filter: drop-shadow(0 0 12px rgba(36, 164, 255, .35)); }
.brand span span { color: #8d5cff; }
.main-nav { display: flex; align-items: center; gap: 24px; color: #c0d1e6; }
.main-nav a { padding: 25px 4px 21px; border-bottom: 3px solid transparent; }
.main-nav a:hover { color: white; border-bottom-color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display:flex; align-items:center; gap:8px; padding: 6px 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 999px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.page-shell { width: min(1460px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 70px; }
.site-footer { width: min(1460px, calc(100% - 48px)); margin: 0 auto; padding: 26px 0 38px; color: var(--muted); border-top: 1px solid var(--line-soft); display:flex; justify-content:space-between; gap:20px; }
.footer-links { display:flex; gap:18px; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 11px;
  min-height: 42px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-small { min-height: 36px; padding: 8px 13px; font-size: 13px; }
.btn-primary { color:white; background: linear-gradient(135deg, var(--blue), #315dff 55%, var(--violet)); box-shadow: 0 0 24px rgba(36, 116, 255, .22); }
.btn-secondary { color:white; background: #132947; border:1px solid #2c4e78; }
.btn-ghost { background: rgba(255,255,255,.035); border: 1px solid #294565; color: #dbe8f7; }
.btn-green { background: linear-gradient(135deg, #0fa36b, #08c781); color: white; }
.btn-red { background: rgba(164, 33, 53, .42); border: 1px solid #8b2c42; color:#ffdce1; }
.btn-block { width:100%; }

.flash { width:min(1460px, calc(100% - 48px)); margin:18px auto 0; padding: 12px 16px; border-radius: 12px; border:1px solid var(--line); }
.flash-success { background: rgba(24, 137, 93, .18); border-color: rgba(46, 225, 158, .4); }
.flash-error { background: rgba(175, 49, 67, .16); border-color: rgba(255, 98, 117, .42); }
.flash-info { background: rgba(34, 115, 197, .16); border-color: rgba(54, 157, 255, .4); }

.home-section { position: relative; padding: 18px 0 46px; }
.home-section + .home-section { border-top: 1px solid rgba(125, 75, 255, .35); padding-top: 40px; }
.section-top { display:flex; align-items:flex-start; justify-content:space-between; gap:26px; margin-bottom:24px; }
.section-heading h1, .section-heading h2 { margin:0; text-transform:uppercase; letter-spacing:-1px; font-size: clamp(28px, 3vw, 43px); line-height:1.05; }
.section-heading h1 span, .section-heading h2 span { background: linear-gradient(90deg, #ffffff, #4fc8ff 45%, #a05eff); -webkit-background-clip:text; background-clip:text; color:transparent; }
.section-heading p { color:var(--muted); margin:8px 0 0; font-size:16px; }
.section-cta { min-width: 180px; min-height: 52px; }
.section-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.live-dot { display:inline-block; width:13px; height:13px; border-radius:50%; background:var(--green); margin-left:10px; box-shadow:0 0 20px rgba(41,230,164,.75); vertical-align:middle; }

.toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin: 18px 0; }
.game-tab { border:1px solid #294565; color:#d4e2f2; background:#0d1b2e; min-height:45px; padding:9px 16px; border-radius:10px; display:inline-flex; gap:8px; align-items:center; font-weight:700; cursor:pointer; }
.game-tab:hover, .game-tab.active { border-color:#22b7ff; background:#102a4a; box-shadow:0 0 0 1px rgba(42,175,255,.14), 0 0 22px rgba(25,139,255,.11); }
.game-icon { min-width:22px; height:22px; display:grid; place-items:center; border-radius:7px; color:#7fdcff; font-weight:900; }
.search-box { margin-left:auto; position:relative; min-width:290px; }
.search-box input { width:100%; padding:11px 14px 11px 40px; }
.search-box:before { content:'⌕'; position:absolute; left:14px; top:8px; font-size:22px; color:#82a2c6; }

.live-panel, .recent-panel {
  background: linear-gradient(180deg, rgba(14,33,56,.86), rgba(7,21,37,.9));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:15px;
  box-shadow: var(--shadow);
}
.recent-panel { margin-top:17px; border-color:rgba(177,80,104,.32); }
.panel-title-row { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 3px 13px; }
.panel-title { margin:0; font-size:18px; display:flex; align-items:center; gap:9px; text-transform:uppercase; }
.panel-title.online { color:#72f8c8; }
.panel-title.offline { color:#ff8a9b; }
.panel-count { color:var(--muted); font-size:13px; }

.cards-grid { display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap:12px; }
.cards-grid.clans { grid-template-columns: repeat(3, minmax(0,1fr)); }
.player-card, .clan-card {
  position:relative;
  min-width:0;
  border:1px solid #254262;
  background: linear-gradient(180deg, rgba(14, 31, 52, .98), rgba(8, 22, 38, .98));
  border-radius:15px;
  padding:15px;
  overflow:hidden;
}
.player-card:before, .clan-card:before { content:''; position:absolute; inset:0 auto auto 0; width:100%; height:1px; background:linear-gradient(90deg, transparent, rgba(46,190,255,.5), transparent); opacity:.65; }
.player-card.self { border-color:#119cff; box-shadow: 0 0 0 1px rgba(25,158,255,.35), 0 0 28px rgba(0,122,255,.13); }
.player-card.offline { filter:saturate(.48); opacity:.9; }
.player-card.offline .avatar-ring { box-shadow:none; }
.avatar-wrap { display:flex; align-items:center; justify-content:center; margin:2px 0 10px; position:relative; }
.avatar-ring { width:86px; height:86px; padding:3px; border-radius:50%; background:linear-gradient(135deg,#1fd7ff,#5d4cff,#d44cff); box-shadow:0 0 20px rgba(36,157,255,.26); position:relative; }
.avatar-ring img { width:100%; height:100%; border-radius:50%; object-fit:cover; background:#0d1d30; border:3px solid #081524; }
.status-dot { position:absolute; width:17px; height:17px; border-radius:50%; right:0; bottom:8px; background:var(--green); border:3px solid #091729; box-shadow:0 0 12px rgba(41,230,164,.7); }
.player-card.offline .status-dot { background:var(--red); box-shadow:0 0 10px rgba(255,98,117,.5); }
.player-name { text-align:center; font-size:19px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.player-meta { display:grid; gap:7px; margin:12px 0; color:#c9d7e7; }
.meta-line { display:flex; align-items:center; gap:8px; min-width:0; }
.meta-line span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.meta-line.deadline-line { align-items:flex-start; }
.meta-line.deadline-line span:last-child { overflow:visible; text-overflow:clip; white-space:normal; }
.deadline-time { white-space:nowrap; }
.tag { display:inline-flex; align-items:center; min-height:24px; border-radius:999px; padding:2px 9px; font-size:12px; font-weight:800; background:#263456; color:#c7d7f2; }
.tag-ranked { background:#5937cc; color:#fff; }
.tag-casual { background:#6b5229; color:#ffe0a6; }
.tag-any { background:#284d63; color:#c8eaff; }
.freshness { font-weight:700; color:#49e9b1; font-size:13px; }
.player-card.offline .freshness { color:#ff7e91; }
.nick-row { font-size:13px; color:#c7d5e5; padding:8px 0; border-top:1px solid rgba(255,255,255,.045); }
.locked { color:#8da2bb; }
.card-actions { display:grid; gap:7px; margin-top:8px; }
.card-actions.two { grid-template-columns:1fr 1fr; }
.card-actions.three { grid-template-columns:1fr 1fr 1fr; }
.card-actions .btn { min-height:38px; padding:7px 9px; font-size:13px; }

.empty-state { padding:36px 18px; text-align:center; color:var(--muted); border:1px dashed #2a496d; border-radius:14px; background:rgba(255,255,255,.015); }
.empty-state strong { display:block; color:#e7f2ff; font-size:17px; margin-bottom:5px; }

.clan-card { padding:0; }
.clan-banner { height:110px; position:relative; overflow:hidden; background:linear-gradient(135deg,#14233b,#21144b); }
.clan-banner:after { content:''; position:absolute; inset:0; background:linear-gradient(180deg,transparent 15%,rgba(5,16,28,.86)); }
.clan-logo { width:74px; height:74px; border-radius:14px; object-fit:cover; position:absolute; z-index:2; left:16px; bottom:10px; background:#0a1929; border:2px solid rgba(255,255,255,.14); box-shadow:0 8px 22px rgba(0,0,0,.3); }
.clan-body { padding:14px 16px 16px; }
.clan-title { font-size:19px; font-weight:800; display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.clan-tag { color:#9eb4cf; font-size:13px; }
.clan-meta { display:grid; gap:7px; margin:12px 0; color:#c6d5e5; }
.recruiting { color:#52ebaf; font-weight:800; font-size:13px; }

.form-card { width:min(560px,100%); margin:28px auto; background:linear-gradient(180deg,#0d1d31,#081522); border:1px solid var(--line); border-radius:18px; padding:26px; box-shadow:var(--shadow); }
.form-card.wide { width:min(900px,100%); }
.form-card h1, .form-card h2 { margin:0 0 8px; }
.form-card .intro { margin:0 0 22px; color:var(--muted); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field { display:grid; gap:6px; }
.field.full { grid-column:1/-1; }
.field label { color:#cddbeb; font-size:13px; font-weight:700; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width:100%;
  color:var(--text);
  background:#091726;
  border:1px solid #294666;
  border-radius:10px;
  padding:11px 12px;
  outline:none;
  transition:border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color:#1aa9ff; box-shadow:0 0 0 3px rgba(26,169,255,.11); }
textarea { min-height:100px; resize:vertical; }
.help { color:#8196ae; font-size:12px; }
.form-error { background:rgba(174,44,67,.16); border:1px solid rgba(255,98,117,.36); color:#ffd7dd; border-radius:10px; padding:10px 12px; margin-bottom:15px; }
.form-success { background:rgba(33,147,101,.16); border:1px solid rgba(46,225,158,.36); color:#d5ffef; border-radius:10px; padding:10px 12px; margin-bottom:15px; }
.form-links { margin-top:16px; display:flex; gap:10px; justify-content:space-between; color:#9eb4cf; font-size:13px; }
.form-links a { color:#75cfff; }
.checkbox-row { display:flex; gap:9px; align-items:flex-start; color:#b6c6d8; font-size:13px; }
.checkbox-row input { margin-top:3px; }

.segmented { display:flex; gap:8px; flex-wrap:wrap; }
.segmented label { cursor:pointer; }
.segmented input { position:absolute; opacity:0; pointer-events:none; }
.segmented span { display:inline-flex; align-items:center; justify-content:center; min-height:37px; min-width:78px; padding:7px 12px; border:1px solid #2a4868; background:#0a192a; border-radius:9px; color:#b9cbe0; font-weight:700; }
.segmented input:checked + span { border-color:#1ab5ff; background:#133557; color:white; box-shadow:0 0 0 1px rgba(26,181,255,.12); }

.modal-backdrop { position:fixed; inset:0; z-index:100; background:rgba(0,6,14,.76); backdrop-filter:blur(5px); display:none; align-items:center; justify-content:center; padding:20px; }
.modal-backdrop.open { display:flex; }
.modal { width:min(610px,100%); max-height:calc(100vh - 40px); overflow:auto; background:linear-gradient(180deg,#10223a,#071522); border:1px solid #2b4d73; border-radius:19px; box-shadow:0 24px 90px rgba(0,0,0,.55), 0 0 45px rgba(57,75,255,.12); }
.modal.large { width:min(760px,100%); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px 22px 12px; }
.modal-head h3 { margin:0; font-size:22px; }
.modal-head p { margin:5px 0 0; color:var(--muted); }
.modal-close { width:36px; height:36px; border:1px solid #2b4665; border-radius:10px; background:#0b1a2b; cursor:pointer; font-size:20px; }
.modal-body { padding:10px 22px 22px; }
.modal-footer { padding:14px 22px 22px; display:flex; gap:10px; justify-content:flex-end; }
.inline-summary { border:1px solid #2b496a; border-radius:12px; background:#0a192a; padding:12px 14px; display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.summary-title { font-weight:800; }
.summary-meta { color:var(--muted); font-size:13px; margin-top:3px; }
.optional-block { border-top:1px solid rgba(255,255,255,.07); padding-top:15px; margin-top:15px; }
.optional-title { font-weight:800; margin-bottom:3px; }
.optional-note { color:var(--muted); font-size:12px; margin-bottom:10px; }
.hidden { display:none !important; }

.profile-hero { display:grid; grid-template-columns:auto 1fr auto; gap:20px; align-items:center; background:linear-gradient(135deg,#0d2036,#11172f); border:1px solid var(--line); border-radius:18px; padding:22px; margin-bottom:22px; }
.profile-hero img { width:96px; height:96px; object-fit:cover; border-radius:50%; border:3px solid #295980; }
.profile-hero h1 { margin:0; }
.profile-hero p { color:var(--muted); margin:5px 0 0; }
.info-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.info-card { background:#0b1a2d; border:1px solid var(--line); border-radius:14px; padding:16px; }
.info-card h3 { margin:0 0 10px; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; background:#091725; }
table { width:100%; border-collapse:collapse; min-width:700px; }
th, td { padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.06); text-align:left; }
th { color:#9eb2ca; font-size:12px; text-transform:uppercase; letter-spacing:.04em; background:#0d1e31; }
tr:last-child td { border-bottom:0; }
.status-pill { display:inline-flex; align-items:center; border-radius:999px; padding:3px 8px; font-size:12px; font-weight:800; background:#1c354e; }
.status-pill.active, .status-pill.accepted { background:rgba(28,156,103,.22); color:#70f0bd; }
.status-pill.pending { background:rgba(187,137,30,.2); color:#ffd575; }
.status-pill.rejected, .status-pill.blocked { background:rgba(176,50,69,.2); color:#ff9aa8; }

.kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.kpi { background:linear-gradient(180deg,#0d1d31,#091725); border:1px solid var(--line); border-radius:14px; padding:18px; }
.kpi strong { display:block; font-size:28px; margin-top:4px; }
.kpi span { color:var(--muted); font-size:13px; }

.toast-stack { position:fixed; right:18px; bottom:18px; z-index:200; display:grid; gap:8px; }
.toast { min-width:260px; max-width:360px; padding:12px 14px; border-radius:11px; background:#10213a; border:1px solid #2e4d70; box-shadow:var(--shadow); }
.toast.success { border-color:rgba(41,230,164,.45); }
.toast.error { border-color:rgba(255,98,117,.45); }
.loading { opacity:.55; pointer-events:none; }

@media (max-width: 1180px) {
  .cards-grid { grid-template-columns:repeat(3,1fr); }
  .cards-grid.clans { grid-template-columns:repeat(2,1fr); }
  .kpi-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns:auto 1fr; padding:0 16px; gap:14px; }
  .main-nav { display:none; }
  .header-actions { justify-self:end; }
  .user-chip span { display:none; }
  .page-shell, .site-footer, .flash { width:min(100% - 24px, 1460px); }
  .section-top { align-items:center; }
  .section-heading h1, .section-heading h2 { font-size:30px; }
  .section-heading p { display:none; }
  .search-box { margin-left:0; width:100%; min-width:0; }
  .cards-grid, .cards-grid.clans { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .form-grid, .info-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .profile-hero { grid-template-columns:auto 1fr; }
  .profile-hero > :last-child { grid-column:1/-1; }
}

@media (max-width: 560px) {
  .brand { font-size:20px; }
  .brand img { width:32px; height:32px; }
  .header-actions .btn { padding:7px 10px; }
  .page-shell { padding-top:22px; }
  .home-section { padding-bottom:34px; }
  .section-top { gap:12px; flex-wrap:wrap; }
  .section-heading h1, .section-heading h2 { font-size:26px; }
  .section-actions { width:100%; justify-content:stretch; }
  .section-actions .section-cta { flex:1 1 calc(50% - 4px); min-width:0; }
  .section-cta { min-width:auto; min-height:45px; padding:9px 12px; }
  .game-tab { min-height:41px; padding:7px 11px; font-size:12px; }
  .cards-grid, .cards-grid.clans { grid-template-columns:1fr; }
  .live-panel, .recent-panel { padding:10px; }
  .player-card { display:grid; grid-template-columns:82px 1fr; gap:0 12px; align-items:start; }
  .player-card .avatar-wrap { grid-row:1/4; margin:0; }
  .player-card .avatar-ring { width:76px; height:76px; }
  .player-card .player-name { text-align:left; }
  .player-card .player-meta { margin:7px 0; }
  .player-card .nick-row, .player-card .card-actions { grid-column:1/-1; }
  .clan-banner { height:94px; }
  .modal-backdrop { padding:10px; }
  .modal { max-height:calc(100vh - 20px); }
  .modal-head, .modal-body, .modal-footer { padding-left:16px; padding-right:16px; }
  .card-actions.three { grid-template-columns:1fr; }
  .kpi-grid { grid-template-columns:1fr 1fr; }
}

/* V1.2 -------------------------------------------------------------- */
.player-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.player-card-head .avatar-wrap { margin:2px 0 10px; flex:1; justify-content:flex-start; }
.player-follow-box, .clan-follow-box { display:grid; justify-items:end; gap:5px; }
.follower-count, .profile-follow-count { color:#8ea4be; font-size:11px; white-space:nowrap; }
.follow-btn {
  border:1px solid #315574; background:#0d2137; color:#cfe3f8; min-height:28px; padding:4px 9px;
  border-radius:999px; font-weight:800; font-size:11px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
}
.follow-btn.following { background:rgba(48,168,125,.18); border-color:rgba(58,225,165,.42); color:#79efc2; }
.follow-btn:disabled { opacity:.6; cursor:wait; }
.player-stats-strip { display:flex; gap:8px; flex-wrap:wrap; color:#a8bfd7; font-size:11px; padding:7px 0; border-top:1px solid rgba(255,255,255,.045); }
.time-left { color:#56f0b9; }
.time-left.ending-soon { color:#ffca6b; }
.social-live-btn { width:100%; min-height:34px; border-radius:9px; border:1px solid #345477; background:#0e2238; color:#cfe0f3; font-weight:800; cursor:pointer; margin-top:6px; }
.social-live-btn.live { border-color:rgba(255,72,99,.56); color:#ff9bab; background:rgba(119,26,43,.24); box-shadow:0 0 18px rgba(255,65,96,.08); }
.social-link-list { display:grid; gap:10px; }
.social-link { width:100%; }
.live-now-banner { border:1px solid rgba(255,83,108,.4); color:#ff8ea0; background:rgba(146,30,49,.18); border-radius:10px; padding:9px 12px; font-weight:900; }
.social-ready-block { margin-top:18px; }
.checkbox-row.compact { margin-top:7px; }
.checkbox-row.live-check { margin-top:13px; padding-top:12px; border-top:1px solid rgba(255,255,255,.07); color:#ff9aac; font-weight:800; }
.modal.small { width:min(480px,100%); }
.clan-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.profile-actions { display:grid; gap:8px; justify-items:end; }

.phone-input { display:grid; grid-template-columns:minmax(180px,1.2fr) minmax(130px,.8fr); gap:8px; }
.phone-country { display:grid; grid-template-columns:1fr; gap:5px; }
.phone-country-search { width:100%; color:var(--text); background:#091726; border:1px solid #294666; border-radius:10px; padding:9px 11px; outline:none; }
.phone-country-select, .phone-local { width:100%; }

@media (max-width: 680px) {
  .phone-input { grid-template-columns:1fr; }
  .player-card-head .avatar-wrap { justify-content:flex-start; }
  .clan-title-row { display:grid; }
  .clan-follow-box { justify-items:start; }
  .profile-actions { justify-items:stretch; }
}
@media (max-width: 680px) {
  .player-card .player-card-head { grid-column:1/-1; }
  .player-card .player-stats-strip, .player-card .social-live-btn { grid-column:1/-1; }
}

/* V1.3 -------------------------------------------------------------- */
.home-mode-tabs {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:2px 0 26px;
  padding:7px; border:1px solid rgba(93,126,255,.23); background:rgba(6,17,31,.78); border-radius:16px;
  box-shadow:0 12px 42px rgba(0,0,0,.14);
}
.home-mode-tab {
  min-height:48px; border:1px solid transparent; border-radius:11px; background:transparent; color:#9fb3cb;
  font-weight:900; letter-spacing:.04em; cursor:pointer; transition:.18s ease;
}
.home-mode-tab:hover { color:#fff; background:rgba(28,61,97,.45); }
.home-mode-tab.active {
  color:#fff; border-color:#3576ff; background:linear-gradient(135deg,rgba(22,116,255,.25),rgba(115,55,255,.23));
  box-shadow:0 0 24px rgba(49,100,255,.12);
}
.home-panel { border-top:0 !important; padding-top:18px !important; }
.home-panel[hidden] { display:none !important; }
.tournaments-coming {
  min-height:430px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center;
  border:1px solid var(--line) !important; border-radius:20px; background:radial-gradient(circle at 50% 20%,rgba(91,57,255,.16),transparent 42%),#081522;
  padding:48px 20px !important;
}
.tournaments-coming[hidden] { display:none !important; }
.tournaments-coming h2 { font-size:42px; margin:12px 0 6px; }
.tournaments-coming p { color:var(--muted); max-width:520px; }
.tournaments-icon { font-size:62px; filter:drop-shadow(0 0 20px rgba(145,91,255,.26)); }

.carousel-shell { position:relative; }
.cards-carousel {
  display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; scroll-behavior:smooth; scrollbar-width:none;
  overscroll-behavior-inline:contain; padding:2px 1px 8px;
}
.cards-carousel::-webkit-scrollbar { display:none; }
.cards-carousel > .player-card,
.cards-carousel > .clan-card { flex:0 0 calc((100% - 48px) / 5); min-width:0; scroll-snap-align:start; }
.cards-carousel > .empty-state { flex:0 0 100%; min-width:100%; }
.carousel-arrow {
  position:absolute; z-index:5; top:50%; transform:translateY(-50%); width:38px; height:38px; border-radius:50%;
  border:1px solid #355b81; background:rgba(6,20,35,.94); color:#eaf5ff; font-size:28px; line-height:1; cursor:pointer;
  box-shadow:0 8px 28px rgba(0,0,0,.32),0 0 18px rgba(45,142,255,.12); opacity:0; pointer-events:none; transition:.16s ease;
}
.carousel-shell.has-overflow .carousel-arrow { opacity:1; pointer-events:auto; }
.carousel-arrow.prev { left:-13px; }
.carousel-arrow.next { right:-13px; }
.carousel-arrow:hover:not(:disabled) { border-color:#38b9ff; background:#0c2944; }
.carousel-arrow:disabled { opacity:.2 !important; cursor:default; pointer-events:none !important; }

.player-identity-row { display:flex; gap:7px; flex-wrap:wrap; align-items:center; margin:5px 0 7px; }
.game-badge, .nationality-badge {
  display:inline-flex; align-items:center; gap:5px; min-height:25px; border-radius:999px; padding:3px 8px; font-size:10px; font-weight:900;
  border:1px solid #31506e; background:#0b1c30; color:#c9ddf0;
}
.game-badge { border-color:rgba(255,85,92,.38); color:#ffb2b8; background:rgba(117,30,43,.16); letter-spacing:.04em; }
.nationality-badge { color:#a9c8e5; }
.profile-separator { opacity:.45; margin:0 5px; }
.offline-contact-note { color:#8ca4bd; font-size:10px; margin-top:7px; text-align:center; }
.offline-contact-check { padding:10px 12px; border:1px solid rgba(77,126,176,.26); background:rgba(10,28,47,.48); border-radius:10px; }
.card-report-row { display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }
.safety-link,
.report-link {
  appearance:none; border:0; background:transparent; color:#748ba5; font-size:10px; cursor:pointer; padding:3px 1px; font-weight:700;
}
.report-link:hover { color:#ff94a5; }
.block-link:hover { color:#ffc36b; }
.interaction-notice { display:grid; gap:5px; border-color:rgba(255,164,82,.28); }
.email-verification-card { display:grid; gap:5px; border-color:rgba(255,205,80,.24); }
.blocked-player-cell { display:flex; align-items:center; gap:10px; min-width:180px; }
.blocked-player-cell img { width:34px; height:34px; border-radius:50%; object-fit:cover; border:1px solid #31506e; }

.moderation-tabs { display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; }
.moderation-tabs a { padding:8px 12px; border-radius:999px; border:1px solid #2b4868; color:#9fb4cd; background:#0a192a; font-weight:800; font-size:12px; }
.moderation-tabs a.active { color:#fff; border-color:#387bff; background:#122d52; }
.moderation-actions { display:flex; gap:5px; flex-wrap:wrap; }
.moderation-table td { vertical-align:top; }
.status-pill.reviewed { background:rgba(55,119,184,.2); color:#8dcaff; }
.status-pill.closed { background:rgba(103,114,127,.2); color:#c1cad4; }

@media (max-width: 1180px) {
  .cards-carousel > .player-card, .cards-carousel > .clan-card { flex-basis:calc((100% - 24px) / 3); }
}
@media (max-width: 820px) {
  .home-mode-tabs { margin-bottom:18px; }
  .home-mode-tab { min-height:44px; font-size:12px; }
  .cards-carousel > .player-card, .cards-carousel > .clan-card { flex-basis:calc((100% - 12px) / 2); }
  .carousel-arrow.prev { left:-8px; }
  .carousel-arrow.next { right:-8px; }
}
@media (max-width: 560px) {
  .home-mode-tabs { gap:5px; padding:5px; }
  .home-mode-tab { padding:7px 5px; font-size:10px; letter-spacing:0; }
  .cards-carousel { padding-right:12%; }
  .cards-carousel > .player-card, .cards-carousel > .clan-card { flex-basis:88%; }
  .carousel-arrow { display:none; }
  .player-card { display:block; }
  .player-card .player-card-head, .player-card .player-stats-strip, .player-card .social-live-btn { display:flex; }
  .player-card .nick-row, .player-card .card-actions { grid-column:auto; }
  .player-card .avatar-wrap { margin:2px 0 10px; }
}

/* V1.4 -------------------------------------------------------------- */
.discovery-filters {
  display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; margin:-4px 0 18px;
  padding:12px; border:1px solid rgba(66,108,151,.34); border-radius:14px;
  background:linear-gradient(180deg,rgba(10,27,46,.88),rgba(7,20,34,.88));
}
.discovery-filter-title {
  align-self:center; color:#89a5c3; font-size:11px; font-weight:900; letter-spacing:.08em;
  text-transform:uppercase; padding:0 5px; white-space:nowrap;
}
.discovery-filter-search {
  flex:1 0 100%; display:grid; gap:5px; min-width:0;
}
.discovery-filter-search label {
  color:#8fa8c1; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.04em;
}
.filter-search-box {
  margin-left:0; width:min(520px,100%); min-width:0;
}
.filter-search-box input { min-height:42px; }
.filter-field { display:grid; gap:5px; flex:1 1 150px; min-width:138px; }
.filter-field label { color:#8fa8c1; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.04em; }
.filter-field select { min-height:39px; padding:8px 10px; font-size:12px; }
.filter-field select:disabled { opacity:.55; cursor:not-allowed; }
.filter-clear {
  min-height:39px; padding:8px 13px; border-radius:9px; border:1px solid #31506f;
  background:#0a192a; color:#9fb5cd; font-size:12px; font-weight:800; cursor:pointer;
}
.filter-clear:hover { color:#fff; border-color:#458ac5; }
.mobile-filter-trigger {
  display:none; align-items:center; justify-content:center; gap:8px; width:100%; min-height:43px; margin:-3px 0 16px;
  border:1px solid #315574; border-radius:11px; background:#0b1d31; color:#d2e5f7; font-weight:900; cursor:pointer;
}
.filter-count {
  display:inline-flex; align-items:center; justify-content:center; min-width:21px; height:21px; padding:0 6px;
  border-radius:999px; background:#1b65d8; color:#fff; font-size:10px;
}
.mobile-filter-form { display:grid; gap:12px; }
.recruitment-scope {
  display:inline-flex; width:max-content; max-width:100%; align-items:center; gap:5px; border-radius:999px;
  padding:4px 9px; border:1px solid #31506d; background:#0a1c2d; font-size:11px; font-weight:900;
}
.recruitment-scope.local { color:#ffd48a; border-color:rgba(225,164,66,.38); background:rgba(104,70,20,.17); }
.recruitment-scope.international { color:#8ee8c8; border-color:rgba(69,205,159,.36); background:rgba(25,99,77,.16); }
.recruitment-scope-segmented span { min-width:125px; }

@media (max-width: 1180px) {
  .discovery-filter-title { flex-basis:100%; padding:0; }
  .discovery-filters { align-items:flex-end; }
}
@media (max-width: 820px) {
  .desktop-discovery-filters { display:flex; margin-bottom:10px; padding:10px; }
  .desktop-discovery-filters > .discovery-filter-title,
  .desktop-discovery-filters > .filter-field,
  .desktop-discovery-filters > .filter-clear { display:none; }
  .discovery-filter-search { flex-basis:100%; }
  .filter-search-box { width:100%; max-width:none; }
  .mobile-filter-trigger { display:flex; margin-top:0; }
}

/* V1.5 -------------------------------------------------------------- */
.match-scope-badge {
  display:inline-flex; align-items:center; width:max-content; gap:5px; min-height:25px; margin-top:2px;
  padding:3px 8px; border-radius:999px; border:1px solid rgba(69,205,159,.30);
  background:rgba(25,99,77,.13); color:#9ce4cb; font-size:10px; font-weight:900;
}
.match-scope-badge.local { color:#ffd48a; border-color:rgba(225,164,66,.38); background:rgba(104,70,20,.17); }
.match-scope-badge.international { color:#8ee8c8; border-color:rgba(69,205,159,.36); background:rgba(25,99,77,.16); }
.match-scope-segmented span { min-width:125px; }

/* V1.7 — identity completion (preserved in V1.8) */
.language-picker { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; max-height:220px; overflow:auto; padding:10px; border:1px solid var(--line); border-radius:12px; background:rgba(7,18,31,.45); }
.language-choice { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid rgba(255,255,255,.08); border-radius:10px; cursor:pointer; min-width:0; }
.language-choice input { width:auto; margin:0; }
.language-choice span { display:flex; flex-direction:column; min-width:0; }
.language-choice strong { font-size:13px; }
.language-choice small { color:var(--muted); font-size:11px; }
.identity-languages, .card-languages { color:var(--muted); }
.current-upload-preview { display:flex; align-items:center; gap:12px; margin:0 0 10px; flex-wrap:wrap; }
.current-upload-preview img { width:72px; height:72px; object-fit:cover; border-radius:12px; border:1px solid var(--line); }
.current-upload-preview.banner img { width:min(260px,100%); height:86px; }
.clan-banner.has-image { background-size:cover; background-position:center; }
.clan-profile-banner { height:220px; margin:0 0 14px; border-radius:18px; border:1px solid var(--line); background-size:cover; background-position:center; box-shadow:var(--shadow); }
.profile-hero.with-clan-banner { margin-top:-52px; position:relative; z-index:1; margin-left:18px; margin-right:18px; }
@media (max-width: 760px) {
  .language-picker { grid-template-columns:1fr 1fr; max-height:260px; }
  .clan-profile-banner { height:150px; }
  .profile-hero.with-clan-banner { margin-top:-30px; margin-left:8px; margin-right:8px; }
}

/* V2.1 — search placement refinement ------------------------------------ */
/* Search remains live/AJAX-driven; only its presentation was moved into the shared filter surface. */


/* V2.2 — unified Player discovery ------------------------------------ */
#playersPanel .panel-title { color:#dcecff; }
#playerCards .player-card.offline { scroll-snap-align:start; }

/* V3 Clan Competitions */
.status-pill.scheduled { background:rgba(34,111,201,.22); color:#8ec8ff; }
.status-pill.result_pending { background:rgba(187,137,30,.2); color:#ffd575; }
.status-pill.disputed { background:rgba(176,50,69,.24); color:#ff9aa8; }
.status-pill.completed { background:rgba(28,156,103,.22); color:#70f0bd; }
.status-pill.declined, .status-pill.cancelled { background:rgba(103,114,127,.2); color:#c1cad4; }

.competition-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.competition-card { display:block; border:1px solid var(--line); border-radius:16px; padding:16px; background:#091725; color:inherit; text-decoration:none; transition:.18s ease; }
.competition-card:hover { transform:translateY(-2px); border-color:#376a9b; background:#0c1c30; }
.competition-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); font-size:12px; font-weight:800; }
.competition-versus { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:12px; margin:18px 0 12px; }
.competition-versus > span:last-child { text-align:right; }
.competition-versus strong { font-size:13px; color:#8eb2da; }
.competition-versus.score strong { font-size:22px; color:#fff; }
.competition-versus small { color:var(--muted); }
.competition-meta { color:var(--muted); font-size:13px; }

.match-headline-row { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.eyebrow { color:#76bfff; text-transform:uppercase; letter-spacing:.08em; font-size:12px; font-weight:900; }
.muted-vs { color:var(--muted); font-weight:600; }
.match-scoreboard { display:grid; grid-template-columns:1fr minmax(130px,220px) 1fr; align-items:center; gap:20px; margin:26px 0; }
.match-side { display:flex; flex-direction:column; align-items:center; gap:7px; text-align:center; color:inherit; text-decoration:none; }
.match-side img { width:84px; height:84px; object-fit:cover; border-radius:20px; border:1px solid var(--line); background:#081522; }
.match-side strong { font-size:20px; }
.match-side span { color:var(--muted); }
.match-score-center { text-align:center; }
.match-vs { font-size:30px; font-weight:900; color:#8eb2da; }
.match-score { font-size:42px; font-weight:900; letter-spacing:.03em; }
.match-score span { color:var(--muted); font-weight:600; }
.match-result-label { margin-top:8px; font-weight:800; color:#70f0bd; }
.match-note { margin-top:14px; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:#091725; }
.match-note p { margin:7px 0 0; color:#c4d2e4; line-height:1.55; }
.score-entry-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.match-evidence-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.evidence-image { display:block; width:100%; max-height:420px; object-fit:contain; border:1px solid var(--line); border-radius:12px; background:#06111e; }
.clan-record { display:flex; gap:10px; align-items:baseline; font-size:18px; }
.clan-record strong { color:#70f0bd; }
.clan-record-line small { color:var(--muted); }
.recent-match-list { display:grid; gap:8px; }
.recent-match-row { display:grid; grid-template-columns:34px 1fr auto; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:11px; color:inherit; text-decoration:none; background:#091725; }
.match-result-mark { width:28px; height:28px; display:grid; place-items:center; border-radius:8px; font-weight:900; }
.match-result-mark.w { background:rgba(28,156,103,.22); color:#70f0bd; }
.match-result-mark.d { background:rgba(187,137,30,.2); color:#ffd575; }
.match-result-mark.l { background:rgba(176,50,69,.2); color:#ff9aa8; }
.admin-match-card { border:1px solid var(--line); border-radius:16px; padding:18px; background:#091725; margin-top:14px; }
.admin-match-score { font-size:20px; margin:8px 0 14px; }
.admin-resolution-form { margin-top:16px; }

@media (max-width: 900px) {
  .competition-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 640px) {
  .competition-grid { grid-template-columns:1fr; }
  .match-headline-row { display:grid; }
  .match-scoreboard { grid-template-columns:1fr; }
  .match-score-center { order:-1; }
  .score-entry-grid, .match-evidence-grid { grid-template-columns:1fr; }
}

/* V3.0.1 — player profile/contact polish */
.player-name a { color:inherit; text-decoration:none; }
.player-name a:hover { color:#9dcaff; text-decoration:underline; text-underline-offset:3px; }
.player-profile-action { margin-top:7px; }
.player-games-card { margin-top:26px; }
.player-profile-contact-cell { min-width:310px; }
.profile-contact-actions { margin-top:0; min-width:290px; }
@media (max-width: 760px) {
  .player-games-card { margin-top:20px; }
  .player-profile-contact-cell { min-width:260px; }
  .profile-contact-actions { min-width:240px; grid-template-columns:1fr; }
}

/* V4.0.0 — Player Duels ------------------------------------------------ */
.competition-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.competition-section-label { display:flex; align-items:baseline; gap:10px; margin:22px 2px 10px; }
.competition-section-label strong { font-size:19px; color:#dcecff; }
.competition-section-label span { color:var(--muted); font-size:13px; }
.competition-section-label.clan-section { margin-top:28px; padding-top:6px; border-top:1px solid rgba(255,255,255,.055); }
.duel-card { border-color:rgba(67,144,231,.34); }
.duel-mini-record { color:#9ed0ff; }
.player-duel-hero .match-side img { border-radius:50%; }
.player-duel-record { margin-top:22px; }
.duel-record-total { color:#b7cce4; font-size:14px; }
.duel-record-total strong { color:#fff; font-size:24px; margin-right:4px; }
.duel-record-total .win { color:#70f0bd; font-weight:900; }
.duel-record-total .draw { color:#ffd575; font-weight:900; }
.duel-record-total .loss { color:#ff9aa8; font-weight:900; }
.duel-game-records { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px; }
.duel-game-record { display:grid; gap:4px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:#091725; }
.duel-game-record strong { color:#fff; }
.duel-game-record span { font-weight:900; color:#c5d9ef; }
.duel-game-record small { color:var(--muted); }
@media (max-width: 760px) {
  .competition-actions { width:100%; justify-content:stretch; }
  .competition-actions .btn { flex:1 1 100%; }
  .competition-section-label { display:grid; gap:3px; }
  .duel-record-total { margin-top:6px; }
}

/* V4.1 — Open Challenges + unified competition rails ------------------- */
.challenge-discovery-section { margin-top:22px; }
.challenge-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin:0 3px 11px; }
.challenge-section-head h2 { margin:0; color:#e6f2ff; font-size:20px; }
.challenge-section-head p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.open-challenge-panel { border-color:rgba(91,108,255,.32); }
.open-challenge-card { border-color:rgba(113,92,255,.42); }
.open-challenge-kicker { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#a9c8ff; font-size:12px; font-weight:900; margin-bottom:4px; }
.open-challenge-message { margin:8px 0; padding:9px 10px; border-radius:10px; background:rgba(255,255,255,.035); color:#c8d8ea; font-size:13px; line-height:1.45; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.open-challenge-overlay { position:absolute; left:10px; top:10px; padding:5px 8px; border-radius:999px; background:rgba(8,20,38,.86); border:1px solid rgba(118,140,255,.42); color:#b9d4ff; font-size:11px; font-weight:900; backdrop-filter:blur(5px); }
.competition-game-tabs { margin-top:4px; margin-bottom:20px; }
.competition-carousel > .competition-card { flex:0 0 calc((100% - 24px) / 3); min-width:0; scroll-snap-align:start; }
.competition-carousel > .empty-state { flex:0 0 100%; min-width:100%; }
.competition-card[hidden] { display:none !important; }
.competition-filter-empty { flex:0 0 100%; min-width:100%; }

@media (max-width: 900px) {
  .competition-carousel > .competition-card { flex-basis:calc((100% - 12px) / 2); }
}
@media (max-width: 640px) {
  .challenge-section-head { align-items:stretch; flex-direction:column; }
  .challenge-section-head .btn { width:100%; }
  .competition-carousel { padding-right:12%; }
  .competition-carousel > .competition-card { flex-basis:88%; }
}

/* V4.2 — Official Match Rules & Evidence */
.rule-choice-grid { display:flex; flex-wrap:wrap; gap:8px; }
.rule-choice { appearance:none; border:1px solid var(--line); background:#091725; color:#c7d8ec; border-radius:10px; padding:9px 12px; font-weight:800; cursor:pointer; transition:.16s ease; }
.rule-choice:hover { border-color:#437fb8; background:#0c1c30; }
.rule-choice.active { border-color:#61aef4; background:#102943; color:#fff; box-shadow:0 0 0 1px rgba(97,174,244,.18) inset; }
.official-rules-field textarea { margin-top:10px; min-height:190px; resize:vertical; }
.official-rules-field textarea[readonly] { background:#07131f; color:#d9e7f6; cursor:default; }
.evidence-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
.evidence-item { display:grid; gap:7px; color:#bcd0e5; text-decoration:none; font-size:12px; font-weight:800; }
.evidence-item .evidence-image { aspect-ratio:16/10; max-height:220px; }
.evidence-item span { text-align:center; }
@media (max-width:640px) { .rule-choice-grid { display:grid; grid-template-columns:1fr; } .evidence-gallery { grid-template-columns:1fr 1fr; } }
.open-rule-details { margin-top:10px; border:1px solid var(--line); border-radius:10px; background:#07131f; overflow:hidden; }
.open-rule-details summary { cursor:pointer; padding:9px 11px; font-size:12px; font-weight:900; color:#9fc9f3; }
.open-rule-details > div { padding:0 11px 11px; color:#c7d8e8; font-size:12px; line-height:1.5; }


/* V4.2.5 — Match-Format evidence slots for ClansZone and Custom Rules */
.series-evidence-help { margin-top:6px; }
.series-evidence-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.series-evidence-slot { border:1px solid var(--line); background:#07131f; border-radius:12px; padding:12px; }
.series-evidence-slot.required-slot { border-color:#31577d; }
.series-evidence-slot > label { display:block; margin-bottom:8px; }
.series-evidence-slot input[type=file] { width:100%; }
.required-mark { color:#ff7f95; }
@media (max-width:640px) { .series-evidence-grid { grid-template-columns:1fr; } }

/* V5 tournaments: isolated styles; existing competition layouts are unchanged. */
.tournament-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;align-items:start}
.tournament-main,.tournament-sidebar{min-width:0;display:grid;gap:20px}
.tournament-panel{padding:22px;border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(135deg,#0b2037,#071625);min-width:0;box-shadow:var(--shadow)}
.tournament-panel h1{font-size:clamp(25px,3vw,38px);line-height:1.2;margin:10px 0 18px}.tournament-panel h2{font-size:19px;margin:0 0 18px}.tournament-panel h2 small{float:right;font-size:13px;color:var(--muted)}
.tournament-hero{display:flex;gap:22px;align-items:center;background:radial-gradient(ellipse at 100% 0%,#32255c,transparent 65%),linear-gradient(135deg,#092840,#071626)}
.tournament-hero-icon{width:78px;height:90px;flex:0 0 78px;display:grid;place-items:center;font-size:32px;border:1px solid var(--line);border-radius:14px;background:#09192c}
.tournament-chips{display:flex;gap:8px;flex-wrap:wrap}.tournament-chips span{border:1px solid #2a4569;background:#08182b;border-radius:9px;padding:7px 10px;font-size:12px}
.tournament-champion{color:var(--green);font-size:21px;font-weight:700}
.tournament-bracket-scroll{overflow-x:auto;padding:12px 5px 24px;outline-offset:4px}
.tournament-bracket{display:grid;grid-template-columns:repeat(var(--tournament-columns),minmax(150px,1fr));gap:24px;min-width:calc(var(--tournament-columns)*174px);direction:ltr}
.tournament-round{display:flex;flex-direction:column;min-width:0}.tournament-round h3{text-align:center;font-size:12px;color:var(--muted);font-weight:500;margin:0 0 20px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.tournament-round-matches{display:flex;flex-direction:column;justify-content:space-around;gap:28px;flex:1}
.tournament-node{position:relative;border:1px solid #365580;background:linear-gradient(135deg,#0e253f,#07172a);border-radius:10px;padding:7px 0;min-height:132px;box-shadow:0 8px 16px #0003}
.tournament-node-decided{border-color:#237964}.tournament-node-title{font-size:10px;color:var(--muted);padding:0 7px 5px;display:flex;justify-content:space-between;gap:4px}.tournament-node-title span{text-align:right}
.tournament-side{display:flex;align-items:center;gap:6px;padding:8px 6px;min-height:40px;font-size:11px}.tournament-side+.tournament-side{border-top:1px solid var(--line-soft)}.tournament-side img,.tournament-placeholder{width:24px;height:24px;flex:0 0 24px;border-radius:50%;object-fit:cover;background:#31415e;display:grid;place-items:center}
.tournament-side-name{overflow-wrap:anywhere;flex:1}.tournament-side strong{padding:2px 4px}.tournament-winner{background:#087b5638;color:#a9ffe3}.tournament-node-time{display:block;text-align:center;font-size:10px;color:var(--muted);padding:6px 3px}.tournament-node-link{display:block;text-align:center;font-size:11px;color:#74c6ff;padding:3px}
.tournament-round-left .tournament-node:after,.tournament-round-right .tournament-node:after{content:"";position:absolute;top:50%;height:1px;width:13px;background:#626ac0}.tournament-round-left .tournament-node:after{right:-13px}.tournament-round-right .tournament-node:after{left:-13px}.tournament-round-final .tournament-node{border-color:var(--violet)}
.tournament-sidebar form{margin:12px 0}.tournament-sidebar .btn{width:100%;white-space:normal}.tournament-check{display:flex;align-items:flex-start;gap:9px;font-size:13px;margin:14px 0}.tournament-check input{width:auto;flex:0 0 auto;margin-top:4px}
.tournament-participants{list-style:none;padding:0;margin:0;max-height:440px;overflow-y:auto}.tournament-participants li{display:flex;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line-soft)}.tournament-participants li>span,.tournament-participants small{font-size:11px;color:var(--muted)}.tournament-participants strong{flex:1;font-size:13px;overflow-wrap:anywhere}.tournament-participants form{margin:0}
.tournament-rules-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;color:var(--muted);line-height:1.8}.tournament-inline{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:14px 0}.tournament-inline .field{flex:1;min-width:150px;margin:0}
.tournament-my-match,.tournament-candidate{padding:14px 0;border-bottom:1px solid var(--line)}.tournament-my-match p{font-size:13px}.tournament-admin-match{scroll-margin-top:90px;padding:15px 0;border-top:1px solid var(--line)}.tournament-admin-match summary,.tournament-rescue summary,.tournament-rule-preview summary{cursor:pointer}.tournament-rescue{margin:16px 0;padding:12px;background:#13243a;border-radius:10px}.tournament-rule-preview{padding:12px 0}
.tournament-list-row{display:flex;gap:18px;align-items:center;justify-content:space-between;padding:18px 0;border-bottom:1px solid var(--line)}.tournament-list-row span{color:var(--muted);font-size:13px}.tournament-badge{padding:12px 16px;margin-bottom:16px;border:1px solid #5b4890;border-radius:10px;background:#281a423d}.tournament-badge span{font-size:12px;color:var(--muted);margin-left:12px}
.tournament-rail-card{min-width:270px;max-width:330px;flex:0 0 290px}.tournament-rail-card h3{font-size:18px;margin:12px 0;overflow-wrap:anywhere}.tournament-rail-card p{color:var(--muted);font-size:13px}
@media(max-width:1100px){.tournament-layout{grid-template-columns:minmax(0,1fr)}.tournament-sidebar{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.tournament-sidebar{grid-template-columns:minmax(0,1fr)}.tournament-panel{padding:16px}.tournament-hero{gap:12px}.tournament-hero-icon{width:50px;height:64px;flex-basis:50px;font-size:23px}.tournament-list-row{align-items:start;flex-direction:column;gap:5px}.tournament-inline .btn{width:100%}}
.tournament-bracket{position:relative}.tournament-connectors{position:absolute;left:0;top:0;pointer-events:none;overflow:visible}.tournament-connectors path{fill:none;stroke:#626ac0;stroke-width:1.4}.tournament-node{z-index:1}.tournament-round-left .tournament-node:after,.tournament-round-right .tournament-node:after{display:none}

/* Quick tournament join: keep card links separate from the modal action. */
.tournament-rail-card{display:flex;flex-direction:column}
.tournament-card-view{display:block;color:inherit;text-decoration:none}
.tournament-card-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-top:auto;padding-top:12px}
.tournament-card-actions .status-pill{align-self:flex-start}
.tournament-card-buttons{display:flex;flex-wrap:wrap;gap:8px}
.tournament-card-buttons .btn{flex:1 1 110px;min-width:0;min-height:54px;padding-inline:8px;line-height:1.25;overflow-wrap:anywhere}
.tournament-card-actions small{color:var(--muted);overflow-wrap:anywhere}
.tournament-card-actions .btn{white-space:normal;text-align:center}
.quick-tournament-modal{width:min(460px,100%)}
#quickTournamentName,#quickTournamentMeta{display:block;overflow-wrap:anywhere}
.quick-tournament-modal .intro{font-size:13px;margin:10px 0}
.quick-tournament-modal select{max-width:100%}
#quickTournamentClanField[hidden]{display:none}
.quick-tournament-actions{display:flex;flex-wrap:wrap;gap:8px}
.quick-tournament-actions .btn{flex:1;white-space:normal}

/* Tournament rules share the existing disclosure; the modal owns scrolling. */
#quickTournamentRules[hidden]{display:none}
#quickTournamentRulesText{white-space:pre-wrap;overflow-wrap:anywhere}

/* V6.5.2: scoped navigation badge and existing messaging actions. */
.chat-unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.65em;height:1.65em;padding-inline:.4em;margin-inline-start:.35em;border-radius:999px;background:linear-gradient(135deg,#168dff,#7444ff);color:#fff;font-size:.75rem;font-weight:800;line-height:1;vertical-align:middle;direction:ltr}
.chat-unread-badge[hidden]{display:none!important}
.message-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-block:12px}
.message-actions:empty{display:none}
.message-actions .btn{max-width:100%;white-space:normal;overflow-wrap:anywhere}
#quickTournamentLeaveEntry{max-width:100%}
#quickTournamentLeaveEntryField[hidden]{display:none}
#quickTournamentLeaveForm .tournament-card-buttons{margin-top:16px}

/* V6.5.2.1: local participant actions and personal tournament states. */
.match-participant{min-width:0;text-align:center}
.match-participant .message-actions{justify-content:center;margin-block:10px 0}
.btn.btn-danger-outline{background:transparent;border:1px solid rgba(255,98,117,.65);color:#ffb4bf}
.btn.btn-danger-outline:hover{background:rgba(255,98,117,.12);border-color:var(--red);color:#ffdce1}
.btn.btn-danger-outline:focus-visible{outline:2px solid var(--red);outline-offset:3px}
.status-pill.participation-joined{background:rgba(41,230,164,.13);border:1px solid rgba(41,230,164,.45);color:#70f0bd}

/* V6.5.3: tournament lifecycle colors, distinct from personal Joined. */
.status-pill.tournament-status.open,.competition-carousel .status-pill.tournament-status.open{background:rgba(41,230,164,.13);border:1px solid rgba(41,230,164,.4);color:#70f0bd}
.status-pill.tournament-status.started,.competition-carousel .status-pill.tournament-status.started{background:rgba(255,163,67,.13);border:1px solid rgba(255,163,67,.45);color:#ffbc75}
.status-pill.tournament-status.completed,.competition-carousel .status-pill.tournament-status.completed{background:rgba(49,207,211,.13);border:1px solid rgba(49,207,211,.4);color:#7ae4e6}
.status-pill.tournament-status.cancelled,.competition-carousel .status-pill.tournament-status.cancelled{background:rgba(255,98,117,.13);border:1px solid rgba(255,98,117,.45);color:#ffb4bf}
/* Only open-clan cards: natural flow keeps the badge clear of the logo. */
.clan-card.open-challenge-card .clan-banner{height:auto;min-height:110px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:10px 16px}
.clan-card.open-challenge-card .clan-logo{position:relative;left:auto;bottom:auto;flex-shrink:0}
.clan-card.open-challenge-card .open-challenge-overlay{position:relative;left:auto;top:auto;order:-1;z-index:2;max-width:100%;overflow-wrap:anywhere}

.competition-carousel .tournament-rail-card[data-event-status="open"]{--event-accent:#399d76}
.competition-carousel .tournament-rail-card[data-event-status="started"]{--event-accent:#ffa343}
.competition-carousel .tournament-rail-card[data-event-status="completed"]{--event-accent:#31cfd3}
.competition-carousel .tournament-rail-card[data-event-status="cancelled"]{--event-accent:#ff6275}
