:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: #0d1b2a;
  --panel-2: #122437;
  --line: #20384d;
  --muted: #91a7bb;
  --text: #eff7ff;
  --cyan: #55d6ef;
  --cyan-strong: #1bb5d0;
  --gold: #ffc85a;
  --green: #61e6a3;
  --red: #ff758b;
  --shadow: 0 18px 55px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% -10%, rgba(20, 118, 145, .2), transparent 35%),
    linear-gradient(145deg, #07111d 0%, #0a1623 52%, #07111d 100%);
  color: var(--text);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-left: 344px;
}

button, select, input { font: inherit; }
button, select, input {
  color: var(--text);
  background: #122437;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
}
button { cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }
button:hover { border-color: var(--cyan); transform: translateY(-1px); }
.primary { background: var(--cyan-strong); border-color: var(--cyan-strong); color: #03141b; font-weight: 800; }

.language-picker {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 11px;
  border: 1px solid #29465e;
  border-radius: 11px;
  background: rgba(7, 17, 29, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
.language-picker label { color: var(--muted); font-size: 11px; font-weight: 700; }
.language-picker select { min-width: 64px; padding: 5px 8px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.rules-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; color: var(--text); font-size: 11px; font-weight: 800; }
.rules-toggle span:first-child { font-size: 15px; line-height: 1; }
#theme-icon { color: var(--gold); font-size: 15px; line-height: 1; }
.community-dock-links { display: inline-flex; align-items: center; gap: 6px; padding-left: 7px; border-left: 1px solid var(--line); }
.community-dock-links a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; transition: transform .2s, box-shadow .2s; }
.community-dock-links a:first-child { background: #25d366; }
.community-dock-links a:last-child { background: #5865f2; }
.community-dock-links a:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 7px 18px rgba(0, 0, 0, .2); }
.community-dock-links img { width: 17px; height: 17px; }

body.rules-open { overflow: hidden; }
.rules-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 18px; background: rgba(2, 9, 16, .78); backdrop-filter: blur(5px); }
.rules-card { width: min(900px, 100%); max-height: min(90vh, 920px); overflow: hidden; border: 1px solid #37617e; border-radius: 18px; background: #0a1927; box-shadow: 0 32px 100px rgba(0, 0, 0, .58); }
.rules-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.rules-header .eyebrow { margin-bottom: 4px; }
.rules-header h2 { margin: 0; font-size: clamp(21px, 4vw, 30px); }
.rules-close { width: 38px; height: 38px; flex: 0 0 auto; padding: 0; color: var(--muted); font-size: 25px; line-height: 1; }
.rules-content { max-height: calc(min(90vh, 920px) - 88px); overflow-y: auto; padding: 20px 22px 24px; scrollbar-color: #37617e transparent; }
.rules-lead { margin: 0 0 14px; color: var(--muted); }
.rules-objective { padding: 13px 15px; border-left: 4px solid var(--cyan); border-radius: 0 11px 11px 0; background: rgba(85, 214, 239, .07); }
.rules-objective strong { color: var(--cyan); }
.rules-objective p { margin: 4px 0 0; }
.rules-section { margin-top: 22px; }
.rules-section h3 { margin: 0 0 10px; font-size: 18px; }
.tank-rule { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 12px; padding: 11px 13px; border: 1px solid rgba(255, 200, 90, .26); border-radius: 10px; background: rgba(255, 200, 90, .07); }
.tank-rule span { flex: 0 0 auto; }
.rules-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.rules-schedule th, .rules-schedule td { padding: 9px 12px; }
.rules-schedule tbody th { color: var(--text); background: transparent; }
.class-priority { display: inline-flex; padding: 4px 8px; border: 1px solid rgba(85, 214, 239, .24); border-radius: 999px; background: rgba(85, 214, 239, .08); color: #dff8ff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.x2-note { margin: 10px 0 0; color: var(--gold); font-size: 12px; }
.protected-rules > p { margin: 0 0 10px; color: var(--muted); }
.protected-rules ol { display: grid; gap: 8px; margin: 0; padding-left: 24px; }
.protected-rules li { padding-left: 4px; }
.protected-rules li::marker { color: var(--cyan); font-weight: 900; }
.rules-footer { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 28px 16px;
  background:
    radial-gradient(circle at 50% 5%, rgba(27, 181, 208, .25), transparent 34%),
    linear-gradient(145deg, #07111d, #0b1b2b 55%, #07111d);
}
.auth-card {
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid #29465e;
  border-radius: 22px;
  background: rgba(10, 25, 39, .97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}
.auth-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-2);
  box-shadow: 0 10px 30px rgba(27, 181, 208, .22);
}
.auth-mark img { width: 100%; height: 100%; object-fit: cover; }
.auth-card h1 { font-size: clamp(29px, 7vw, 40px); }
.auth-copy { margin: 8px 0 22px; color: var(--muted); }
.community-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: -5px 0 20px; }
.community-link { display: flex; align-items: center; min-width: 0; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(18, 36, 55, .72); color: var(--text); text-decoration: none; transition: transform .2s, border-color .2s, background .2s; }
.community-link:hover { transform: translateY(-2px); background: rgba(18, 36, 55, .96); }
.community-link > span:last-child { min-width: 0; }
.community-link strong, .community-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-link strong { font-size: 12px; }
.community-link small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.community-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; }
.community-icon img { width: 19px; height: 19px; }
.whatsapp-link:hover { border-color: #25d366; }
.whatsapp-link .community-icon { background: #25d366; }
.discord-link:hover { border-color: #5865f2; }
.discord-link .community-icon { background: #5865f2; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: #bfd1df; font-size: 13px; font-weight: 700; }
.auth-form input { width: 100%; padding: 12px 13px; }
.auth-form input:focus { outline: 2px solid rgba(85, 214, 239, .3); border-color: var(--cyan); }
.auth-submit { width: 100%; margin-top: 4px; padding: 12px; }
.auth-toggle { width: 100%; margin-top: 12px; border-color: transparent; background: transparent; color: var(--cyan); }
.auth-error { padding: 10px 12px; border: 1px solid rgba(255, 117, 139, .4); border-radius: 9px; background: rgba(255, 117, 139, .08); color: #ffadba; }
.auth-note { margin: 16px 0 0; color: #688198; font-size: 11px; text-align: center; }

.chat-panel {
  position: fixed;
  inset: 0 auto 0 0;
  width: 344px;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  background: rgba(6, 17, 28, .96);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 3;
}
.chat-heading, .section-heading, .hero, .live-box, .chat-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat-heading h2, .section-heading h2 { margin: 0; }
.eyebrow { margin: 0 0 4px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.pill { min-width: 34px; padding: 5px 9px; border-radius: 999px; background: rgba(85, 214, 239, .12); color: var(--cyan); text-align: center; font-weight: 800; }
.chat-feed { flex: 1; overflow-y: auto; margin-top: 18px; padding-right: 5px; scrollbar-color: #29465e transparent; }
.chat-message { margin-bottom: 9px; padding: 11px 12px; border: 1px solid #1d3448; border-radius: 12px; background: #0e2030; }
.chat-name { color: var(--cyan); font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-time { color: #6f899f; font-size: 11px; white-space: nowrap; }
.chat-text { margin-top: 5px; overflow-wrap: anywhere; }
.chat-id { display: block; margin-top: 6px; color: #627b90; font-size: 10px; }
.chat-special { color: var(--gold); font-style: italic; }
.chat-emote-image {
  width: 58px;
  height: 58px;
  margin: 2px 4px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .24));
}
.chat-emote-image.animated { width: 96px; height: 96px; }
.chat-emote-image.emote-only { width: 86px; height: 86px; }
.chat-emote-image.animated.emote-only { width: 128px; height: 128px; }
.empty-state { color: #6f899f; padding: 32px 14px; text-align: center; }

main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 34px 0 70px; }
.hero { align-items: flex-start; margin-bottom: 22px; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.04em; }
.hero-copy { max-width: 660px; margin: 8px 0 0; color: var(--muted); }
.hero-actions { display: grid; gap: 8px; min-width: 260px; }
.account-box { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 27, 42, .88); }
.account-box > div { min-width: 0; flex: 1; }
.account-box strong, .account-box small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-box small { color: var(--muted); }
.account-box button { padding: 6px 9px; color: var(--muted); }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(85, 214, 239, .14); color: var(--cyan); font-weight: 900; }
.live-box { justify-content: flex-start; min-width: 180px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 27, 42, .88); }
.live-box small { display: block; color: var(--muted); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(255, 200, 90, .1); }
.live-dot.online { background: var(--green); box-shadow: 0 0 0 5px rgba(97, 230, 163, .12); }
.live-dot.offline { background: var(--red); box-shadow: 0 0 0 5px rgba(255, 117, 139, .12); }

.error-banner { margin-bottom: 16px; padding: 12px 14px; border: 1px solid rgba(255, 117, 139, .4); border-radius: 10px; background: rgba(255, 117, 139, .08); color: #ffadba; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metrics article { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(18, 36, 55, .98), rgba(12, 28, 43, .98)); }
.metrics span { display: block; color: var(--muted); font-size: 12px; }
.metrics strong { display: block; margin-top: 6px; color: var(--gold); font-size: 26px; }

.toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(13, 27, 42, .9); }
.toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.quick-days { display: flex; gap: 6px; }

.character-layout { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 18px; padding: 18px 20px 20px; }
.account-screen { padding-left: 0; }
.account-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.back-button { color: var(--cyan); background: rgba(13, 27, 42, .88); }
.character-form { display: grid; align-content: start; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 17, 29, .42); }
.character-form label:not(.primary-check) { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.character-form input { width: 100%; }
.primary-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.primary-check input { width: auto; accent-color: var(--cyan-strong); }
.character-list { display: grid; align-content: start; gap: 9px; }
.character-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18, 36, 55, .7); }
.character-badge { display: grid; place-items: center; min-width: 48px; height: 42px; padding: 0 8px; border-radius: 10px; background: rgba(85, 214, 239, .13); color: var(--cyan); font-weight: 900; }
.character-info { flex: 1; min-width: 0; }
.character-info strong, .character-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.character-info small { margin-top: 3px; color: var(--muted); }
.character-actions { display: flex; align-items: center; gap: 7px; }
.character-actions button { padding: 6px 8px; font-size: 11px; }
.primary-label { color: var(--gold); font-size: 11px; font-weight: 800; }
.danger-button { color: #ff9aaa; }

.content-card { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 27, 42, .9); box-shadow: 0 12px 36px rgba(0, 0, 0, .12); }
.section-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.section-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid rgba(32, 56, 77, .78); text-align: left; vertical-align: middle; }
th { color: var(--cyan); background: rgba(7, 17, 29, .45); font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(85, 214, 239, .035); }
.item { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.item img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: #07111d; }
.item strong { display: block; }
.item small, td small { display: block; margin-top: 3px; color: var(--muted); }
.box-preview-trigger { cursor: help; border-radius: 11px; outline: none; }
.box-preview-trigger:hover, .box-preview-trigger:focus-visible { background: rgba(85, 214, 239, .08); box-shadow: 0 0 0 5px rgba(85, 214, 239, .08); }
.box-hint { color: var(--cyan) !important; font-size: 10px; font-weight: 800; }
.box-preview {
  position: fixed;
  z-index: 100;
  max-height: min(72vh, 650px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #37617e;
  border-radius: 15px;
  background: rgba(7, 20, 33, .985);
  box-shadow: 0 24px 75px rgba(0, 0, 0, .56), 0 0 0 1px rgba(85, 214, 239, .08);
  pointer-events: auto;
  scrollbar-color: #37617e transparent;
}
.box-preview header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.box-preview header span { color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.box-preview h3 { margin: 3px 0 0; font-size: 18px; line-height: 1.25; }
.box-preview header b { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: rgba(255, 200, 90, .12); color: var(--gold); font-size: 10px; }
.box-preview section { margin-top: 12px; }
.box-preview h4 { margin: 0 0 7px; color: #b9cede; font-size: 11px; }
.box-preview .previous-phase { padding-top: 10px; border-top: 1px dashed #29465e; }
.box-reward-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.box-reward { display: flex; align-items: flex-start; min-width: 0; gap: 8px; padding: 7px; border: 1px solid #1d3448; border-radius: 10px; background: #0e2030; }
.box-reward img { width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; border-radius: 8px; background: #07111d; }
.box-reward div { min-width: 0; }
.box-reward strong { display: block; overflow: hidden; color: #dcecff; font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.box-reward.quality-3 strong { color: #72bdff; }
.box-reward.quality-4 strong { color: #c48cff; }
.box-reward small { margin-top: 2px; color: #6f899f; font-size: 9px; }
.reward-attributes { display: grid; gap: 1px; margin-top: 5px; }
.reward-attributes span { color: #a9bdcd; font-size: 9px; line-height: 1.25; }
.reward-attributes b { color: var(--green); }
.item-attributes { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; margin-top: 6px; }
.item-attributes span { font-size: 10px; }
.quality-3 strong { color: #72bdff; }
.quality-4 strong { color: #c48cff; }
.price { color: var(--gold); font-weight: 800; white-space: nowrap; }
.player { color: #e6f5ff; font-weight: 700; }
.sequence { min-width: 220px; color: #bcd0df; }
.analytics-screen { max-width: 1320px; }
.analytics-toolbar label:nth-child(3) { min-width: min(360px, 100%); }
.coverage-note { margin: -6px 0 16px; padding: 10px 13px; border-left: 3px solid var(--gold); background: rgba(255, 200, 90, .07); color: #b9cede; font-size: 12px; }
.analytics-table td { white-space: nowrap; }
.analytics-table td:nth-child(2) { white-space: normal; }
.rank-number { color: var(--cyan); font-size: 17px; font-weight: 900; }
.player-total-score { color: var(--gold); font-size: 18px; }
.detail-button { padding: 6px 9px; color: var(--cyan); font-size: 11px; }
.score-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.score-badge { display: grid; place-items: center; width: 42px; height: 34px; flex: 0 0 auto; border: 1px solid #29465e; border-radius: 10px; background: #0a1826; color: #b9cede; }
.score-3 { color: var(--gold); border-color: rgba(255, 200, 90, .38); }
.score-4, .score-5 { color: var(--green); border-color: rgba(97, 230, 163, .4); }
.score-track { width: 84px; height: 6px; overflow: hidden; border-radius: 999px; background: #07111d; }
.score-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-strong), var(--green)); }
.score-breakdown { margin-top: 5px; white-space: nowrap; }
.confidence { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: rgba(111, 137, 159, .12); color: #9db2c2; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.confidence-high { background: rgba(97, 230, 163, .12); color: var(--green); }
.confidence-medium { background: rgba(255, 200, 90, .12); color: var(--gold); }
.confidence-low { background: rgba(255, 154, 170, .1); color: #ff9aaa; }
.status-leader { color: var(--green); font-weight: 800; }
.status-outbid { color: #ffadba; }
.player-detail-card { scroll-margin-top: 18px; border-color: #37617e; }

body.abyss-view { padding-left: 0; }
.abyss-screen { width: calc(100% - 32px); max-width: none; }
.abyss-toolbar { align-items: end; }
.abyss-toolbar label { min-width: 190px; }
.abyss-layout { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(520px, 1.6fr); gap: 18px; align-items: start; }
.abyss-history-card, .abyss-detail-card { margin: 0; }
.abyss-run-list { display: grid; gap: 10px; padding: 14px; }
.abyss-run-card { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.abyss-run-card.selected { border-color: var(--cyan); box-shadow: inset 3px 0 var(--cyan); }
.abyss-run-card > img { width: 58px; height: 58px; object-fit: cover; border-radius: 12px; background: #07111d; }
.abyss-run-title { display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; }
.abyss-run-title strong { font-size: 16px; }
.abyss-run-title span { color: var(--cyan); font-size: 12px; font-weight: 800; }
.abyss-run-main p { margin: 4px 0 7px; color: var(--muted); font-size: 12px; }
.abyss-run-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.abyss-run-tags span, .quality-badge { padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; }
.abyss-detail { padding: 18px; }
.abyss-detail-hero { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.abyss-detail-hero > img { width: 78px; height: 78px; object-fit: cover; border-radius: 16px; background: #07111d; }
.abyss-detail-hero h2, .abyss-detail-hero p { margin: 0; }
.abyss-detail-hero .eyebrow { margin-bottom: 4px; }
.quality-badge { color: var(--gold); border-color: rgba(255, 200, 90, .35); background: rgba(255, 200, 90, .08); }
.abyss-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 16px 0; }
.abyss-facts article { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.abyss-facts span, .abyss-facts strong { display: block; }
.abyss-facts span { color: var(--muted); font-size: 11px; }
.abyss-facts strong { margin-top: 4px; color: var(--gold); }
.abyss-diagnostic-grid, .abyss-technical-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.abyss-diagnostic-grid article, .abyss-technical-grid article { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.abyss-diagnostic-grid span, .abyss-technical-grid span { display: block; color: var(--muted); font-size: 11px; }
.abyss-diagnostic-grid strong, .abyss-technical-grid strong { display: block; margin-top: 3px; color: var(--text); font-size: 17px; }
.abyss-coverage-summary { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--cyan); background: rgba(85, 214, 239, .06); color: var(--muted); font-size: 12px; }
.damage-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.damage-total span { color: var(--muted); }
.damage-total strong { color: var(--gold); font-size: 22px; }
.damage-row { margin-top: 10px; }
.damage-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; font-size: 12px; }
.damage-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(145, 167, 187, .13); }
.damage-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-strong), var(--green)); }
.damage-row.boss .damage-track i { background: linear-gradient(90deg, #a84de0, #ff758b); }
.boss-window { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.boss-window strong { color: var(--text); }
.player-damage-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 11px; }
.player-damage-summary article { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.player-damage-summary span, .player-damage-summary strong { display: block; }
.player-damage-summary span { color: var(--muted); font-size: 11px; }
.player-damage-summary strong { margin-top: 4px; color: var(--gold); font-size: 18px; }
.player-damage-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.visible-roster { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; align-items: center; margin: 0 0 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.visible-roster > strong { font-size: 12px; }
.visible-roster > div { display: flex; flex-wrap: wrap; gap: 6px; }
.visible-roster span { padding: 4px 8px; border-radius: 999px; color: var(--text); background: rgba(85, 214, 239, .1); font-size: 10px; font-weight: 800; }
.visible-roster .cropped-name { color: var(--muted); background: rgba(145, 167, 187, .1); }
.player-damage-table { min-width: 820px; }
.player-damage-table td:first-child { min-width: 170px; }
.player-damage-table td small { margin-top: 3px; }
.player-share { display: inline-block; min-width: 54px; padding: 4px 7px; border-radius: 999px; color: var(--cyan); background: rgba(85, 214, 239, .1); font-weight: 900; text-align: center; }
.player-name-warning, .player-dps-formula { margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid var(--gold); background: rgba(255, 200, 90, .06); color: var(--muted); font-size: 11px; }
.player-dps-formula { border-left-color: var(--cyan); background: rgba(85, 214, 239, .06); }
.abyss-limitations { padding: 13px 15px; border: 1px solid rgba(255, 200, 90, .28); border-radius: 11px; background: rgba(255, 200, 90, .06); }
.abyss-limitations ul { display: grid; gap: 7px; margin: 0; padding-left: 19px; color: var(--muted); font-size: 12px; }
.abyss-limitations li::marker { color: var(--gold); }
.section-note { margin: -4px 0 11px; color: var(--muted); font-size: 12px; }
.abyss-analysis-wrap { max-height: 620px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.abyss-analysis-table { min-width: 1160px; font-size: 12px; }
.abyss-analysis-table th { position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.abyss-analysis-table td { vertical-align: top; }
.abyss-analysis-table td:first-child { min-width: 235px; }
.abyss-analysis-table td strong, .abyss-analysis-table td small, .mob-formula { display: block; }
.abyss-analysis-table td small { color: var(--muted); }
.mob-formula { max-width: 380px; margin-top: 4px; color: var(--cyan); font-size: 10px; line-height: 1.35; }
.abyss-analysis-table .num { white-space: nowrap; text-align: right; }
.abyss-analysis-table .strong-num { color: var(--gold); font-weight: 900; }
.source-badge { display: inline-flex; align-items: center; width: max-content; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 900; white-space: nowrap; }
.source-badge.live, .source-badge.live-apk { color: var(--green); border-color: rgba(97, 230, 163, .3); background: rgba(97, 230, 163, .08); }
.source-badge.apk { color: var(--cyan); border-color: rgba(85, 214, 239, .3); background: rgba(85, 214, 239, .08); }
.source-badge.derived { color: var(--gold); border-color: rgba(255, 200, 90, .3); background: rgba(255, 200, 90, .08); }
.summoner-list article { display: grid; grid-template-columns: minmax(220px, 1.3fr) 1fr 1fr; gap: 8px 16px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.summoner-list small { display: block; color: var(--muted); }
.summoner-list p { grid-column: 1 / -1; margin: 3px 0; color: var(--muted); font-size: 12px; }
.calculation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.calculation-grid article { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.calculation-grid code { color: var(--cyan); font-size: 11px; }
.calculation-grid strong { font-size: 13px; }
.calculation-grid p { margin: 0; color: var(--muted); font-size: 11px; }
.source-reference-list { display: grid; gap: 8px; margin: 10px 0; }
.source-reference-list article { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.source-reference-list p { margin: 2px 0 0; }
.abyss-detail-section { margin-top: 20px; }
.abyss-detail-section h3 { margin: 0 0 10px; font-size: 17px; }
.abyss-member-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.abyss-member { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.abyss-member div small, .abyss-member > small { display: block; color: var(--muted); font-size: 11px; }
.abyss-member p { grid-column: 1 / -1; margin: 2px 0; color: var(--muted); font-size: 11px; }
.abyss-member > small { grid-column: 1 / -1; }
.mapping { align-self: start; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.mapping.confirmed { color: var(--green); background: rgba(97, 230, 163, .1); }
.mapping.inferred { color: var(--gold); background: rgba(255, 200, 90, .1); }
.mapping.unconfirmed { color: var(--muted); background: rgba(145, 167, 187, .1); }
.abyss-threat-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.abyss-threat-list article { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.abyss-threat-list img, .threat-placeholder { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; background: #07111d; }
.threat-placeholder { display: grid; place-items: center; color: var(--red); font-weight: 900; }
.abyss-threat-list small { display: block; color: var(--muted); }
.abyss-threat-list p { margin: 4px 0 0; font-size: 11px; }
.abyss-ability-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.abyss-ability-list article, .abyss-mechanic { padding: 11px; border-left: 3px solid var(--cyan); border-radius: 9px; background: var(--panel-2); }
.abyss-ability-list span { display: block; margin-top: 4px; color: var(--green); font-weight: 800; }
.abyss-ability-list p, .abyss-mechanic p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.abyss-mechanic + .abyss-mechanic { margin-top: 8px; }
.abyss-source { margin-top: 20px; padding-top: 13px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.abyss-source p { margin: 3px 0 0; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef6fb;
  --panel: #ffffff;
  --panel-2: #f2f7fb;
  --line: #c8d9e5;
  --muted: #526f83;
  --text: #142938;
  --cyan: #087f9d;
  --cyan-strong: #24b4ce;
  --gold: #a76500;
  --green: #087a4f;
  --red: #c43e56;
  --shadow: 0 18px 45px rgba(45, 78, 99, .13);
}
[data-theme="light"] body {
  background:
    radial-gradient(circle at 70% -10%, rgba(36, 180, 206, .16), transparent 35%),
    linear-gradient(145deg, #f7fbfe 0%, #edf6fb 52%, #f7fbfe 100%);
}
[data-theme="light"] button,
[data-theme="light"] select,
[data-theme="light"] input { color: var(--text); background: #fff; }
[data-theme="light"] .primary { color: #062631; background: #31bdd5; border-color: #31bdd5; }
[data-theme="light"] .language-picker { border-color: var(--line); background: rgba(255, 255, 255, .96); box-shadow: var(--shadow); }
[data-theme="light"] .community-dock-links a:hover { box-shadow: 0 7px 18px rgba(45, 78, 99, .2); }
[data-theme="light"] .rules-card { border-color: #9bbccc; background: #fff; box-shadow: 0 30px 80px rgba(45, 78, 99, .28); }
[data-theme="light"] .rules-objective { background: #eefafd; }
[data-theme="light"] .tank-rule { background: #fff9eb; }
[data-theme="light"] .class-priority { border-color: #b9dce6; background: #edf9fc; color: #17647a; }
[data-theme="light"] .auth-screen {
  background:
    radial-gradient(circle at 50% 5%, rgba(36, 180, 206, .2), transparent 34%),
    linear-gradient(145deg, #f8fcff, #eaf5fa 55%, #f8fcff);
}
[data-theme="light"] .auth-card,
[data-theme="light"] .chat-panel,
[data-theme="light"] .content-card { background: rgba(255, 255, 255, .96); border-color: var(--line); }
[data-theme="light"] .auth-form label { color: #36566c; }
[data-theme="light"] .community-link { background: #f4f9fc; }
[data-theme="light"] .community-link:hover { background: #fff; }
[data-theme="light"] .auth-note { color: #688398; }
[data-theme="light"] .chat-message { border-color: #d2e0e9; background: #f4f9fc; }
[data-theme="light"] .chat-time,
[data-theme="light"] .chat-id,
[data-theme="light"] .empty-state { color: #637e91; }
[data-theme="light"] .account-box,
[data-theme="light"] .live-box,
[data-theme="light"] .toolbar,
[data-theme="light"] .back-button { background: rgba(255, 255, 255, .9); }
[data-theme="light"] .metrics article { background: linear-gradient(145deg, #fff, #f1f7fb); }
[data-theme="light"] .character-form { background: #f7fbfd; }
[data-theme="light"] .character-item { background: #f2f7fb; }
[data-theme="light"] th { background: #edf6fa; }
[data-theme="light"] th,
[data-theme="light"] td { border-bottom-color: #d5e2eb; }
[data-theme="light"] tbody tr:hover { background: rgba(36, 180, 206, .06); }
[data-theme="light"] .item img,
[data-theme="light"] .box-reward img { background: #eaf2f7; }
[data-theme="light"] .player { color: #18384c; }
[data-theme="light"] .sequence,
[data-theme="light"] .coverage-note { color: #46657a; }
[data-theme="light"] .box-preview { border-color: #9bbccc; background: rgba(255, 255, 255, .99); box-shadow: 0 24px 65px rgba(45, 78, 99, .24); }
[data-theme="light"] .box-preview h4 { color: #3e6178; }
[data-theme="light"] .box-reward { border-color: #d2e0e9; background: #f4f9fc; }
[data-theme="light"] .box-reward strong { color: #17364a; }
[data-theme="light"] .box-reward small,
[data-theme="light"] .reward-attributes span { color: #5b788c; }
[data-theme="light"] .score-badge { border-color: #bdd1de; background: #f4f9fc; color: #36596f; }
[data-theme="light"] .score-track { background: #dce9f0; }
[data-theme="light"] .quality-3 strong,
[data-theme="light"] .box-reward.quality-3 strong { color: #006fab; }
[data-theme="light"] .quality-4 strong,
[data-theme="light"] .box-reward.quality-4 strong { color: #7a35b0; }
[data-theme="light"] .status-outbid { color: #b72f49; }

@media (max-width: 1050px) {
  body { padding-left: 0; }
  .chat-panel { position: relative; width: min(1180px, calc(100% - 32px)); height: 330px; margin: 16px auto 0; border: 1px solid var(--line); border-radius: 14px; }
  main { width: min(1180px, calc(100% - 32px)); padding-top: 20px; }
  .abyss-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .language-picker { right: 8px; bottom: 8px; }
  .language-picker label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #theme-label { display: none; }
  #rules-button-label { display: none; }
  .rules-modal { padding: 8px; }
  .rules-card { max-height: 96vh; }
  .rules-header { padding: 15px 14px 12px; }
  .rules-content { max-height: calc(96vh - 76px); padding: 15px 14px 18px; }
  .hero { display: grid; }
  .hero-actions { width: 100%; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .section-heading { display: grid; }
  .toolbar > label, .toolbar select, .toolbar input { width: 100%; }
  .quick-days { width: 100%; }
  .quick-days button { flex: 1; }
  .primary { width: 100%; }
  .auth-card { padding: 24px 20px; }
  .community-links { grid-template-columns: 1fr; }
  .character-layout { grid-template-columns: 1fr; padding: 14px; }
  .account-page-header { display: grid; }
  .back-button { width: 100%; }
  .character-item { align-items: flex-start; flex-wrap: wrap; }
  .character-actions { width: 100%; justify-content: flex-end; }
  .box-preview { padding: 12px; }
  .box-preview header { display: block; }
  .box-preview header b { display: inline-block; margin-top: 8px; }
  .box-reward-grid { grid-template-columns: 1fr; }
  .analytics-toolbar label:nth-child(3) { min-width: 100%; }
  .score-track { display: none; }
  .abyss-run-card { grid-template-columns: 50px 1fr; }
  .abyss-run-card > img { width: 50px; height: 50px; }
  .abyss-run-card > button { grid-column: 1 / -1; width: 100%; }
  .abyss-detail-hero { grid-template-columns: 62px 1fr; }
  .abyss-detail-hero > img { width: 62px; height: 62px; }
  .quality-badge { grid-column: 1 / -1; justify-self: start; }
  .abyss-facts, .abyss-member-list, .abyss-threat-list, .abyss-ability-list, .player-damage-summary { grid-template-columns: 1fr; }
  .abyss-diagnostic-grid, .abyss-technical-grid { grid-template-columns: repeat(2, 1fr); }
  .calculation-grid { grid-template-columns: 1fr; }
  .summoner-list article { grid-template-columns: 1fr; }
}

