/* ReplayCenter - dark first, light theme via [data-theme="light"]. Tokens follow divine-pride.net (Website2026 theme.css). */
:root {
  --bg: #0d1219;
  --bg-2: #111823;
  --surface: #151d2b;
  --surface-2: #1b2536;
  --surface-3: #233047;
  --text: #e8edf5;
  --text-muted: #a3b1c6;
  --text-subtle: #6f7f96;
  --border: #26324a;
  --border-light: #1f2a3e;
  --accent: #46a0ff;
  --accent-strong: #7cbaff;
  --accent-soft: rgba(70, 160, 255, .14);
  --gold: #f2c14e;
  --success: #3ecf8e;
  --warning: #f5a524;
  --danger: #ff6b6b;
  --npc: #b78cff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, Monaco, Menlo, monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --surface-3: #e7edf6;
  --text: #1b2430;
  --text-muted: #56637a;
  --text-subtle: #8a94a6;
  --border: #d3dce8;
  --border-light: #e6ebf3;
  --accent: #0a67d8;
  --accent-strong: #084fa8;
  --accent-soft: rgba(10, 103, 216, .1);
  --gold: #b07d00;
  --npc: #7a45d8;
  --shadow: 0 10px 30px rgba(20, 40, 80, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 30px; letter-spacing: -.02em; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
img { max-width: 100%; }
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; padding: 28px 0 56px; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border-light);
}
.site-header .container { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 32px; height: 32px; image-rendering: pixelated; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--text-subtle); letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--text-muted); padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- buttons, forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font: 14px var(--font);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); }
.field { margin-bottom: 14px; }
.inline-form { display: inline; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid + .card, .card + .grid { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .nav { display: none; } }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-muted); white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge-gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); margin: 0 4px 6px 0; }
a.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.flash { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 20px; }
.error-box { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); padding: 12px 16px; border-radius: var(--radius-md); }

