.illustration-editor { margin: 22px 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.illustration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin: 14px 0; }
.illustration-choice { display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel-2);
  cursor: pointer; min-width: 0; }
.illustration-choice[aria-pressed="true"] { border-color: var(--gold); background: var(--panel); }
.illustration-choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.illustration-choice img { width: 100%; height: 200px; object-fit: contain; }
.illustration-default { display: flex; align-items: center; justify-content: center; width: 100%; height: 200px; color: var(--muted); }
@media (max-width: 480px) { .illustration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .illustration-choice img, .illustration-default { height: 172px; } }
:root {
  --bg: #0d0d10;
  --panel: #17171c;
  --panel-2: #1f1f26;
  --line: #2c2c35;
  --text: #ecebf0;
  --muted: #9a98a6;
  --red: #d7263d;
  --red-dim: #7a1422;
  --gold: #e8b64c;
  --win: #4fc38a;
  --lose: #e0605e;
  --radius: 10px;
  color-scheme: dark;   /* native date pickers, dropdowns and scrollbars follow the dark theme */
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

/* header.top, not .top: the ranking podium cells also carry a "top" class */
header.top { display: flex; align-items: center; gap: 24px; padding: 14px 24px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(90deg, #1a0408, #0d0d10 60%); border-bottom: 2px solid var(--red-dim); }
.brand { font-weight: 900; letter-spacing: .08em; font-size: 20px; text-decoration: none; font-style: italic; }
.brand span { color: var(--red); }
#nav { display: flex; gap: 6px; flex-wrap: wrap; }
#nav a { text-decoration: none; padding: 6px 12px; border-radius: 6px; color: var(--muted); }
#nav a.on, #nav a:hover { color: var(--text); background: var(--panel-2); }

.banner { background: #2a2108; color: var(--gold); border-bottom: 1px solid #4a3a10; padding: 8px 24px; font-size: 13px; }
.banner.live { background: #0d2418; color: #7fe0a8; border-bottom-color: #1d4a32; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; border-top: 1px solid var(--line); }

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 12px; color: var(--gold); letter-spacing: .03em; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* game select */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.game { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 190px;
  padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, #3a0a12 0%, var(--panel) 55%); transition: transform .15s, border-color .15s; }
.game::before { content: attr(data-mark); position: absolute; top: 10px; right: 14px; font-size: 64px; font-weight: 900;
  font-style: italic; color: rgba(215, 38, 61, .18); line-height: 1; }
.game .t { font-weight: 900; font-style: italic; font-size: 18px; line-height: 1.25; }
.game .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.game .badge { align-self: flex-start; margin-bottom: auto; font-size: 12px; padding: 2px 8px; border-radius: 99px;
  background: var(--red); color: #fff; font-weight: 700; }
.game.ready:hover { transform: translateY(-3px); border-color: var(--red); }
.game.locked { filter: grayscale(.85); opacity: .55; cursor: not-allowed; }
.game.locked .badge { background: #444; }
.game .badge.live { background: var(--win); color: #062114; }
.game .badge.lab { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.game .badge.sample { background: #3a3a45; color: var(--text); }
.game.ready:hover::before { color: rgba(215, 38, 61, .32); }
.game .n { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.btn { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn:disabled { opacity: .5; cursor: default; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.card { display: block; text-decoration: none; padding: 14px 16px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--red); }
.card:hover { border-color: var(--red); }
.card .nm { font-weight: 800; font-size: 17px; }
.card .ac { font-family: Consolas, monospace; color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.card .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.card .meta > span:first-child { white-space: nowrap; }
.card .meta b { color: var(--text); }
.card:hover .nm { color: #fff; }
.stats + .sub { margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: keep-all; }

.profile { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.profile .world { color: var(--muted); }
.profile .cmt { margin-top: 6px; color: var(--gold); }
.acode { font-family: Consolas, monospace; letter-spacing: .06em; background: var(--panel-2); padding: 6px 10px;
  border-radius: 6px; border: 1px solid var(--line); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; }
tr:hover td { background: var(--panel-2); }
.scroll { overflow-x: auto; }
.rank { font-weight: 700; color: var(--gold); }
.win { color: var(--win); font-weight: 700; }
.lose { color: var(--lose); font-weight: 700; }
.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--red); }
.pos { width: 40px; font-weight: 900; font-style: italic; color: var(--muted); }
.pos.top { color: var(--gold); font-size: 17px; }
.pos.top.p2 { color: #c9ccd6; }
.pos.top.p3 { color: #d08b4f; }
/* analysis status pills and the RPC name chips (gamedata.json "analysis" / "rpcs") */
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pill.win { background: rgba(79, 195, 138, .12); color: var(--win); box-shadow: inset 0 0 0 1px rgba(79, 195, 138, .35); }
.pill.lose { background: rgba(224, 96, 94, .12); color: var(--lose); box-shadow: inset 0 0 0 1px rgba(224, 96, 94, .35); }
.pill.mid { background: rgba(232, 182, 76, .1); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(232, 182, 76, .3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.chips code { font: 12px Consolas, monospace; padding: 2px 8px; border-radius: 6px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.tabs button.on { background: var(--red); border-color: var(--red); color: #fff; }

.edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.edit input:not([type=checkbox]) { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 15px; }
.msg { font-size: 13px; min-height: 20px; }
.msg.ok { color: var(--win); }
.msg.err { color: var(--lose); }
.equipment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.equipment-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; min-width: 0; }
.equipment-grid select { width: 100%; max-width: 100%; min-width: 0; flex: none; }
/* An item photo under one select must not stretch the other selects in its row (rage / aura next to an effect photo). */
.equipment-grid { align-items: start; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }

@media (max-width: 640px) {
  header.top { padding: 12px 16px; gap: 12px; flex-wrap: wrap; position: static; }
  .banner { padding: 8px 16px; }
  .stat .v { font-size: 18px; }
}
.color-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; margin-top: 8px; }
.color-group { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.color-group > span { flex: 1; min-width: 0; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); padding: 0; cursor: pointer; flex: none; }
.swatch.default { background: repeating-linear-gradient(45deg, var(--panel-2) 0 4px, var(--line) 4px 8px); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; margin-top: 10px; }
.palette .swatch { width: 100%; }
details.color-more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 8px; }
.swatch.patterned::after { content: '◆'; color: #fff; font-size: 11px; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.trial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.trial-cell { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.trial-cell.cleared { border-color: var(--win); }
.trial-cell label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.trial-cell input, .trial-cell select { min-width: 0; width: 100%; padding: 7px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.search:focus, .edit input:focus, .edit select:focus, .trial-cell input:focus, .trial-cell select:focus {
  outline: none; border-color: var(--red); }
.btn:focus-visible, .tabs button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.trial-cell progress, .carnival-meter { width: 100%; accent-color: var(--gold); }
.member-row { padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.member-row a { flex: 1; }
.edit select { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 15px; }
@media (max-width: 640px) { .trial-cell { padding: 8px; font-size: 12px; } }

/* TTT2 card: tabs, folded report tables, settings (tag presets, card server values) */
.card-tabs { margin: 20px 0 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
details.fold { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
details.fold > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--gold); display: flex;
  justify-content: space-between; gap: 12px; }
details.fold > summary .n { color: var(--muted); font-weight: 400; font-size: 13px; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > .body { padding: 12px 16px; overflow-x: auto; }
.edit label small, .edit .field small { color: var(--muted); font-size: 11px; }
.edit .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.btn.small { padding: 4px 10px; font-size: 13px; text-decoration: none; display: inline-block; }
.btn.saved { border-color: var(--win); color: var(--win); }
.savebar { margin-top: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 99px;
  background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .15s; }
.switch input:checked { background: var(--win); }
.switch input:checked::after { left: 19px; }
.switch input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.setting { margin-bottom: 12px; }
.setting > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.setting > header h3 { margin: 0; font-size: 16px; }
.setting.off .edit { opacity: .45; }
.setting details summary, .panel > details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 12px; }
.setting details p { margin: 6px 0 0; }
.look-cell { display: flex; align-items: center; gap: 8px; }
.look-cell a { font-size: 12px; color: var(--muted); }
.look-cell a:hover { color: var(--text); }
.look { font-size: 12px; color: var(--muted); }
.look.saved { color: var(--win); }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 10px 20px; }
.look-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 12px; }
.preset { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.preset.off { border-left-color: var(--line); }
.preset.off .preset-line { opacity: .5; }
.preset.changed { border-color: var(--gold); border-left-color: var(--gold); background: rgba(232, 182, 76, .05); }
.preset > header { display: flex; align-items: center; gap: 10px; }
.preset-no { font-style: italic; font-weight: 900; color: var(--gold); white-space: nowrap; }
.preset-team { flex: 1; min-width: 0; color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset.off .preset-team { color: var(--muted); font-weight: 400; }
.preset-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preset-line .role { width: 30px; font-size: 12px; color: var(--muted); }
.preset-line select { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); font-size: 14px; }
.preset-line select:first-of-type { flex: 1; min-width: 140px; }
.preset-foot { display: flex; justify-content: flex-end; }
.preset-foot .btn { padding: 3px 10px; font-size: 12px; }
.look-row b { white-space: nowrap; }
@media (max-width: 640px) { .preset-grid { grid-template-columns: 1fr; } }
/* TTT2 pictures from the old Tekken-Net shop (static/img/ttt2) */
.face { width: 32px; height: 40px; border-radius: 4px; object-fit: cover; flex: none; vertical-align: middle; }
.face.lg { width: 48px; height: 60px; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.card .faces { display: flex; gap: 4px; margin: -2px 0 8px; }
.card .faces .face { width: 28px; height: 35px; }
.item-pic { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #777; display: block; }
.equip-pic .item-pic { width: 72px; height: 72px; margin-top: 4px; }
.preset-line .pic { width: 32px; height: 40px; flex: none; display: inline-flex; }
.preset-line .pic:empty { border: 1px dashed var(--line); border-radius: 4px; }
.need { margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--lose); border-radius: var(--radius);
  background: rgba(224, 96, 94, .08); color: var(--lose); font-size: 13px; }
.need ul { margin: 8px 0 0; padding-left: 18px; }
.need li { margin: 4px 0; color: var(--text); }
.need .btn { color: var(--text); }
/* Tag 2 card delete (tagCardPanel): details, typed card number, then the browser's confirm */
.delete-box { margin: 12px 0; padding: 14px 16px; border: 1px solid var(--lose); border-radius: var(--radius);
  background: rgba(224, 96, 94, .08); }
.delete-box h3 { margin: 0 0 8px; color: var(--lose); }
.delete-box ul { margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.delete-box li { margin: 4px 0; }
.btn.danger { background: var(--lose); border-color: var(--lose); color: #fff; }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger-outline { border-color: var(--lose); color: var(--lose); background: transparent; }
/* Costume wear check (costume_rules): yellow when it only needs an in-game look */
.need.warn { border-color: #d6a23a; background: rgba(214, 162, 58, .08); color: #d6a23a; }
.need li.warn { color: var(--muted); }
.trial-note { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; margin: -2px 0 4px; }
.br-equipment { margin: 18px 0; }
.br-equipment .equipment-cell { display: flex; flex-direction: column; align-items: start; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.br-equipment .equipment-cell span { overflow-wrap: anywhere; font-size: 13px; }
.table-wrap { overflow-x: auto; }
