:root {
  color-scheme: dark;
  --night: #070d1c;
  --panel: #111a31;
  --panel-strong: #162241;
  --line: #2a3a60;
  --muted: #9ba9c8;
  --text: #f5f7ff;
  --gold: #ffc853;
  --violet: #8b6cff;
  --green: #42e6a4;
  --danger: #ff6f81;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 12%, #293464 0, transparent 31%),
    radial-gradient(circle at 88% 86%, #183c55 0, transparent 28%),
    var(--night);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #b6a3ff; outline-offset: 3px; }
textarea { width: 100%; min-height: 96px; padding: 12px 15px; border: 1px solid #34476f; border-radius: 13px; background: #091226; color: var(--text); line-height: 1.65; resize: vertical; }
textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px #8b6cff20; }
input::placeholder, textarea::placeholder { color: #95a3bf; opacity: 1; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--violet); }
button { cursor: pointer; }
.hidden { display: none !important; }
.aurora { display: none; }
.aurora-one { width: 420px; height: 420px; background: #7656ff; left: -180px; top: 18%; }
.aurora-two { width: 360px; height: 360px; background: #25b8a2; right: -140px; bottom: 5%; }
.page-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; position: relative; z-index: 1; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 76px; padding: 52px 0; }
.eyebrow, .kicker { margin: 0; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 1.8px; }
.intro-panel h1, .admin-header h1 { margin: 13px 0 20px; font-family: Spectral, serif; line-height: .98; letter-spacing: -.04em; }
.intro-panel h1 { font-size: clamp(48px, 7vw, 82px); }
.intro-panel h1 span, .admin-header h1 span { color: var(--gold); }
.intro-panel > p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.feature-list { display: grid; gap: 12px; margin-top: 35px; }
.feature-list div { display: flex; align-items: center; gap: 14px; color: #cbd4e9; }
.feature-list b { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #4c5f91; border-radius: 12px; color: var(--gold); font-size: 12px; }
.login-card { padding: 38px; border: 1px solid #394a77; border-radius: 28px; background: linear-gradient(155deg, #14203bd9, #0d152ae8); box-shadow: 0 35px 90px #0008; backdrop-filter: blur(18px); }
.crest { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 24px; border: 1px solid #6f5ade; border-radius: 17px; background: #211d49; color: var(--gold); font-size: 29px; }
.login-card h2 { margin: 8px 0 2px; font-size: 28px; }
.subtext { margin: 0 0 27px; color: var(--muted); }
label { display: block; margin: 16px 0 7px; color: #d7dff1; font-size: 14px; font-weight: 700; }
input { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid #34476f; border-radius: 13px; outline: none; background: #091226; color: white; transition: .2s; }
input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px #8b6cff20; }
select { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid #34476f; border-radius: 13px; outline: none; background: #091226; color: white; }
select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px #8b6cff20; }
.password-row { display: grid; grid-template-columns: 1fr auto; }
.password-row input { border-radius: 13px 0 0 13px; }
.icon-button { border: 1px solid #34476f; border-left: 0; border-radius: 0 13px 13px 0; background: #172442; color: #cbd4e9; padding: 0 15px; }
.primary-button, .secondary-button { border: 0; border-radius: 13px; font-weight: 800; }
.primary-button { width: 100%; min-height: 54px; margin-top: 24px; background: linear-gradient(115deg, var(--gold), #ffad4d); color: #241704; box-shadow: 0 15px 34px #ffb3412b; }
.primary-button:disabled { cursor: wait; opacity: .62; }
.secondary-button { padding: 11px 17px; background: #1a2849; color: white; }
.message { min-height: 22px; margin: 13px 0 0; color: var(--danger); font-size: 13px; }
.message.success { color: var(--green); }
.security-note { margin-top: 21px; padding-top: 19px; border-top: 1px solid #283857; color: var(--muted); font-size: 12px; line-height: 1.6; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.admin-view { min-height: 100vh; padding: 28px 0 70px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0 28px; border-bottom: 1px solid #253555; }
.admin-header h1 { margin: 5px 0 0; font-size: 28px; }
.admin-actions { display: flex; align-items: center; gap: 15px; }
.identity { text-align: right; }
.identity small { display: block; color: var(--muted); }
.identity strong { display: block; margin-top: 2px; }
.dashboard-grid { display: grid; grid-template-columns: 245px 1fr; gap: 22px; margin-top: 28px; }
.side-card, .welcome-card { border: 1px solid var(--line); border-radius: 22px; background: #101a31db; box-shadow: 0 25px 70px #0004; }
.side-card { padding: 22px 15px; align-self: start; }
.side-card h2 { margin: 7px 4px 2px; font-size: 20px; }
.role-badge { display: inline-flex; margin: 9px 4px 22px; padding: 5px 9px; border: 1px solid #6f5ade; border-radius: 999px; color: #c9bcff; font-size: 11px; font-weight: 800; }
.side-card nav { display: grid; gap: 7px; }
.nav-item { width: 100%; padding: 12px 13px; border: 0; border-radius: 12px; background: transparent; color: #9faecc; text-align: left; font-weight: 700; }
.nav-item.active { background: linear-gradient(115deg, #795bea, #6750d0); color: white; }
.nav-item:disabled { cursor: default; opacity: .48; }
.nav-item span { display: inline-block; width: 27px; }
.welcome-card { min-height: 430px; padding: 42px; background: linear-gradient(135deg, #1f204f, #152848 62%, #11394b); position: relative; overflow: hidden; }
.welcome-card:after { content: ""; position: absolute; width: 280px; height: 280px; right: -70px; top: -90px; border-radius: 50%; background: #806cff18; }
.welcome-card > div { position: relative; z-index: 1; }
.system-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #238965; border-radius: 999px; color: var(--green); font-size: 11px; font-weight: 800; }
.system-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.welcome-card h2 { max-width: 610px; margin: 23px 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.12; }
.welcome-card p { max-width: 680px; color: #b8c4df; line-height: 1.8; }
.auth-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 45px; }
.auth-summary div { min-width: 0; padding: 17px; border: 1px solid #405378; border-radius: 15px; background: #0b1529a3; }
.auth-summary span { display: block; color: var(--muted); font-size: 12px; }
.auth-summary strong { display: block; overflow: hidden; margin-top: 8px; color: white; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-content { min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 8px 2px; }
.page-heading h2 { margin: 5px 0 0; font-size: 30px; }
.page-heading p:not(.kicker) { margin: 3px 0 0; color: var(--muted); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 134px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #14203b, #0d172c); box-shadow: 0 18px 45px #0003; }
.metric-card .metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #4e5d89; border-radius: 11px; background: #0a142a; color: var(--gold); }
.metric-card strong { display: block; margin-top: 13px; font-size: 25px; }
.metric-card small { display: block; margin-top: 2px; color: var(--muted); }
.content-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 14px; margin-top: 14px; }
.data-card, .loading-card, .error-card { border: 1px solid var(--line); border-radius: 19px; background: #101a31e8; box-shadow: 0 20px 55px #0003; }
.data-card { min-width: 0; overflow: hidden; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid #263758; }
.card-heading h3 { margin: 4px 0 0; font-size: 20px; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border: 1px solid #485b85; border-radius: 999px; color: #cdd6eb; font-size: 11px; font-weight: 800; }
.count-badge.large { padding: 8px 12px; color: var(--gold); }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 15px; border-bottom: 1px solid #243451; text-align: left; font-size: 12px; }
th { color: #b1bfd9; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; background: #101a30; }
td { color: #dfe5f3; }
td b, td small { display: block; }
td small { margin-top: 2px; color: #a0afca; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #16244080; }
.number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.negative { color: var(--danger); }
.empty-cell { padding: 28px; color: var(--muted); text-align: center; }
.alert-list { display: grid; }
.alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid #243451; }
.alert-row:last-child { border-bottom: 0; }
.alert-row b, .alert-row small { display: block; }
.alert-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.alert-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.severity { min-width: 58px; padding: 4px 6px; border-radius: 7px; background: #263452; color: #bfc9de; text-align: center; font-size: 9px; font-weight: 800; }
.severity.warning { background: #563f1e; color: #ffc85e; }
.severity.critical { background: #5c2431; color: #ff8997; }
.status-label { color: #8594b2; font-size: 9px; font-weight: 800; }
.loading-card, .error-card { min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 36px; }
.loading-card h2, .error-card h2 { margin: 0; }
.loading-card p, .error-card p:not(.kicker) { margin: 5px 0 0; color: var(--muted); }
.loading-orb { width: 34px; height: 34px; border: 3px solid #304267; border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
.error-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid #884356; border-radius: 14px; background: #4f2130; color: #ff8797; font-size: 22px; font-weight: 900; }
.error-card .secondary-button { margin-top: 16px; }
.player-directory { min-height: 360px; }
.toolbar { padding: 16px; border-bottom: 1px solid #263758; }
.search-box { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; max-width: 560px; margin: 0; border: 1px solid #34476f; border-radius: 13px; background: #091226; }
.search-box span { padding-left: 14px; color: #7f90b2; font-size: 20px; }
.search-box input { min-height: 48px; border: 0; background: transparent; }
.connected-badge, .account-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.connected-badge, .account-status.active { border: 1px solid #258664; background: #123c35; color: var(--green); }
.account-status.inactive { border: 1px solid #704251; background: #3c202b; color: #ff8c9b; }
.muted { color: var(--muted); }
.table-action { padding: 7px 11px; border: 1px solid #546898; border-radius: 9px; background: #1b2a4c; color: #eef2ff; font-size: 11px; font-weight: 800; }
.table-action:hover { border-color: var(--violet); background: #2a2458; }
.table-action.history { border-color: #397d76; background: #123934; color: #7ff2d6; }
.manage-dialog { width: min(980px, calc(100% - 28px)); max-height: min(860px, calc(100vh - 34px)); padding: 0; border: 1px solid #405582; border-radius: 24px; background: #0d162b; color: var(--text); box-shadow: 0 35px 100px #000b; }
.manage-dialog::backdrop { background: #020612c7; backdrop-filter: blur(7px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 27px 20px; border-bottom: 1px solid #2a3a60; background: linear-gradient(135deg, #19264a, #12233d); }
.dialog-header h2 { margin: 5px 0 0; font-size: 26px; }
.dialog-header p:not(.kicker) { margin: 4px 0 0; color: var(--muted); }
.dialog-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #485b85; border-radius: 12px; background: #101a31; color: white; font-size: 25px; line-height: 1; }
.player-snapshot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 18px 27px 0; }
.player-snapshot div { padding: 14px 16px; border: 1px solid #2d4068; border-radius: 14px; background: #101c35; }
.player-snapshot span, .player-snapshot strong { display: block; }
.player-snapshot span { color: var(--muted); font-size: 11px; }
.player-snapshot strong { margin-top: 4px; }
.dialog-message { min-height: 22px; margin: 10px 27px 0; color: var(--danger); font-size: 12px; }
.dialog-message.success { color: var(--green); }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 27px 27px; }
.management-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid #2c3e65; border-radius: 17px; background: #101b34; }
.management-card h3 { margin: 4px 0 2px; font-size: 18px; }
.management-card > div > p:not(.kicker) { min-height: 39px; margin: 2px 0 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.management-card label { margin-top: 11px; }
.management-card input, .management-card select { min-height: 46px; }
.operation-button { min-height: 44px; margin-top: auto; padding: 10px 14px; border: 0; border-radius: 11px; background: linear-gradient(115deg, #8064f1, #6850ce); color: white; font-weight: 800; }
.operation-button:disabled { cursor: not-allowed; opacity: .45; }
.quick-values { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.quick-values button { padding: 6px 9px; border: 1px solid #405581; border-radius: 8px; background: #172443; color: #dfe6f7; font-size: 11px; }
.danger-zone { border-color: #673847; background: #231527; }
.danger-button { background: linear-gradient(115deg, #d64f67, #a7314b); }
.success-button { background: linear-gradient(115deg, #1f9b72, #1b765e); }
.player-history-dialog { width: min(1040px, calc(100% - 28px)); }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 18px 27px 0; }
.history-summary div { padding: 13px 16px; border: 1px solid #2d4068; border-radius: 13px; background: #101c35; }
.history-summary span, .history-summary strong { display: block; }
.history-summary span { color: var(--muted); font-size: 10px; }
.history-summary strong { margin-top: 4px; }
.history-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 16px 27px; border-bottom: 1px solid #28395e; }
.history-filters button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #3a4e78; border-radius: 999px; background: #101c35; color: #b7c2db; font-size: 11px; font-weight: 800; }
.history-filters button span { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 999px; background: #071126; color: #dce5f8; font-size: 9px; }
.history-filters button.active { border-color: #8e72ff; background: #563faf; color: white; }
.history-timeline { display: grid; gap: 10px; padding: 18px 27px 27px; }
.history-event { display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 13px; padding: 15px; border: 1px solid #2b3e64; border-radius: 15px; background: linear-gradient(135deg, #111d37, #0d172c); }
.history-event-icon { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid #3d527d; border-radius: 13px; background: #091328; font-size: 21px; }
.history-event-body { min-width: 0; }
.history-event-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.history-event-heading h3 { margin: 3px 0 0; font-size: 15px; }
.history-kind { color: #ffc84d; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.history-status { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #43678a; border-radius: 999px; color: #a8d9ff; font-size: 9px; font-weight: 900; }
.history-event-body > p { margin: 7px 0; color: #b5c1d9; font-size: 12px; line-height: 1.55; }
.history-event footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #7f90b2; font-size: 10px; }
.history-event code { max-width: 100%; overflow: hidden; padding: 3px 6px; border-radius: 6px; background: #071126; color: #93a9d1; text-overflow: ellipsis; white-space: nowrap; }
.history-loading, .history-error, .history-empty { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 12px; padding: 28px; color: var(--muted); text-align: center; }
.history-error > span { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid #a64156; border-radius: 14px; background: #592334; color: #ff8a9d; font-size: 24px; font-weight: 900; }
.history-empty span { font-size: 30px; }
.content-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 7px; border: 1px solid #2d4068; border-radius: 15px; background: #0d172d; }
.content-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; }
.content-tabs button:hover { border-color: #3b4e76; color: white; }
.content-tabs button.active { border-color: #8d70ff; background: linear-gradient(120deg, #7355dd, #5139aa); color: white; box-shadow: 0 8px 25px #6d4edf38; }
.content-tab-panel { min-width: 0; }
.content-category-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 7px; border: 1px solid #2d4068; border-radius: 15px; background: #0d172d; }
.content-category-row > button { display: inline-flex; flex: 1 1 120px; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; }
.content-category-row > button:hover { border-color: #3b4e76; color: white; }
.content-category-row > button.active { border-color: #8d70ff; background: linear-gradient(120deg, #7355dd, #5139aa); color: white; box-shadow: 0 8px 25px #6d4edf38; }
.content-subtab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 16px; padding: 6px 8px; border: 1px solid #263a61; border-radius: 12px; background: #101b34; }
.content-subtab-row > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #aebbd3; font-size: 12px; font-weight: 800; }
.content-subtab-row > button:hover { border-color: #3b4e76; color: white; }
.content-subtab-row > button.active { border-color: #5f83d1; background: #1a2b4e; color: #f6f8ff; box-shadow: inset 0 0 0 1px #314b7d; }
.content-subtab-row > select { width: auto; min-height: 36px; padding: 7px 34px 7px 11px; border-color: #30456f; border-radius: 9px; background: #0b162b; color: #dfe7f7; font-size: 12px; font-weight: 800; }
.content-subtab-row > select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px #8b6cff20; }
.content-category-row > button:focus-visible, .content-subtab-row > button:focus-visible { outline: 2px solid #a891ff; outline-offset: 2px; }
.gacha-filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(210px, auto) auto auto; align-items: end; gap: 10px; margin-bottom: 12px; padding: 13px; border: 1px solid #2d4068; border-radius: 15px; background: #101a31; }
.gacha-filter-field > span { display: block; margin: 0 0 6px; color: #9aa9c5; font-size: 10px; font-weight: 800; }
.gacha-filter-field select { min-height: 44px; }
.gacha-filter-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 9px; min-height: 44px; padding: 7px 11px; border: 1px solid #30456f; border-radius: 11px; background: #0b162b; cursor: pointer; }
.gacha-filter-toggle input { grid-row: 1 / span 2; width: 17px; height: 17px; accent-color: var(--violet); }
.gacha-filter-toggle span, .gacha-filter-toggle small, .gacha-filter-summary b, .gacha-filter-summary small { display: block; }
.gacha-filter-toggle span { color: #dfe7f7; font-size: 11px; font-weight: 800; }
.gacha-filter-toggle small { color: var(--muted); font-size: 9px; }
.gacha-filter-summary { min-width: 94px; padding: 6px 10px; text-align: center; }
.gacha-filter-summary b { color: var(--gold); font-size: 16px; }
.gacha-filter-summary small { color: var(--muted); font-size: 9px; }
.filter-reset { min-height: 44px; padding: 8px 13px; border: 1px solid #42577f; border-radius: 10px; background: #172440; color: #e8edfa; font-size: 11px; font-weight: 800; }
.filter-reset:hover:not(:disabled) { border-color: var(--violet); background: #2a2458; }
.filter-reset:disabled { opacity: .42; cursor: not-allowed; }
.filter-scroll-target { scroll-margin-top: 16px; }
.rarity-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.rarity-filter-strip { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.rarity-strip > .rarity-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 13px 14px; overflow: hidden; border: 1px solid #2b3e65; border-radius: 13px; background: linear-gradient(135deg, #111d37, #0d172c); color: inherit; text-align: left; }
.rarity-strip > .rarity-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--rarity-color); }
.rarity-filter-card { cursor: pointer; }
.rarity-filter-card:hover { border-color: color-mix(in srgb, var(--rarity-color) 72%, #51658b); background: linear-gradient(135deg, #192746, #111d35); }
.rarity-filter-card.active { border-color: var(--rarity-color); background: color-mix(in srgb, var(--rarity-color) 13%, #111d37); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rarity-color) 48%, transparent), 0 8px 24px #0004; }
.rarity-filter-card:focus-visible { outline: 2px solid var(--rarity-color); outline-offset: 2px; }
.rarity-strip i { width: 10px; height: 10px; border-radius: 3px; background: var(--rarity-color); transform: rotate(45deg); box-shadow: 0 0 16px var(--rarity-color); }
.rarity-strip span { min-width: 0; overflow: hidden; color: var(--rarity-color); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.rarity-strip b { font-size: 19px; }
.catalog-stack { display: grid; gap: 16px; }
.catalog-card { overflow: hidden; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.catalog-heading h3 { margin-top: 3px; }
.catalog-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.bulk-item-summary { margin: 12px 0 0; padding: 11px 13px; border: 1px solid #30456f; border-radius: 11px; background: #0c172d; color: #b8c6e4; font-size: 11px; font-weight: 800; }
.bulk-mass-section { display: grid; gap: 14px; }
.bulk-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bulk-action-card { display: flex; align-items: flex-start; gap: 11px; min-height: 70px; padding: 13px; border: 1px solid #304264; border-radius: 13px; background: #0d172b; color: var(--text); text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.bulk-action-card:hover { border-color: #7965e8; background: #131e38; }
.bulk-action-card.active { border-color: var(--violet); background: #1d1941; box-shadow: inset 0 0 0 1px #8b6cff66; }
.bulk-action-card.is-disabled, .bulk-action-card:disabled { opacity: .48; cursor: not-allowed; }
.bulk-action-icon { display: inline-grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 9px; background: #28204c; color: #b79cff; font-size: 18px; font-weight: 900; }
.bulk-action-card b, .bulk-action-card small { display: block; }
.bulk-action-card b { font-size: 12px; }
.bulk-action-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.bulk-config-panel { padding: 13px; border: 1px solid #2b3e65; border-radius: 12px; background: #0c162b; }
.bulk-config-panel h4 { margin: 0 0 10px; color: #cbbdff; font-size: 13px; }
.bulk-config-panel[hidden], .bulk-mass-section[hidden] { display: none; }
.primary-compact { flex: 0 0 auto; min-height: 40px; padding: 9px 14px; border: 0; border-radius: 10px; background: linear-gradient(115deg, #8767f4, #674dcc); color: white; font-weight: 900; }
.catalog-card .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-icon { display: inline-grid; width: 39px; height: 39px; place-items: center; border: 1px solid #33466d; border-radius: 12px; background: #0b1428; font-size: 20px; }
.catalog-icon.small { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.catalog-item-thumbnail { position: relative; width: 48px; height: 48px; overflow: hidden; flex-shrink: 0; }
.catalog-item-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.catalog-item-thumbnail img[hidden], .catalog-item-thumbnail.has-image .item-thumbnail-fallback { display: none; }
.item-catalog-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-catalog-copy { display: grid; min-width: 0; gap: 3px; }
.item-catalog-copy > b { overflow-wrap: anywhere; }
.item-catalog-id { color: #94a9d5; font-size: 10px; }
.item-catalog-description { color: #b8c6e4; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.rarity-badge { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--rarity-color) 50%, #26385c); border-radius: 999px; background: color-mix(in srgb, var(--rarity-color) 12%, #111b31); color: var(--rarity-color); font-size: 10px; font-weight: 900; }
.catalog-card .table-wrap { overflow-x: auto; }
.catalog-card table { table-layout: fixed; white-space: normal; }
.catalog-card th, .catalog-card td { overflow-wrap: anywhere; }
.actions-cell { display: flex; gap: 6px; white-space: nowrap; }
.catalog-card .actions-cell { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; white-space: normal; }
.catalog-card .actions-cell .table-action { flex: 0 1 auto; min-width: 0; }
.item-catalog-table { min-width: 780px; }
.item-catalog-table th:first-child, .item-catalog-table td:first-child { width: 32%; }
.item-catalog-table th:nth-child(2), .item-catalog-table td:nth-child(2) { width: 10%; }
.item-catalog-table th:nth-child(3), .item-catalog-table td:nth-child(3) { width: 11%; }
.item-catalog-table th:nth-child(4), .item-catalog-table td:nth-child(4) { width: 11%; }
.item-catalog-table th:nth-child(5), .item-catalog-table td:nth-child(5) { width: 15%; }
.item-catalog-table th:last-child, .item-catalog-table td:last-child { width: 21%; }
.item-catalog-table .actions-cell { display: table-cell; vertical-align: middle; white-space: nowrap; }
.item-catalog-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; white-space: nowrap; }
.item-catalog-table .item-catalog-actions .table-action { flex: 0 0 auto; min-width: max-content; padding: 6px 8px; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
.form-ux-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 4px; padding: 9px 12px; border: 1px solid #2f4772; border-radius: 11px; background: linear-gradient(110deg, #111f3b, #101a31); color: #9fb1d4; font-size: 11px; }
.form-ux-toolbar > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.form-ux-toolbar .table-action { padding: 5px 8px; font-size: 10px; }
.form-preview-dialog { width: min(760px, calc(100% - 24px)); max-height: min(760px, calc(100vh - 30px)); padding: 0; border: 1px solid #536aa0; border-radius: 22px; background: #0d162b; color: var(--text); box-shadow: 0 30px 100px #000b; }
.form-preview-dialog::backdrop { background: #020612c7; backdrop-filter: blur(7px); }
.form-preview-body { display: grid; gap: 7px; padding: 20px 24px 105px; overflow: auto; }
.form-preview-row { display: grid; grid-template-columns: minmax(150px, .65fr) minmax(0, 1.35fr); gap: 14px; padding: 10px 12px; border: 1px solid #293d66; border-radius: 10px; background: #101c35; }
.form-preview-row span { color: #9fb1d4; font-size: 11px; }
.form-preview-row b { overflow-wrap: anywhere; color: #f5f7ff; font-size: 12px; }
.form-preview-dialog .dialog-actions { margin: 0; }
.item-catalog-table td:nth-child(2) .rarity-badge, .item-catalog-table td:nth-child(3) { white-space: nowrap; }
.item-catalog-indicator { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.item-catalog-indicator i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #77839a; }
.item-catalog-indicator.available i { background: #35d39a; box-shadow: 0 0 9px #35d39a66; }
.item-catalog-indicator.unavailable i { background: #77839a; }
.item-catalog-indicator.problem i { background: #ff627f; box-shadow: 0 0 9px #ff627f66; }
.table-action.ghost { border-color: #334668; background: #101a30; color: #c5cee2; }
.table-action.trash { border-color: #713746; background: #351823; color: #ff9bad; }
.table-action.trash:hover { border-color: #d95d76; background: #622338; color: #fff; }
.positive { color: var(--green); }
.negative { color: var(--danger); }
.validation-row td { border-bottom-color: #6f3447; background: #4e1f2d66; }
.validation-row td:first-child { box-shadow: inset 3px 0 #ff7188; }
.validation-row:hover td { background: #61283aaa; }
.validation-reason { display: inline-flex !important; align-items: center; max-width: 340px; margin-top: 6px !important; padding: 4px 7px; border: 1px solid #873d51; border-radius: 7px; background: #4b1d2a; color: #ff9bad !important; font-size: 9px !important; line-height: 1.35; white-space: normal; }
.inactive-config-row td { background: #111a2c66; opacity: .68; }
.inactive-config-row:hover td { background: #18233a99; opacity: .82; }
.gacha-readiness-body { display: grid; gap: 14px; padding: 18px 24px 24px; }
.gacha-readiness-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gacha-readiness-summary > div { padding: 15px; border: 1px solid #30456f; border-radius: 13px; background: #0c172d; }
.gacha-readiness-summary span, .gacha-readiness-summary b, .gacha-readiness-summary small { display: block; }
.gacha-readiness-summary span { color: #aebbd3; font-size: 10px; font-weight: 800; }
.gacha-readiness-summary b { margin: 5px 0 2px; font-size: 27px; }
.gacha-readiness-summary small { color: var(--muted); font-size: 9px; }
.gacha-readiness-summary .ready b { color: var(--green); }
.gacha-readiness-summary .error b { color: var(--danger); }
.gacha-readiness-summary .warning b { color: var(--gold); }
.gacha-readiness-note { margin: 0; padding: 11px 13px; border: 1px solid #31466d; border-radius: 11px; background: #101a30; color: #aebbd3; font-size: 11px; }
.gacha-readiness-list { display: grid; gap: 9px; }
.gacha-readiness-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px; border: 1px solid #30456f; border-radius: 13px; background: #0d182e; }
.gacha-readiness-row.ready { border-color: #286854; background: #102b2766; }
.gacha-readiness-row.error { border-color: #803b4f; background: #4e1f2d66; }
.gacha-readiness-row.warning { border-color: #765b31; background: #4b351833; }
.gacha-readiness-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid currentColor; border-radius: 10px; color: #91a3c4; font-weight: 900; }
.gacha-readiness-row.ready .gacha-readiness-icon { color: var(--green); }
.gacha-readiness-row.error .gacha-readiness-icon { color: var(--danger); }
.gacha-readiness-row.warning .gacha-readiness-icon { color: var(--gold); }
.gacha-readiness-detail { min-width: 0; }
.gacha-readiness-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gacha-readiness-title b, .gacha-readiness-title small { display: block; }
.gacha-readiness-title small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.gacha-readiness-title > span { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #415579; border-radius: 99px; color: #c7d1e6; font-size: 9px; font-weight: 900; }
.gacha-readiness-detail ul { margin: 9px 0 0; padding-left: 18px; color: #ffadb9; font-size: 11px; line-height: 1.65; }
.gacha-readiness-ok { margin: 8px 0 0; color: #75dfb7; font-size: 11px; }
.content-dialog { width: min(1120px, calc(100% - 24px)); }
.editor-form { display: grid; gap: 13px; padding: 18px 24px 24px; }
.editor-form [hidden] { display: none !important; }
.editor-section { padding: 18px; border: 1px solid #2d4068; border-radius: 16px; background: #101b34; }
.editor-section.compact { padding: 14px 18px; }
.editor-section h3 { margin: 0 0 13px; font-size: 17px; }
.required-mark { color: #ff8fa3; }
.editor-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--text); cursor: pointer; list-style: none; font-size: 16px; font-weight: 900; }
.editor-disclosure > summary::-webkit-details-marker { display: none; }
.editor-disclosure > summary::after { content: "+"; display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border: 1px solid #40557f; border-radius: 8px; color: #b7a9ff; font-size: 18px; }
.editor-disclosure[open] > summary::after { content: "−"; }
.editor-disclosure > summary small { min-width: 0; margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 700; text-align: right; }
.editor-disclosure[open] > summary { padding-bottom: 13px; border-bottom: 1px solid #2c3e62; }
.editor-disclosure[open] > summary + .form-grid, .editor-disclosure[open] > summary + label { margin-top: 13px; }
.section-help { margin: 13px 0; color: var(--muted); font-size: 12px; }
.inline-guide { margin-top: 13px; padding-top: 11px; border-top: 1px solid #2c3e62; }
.inline-guide summary { color: #cbd5eb; cursor: pointer; font-size: 12px; font-weight: 800; }
.inline-guide p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.section-heading h3 { margin-bottom: 3px; }
.section-heading p { margin: 0 0 13px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 13px; }
.form-grid .span-two { grid-column: span 2; }
.form-grid .span-four { grid-column: span 4; }
.hint-card { align-self: stretch; padding: 13px 15px; border: 1px solid #3a4f78; border-radius: 12px; background: #0c162b; color: var(--muted); }
.hint-card b { display: block; margin-bottom: 5px; color: var(--text); font-size: 12px; }
.hint-card p { margin: 0; font-size: 11px; line-height: 1.6; }
.armor-slot-settings-list { display: grid; gap: 9px; }
.armor-slot-settings-row { display: grid; grid-template-columns: auto minmax(180px, 1fr) minmax(110px, .45fr) minmax(145px, .55fr) auto; align-items: end; gap: 10px; padding: 11px; border: 1px solid #34496f; border-radius: 13px; background: #0b152a; }
.armor-slot-settings-row > small { align-self: center; color: var(--muted); font: 9px/1.3 Consolas, monospace; }
.equipment-set-bonus-list { display: grid; gap: 14px; }
.equipment-set-bonus-row { padding: 14px; border: 1px solid #34496f; border-radius: 15px; background: #0b152a; }
.equipment-set-bonus-row .section-heading { margin-bottom: 12px; }
.party-raid-admin-grid { display: grid; gap: 16px; }
.party-raid-admin-card { overflow: hidden; }
.party-raid-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 20px 14px; color: var(--muted); }
.party-raid-member-list { display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.party-raid-member-list > div { display: grid; grid-template-columns: auto minmax(150px, 1fr) minmax(90px, .45fr) auto; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid rgba(52,73,111,.55); }
.party-raid-member-list > div:last-child { border-bottom: 0; }
.party-raid-member-list > div > div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.editor-form label { min-width: 0; }
.editor-form input, .editor-form select, .editor-form textarea { width: 100%; }
.editor-form textarea { resize: vertical; }
.editor-form input[readonly] { border-color: #2a3a5d; background: #0a1428; color: #aeb9d0; }
.item-image-editor { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: end; gap: 12px; }
.item-image-preview { position: relative; display: grid; min-height: 78px; overflow: hidden; place-items: center; border: 1px solid #395079; border-radius: 12px; background: #091326; }
.item-image-preview img { width: 100%; height: 90px; object-fit: contain; background: #07101f; }
.item-image-preview span { padding: 10px; color: var(--muted); font-size: 10px; text-align: center; }
.item-image-preview:not(.empty):not(.invalid) span { display: none; }
.item-image-preview.invalid { border-color: #8c4354; background: #2b1520; }
.item-image-preview.invalid img { display: none; }
.toggle-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.toggle-grid label, .toggle-line { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 10px 12px; border: 1px solid #30436a; border-radius: 10px; background: #0c162b; font-size: 12px; font-weight: 800; }
.toggle-grid input, .toggle-line input { width: 17px; height: 17px; flex: 0 0 auto; }
.toggle-grid label small { margin-left: auto; color: #ff9bad; font-size: 9px; }
.toggle-grid label.disabled { opacity: .62; }
.pool-assignment-list { display: grid; gap: 8px; }
.pool-assignment-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 160px) minmax(170px, 220px) 34px; align-items: end; gap: 10px; padding: 10px; border: 1px solid #2d4067; border-radius: 12px; background: #0c162b; }
.pool-assignment-row.selected { border-color: #6752bd; background: #151d3c; }
.pool-assignment-row .toggle-line { align-self: stretch; border: 0; background: transparent; }
.pool-assignment-row small { display: block; margin-top: 2px; color: var(--muted); }
.pool-rate-membership { display: flex; justify-content: flex-end; gap: 8px; margin: 10px 0; }
.pool-rate-membership select { width: min(260px, 60%); }
.pool-rate-remove { width: 34px; height: 38px; padding: 0; border: 1px solid #60465a; border-radius: 9px; color: #ff9ca8; background: #291d31; font-size: 24px; line-height: 1; cursor: pointer; }
.pool-rate-remove:hover { color: #fff; background: #7f1d32; }
.skill-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 320px; overflow: auto; }
.skill-check { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid #2d4067; border-radius: 12px; background: #0c162b; cursor: pointer; }
.skill-check input { width: 17px; height: 17px; flex: 0 0 auto; }
.skill-check b, .skill-check small { display: block; }
.skill-check small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.race-trait-list { display: grid; gap: 12px; }
.race-trait-row { padding: 13px; border: 1px solid #3a4e78; border-radius: 14px; background: #0c162b; }
.recipe-resource-stack { display: flex; flex-wrap: wrap; gap: 5px; max-width: 360px; }
.recipe-resource-stack span { display: inline-flex; padding: 5px 8px; border: 1px solid #3c5076; border-radius: 99px; background: #101c35; color: #d7e0f2; font-size: 9px; white-space: nowrap; }
.recipe-resource-stack.outputs span { border-color: #2d8065; background: #10362e; color: #8df0c8; }
.craft-resource-list { display: grid; gap: 10px; }
.item-catalog-filters { flex-wrap: wrap; gap: 14px; align-items: center; }
.item-type-filter { display: flex; align-items: center; gap: 10px; color: #a9b9d5; }
.item-type-filter select { min-width: 180px; max-width: 100%; padding: 12px; border: 1px solid #34496f; border-radius: 12px; background: #0b152a; color: #fff; }
.craft-resource-row { display: grid; grid-template-columns: 155px minmax(220px, 1fr) 145px auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid #34496f; border-radius: 13px; background: #0b152a; }
.craft-resource-list.outputs .craft-resource-row { border-color: #2d6d5b; background: #0c211f; }
.craft-remove-resource { min-height: 45px; }
.trait-row-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; }
.trait-row-footer label { display: flex; align-items: center; gap: 7px; flex-direction: row; }
.trait-row-footer input[type="number"] { width: 92px; }
.rarity-rate-row .catalog-icon { color: var(--rarity-color, var(--accent)); }
.rarity-rate-row { grid-template-columns: minmax(0, 1fr) 130px 170px; }
.type-rate-row { grid-template-columns: minmax(0, 1fr) 130px minmax(210px, 250px); }
.rate-mode-label { font-size: 9px; }
.rate-mode-warning { padding: 10px 12px; border: 1px solid #7c633b; border-radius: 10px; background: #3d301b; color: var(--gold); font-size: 11px; }
.pool-rate-field { min-width: 0; }
.rate-total-value { display: inline-flex; align-items: center; justify-content: center; min-width: 86px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #0c162b; font-weight: 800; white-space: nowrap; }
.dialog-actions { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin: 0 -24px -24px; padding: 15px 24px; border-top: 1px solid #2d4068; background: #0c1529; }
.dialog-actions button { min-width: 130px; }
.dialog-actions .primary-button { margin-top: 0; box-shadow: none; }
.manage-dialog { scroll-padding-block: 24px 110px; }
.form-grid > label { min-width: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(390px, calc(100% - 44px)); padding: 13px 17px; border: 1px solid #258664; border-radius: 12px; background: #123c35; color: #b8ffe3; box-shadow: 0 18px 50px #0008; opacity: 0; transform: translateY(18px); pointer-events: none; transition: .22s; font-weight: 700; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #874152; background: #491f2c; color: #ffd5db; }
.combat-dialog { width: min(1220px, calc(100% - 24px)); }
.combat-tabs { position: sticky; top: 0; z-index: 4; }
.operations-dialog { width: min(1080px, calc(100% - 24px)); }
.operations-dialog #trashConfirmForm { padding: 20px; }
.player-directory { min-width: 0; max-width: 100%; }
.player-directory .table-wrap { width: 100%; }
.exploration-locations-table { min-width: 920px; }
@media (max-width: 820px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid > .side-card { min-width: 0; }
}
.operations-tabs { position: sticky; top: 0; z-index: 5; margin-top: 16px; }
.operations-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid #2e426b; border-radius: 15px; background: #101a31; }
.operations-toolbar label { flex: 1; max-width: 620px; color: var(--muted); font-size: 11px; font-weight: 800; }
.operations-toolbar select { width: 100%; margin-top: 7px; }
.battle-command-card { overflow: hidden; margin-bottom: 16px; border: 1px solid #3b4f7d; border-radius: 20px; background: linear-gradient(135deg, #182649, #10263c); box-shadow: 0 20px 55px #02081844; }
.battle-live-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; }
.battle-live-heading h3 { margin: 3px 0; font-size: 24px; }
.battle-live-heading p:not(.kicker) { margin: 0; color: var(--muted); }
.battle-turn-box { min-width: 220px; padding: 14px 17px; border: 1px solid #415987; border-radius: 14px; background: #0b162caa; text-align: right; }
.battle-turn-box span, .battle-turn-box small { display: block; color: var(--muted); font-size: 10px; }
.battle-turn-box strong { display: block; margin: 3px 0; color: var(--gold); font-size: 16px; }
.battle-command-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid #31476d; background: #09132899; }
.battle-command-strip button { padding: 9px 13px; border: 1px solid #4c618e; border-radius: 10px; background: #1b2a4b; color: white; font-weight: 800; }
.battle-command-strip button:hover { border-color: #9b83ff; background: #2b235c; }
.battle-command-strip button.danger, .danger-button { border-color: #a9485a; background: #7f2738; }
.battle-command-strip button:disabled { opacity: .4; cursor: not-allowed; }
.participant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.participant-card { padding: 17px; border: 1px solid #2f426a; border-radius: 17px; background: #111c34; }
.participant-card.current { border-color: #987dff; box-shadow: inset 3px 0 #795bea, 0 12px 35px #2f1d7555; }
.participant-card.knocked-out { opacity: .56; filter: saturate(.55); }
.participant-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.participant-card header div { min-width: 0; flex: 1; }
.participant-card header b, .participant-card header small { display: block; }
.participant-card header small { color: var(--muted); font-size: 10px; }
.participant-kind { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #405681; border-radius: 12px; background: #0a152b; font-size: 19px; }
.live-badge { padding: 4px 8px; border: 1px solid #7a62dc; border-radius: 99px; color: #c8bbff; font-size: 9px; font-weight: 900; }
.participant-resource { display: grid; grid-template-columns: 25px minmax(80px, 1fr) auto; align-items: center; gap: 7px; margin: 7px 0; }
.participant-resource > span { color: var(--muted); font-size: 9px; font-weight: 900; }
.participant-resource small { color: #cbd4e7; font-size: 9px; font-variant-numeric: tabular-nums; }
.resource-bar { position: relative; height: 7px; overflow: hidden; border-radius: 99px; background: #071023; }
.resource-bar i { display: block; height: 100%; border-radius: inherit; background: #47d8a1; }
.resource-bar.red i { background: linear-gradient(90deg, #d94d68, #ff7087); }
.resource-bar.blue i { background: linear-gradient(90deg, #3e8cea, #6cbcff); }
.resource-bar.amber i { background: linear-gradient(90deg, #e39b39, #ffd260); }
.effect-chip-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 29px; margin: 12px 0; }
.effect-chip, .muted-chip { padding: 5px 8px; border: 1px solid #51427e; border-radius: 99px; background: #241d4c; color: #d6cdff; font-size: 9px; }
.effect-chip:hover { border-color: #d95d76; color: #ff9aac; }
.muted-chip { border-color: #32415f; background: #111a2c; color: var(--muted); }
.compact-panel { margin-top: 0; }
.mini-log-list { display: grid; }
.mini-log-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 10px; padding: 10px 16px; border-top: 1px solid #253654; font-size: 10px; }
.mini-log-list span, .mini-log-list small { color: var(--muted); }
.mini-log-list small { text-align: right; }
.empty-state-card { padding: 55px 25px; border: 1px dashed #405581; border-radius: 18px; background: #111b32; text-align: center; }
.empty-state-card b { font-size: 20px; }
.empty-state-card p { color: var(--muted); }
.action-badge { display: inline-flex; padding: 4px 8px; border: 1px solid #4e3a8f; border-radius: 99px; background: #251d55; color: #c9bbff; font-size: 9px; font-weight: 900; }
.wrap-cell { max-width: 280px; white-space: normal; }
.cell-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.audit-meta { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-bottom: 15px; }
.audit-meta > div { padding: 13px; border: 1px solid #31466d; border-radius: 12px; background: #101a30; }
.audit-meta span, .audit-meta b { display: block; }
.audit-meta span { color: var(--muted); font-size: 9px; }
.audit-diff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.audit-diff-grid section { min-width: 0; }
.audit-diff-grid h3 { margin: 0 0 7px; }
.audit-diff-grid pre, .alert-center-row pre { max-height: 310px; overflow: auto; margin: 0; padding: 13px; border: 1px solid #2b3b5c; border-radius: 12px; background: #070e1d; color: #b9c6df; white-space: pre-wrap; word-break: break-word; font: 10px/1.55 Consolas, monospace; }
.backup-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 15px; margin-bottom: 15px; }
.inline-admin-form { display: grid; gap: 11px; padding: 16px; }
.inline-admin-form label { color: var(--muted); font-size: 10px; font-weight: 800; }
.inline-admin-form input, .inline-admin-form textarea { width: 100%; margin-top: 6px; }
.inline-admin-form textarea { min-height: 76px; }
.full-button { width: calc(100% - 32px); margin: 0 16px 16px; }
.backup-list { display: grid; max-height: 390px; overflow: auto; }
.backup-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid #263756; }
.backup-list b, .backup-list small { display: block; }
.backup-list small, .backup-list p { color: var(--muted); font-size: 9px; }
.backup-list p { margin: 4px 0 0; }
.trash-panel { margin-top: 0; }
.alert-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.25fr; gap: 12px; margin-bottom: 15px; }
.scan-card { padding: 17px; border: 1px solid #6b55ce; border-radius: 15px; background: linear-gradient(135deg, #30266b, #17274d); color: white; text-align: left; }
.scan-card b, .scan-card small { display: block; }
.scan-card small { margin-top: 4px; color: #b7c1d8; }
.alert-center-list { display: grid; }
.alert-center-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 16px; border-top: 1px solid #293a5d; }
.alert-center-row.critical { background: #47172724; }
.alert-center-row.warning { background: #67451618; }
.alert-center-row.resolved { opacity: .54; }
.severity-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #a4475b; border-radius: 11px; background: #5a1e2c; color: #ff93a7; font-weight: 900; }
.warning .severity-icon { border-color: #98713a; background: #4b3518; color: #ffd27c; }
.info .severity-icon { border-color: #376a97; background: #17334c; color: #80c8ff; }
.alert-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.alert-title-line span { padding: 3px 7px; border: 1px solid #415579; border-radius: 99px; color: var(--muted); font-size: 8px; font-weight: 900; }
.alert-center-row small { color: var(--muted); font-size: 9px; }
.alert-center-row pre { max-height: 120px; margin-top: 8px; }
.danger-note { padding: 13px; border: 1px solid #7b3949; border-radius: 12px; background: #4a1925; color: #ffb5c2; }
.cbt-reset-panel { margin-top: 15px; padding-bottom: 18px; }
.cbt-reset-panel > .danger-note { margin: 0 18px 14px; }
.cbt-reset-summary { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 15px; }
.cbt-reset-summary span { padding: 8px 11px; border: 1px solid #745065; border-radius: 9px; color: #f3d5db; font-size: 11px; }
.cbt-reset-summary b { color: #fff; }
.cbt-reset-step { margin: 0 18px 12px; padding: 15px; border: 1px solid #674252; border-radius: 13px; background: #1d1727; }
.cbt-reset-step > b { display: block; margin-bottom: 7px; }
.cbt-reset-step p { margin: 7px 0 11px; color: #dec5d2; font-size: 12px; line-height: 1.6; }
.cbt-reset-step small { margin-left: 10px; color: #c9a9ba; }
.cbt-reset-step code { overflow-wrap: anywhere; color: #ffd48a; }
.cbt-reset-step .danger-button { min-height: 42px; padding: 9px 17px; border: 0; border-radius: 10px; color: white; font-weight: 800; }
.cbt-reset-step .danger-button:disabled { cursor: not-allowed; opacity: .43; }
.cbt-reset-ack { display: flex; align-items: center; gap: 9px; }
.cbt-reset-ack input { width: auto; min-height: 0; margin: 0; }
.catalog-heading p, .card-heading p:not(.kicker) { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.rules-card { padding-bottom: 22px; }
.rule-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; padding: 20px; }
.rule-summary > div { min-width: 0; padding: 18px; border: 1px solid #30446e; border-radius: 15px; background: linear-gradient(145deg, #111e39, #0c172d); }
.rule-summary span, .rule-summary b, .rule-summary small { display: block; }
.rule-summary span { color: var(--muted); font-size: 11px; }
.rule-summary b { margin-top: 7px; color: var(--gold); font-size: 27px; }
.rule-summary small { margin-top: 2px; color: #9aa7c1; }
.rules-edit-button { width: min(300px, calc(100% - 40px)); margin: 0 20px; }
.form-section { padding: 18px; border: 1px solid #2d4068; border-radius: 16px; background: #101b34; }
.form-section > h3 { margin: 0 0 14px; font-size: 17px; }
.form-section .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.form-section .section-heading h3 { margin: 0 0 3px; font-size: 17px; }
.form-section .section-heading p { margin: 0; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 10px 12px; border: 1px solid #30436a; border-radius: 10px; background: #0c162b; font-size: 12px; font-weight: 800; }
.check-label input { width: 17px; height: 17px; flex: 0 0 auto; }
.field-help { margin: -5px 0 12px; color: var(--muted); font-size: 12px; }
.multi-hit-guide, .defense-effect-guide { margin: 8px 0 12px; padding: 10px 12px; border-left: 3px solid var(--accent, #8b5cf6); background: rgba(139, 92, 246, 0.06); border-radius: 6px; line-height: 1.65; }
.secondary-button.compact { min-height: 38px; padding: 8px 12px; white-space: nowrap; }
.repeat-list { display: grid; gap: 10px; margin-top: 14px; }
.repeat-row { position: relative; display: grid; align-items: end; gap: 9px; padding: 13px 48px 13px 13px; border: 1px solid #30436a; border-radius: 13px; background: #0b152a; }
.effect-row { grid-template-columns: repeat(8, minmax(100px, 1fr)); }
.effect-row .effect-curse { align-self: end; }
.duration-bonus-config { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; margin: 8px 0; padding: 16px; min-width: 0; border: 1px solid #40557c; border-radius: 12px; background: #0b152a; }
.duration-bonus-config[hidden], .duration-bonus-config [hidden] { display: none; }
.duration-bonus-config legend { padding: 0 8px; color: #c4b5fd; font-weight: 700; }
.duration-bonus-config .field-help { grid-column: 1 / -1; margin: 0; }
.skill-library-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.skill-rank-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; padding: 15px 24px 0; }
.skill-rank-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border: 1px solid #30436a; border-radius: 11px; background: #101b34; }
.skill-rank-item span { min-width: 0; }
.skill-rank-item b, .skill-rank-item small { display: block; }
.skill-rank-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.skill-rules-section > summary { margin-bottom: 13px; }
.skill-rule-row { display: block; padding-right: 48px; }
.skill-rule-main, .skill-rule-condition, .skill-rule-bonus { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.skill-rule-main, .skill-rule-condition { margin-bottom: 10px; }
.skill-rule-main > label:nth-child(2) { grid-column: span 2; }
.skill-rule-row [hidden] { display: none !important; }
.skill-rule-add { margin-top: 13px; }
.skill-stack-row { grid-template-columns: minmax(160px, 1.5fr) repeat(3, minmax(120px, 1fr)); }
.skill-stack-row [hidden] { display: none !important; }
.skill-stack-add { margin-top: 13px; }
.loot-row, .reward-row { grid-template-columns: 1fr minmax(180px, 1.7fr) repeat(4, minmax(88px, .8fr)) auto; }
.loot-item-picker.disabled { opacity: .55; }
.loot-item-picker .exploration-item-result > span { min-width: 0; overflow-wrap: anywhere; }
.loot-item-picker [hidden] { display: none !important; }
.wave-row { grid-template-columns: auto minmax(190px, 1.4fr) minmax(150px, 1fr) repeat(2, minmax(190px, 1.4fr)); }
.exploration-event-row { grid-template-columns: repeat(4, minmax(115px, 1fr)); }
.exploration-event-rewards { grid-column: 1 / -1; min-width: 0; }
.exploration-reward-heading { align-items: center; margin: 0 0 9px; }
.exploration-reward-heading small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.exploration-item-reward-list { display: grid; gap: 8px; }
.exploration-item-reward-row { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(100px, .8fr)) auto; align-items: end; gap: 9px; padding: 10px 42px 10px 10px; border: 1px solid #30436a; border-radius: 12px; background: #0c172d; position: relative; }
.exploration-item-picker { min-width: 0; position: relative; }
.exploration-selected-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; margin-bottom: 5px; padding: 5px 8px; border: 1px solid #405782; border-radius: 8px; background: #142341; color: #e2e9f8; font-size: 11px; overflow-wrap: anywhere; }
.exploration-selected-item.empty { display: none; }
.exploration-selected-item button { flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 6px; background: #422330; color: #ff9eab; font-size: 16px; line-height: 1; }
.exploration-item-picker label { display: block; }
.exploration-item-results { position: absolute; z-index: 30; top: calc(100% - 1px); right: 0; left: 0; max-height: 250px; overflow: auto; padding: 5px; border: 1px solid #536d9d; border-radius: 10px; background: #091327; box-shadow: 0 14px 30px #0008; }
.exploration-item-result { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: #e4eaf7; text-align: left; font: inherit; cursor: pointer; }
.exploration-item-result:hover, .exploration-item-result:focus-visible { outline: none; background: #1d3156; }
.exploration-item-result small { color: #9aaccd; white-space: nowrap; }
.exploration-item-no-results { display: block; padding: 10px; color: var(--muted); font-size: 11px; }
.exploration-reward-remove { top: 8px; right: 8px; }
.exploration-event-rewards [data-add-exploration-reward] { min-height: 34px; }
.exploration-event-message-label { grid-column: span 3; }
.exploration-location-image-editor { align-items: center; }
.exploration-location-image-editor > label { min-width: 0; }
.exploration-fishing-config { align-self: start; }
.exploration-summary-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 15px; margin-bottom: 15px; }
.exploration-settings-card, .exploration-guide-card { overflow: hidden; }
.exploration-settings-form { padding-top: 0; }
.exploration-settings-form .operation-button { margin-top: 0; }
.exploration-flow { display: grid; gap: 11px; margin: 0; padding: 4px 24px 18px 46px; color: #cbd4e7; line-height: 1.55; }
.exploration-flow b { color: var(--gold); }
.exploration-guide-card .info-banner { margin: 0 20px 20px; }
.exploration-log-card { margin-top: 15px; }
.compact-heading { align-items: center; margin-bottom: 12px; }
.compact-heading h3 { margin: 0; }
.compact-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.learning-skill-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.learning-skill-toolbar input { flex: 1 1 260px; min-width: 0; }
.learning-skill-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.learning-skill-option { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 11px; border: 1px solid #30436a; border-radius: 10px; background: #0c172d; cursor: pointer; }
.learning-skill-option:hover, .learning-skill-option:has(input:checked) { border-color: #8061e8; background: #1b1740; }
.learning-skill-option input[type="checkbox"] { width: 17px; height: 17px; flex: 0 0 auto; accent-color: #8b5cf6; }
.learning-skill-option span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 800; }
.learning-skill-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 600; }
.learning-skill-options [hidden], [data-learning-modifier-empty][hidden] { display: none !important; }
.learning-modifier-list { display: grid; gap: 8px; }
.learning-modifier-row { display: grid; grid-template-columns: 1.3fr 0.95fr minmax(95px, 0.7fr) minmax(150px, 0.9fr) auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid #30436a; border-radius: 10px; background: #0c172d; }
.learning-modifier-row .table-action { min-height: 42px; }
.learning-modifier-row [data-learning-modifier-slot] { display: none; }
.learning-modifier-list + .muted-chip { display: block; margin-top: 9px; }
.repeat-row label { font-size: 11px; }
.repeat-row input, .repeat-row select { min-height: 42px; padding: 9px 10px; }
.repeat-remove { position: absolute; top: 12px; right: 12px; display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #733849; border-radius: 8px; background: #421f2b; color: #ff9eab; font-size: 19px; line-height: 1; }
.repeat-index { align-self: center; padding: 7px 9px; border: 1px solid #6751bb; border-radius: 8px; color: #bbaaff; font-size: 10px; font-weight: 900; }
.wide-field { min-width: 0; }
.info-banner { padding: 13px 15px; border: 1px solid #5a4c82; border-radius: 12px; background: #221c3a; color: #d9cffc; font-size: 12px; line-height: 1.55; }
.manual-boss-panel { margin-bottom: 15px; }
.manual-boss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.manual-boss-card { padding: 15px; border: 1px solid #30456f; border-radius: 15px; background: linear-gradient(145deg, #111d38, #0b162b); }
.manual-boss-card.current { border-color: #8c6aff; box-shadow: inset 0 0 0 1px #6d50d4; }
.manual-boss-card header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.manual-boss-card header b, .manual-boss-card header small { display: block; }
.manual-boss-card header small, .manual-boss-card > p { color: var(--muted); font-size: 10px; }
.manual-boss-card > p { margin: 11px 0; }
.mode-badge { padding: 5px 8px; border: 1px solid #3e5278; border-radius: 99px; color: #a9b5cb; font-size: 8px; font-weight: 900; }
.mode-badge.manual { border-color: #7b5bea; background: #30235f; color: #d4c9ff; }
.mode-badge.auto { border-color: #28795e; background: #103c31; color: #77efbd; }
.manual-boss-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.manual-boss-buttons button { min-height: 37px; padding: 8px 11px; border: 1px solid #3c527d; border-radius: 10px; background: #182744; color: #dbe3f3; font-weight: 800; }
.manual-boss-buttons button:disabled { opacity: .42; cursor: not-allowed; }
.boss-action-preview { display: grid; gap: 5px; padding: 14px; border: 1px solid #55458b; border-radius: 12px; background: #201a3b; }
.boss-action-preview span, .boss-action-preview small { color: var(--muted); }
.boss-target-fieldset { min-width: 0; padding: 12px; border: 1px solid #30436a; border-radius: 12px; }
.boss-target-fieldset legend { padding: 0 6px; color: var(--gold); font-size: 11px; font-weight: 900; }
.boss-target-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 310px; overflow: auto; }
.boss-target-list label { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #2d4065; border-radius: 10px; background: #0c162b; cursor: pointer; }
.boss-target-list input { width: 17px; height: 17px; flex: 0 0 auto; }
.boss-target-list b, .boss-target-list small { display: block; }
.boss-target-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Interaction polish: keep the existing dark fantasy visual language while making state changes easier to see. */
:root {
  --glow-violet: #8b6cff66;
  --glow-gold: #ffc85355;
  --surface-hover: #1a2a4b;
  --ease-out: cubic-bezier(.22, .8, .24, 1);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 42%, #ffffff03 50%, transparent 58%);
  background-size: 220% 100%;
  animation: ambient-sweep 18s ease-in-out infinite;
  z-index: 0;
}

.aurora {
  display: block;
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .13;
  animation: aurora-drift 16s ease-in-out infinite alternate;
}

.aurora-two { animation-delay: -7s; }
.page-shell { animation: shell-enter .65s var(--ease-out) both; }
.admin-view { animation: admin-enter .45s var(--ease-out) both; }

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #070d1cf2 0%, #070d1cd9 72%, transparent 100%);
  backdrop-filter: blur(14px);
}

.side-card, .welcome-card, .data-card, .metric-card, .loading-card, .error-card {
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s var(--ease-out), background-color .25s ease;
}

.side-card:hover, .metric-card:hover {
  border-color: #526da7;
  box-shadow: 0 24px 65px #0005, 0 0 0 1px #526da722;
}

.metric-card:hover { transform: translateY(-3px); }
.data-card:hover { border-color: #3b5688; }

.nav-item {
  position: relative;
  overflow: hidden;
  transition: color .2s ease, background .2s ease, transform .2s var(--ease-out), box-shadow .2s ease;
}

.nav-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, #ffffff14, transparent);
  transform: translateX(-120%);
  transition: transform .45s ease;
}

.nav-item:hover { transform: translateX(3px); color: #fff; }
.nav-item:hover::after { transform: translateX(120%); }
.nav-item.active { box-shadow: 0 10px 25px #6d4edf33; }

button, input, select, textarea, summary, .search-box {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .2s var(--ease-out);
}

button:not(:disabled):active { transform: translateY(1px) scale(.985); }
.primary-button:hover, .primary-compact:hover { filter: brightness(1.08); box-shadow: 0 14px 32px #8064f145; }
.secondary-button:hover { background: var(--surface-hover); box-shadow: 0 8px 20px #0003; }
.dialog-close:hover { border-color: var(--gold); color: var(--gold); transform: rotate(90deg); }
.table-action:hover { transform: translateY(-1px); }

.dashboard-content[aria-busy="true"] { cursor: progress; }
.dashboard-content > * { animation: content-enter .48s var(--ease-out) both; }
.dashboard-content > *:nth-child(2) { animation-delay: .045s; }
.dashboard-content > *:nth-child(3) { animation-delay: .09s; }
.dashboard-content > *:nth-child(4) { animation-delay: .135s; }
.dashboard-content tbody tr { animation: row-enter .32s var(--ease-out) both; }
.dashboard-content tbody tr:nth-child(2) { animation-delay: .025s; }
.dashboard-content tbody tr:nth-child(3) { animation-delay: .05s; }
.dashboard-content tbody tr:nth-child(4) { animation-delay: .075s; }

.welcome-card:after {
  animation: welcome-orb 10s ease-in-out infinite alternate;
  transform-origin: center;
}

.system-pill i, .status-dot { animation: status-pulse 2.2s ease-in-out infinite; }
.loading-card { animation: content-enter .35s var(--ease-out) both, loading-breathe 1.8s ease-in-out infinite alternate; }

.manage-dialog[open] { animation: dialog-enter .35s var(--ease-out) both; }
.manage-dialog::backdrop { animation: backdrop-enter .25s ease both; }
.toast.visible { animation: toast-enter .42s var(--ease-out) both; }
.toast.error.visible { animation-name: toast-error-enter; }

@keyframes shell-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes admin-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes content-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes row-enter { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-enter { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes toast-error-enter { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes status-pulse { 0%, 100% { box-shadow: 0 0 0 0 #42e6a400; } 50% { box-shadow: 0 0 0 5px #42e6a41a; } }
@keyframes loading-breathe { from { box-shadow: 0 20px 55px #0003; } to { box-shadow: 0 20px 55px #0003, 0 0 30px #8b6cff14; } }
@keyframes welcome-orb { from { transform: scale(1) rotate(0deg); opacity: .7; } to { transform: scale(1.18) rotate(18deg); opacity: 1; } }
@keyframes aurora-drift { from { transform: translate3d(-12px, 8px, 0) scale(1); } to { transform: translate3d(22px, -16px, 0) scale(1.1); } }
@keyframes ambient-sweep { 0%, 55% { background-position: 120% 0; } 100% { background-position: -30% 0; } }

@media (max-width: 820px) {
  .admin-header { position: relative; background: transparent; backdrop-filter: none; }
  .side-card { box-shadow: 0 15px 35px #0003; }
  .side-card nav { scrollbar-width: thin; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .aurora { display: none; }
  .dashboard-content > *, .dashboard-content tbody tr { animation: none; }
}
@media (max-width: 820px) {
  .form-ux-toolbar { align-items: stretch; flex-direction: column; }
  .form-ux-toolbar > div { justify-content: flex-start; }
  .form-preview-row { grid-template-columns: 1fr; gap: 4px; }
  .login-layout { grid-template-columns: 1fr; gap: 35px; padding: 36px 0; }
  .intro-panel h1 { font-size: 48px; }
  .feature-list { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-card { display: block; padding: 12px; }
  .side-card > .kicker, .side-card > h2, .side-card > .role-badge { display: none; }
  .side-card nav { display: flex; overflow-x: auto; gap: 6px; padding: 4px; }
  .side-card .nav-item { flex: 0 0 auto; width: auto; white-space: nowrap; min-height: 44px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-columns { grid-template-columns: 1fr; }
  .content-category-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-category-row > button, .content-subtab-row > button { width: 100%; }
  .content-subtab-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-subtab-row > select { width: 100%; }
  .management-grid { grid-template-columns: 1fr; }
  .gacha-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rarity-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-four { grid-column: span 2; }
  .toggle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.three, .rule-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .effect-row, .loot-row, .reward-row, .wave-row, .exploration-event-row, .craft-resource-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-rule-main, .skill-rule-condition, .skill-rule-bonus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-stack-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exploration-item-reward-row { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(75px, .7fr)); padding-left: 8px; }
  .exploration-reward-remove { grid-row: 1; grid-column: 4; }
  .skill-check-grid { grid-template-columns: 1fr; }
  .exploration-summary-grid { grid-template-columns: 1fr; }
  .exploration-event-message-label { grid-column: span 2; }
  .repeat-index { grid-column: 1 / -1; }
  .participant-grid, .backup-grid, .audit-diff-grid, .manual-boss-grid { grid-template-columns: 1fr; }
  .alert-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gacha-readiness-summary { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 22px, 1180px); }
  .intro-panel > p { font-size: 15px; }
  .login-card { padding: 25px 20px; border-radius: 22px; }
  .admin-header, .admin-actions { align-items: flex-start; }
  .admin-header { flex-direction: column; }
  .identity { text-align: left; }
  .welcome-card { padding: 26px 20px; }
  .auth-summary { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metrics-grid { grid-template-columns: 1fr; }
  .player-snapshot { grid-template-columns: 1fr; }
  .history-summary { grid-template-columns: 1fr; }
  .dialog-header, .player-snapshot, .history-summary, .history-filters, .history-timeline, .management-grid { padding-left: 18px; padding-right: 18px; }
  .gacha-filter-bar { grid-template-columns: 1fr; }
  .rarity-strip, .form-grid.two, .form-grid.four, .pool-assignment-row { grid-template-columns: 1fr; }
  .bulk-action-grid { grid-template-columns: 1fr; }
  .form-grid .span-two, .form-grid .span-four { grid-column: auto; }
  .item-image-editor { grid-template-columns: 1fr; }
  .item-image-preview { min-height: 105px; }
  .editor-disclosure > summary { align-items: flex-start; flex-wrap: wrap; }
  .editor-disclosure > summary small { order: 3; width: 100%; text-align: left; }
  .catalog-heading, .catalog-card .toolbar { align-items: stretch; flex-direction: column; }
  .item-catalog-table th, .item-catalog-table td { padding: 10px 8px; }
  .item-catalog-table th:first-child, .item-catalog-table td:first-child { width: 30%; }
  .item-catalog-table th:nth-child(2), .item-catalog-table td:nth-child(2) { width: 10%; }
  .item-catalog-table th:nth-child(3), .item-catalog-table td:nth-child(3) { width: 11%; }
  .item-catalog-table th:nth-child(4), .item-catalog-table td:nth-child(4) { width: 11%; }
  .item-catalog-table th:nth-child(5), .item-catalog-table td:nth-child(5) { width: 16%; }
  .item-catalog-table th:last-child, .item-catalog-table td:last-child { width: 22%; }
  .item-catalog-table .catalog-item-thumbnail { width: 40px; height: 40px; }
  .item-catalog-table .table-action { padding: 6px 7px; font-size: 10px; }
  .catalog-heading-actions { flex-direction: column; align-items: stretch; }
  .gacha-readiness-row { grid-template-columns: auto minmax(0, 1fr); }
  .gacha-readiness-row > .table-action { grid-column: 1 / -1; }
  .content-tabs { display: grid; grid-template-columns: 1fr; }
  .content-tabs button { width: 100%; justify-content: flex-start; }
  .content-category-row, .content-subtab-row { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline mandatory; }
  .content-category-row > button, .content-subtab-row > button { width: auto; flex: 0 0 auto; justify-content: flex-start; scroll-snap-align: start; }
  .primary-compact { width: 100%; }
  .toggle-grid { grid-template-columns: 1fr; }
  .editor-form { padding: 14px 13px 18px; }
  .editor-section { padding: 15px; }
  .dialog-actions { margin: 0 -13px -18px; padding: 13px; }
  .dialog-actions button { min-width: 0; min-height: 44px; }
  .dialog-actions .secondary-button { flex: 0 0 auto; }
  input, select, textarea { font-size: 16px; }
  .form-grid.three, .rule-summary, .effect-row, .loot-row, .reward-row, .wave-row, .exploration-event-row, .craft-resource-row { grid-template-columns: 1fr; }
  .skill-rule-main, .skill-rule-condition, .skill-rule-bonus { grid-template-columns: 1fr; }
  .skill-stack-row { grid-template-columns: 1fr; }
  .exploration-item-reward-row { grid-template-columns: 1fr 1fr; }
  .exploration-item-picker { grid-column: 1 / -1; }
  .exploration-reward-remove { grid-row: auto; grid-column: 2; }
  .learning-skill-options { grid-template-columns: 1fr; }
  .learning-skill-toolbar { align-items: stretch; flex-direction: column; }
  .learning-modifier-row { grid-template-columns: 1fr 1fr; }
  .learning-modifier-row input { grid-column: 1 / -1; }
  .learning-modifier-row .table-action { grid-column: 2; }
  .skill-rule-main > label:nth-child(2) { grid-column: auto; }
  .armor-slot-settings-row { grid-template-columns: auto minmax(0, 1fr); }
  .armor-slot-settings-row > label, .armor-slot-settings-row > small { grid-column: 1 / -1; }
  .exploration-event-message-label { grid-column: auto; }
  .form-section .section-heading { flex-direction: column; }
  .form-section .section-heading .compact { width: 100%; }
  .battle-live-heading, .operations-toolbar { align-items: stretch; flex-direction: column; }
  .battle-turn-box { min-width: 0; text-align: left; }
  .mini-log-list > div { grid-template-columns: 1fr; }
  .alert-summary-grid { grid-template-columns: 1fr; }
  .alert-center-row { grid-template-columns: auto minmax(0, 1fr); }
  .alert-center-row > button { grid-column: 1 / -1; }
  .boss-target-list { grid-template-columns: 1fr; }
  .trait-row-footer { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.trade-admin-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}.trade-admin-layout{display:grid;grid-template-columns:1.2fr 1fr;gap:18px;margin-bottom:18px}.trade-settings-form{grid-template-columns:repeat(2,minmax(0,1fr))}.trade-settings-form .check-row,.trade-settings-form button{grid-column:1/-1}.trade-restriction-list{margin-top:18px}.trade-restriction-list>div{align-items:center;grid-template-columns:1fr auto}.trade-restriction-list button{grid-column:2;grid-row:1/4}@media(max-width:980px){.trade-admin-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.trade-admin-layout{grid-template-columns:1fr}}@media(max-width:620px){.trade-admin-summary{grid-template-columns:1fr}.trade-settings-form{grid-template-columns:1fr}}
.pet-catalog-image{display:block;width:52px;height:52px;object-fit:cover;border:1px solid #34466c;border-radius:12px;background:#091326}.pet-preview{display:flex;align-items:center;justify-content:center;min-height:140px;margin-top:14px;border:1px dashed #40557c;border-radius:14px;background:#091326;color:var(--muted);overflow:hidden}.pet-preview img{max-width:100%;max-height:220px;object-fit:contain}.pet-preview img[hidden]{display:none}.pet-metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.pet-metric-editor{display:grid;gap:10px;padding:14px;border:1px solid #2b3d61;border-radius:14px;background:#0b152a}.pet-metric-editor>b{color:var(--gold)}.pet-metric-editor small,.pet-token-editor small{color:var(--muted);line-height:1.5}.pet-token-editor{padding:14px;border:1px solid #30436a;border-radius:12px;background:#0c162b}.pet-token-editor label{max-width:640px}@media(max-width:820px){.pet-metric-grid{grid-template-columns:1fr}}