/* ---------- hero / home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 56px 48px;
  background:
    radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
    radial-gradient(700px 300px at 0% 110%, color-mix(in srgb, var(--npc) 22%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--border-light);
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center;
}
.hero h1 { font-size: 42px; margin-bottom: 14px; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--npc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-muted); font-size: 17px; max-width: 560px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 32px 24px; } .hero h1 { font-size: 32px; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 0; }
.stat { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 14px 16px; }
.stat b { display: block; font-size: 22px; letter-spacing: -.02em; }
.stat span { color: var(--text-subtle); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.features { margin-top: 32px; }
.feature { padding: 22px; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; font-size: 20px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin: 40px 0 14px; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg) 55%, transparent); padding: 34px 24px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over { transform: scale(1.01); }
.dropzone .big { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.dropzone strong { display: block; font-size: 17px; margin-bottom: 4px; }
.upload-list { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; }
.upload-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); margin-top: 6px; font-size: 14px; }
.upload-list li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--npc)); transition: width .2s; }

/* ---------- replay cards / list ---------- */
.replay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.replay-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border-light); color: var(--text); transition: border-color .15s, transform .15s; }
.replay-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.replay-card .top { display: flex; gap: 12px; align-items: center; }
.job-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.job-icon img { width: 24px; height: 24px; image-rendering: pixelated; }
.replay-card .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-card .meta { font-size: 13px; color: var(--text-subtle); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filter-bar .field { margin: 0; min-width: 160px; }
.filter-bar .field.grow { flex: 1; min-width: 220px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }

/* ---------- replay detail ---------- */
.replay-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.replay-head .avatar { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--npc) 18%, transparent)); display: grid; place-items: center; }
.replay-head .avatar img { width: 24px; height: 24px; image-rendering: pixelated; }
.replay-head h1 { margin: 0 0 4px; font-size: 26px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.kv div { background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 12px; }
.kv span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); }
.kv b { font-size: 15px; }
@media (max-width: 800px) { .replay-head { grid-template-columns: auto 1fr; } .replay-head .actions { grid-column: 1 / -1; } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 26px 0 18px; overflow-x: auto; scrollbar-width: thin; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); padding: 10px 14px; font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count { font-size: 11px; background: var(--surface-3); color: var(--text-muted); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
td { padding: 8px 10px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-wrap { overflow: auto; max-height: 640px; border-radius: var(--radius-md); }
.item-cell { display: inline-flex; align-items: center; gap: 8px; }
.item-cell img { width: 24px; height: 24px; image-rendering: pixelated; }

/* conversations - chat look */
.conv-list { display: grid; gap: 14px; }
.conv { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.conv summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.conv summary::-webkit-details-marker { display: none; }
.conv summary:hover { background: var(--surface-2); }
.conv .npc-sprite { width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--npc) 16%, var(--surface-2)); overflow: hidden; display: grid; place-items: center; flex: none; color: var(--npc); font-weight: 800; }
.conv .npc-sprite img { max-width: 42px; max-height: 42px; object-fit: contain; }
.conv .who { flex: 1; min-width: 0; }
.conv .who b { display: block; }
.conv-body { padding: 4px 18px 18px 70px; display: grid; gap: 8px; }
.bubble { position: relative; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 4px 14px 14px 14px; padding: 10px 14px; max-width: 720px; white-space: pre-wrap; }
.bubble .ro-color { font-weight: 600; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.step .tag { font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-muted); }
.step.gain .tag { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.step.loss .tag { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.step.quest .tag { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.step.warp .tag { background: var(--accent-soft); color: var(--accent); }
.menu { display: flex; flex-wrap: wrap; gap: 6px; }
.menu span { border: 1px solid var(--border); border-radius: 8px; padding: 5px 11px; font-size: 13px; background: var(--bg-2); }
.next { font-size: 12px; color: var(--text-subtle); }

/* script viewer */
.code {
  background: #0a0f16; color: #d6e2f0; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; overflow: auto; max-height: 720px; font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre; tab-size: 4;
}
[data-theme="light"] .code { background: #0f1722; }
.code .kw { color: #7cbaff; }
.code .str { color: #f2c14e; }
.code .cm { color: #6f7f96; font-style: italic; }
.code .num { color: #b78cff; }
.code .lbl { color: #3ecf8e; font-weight: 700; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 4px 0 12px 16px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--bg); }
.timeline li.map::before { background: var(--accent); }
.timeline li.npc::before { background: var(--npc); }
.timeline li.quest::before, .timeline li.levelup::before { background: var(--gold); }
.timeline li.item::before { background: var(--success); }
.timeline time { font-family: var(--mono); font-size: 12px; color: var(--text-subtle); margin-right: 8px; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.route .arrow { color: var(--text-subtle); }

/* chat log */
.chat-line { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border-light); font-size: 14px; }
.chat-line time { font-family: var(--mono); font-size: 12px; color: var(--text-subtle); flex: none; width: 72px; }
.chat-line .ch { flex: none; width: 82px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ch-public { color: var(--text-muted); } .ch-self { color: var(--accent); } .ch-party { color: #6be675; } .ch-guild { color: #9ae3ff; }
.ch-whisper { color: #ffcf6b; } .ch-broadcast { color: var(--gold); } .ch-npc { color: var(--npc); }

/* packet explorer */
.px-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.px-toolbar input { max-width: 320px; }
.px-row { border-bottom: 1px solid var(--border-light); padding: 6px 4px; font-size: 13px; cursor: pointer; }
.px-row:hover { background: var(--surface-2); }
.px-row .head { display: flex; gap: 12px; align-items: baseline; }
.px-row .head time { font-family: var(--mono); color: var(--text-subtle); width: 90px; }
.px-row .head .pname { font-family: var(--mono); font-weight: 700; }
.px-row .head .pid { font-family: var(--mono); color: var(--text-subtle); font-size: 12px; }
.px-row .fields { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin: 4px 0 0 102px; white-space: pre-wrap; word-break: break-all; }
.px-row.warn .pname { color: var(--warning); }

footer.site-footer { border-top: 1px solid var(--border-light); padding: 22px 0; color: var(--text-subtle); font-size: 13px; }
footer.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.login-card { max-width: 420px; margin: 40px auto; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing { text-align: center; padding: 60px 20px; }
.processing .spinner { width: 42px; height: 42px; border-width: 4px; margin-bottom: 18px; }

/* ---------- replay player ---------- */
.container-wide { max-width: none; }
.player-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.player { display: grid; grid-template-columns: 1fr 320px; grid-template-rows: auto auto; gap: 12px; }
.player-stage { position: relative; height: calc(100vh - 290px); min-height: 460px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: #000; }
.player-canvas { position: absolute; inset: 0; }
.player-canvas canvas { display: block; outline: none; }
.player-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; font-family: var(--font); }
.player-status { position: absolute; left: 10px; top: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; pointer-events: none; z-index: 5; }
.player-side { display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 290px); min-height: 460px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.player-side-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 6px; }
.player-log { flex: 1; overflow-y: auto; padding: 8px 10px; font-size: 13px; }
.player-log .line { padding: 3px 0; border-bottom: 1px dashed var(--border-light); }
.player-log .line time { font-family: var(--mono); font-size: 11px; color: var(--text-subtle); margin-right: 6px; }
.player-log .map-link { cursor: pointer; display: block; padding: 6px 4px; border-radius: 6px; }
.player-log .map-link:hover, .player-log .map-link.current { background: var(--surface-2); }
.player-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 10px 14px; }
.player-bar select { width: auto; padding: 5px 8px; }
.player-check { display: flex !important; align-items: center; gap: 5px; margin: 0; color: var(--text-muted); }
.player-scrub { position: relative; flex: 1; }
.player-scrub input { width: 100%; accent-color: var(--accent); }
.player-segments { position: absolute; left: 0; right: 0; top: -6px; height: 4px; }
.player-segments span { position: absolute; top: 0; height: 4px; border-radius: 2px; opacity: .8; }
@media (max-width: 1000px) { .player { grid-template-columns: 1fr; } .player-side { height: 260px; min-height: 0; } }

/* labels over actors */
.pl-label { position: absolute; transform: translate(-50%, 0); white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.pl-label.self { color: #ffe066; }
.pl-label.npc { color: #b9f2ff; }
.pl-label.monster { color: #ffd0d0; }
.pl-label.boss { color: #ff6b6b; }
/* HP gauge under a damaged monster, like the client's (green, red when low) */
.pl-gauge { position: absolute; transform: translate(-50%, 0); width: 30px; height: 4px; background: rgba(20,20,30,.85); border: 1px solid #10131a; border-radius: 1px; pointer-events: none; }
.pl-gauge > div { height: 100%; background: #37d65a; transition: width .15s linear; }
.pl-gauge.low > div { background: #e6453a; }
.pl-label.with-gauge { margin-top: 7px; }
.pl-bubble { position: absolute; transform: translate(-50%, -100%); max-width: 260px; padding: 5px 9px; border-radius: 10px; background: rgba(255,255,255,.95); color: #111; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.4); white-space: pre-wrap; }
.pl-bubble.skill { background: rgba(20,20,40,.85); color: #ffe066; font-weight: 700; border-radius: 6px; }
.pl-float { position: absolute; transform: translate(-50%, -100%); font-weight: 800; font-size: 16px; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; animation: pl-rise 1.2s ease-out forwards; }
.pl-float.player-hit { color: #ff6b6b; }
.pl-float.miss { color: #aaa; font-size: 13px; }
@keyframes pl-rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -40px; } }

/* RO-style NPC dialog */
.player-dialog { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(560px, 92%); background: rgba(255,255,255,.96); color: #111; border: 1px solid #7c8aa5; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.45); padding: 10px 14px; font-size: 13px; line-height: 1.55; z-index: 6; }
.player-dialog-name { font-weight: 700; color: #1a4fa0; margin-bottom: 4px; }
.player-dialog-text { white-space: pre-wrap; max-height: 180px; overflow-y: auto; }
.player-dialog-menu { display: grid; gap: 3px; margin-top: 6px; }
.player-dialog-menu span { padding: 3px 8px; border: 1px solid #c5cfdf; border-radius: 4px; background: #f3f6fb; }
.player-dialog-hint { text-align: right; font-size: 11px; color: #667; margin-top: 4px; }
/* showimage: placed like the client's DrawIllustImage (0 left, 1 center, 2 right - bottom aligned; 3/4 screen center) */
.player-cutin { position: absolute; bottom: 0; right: 2%; height: 72%; display: flex; align-items: flex-end; z-index: 5; pointer-events: none; }
.player-cutin[data-type="0"] { right: auto; left: 2%; }
.player-cutin[data-type="1"] { right: auto; left: 50%; transform: translateX(-50%); }
.player-cutin[data-type="3"], .player-cutin[data-type="4"] { right: auto; left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); align-items: center; }
.player-cutin img { max-height: 100%; max-width: min(46vw, 520px); object-fit: contain; }
.player-cutin .player-cutin-name { display: none; }
.player-cutin.missing img { display: none; }
.player-cutin.missing { height: auto; bottom: 16px; }
.player-cutin.missing .player-cutin-name { display: block; background: rgba(0,0,0,.6); color: #ddd; font-size: 11px; padding: 3px 8px; border-radius: 4px; }

/* client link tags (<NAVI>, <ITEM>, <URL>): the label, target as tooltip */
.ro-link { color: #1a6fd6; text-decoration: underline; text-decoration-style: dotted; cursor: help; }
.bubble .ro-link { color: var(--accent); }

/* map legend of the timeline colors */
.player-bar { flex-wrap: wrap; }
.player-legend { flex-basis: 100%; display: flex; gap: 6px; padding: 2px 0 4px; overflow-x: auto; scrollbar-width: thin; }
.legend-item { flex: none; white-space: nowrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 99px; background: none; color: var(--text); font: 12px var(--font); cursor: pointer; }
.legend-item:hover { border-color: var(--accent); }
.legend-item i, .player-log .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend-item span { color: var(--text-subtle); }
.player-log .swatch { margin-right: 6px; vertical-align: -1px; }

/* Cumulated NPC script page (/npc) */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 8px 0 16px; }
.npc-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.npc-layout .code { max-height: 75vh; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (max-width: 900px) { .npc-layout { grid-template-columns: 1fr; } }
