/* "Modern" theme: same clanbase structure + red/gold identity, without the early-2000s finish.
   Everything is scoped to html[data-theme="modern"]; the classic theme (clan.css) is untouched.
   Fonts: static/fonts (self-hosted, OFL). */

html[data-theme="modern"] {
  --bg: #120707; --bg2: #1a0b0b; --panel: #1d0e0e; --panel2: #261212; --row: transparent; --row2: transparent;
  --line: #3a1a1a; --line2: #4d2222; --box: #d0262a; --fg: #efe6e4; --dim: #a8908c; --gold: #f2b632;
  --idc: #f0cf7a; --win: #2fa84f; --loss: #d93a3a; --ink: #1f1400;
  --radius: 6px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
}
html[data-theme="modern"] body {
  font: 14px/1.55 var(--font); font-feature-settings: "tnum" 1, "cv11" 1;
  background: radial-gradient(1200px 500px at 50% -200px, #2a0d0d 0%, transparent 70%), var(--bg);
  background-attachment: fixed; padding: 18px max(20px, env(safe-area-inset-left));
}
html[data-theme="modern"] a { color: var(--idc); text-decoration: none; transition: color .15s; }
html[data-theme="modern"] a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="modern"] .site { max-width: 1280px; }

/* header */
html[data-theme="modern"] .top { padding: 4px 2px 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
html[data-theme="modern"] .brand { font: 700 28px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; }
html[data-theme="modern"] .brand:hover { text-decoration: none; }
html[data-theme="modern"] .top small { font-size: 12px; letter-spacing: .04em; }

/* layout */
html[data-theme="modern"] .cols { grid-template-columns: 200px minmax(0, 1fr) 240px; gap: 18px; }
html[data-theme="modern"] .cols > nav { position: sticky; top: 14px; align-self: start; }

/* boxes: hairline border, one red accent under the title */
html[data-theme="modern"] .box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  margin-bottom: 16px; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.25); overflow: hidden; }
html[data-theme="modern"] .box > h2 { background: var(--panel2); border-bottom: 2px solid var(--box); padding: 7px 12px;
  font: 600 14px/1.3 var(--cond); letter-spacing: .14em; color: var(--gold); }
html[data-theme="modern"] .in { padding: 12px; }

/* menu */
html[data-theme="modern"] .menu { padding: 6px; }
html[data-theme="modern"] .menu li { padding: 0; }
html[data-theme="modern"] .menu a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 4px; color: var(--fg); }
html[data-theme="modern"] .menu a:hover { background: var(--panel2); text-decoration: none; color: #fff; }
html[data-theme="modern"] .menu a.on { background: linear-gradient(90deg, rgba(208,38,42,.28), transparent); color: #fff;
  box-shadow: inset 2px 0 0 var(--box); text-decoration: none; }
html[data-theme="modern"] .menu .grp { font: 600 12px var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  padding: 10px 8px 4px; margin: 0; }
html[data-theme="modern"] .ico { display: inline-flex; width: 16px; height: 16px; color: var(--dim); flex: none; }
html[data-theme="modern"] .menu a.on .ico, html[data-theme="modern"] .menu a:hover .ico { color: var(--gold); }
html[data-theme="modern"] .ico svg { width: 16px; height: 16px; }

/* headings */
html[data-theme="modern"] .pagetitle { font: 700 40px/1.05 var(--cond); letter-spacing: .02em; text-transform: uppercase; margin-bottom: 8px; }
html[data-theme="modern"] .lead { font-size: 14px; }
html[data-theme="modern"] .sec { font: 700 20px/1.2 var(--cond); letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 28px 0 12px; position: relative; }
html[data-theme="modern"] .sec::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 48px; height: 2px; background: var(--box); }
html[data-theme="modern"] .sec.first { margin-top: 4px; }

/* tables: hairlines, roomy rows, hover instead of zebra */
html[data-theme="modern"] .tw { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 16px; }
html[data-theme="modern"] table { font-size: 13px; }
html[data-theme="modern"] th { background: var(--panel2); color: var(--dim); font: 600 12px var(--cond); letter-spacing: .1em;
  text-transform: uppercase; padding: 9px 10px; border-bottom: 1px solid var(--line2); position: sticky; top: 0; }
html[data-theme="modern"] td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
html[data-theme="modern"] tbody tr { background: transparent; transition: background .12s; }
html[data-theme="modern"] tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
html[data-theme="modern"] tbody tr:hover { background: rgba(242,182,50,.06); }
html[data-theme="modern"] tbody tr:last-child td { border-bottom: 0; }
html[data-theme="modern"] .name { font-size: 14px; font-weight: 600; }
html[data-theme="modern"] .frm td { background: transparent; }
html[data-theme="modern"] .frm th { position: static; background: transparent; color: var(--dim); }

/* top 3 on the leaderboard */
html[data-theme="modern"] tr.rank-1 td:first-child, html[data-theme="modern"] tr.rank-2 td:first-child,
html[data-theme="modern"] tr.rank-3 td:first-child { position: relative; }
html[data-theme="modern"] tr.rank-1 td:first-child span, html[data-theme="modern"] tr.rank-2 td:first-child span,
html[data-theme="modern"] tr.rank-3 td:first-child span { display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
  align-items: center; justify-content: center; font: 700 13px var(--cond); color: #1b1200; }
html[data-theme="modern"] tr.rank-1 td:first-child span { background: linear-gradient(135deg, #ffe08a, #e0a91d); }
html[data-theme="modern"] tr.rank-2 td:first-child span { background: linear-gradient(135deg, #f1f1f1, #a9adb3); }
html[data-theme="modern"] tr.rank-3 td:first-child span { background: linear-gradient(135deg, #f0b98a, #b0703d); }
html[data-theme="modern"] tr.rank-1 { background: linear-gradient(90deg, rgba(242,182,50,.10), transparent 60%) !important; }

/* form / score chips */
html[data-theme="modern"] .form { gap: 3px; }
html[data-theme="modern"] .form b { width: 18px; height: 18px; line-height: 18px; border-radius: 3px; font: 700 10px/18px var(--font); }
html[data-theme="modern"] .sc { border-radius: 3px; padding: 2px 7px; }
html[data-theme="modern"] .flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); margin-right: 8px; vertical-align: -2px; }

/* rating trend sparkline (hidden in classic) */
.trend { display: none; }
html[data-theme="modern"] .trend { display: inline-block; vertical-align: middle; }
html[data-theme="modern"] .trend polyline { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
html[data-theme="modern"] .trend.down polyline { stroke: #e46a5a; }
.col-trend { display: none; }
html[data-theme="modern"] .col-trend { display: table-cell; }

/* buttons + inputs */
html[data-theme="modern"] .btn { font: 600 12px/1 var(--font); letter-spacing: .02em; border-radius: 4px; padding: 7px 12px; min-height: 32px;
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s, border-color .15s; }
html[data-theme="modern"] .btn.big { font-size: 13px; padding: 10px 16px; min-height: 40px; background: var(--gold); color: var(--ink); border-color: var(--gold); }
html[data-theme="modern"] .btn.big:hover { background: #ffd165; }
html[data-theme="modern"] .btn.red.big { background: transparent; color: #ff7a6a; border-color: #ff7a6a; }
html[data-theme="modern"] .btn.link { min-height: 0; padding: 0; }
html[data-theme="modern"] input, html[data-theme="modern"] select, html[data-theme="modern"] textarea {
  font: 14px var(--font); background: #0d0505; border: 1px solid var(--line2); border-radius: 4px; padding: 7px 9px; min-height: 36px; color: var(--fg); }
html[data-theme="modern"] input:focus, html[data-theme="modern"] select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(242,182,50,.18); }
html[data-theme="modern"] input[type=checkbox], html[data-theme="modern"] input[type=radio] { min-height: 0; accent-color: var(--gold); }
html[data-theme="modern"] .pills { gap: 0; border: 1px solid var(--line2); border-radius: 5px; overflow: hidden; }
html[data-theme="modern"] .pills label { border: 0; border-right: 1px solid var(--line2); padding: 8px 16px; font: 600 14px var(--font); }
html[data-theme="modern"] .pills label:last-of-type { border-right: 0; }

/* teams */
html[data-theme="modern"] .team { border-radius: var(--radius); border-color: var(--line); overflow: hidden; }
html[data-theme="modern"] .team h3 { font: 700 18px var(--cond); letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; }
html[data-theme="modern"] .team ol { padding: 8px 12px 10px 30px; }
html[data-theme="modern"] .team li { padding: 4px 0; }
html[data-theme="modern"] .bigscore, html[data-theme="modern"] .ctl-score { font-family: var(--cond); }

/* sidebar lists */
html[data-theme="modern"] .mlist { font-size: 13px; }
html[data-theme="modern"] .mlist li { padding: 3px 0; }
html[data-theme="modern"] .mlist li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--box); margin-right: 8px; vertical-align: 1px; }
html[data-theme="modern"] .mlist li.hd { font: 600 12px var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-top: 10px; }
html[data-theme="modern"] .mlist li.hd::before { display: none; }
html[data-theme="modern"] .rel { color: var(--dim); font-size: 12px; }

/* LIVE */
html[data-theme="modern"] .live { display: inline-flex; align-items: center; gap: 5px; background: rgba(217,58,58,.15); color: #ff6b5e;
  border: 1px solid rgba(217,58,58,.45); border-radius: 10px; padding: 0 7px; font: 700 11px/18px var(--font); letter-spacing: .06em; }
html[data-theme="modern"] .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4b3e;
  animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { html[data-theme="modern"] .live::before { animation: none; } }

/* messages, comments, misc */
html[data-theme="modern"] .flash, html[data-theme="modern"] .err { border-width: 1px; border-radius: var(--radius); padding: 10px 14px; }
html[data-theme="modern"] .flash { border-color: rgba(47,168,79,.5); background: rgba(47,168,79,.12); }
html[data-theme="modern"] .err { border-color: rgba(217,58,58,.55); background: rgba(217,58,58,.12); }
html[data-theme="modern"] .comment { padding: 10px 12px; background: transparent !important; }
html[data-theme="modern"] .avail td { font-size: 11px; padding: 6px 2px; }
html[data-theme="modern"] .avail td.res { background: #4a1f1f; }
html[data-theme="modern"] .help { border-color: var(--line2); color: var(--dim); background: transparent; }
html[data-theme="modern"] .help:hover, html[data-theme="modern"] .help:focus { color: var(--gold); border-color: var(--gold); }
html[data-theme="modern"] #tip { font: 13px/1.5 var(--font); border: 1px solid var(--line2); border-top: 2px solid var(--box);
  border-radius: var(--radius); background: #1a0909; padding: 10px 12px; }
html[data-theme="modern"] .foot { font-size: 12px; padding-top: 20px; border-top: 1px solid var(--line); margin-top: 10px; }

/* phones: menu becomes a horizontal bar on top, sidebar below the content */
@media (max-width: 860px) {
  html[data-theme="modern"] .cols { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html[data-theme="modern"] .cols > nav { position: static; }
  html[data-theme="modern"] .cols > nav .box:last-child { display: none; }       /* account box: in the footer bar instead */
  html[data-theme="modern"] .menu { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 6px; }
  html[data-theme="modern"] .menu .grp { display: none; }
  html[data-theme="modern"] .menu a { white-space: nowrap; padding: 8px 10px; }
  html[data-theme="modern"] .pagetitle { font-size: 30px; }
  html[data-theme="modern"] body { padding: 12px 14px; }
}
.mobile-account { display: none; }
@media (max-width: 860px) {
  html[data-theme="modern"] .mobile-account { display: block; text-align: center; margin: 4px 0 12px; color: var(--dim); font-size: 13px; }
}
