:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #1b2224;
  --panel-2: #263035;
  --panel-3: #312b2c;
  --line: #475158;
  --text: #f6f0e4;
  --muted: #b8c0bd;
  --hot: #e66a4f;
  --warn: #e7bd5c;
  --ok: #69c889;
  --blue: #78a7d9;
  --violet: #b68bea;
  --paper: #d7bd82;
  --ink: #281f1a;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .016) 1px, transparent 1px),
    radial-gradient(circle at 14% 12%, rgba(231, 189, 92, .14), transparent 26rem),
    radial-gradient(circle at 82% 5%, rgba(120, 167, 217, .12), transparent 25rem),
    radial-gradient(circle at 76% 74%, rgba(230, 106, 79, .11), transparent 28rem),
    linear-gradient(135deg, #111414, #182022 48%, #241e20);
  background-size: 24px 24px, 24px 24px, auto, auto, auto, auto;
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 12px;
  color: #201813;
  background: linear-gradient(180deg, #f0ca70, #d7a545);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .14s ease, border-color .14s ease, filter .14s ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #303a45;
  color: var(--text);
  padding: 0 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 16px clamp(12px, 2vw, 28px) 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.entry-switch a {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  text-decoration: none;
  font-weight: 800;
}

.entry-switch a:hover {
  border-color: rgba(231, 189, 92, .7);
  color: var(--warn);
}

.entry-switch a.current {
  border-color: rgba(105, 200, 137, .72);
  color: var(--ok);
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 22px rgba(231, 189, 92, .18);
}

.topbar p,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.ghost {
  color: var(--text);
  background: linear-gradient(180deg, #303a3d, #232b2f);
  border-color: var(--line);
}

.join-panel,
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0)),
    rgba(27, 34, 36, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.join-panel {
  max-width: 440px;
  padding: 16px;
}

.join-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.web-entry,
.legacy-entry,
.demo-box {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 14px;
}

.web-entry:first-of-type {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.web-entry h3,
.legacy-entry summary,
.demo-box h3 {
  margin: 0;
  font-size: 15px;
}

.legacy-entry summary {
  cursor: pointer;
  color: var(--text);
}

.web-entry label,
.demo-box label {
  margin-bottom: 0;
}

.web-entry button,
.demo-box button {
  width: 100%;
}

.claim-box {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.claim-box.active {
  border-left-color: var(--warn);
}

.claim-box strong {
  color: var(--text);
  font-size: 17px;
}

.claim-box span {
  color: var(--muted);
  line-height: 1.5;
}

.join-class {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  gap: 18px;
  align-items: start;
}

.stage {
  display: grid;
  gap: 14px;
}

.side-panel {
  position: sticky;
  top: 12px;
  overflow: hidden;
}

.panel-head,
.log-head,
.card-head,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head,
.log-head {
  padding: 13px 14px;
  background:
    linear-gradient(90deg, rgba(231, 189, 92, .09), transparent 44%),
    rgba(38, 48, 53, .86);
  border-bottom: 1px solid var(--line);
}

.log-head {
  border-top: 1px solid var(--line);
}

.panel-head h2,
.log-head h2 {
  margin: 0 0 2px;
  font-size: 16px;
}

.panel-head span,
.log-head span {
  color: var(--muted);
  font-size: 12px;
}

.phase-body {
  padding: 14px;
}

.route-grid,
.monster-grid,
.reward-grid,
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.route-map-wrap {
  margin-bottom: 12px;
  overflow-x: auto;
  padding: 14px 10px 12px;
  border: 1px solid rgba(215, 189, 130, .28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(40, 31, 26, .15), rgba(40, 31, 26, .02), rgba(40, 31, 26, .16)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, rgba(215, 189, 130, .22), rgba(90, 69, 42, .18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.route-map-board {
  position: relative;
  display: block;
  width: var(--map-width);
  height: var(--map-height);
  min-width: var(--map-width);
  margin: 0 auto;
}

.route-map-board::before {
  content: "";
  position: absolute;
  inset: 10px 18px;
  border: 1px solid rgba(40, 31, 26, .22);
  border-radius: 8px;
  pointer-events: none;
}

.route-map-lines {
  position: absolute;
  inset: 0;
  width: var(--map-width);
  height: var(--map-height);
  pointer-events: none;
}

.route-map-lines path {
  fill: none;
  stroke: rgba(215, 189, 130, .16);
  stroke-linecap: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.route-map-lines path.muted {
  stroke: rgba(215, 189, 130, .12);
}

.route-map-lines path.near {
  stroke: rgba(215, 189, 130, .28);
}

.route-map-lines path.passed {
  stroke: rgba(62, 123, 79, .42);
}

.route-map-lines path.active {
  stroke: rgba(238, 190, 78, .95);
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(238, 190, 78, .4));
}

.map-node {
  position: absolute;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 2px;
  width: 116px;
  min-height: 74px;
  padding: 8px 9px;
  color: #fbf0d2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0)),
    #263035;
  border-color: rgba(255, 255, 255, .14);
  text-align: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .26);
  transform: translate(-50%, -50%);
}

.map-node:disabled {
  cursor: default;
  opacity: 1;
}

.map-node span,
.map-node strong,
.map-node em {
  display: block;
  overflow: hidden;
}

.map-node span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-node strong {
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-node em {
  justify-self: center;
  max-width: 100%;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #112017;
  background: rgba(105, 200, 137, .88);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-node.prepare em {
  color: #201813;
  background: rgba(231, 189, 92, .92);
}

.map-node.start {
  border-color: rgba(117, 167, 232, .72);
}

.map-node.elite {
  border-color: rgba(178, 148, 255, .68);
}

.map-node.mini_boss {
  border-color: rgba(224, 128, 92, .82);
}

.map-node.rest {
  border-color: rgba(93, 199, 131, .68);
}

.map-node.prepare {
  border-color: rgba(231, 189, 92, .82);
  background:
    linear-gradient(180deg, rgba(105, 200, 137, .16), rgba(231, 189, 92, .08)),
    #263035;
}

.map-node.shop {
  border-color: rgba(117, 167, 232, .68);
}

.map-node.event {
  border-color: rgba(224, 184, 78, .64);
}

.map-node.boss {
  border-color: rgba(225, 91, 83, .86);
}

.map-node.current {
  background: linear-gradient(180deg, #2d5a43, #243a33);
  border-color: rgba(93, 199, 131, .95);
  box-shadow: 0 0 0 2px rgba(93, 199, 131, .22), 0 10px 26px rgba(0, 0, 0, .28);
}

.map-node.available {
  background: linear-gradient(180deg, #70521d, #4b391b);
  border-color: rgba(224, 184, 78, .9);
  box-shadow: 0 0 0 2px rgba(224, 184, 78, .22), 0 12px 30px rgba(224, 184, 78, .12);
  cursor: pointer;
}

.map-node.available:hover {
  transform: translate(-50%, -52%);
}

.map-node.available span {
  color: var(--warn);
}

.map-node.passed {
  opacity: .48;
  filter: grayscale(.45);
}

.map-node.locked {
  opacity: .28;
  filter: grayscale(.6);
}

.map-node.locked strong,
.map-node.locked span,
.map-node.locked em,
.map-node.passed strong,
.map-node.passed span,
.map-node.passed em {
  color: rgba(246, 240, 228, .52);
}

.map-node.locked em,
.map-node.passed em {
  background: rgba(246, 240, 228, .14);
}

.class-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-card,
.monster-card,
.reward-card,
.player-card,
.action-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0)),
    var(--panel-2);
}

.route-card,
.reward-card,
.action-box {
  padding: 12px;
}

.reward-card {
  position: relative;
  overflow: hidden;
}

.reward-card::after,
.route-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 92, .45), transparent);
  opacity: .75;
  pointer-events: none;
}

.route-card h3,
.reward-card h3,
.monster-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.route-card p,
.reward-card p,
.monster-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.route-card button,
.reward-card button {
  width: 100%;
  margin-top: 12px;
}

.route-card .tag,
.monster-card .tag,
.reward-card .tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  margin-bottom: 8px;
  color: #111315;
  background: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.route-card.elite .tag,
.monster-card.elite .tag {
  background: var(--violet);
}

.route-card.mini_boss .tag {
  background: #e0805c;
}

.route-card.rest .tag {
  background: var(--ok);
}

.route-card.boss .tag,
.monster-card.boss .tag {
  background: var(--hot);
}

.event-roll {
  display: grid;
  grid-template-columns: minmax(380px, 430px) 1fr;
  gap: 12px;
  align-items: stretch;
}

.event-wheel-shell {
  position: relative;
  display: grid;
  min-height: 410px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(215, 189, 130, .28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(231, 189, 92, .15), transparent 11rem),
    repeating-conic-gradient(from -18deg, rgba(231, 189, 92, .16) 0deg 24deg, rgba(120, 167, 217, .1) 24deg 48deg),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0)),
    var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.event-pointer {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 4;
  min-width: 58px;
  padding: 4px 8px 6px;
  transform: translateX(-50%);
  border-radius: 6px;
  color: #201813;
  background: var(--warn);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.event-pointer::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: -9px;
  width: 0;
  height: 0;
  transform: translateX(50%);
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  border-top: 10px solid var(--warn);
}

.event-wheel {
  position: relative;
  width: 338px;
  height: 338px;
  border: 2px solid rgba(231, 189, 92, .72);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(16, 18, 20, .96) 0 21%, transparent 22%),
    radial-gradient(circle, transparent 0 68%, rgba(255, 255, 255, .12) 69%, transparent 70%),
    var(--wheel-bg);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .34), inset 0 0 34px rgba(0, 0, 0, .42);
}

.event-wheel::before,
.event-wheel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.event-wheel::before {
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
}

.event-wheel::after {
  inset: 50%;
  width: 94px;
  height: 94px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(231, 189, 92, .34);
  background:
    radial-gradient(circle at 50% 42%, rgba(231, 189, 92, .18), transparent 3.3rem),
    rgba(18, 21, 22, .9);
}

.event-roll.rolling .event-wheel {
  animation: eventSpin .9s cubic-bezier(.16, .78, .2, 1) both;
}

@keyframes eventSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(1120deg);
  }
}

.event-wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 104px;
  min-height: 54px;
  align-content: center;
  gap: 3px;
  padding: 6px 8px;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-118px) rotate(var(--back));
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  color: var(--text);
  background: rgba(20, 25, 27, .78);
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
  backdrop-filter: blur(3px);
}

.event-wheel-label.hot {
  border-color: rgba(230, 106, 79, .62);
}

.event-wheel-label.warn {
  border-color: rgba(231, 189, 92, .68);
}

.event-wheel-label.ok {
  border-color: rgba(105, 200, 137, .62);
}

.event-wheel-label span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.event-wheel-label strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rollEventBtn {
  position: absolute;
  z-index: 5;
  width: 120px;
  min-height: 54px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.event-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.event-choice-card {
  min-height: 142px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0)),
    var(--panel-2);
}

.event-choice-card.hot {
  border-color: rgba(230, 106, 79, .56);
}

.event-choice-card.warn,
.event-choice-card.jiuhu {
  border-color: rgba(231, 189, 92, .62);
}

.event-choice-card.ok {
  border-color: rgba(105, 200, 137, .56);
}

.event-choice-card .tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  margin-bottom: 8px;
  color: #111315;
  background: var(--warn);
  font-size: 12px;
  font-weight: 850;
}

.event-choice-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.event-choice-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.event-result-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 8, .56);
}

.event-result-card {
  width: min(520px, 100%);
  border: 1px solid rgba(231, 189, 92, .72);
  border-radius: 8px;
  padding: 22px 24px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
    rgba(28, 35, 38, .98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  animation: event-result-pop .42s cubic-bezier(.16, .84, .22, 1) both;
}

.event-result-card.hot {
  border-color: rgba(230, 106, 79, .78);
}

.event-result-card.ok {
  border-color: rgba(105, 200, 137, .76);
}

.event-result-card span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #201813;
  background: var(--warn);
  font-size: 12px;
  font-weight: 900;
}

.event-result-card h2 {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.12;
}

.event-result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.event-result-details {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.event-result-details li {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  font-size: 14px;
  line-height: 1.45;
}

.event-result-card button {
  width: 100%;
  margin-top: 18px;
}

@keyframes event-result-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.action-feedback {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 3px;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid rgba(215, 189, 130, .34);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(23, 28, 31, .96);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .36);
  animation: action-feedback-in .18s ease-out both;
}

.action-feedback.hot {
  border-left-color: var(--hot);
}

.action-feedback.ok {
  border-left-color: var(--ok);
}

.action-feedback strong {
  font-size: 14px;
}

.action-feedback span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.action-feedback.leaving {
  animation: action-feedback-out .22s ease-in both;
}

@keyframes action-feedback-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes action-feedback-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.route-card.jiuhu-event-card {
  position: relative;
  overflow: hidden;
  grid-column: 1 / -1;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  border-color: rgba(224, 184, 78, .62);
  background:
    linear-gradient(90deg, rgba(13, 17, 19, .95), rgba(13, 17, 19, .7) 42%, rgba(13, 17, 19, .2)),
    linear-gradient(0deg, rgba(13, 17, 19, .9), rgba(13, 17, 19, .08) 58%),
    url("assets/jiuhu-event.jpg") center right / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(224, 184, 78, .18);
}

.route-card.jiuhu-event-card .tag {
  color: #111315;
  background: var(--warn);
}

.route-card.jiuhu-event-card h3 {
  font-size: 24px;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.route-card.jiuhu-event-card p {
  max-width: 460px;
  color: var(--text);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.route-card.jiuhu-event-card button {
  width: min(180px, 100%);
}

.monster-grid {
  padding: 14px;
  background:
    radial-gradient(circle at 18% 50%, rgba(120, 167, 217, .08), transparent 18rem),
    radial-gradient(circle at 82% 45%, rgba(230, 106, 79, .08), transparent 18rem),
    linear-gradient(180deg, rgba(0, 0, 0, .12), transparent);
}

.monster-card {
  position: relative;
  padding: 13px;
  min-height: 156px;
  overflow: hidden;
}

.monster-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 20%, rgba(230, 106, 79, .16), transparent 9rem),
    linear-gradient(135deg, transparent, rgba(0, 0, 0, .18));
  pointer-events: none;
}

.monster-card > * {
  position: relative;
  z-index: 1;
}

.monster-card.clash-ready {
  border-color: rgba(231, 189, 92, .92);
  box-shadow: inset 0 0 0 1px rgba(231, 189, 92, .2), 0 0 22px rgba(231, 189, 92, .13);
}

.monster-card.dead {
  opacity: .54;
  filter: grayscale(.55);
}

.clash-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 226, 156, .5);
  border-radius: 999px;
  padding: 0 9px;
  color: #fff4c8;
  background: rgba(90, 58, 14, .9);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(231, 189, 92, .18);
}

.bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
  margin: 9px 0;
}

.bar > i {
  position: relative;
  z-index: 2;
  display: block;
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--hot), #ef8c62);
}

.hp-bar .hp-ghost {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: var(--ghost);
  background: linear-gradient(90deg, rgba(239, 196, 96, .75), rgba(239, 91, 91, .82));
}

.monster-card.hit {
  animation: monster-hit .28s ease;
}

.monster-card.charging {
  border-color: rgba(230, 106, 79, .82);
  box-shadow: 0 0 0 2px rgba(230, 106, 79, .18), 0 12px 28px rgba(230, 106, 79, .12);
}

.monster-card.charging::after {
  content: "蓄力";
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  min-height: 24px;
  border: 1px solid rgba(230, 106, 79, .52);
  border-radius: 999px;
  padding: 2px 8px;
  color: #ffd7d7;
  background: rgba(77, 24, 23, .88);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(230, 106, 79, .22);
}

.monster-card.hit .hp-ghost {
  animation: hp-ghost-drain .78s .12s ease forwards;
}

.damage-float {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  color: #ffd7d7;
  font-weight: 800;
  font-size: 18px;
  text-shadow: 0 2px 0 rgba(110, 22, 22, .65), 0 0 14px rgba(239, 91, 91, .45);
  pointer-events: none;
  animation: damage-float .82s ease-out forwards;
}

.monster-card.charging .damage-float {
  top: 40px;
}

.intent-line {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, .16);
  color: var(--text) !important;
  font-weight: 800;
}

.intent-line.hot {
  border-color: rgba(230, 106, 79, .52);
  color: #ffd4c8 !important;
}

.intent-line.warn {
  border-color: rgba(231, 189, 92, .52);
  color: #ffe7ad !important;
}

.intent-line.ok {
  border-color: rgba(105, 200, 137, .48);
  color: #c7f4d3 !important;
}

.clash-line,
.combat-note {
  border-left: 3px solid var(--warn);
  padding-left: 9px;
  color: #ffe7ad !important;
  font-weight: 750;
}

.combat-note {
  border: 1px solid rgba(231, 189, 92, .28);
  border-left-width: 3px;
  border-radius: 8px;
  background: rgba(231, 189, 92, .07);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.5;
}

@keyframes monster-hit {
  0% {
    transform: translateX(0);
    box-shadow: 0 0 0 rgba(239, 91, 91, 0);
  }
  24% {
    transform: translateX(-4px);
    box-shadow: 0 0 0 1px rgba(239, 91, 91, .45), 0 0 24px rgba(239, 91, 91, .18);
  }
  48% {
    transform: translateX(4px);
  }
  72% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
    box-shadow: 0 0 0 rgba(239, 91, 91, 0);
  }
}

@keyframes hp-ghost-drain {
  from {
    width: var(--ghost);
  }
  to {
    width: var(--value);
  }
}

@keyframes damage-float {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(.9);
  }
  18% {
    opacity: 1;
    transform: translateY(-2px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translateY(-24px) scale(1);
  }
}

@keyframes shield-pulse {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(87, 165, 255, .2), 0 0 0 rgba(87, 165, 255, 0);
  }
  38% {
    transform: scale(1.012);
    box-shadow: inset 0 0 0 1px rgba(87, 165, 255, .42), 0 0 24px rgba(87, 165, 255, .25);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(87, 165, 255, .22), 0 0 18px rgba(87, 165, 255, .12);
  }
}

@keyframes shield-float {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(.9);
  }
  18% {
    opacity: 1;
    transform: translateY(-2px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) scale(1);
  }
}

.bar.block > i {
  background: linear-gradient(90deg, var(--blue), var(--ok));
}

.team-list,
.relic-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.team-list {
  max-height: 340px;
  overflow: auto;
}

.relic-list {
  max-height: 620px;
  overflow: auto;
}

.player-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.player-card.dead {
  opacity: .52;
}

.player-card.acted {
  opacity: .62;
  filter: grayscale(.45);
}

.player-card.waiting-action {
  border-color: rgba(231, 189, 92, .62);
  background:
    linear-gradient(90deg, rgba(231, 189, 92, .12), transparent),
    var(--panel-2);
}

.player-card.guarded {
  border-color: rgba(87, 165, 255, .82);
  background: linear-gradient(180deg, rgba(87, 165, 255, .13), rgba(42, 48, 57, .82));
  box-shadow: inset 0 0 0 1px rgba(87, 165, 255, .22), 0 0 18px rgba(87, 165, 255, .12);
}

.player-card.guarded.acted {
  opacity: .78;
  filter: grayscale(.2);
}

.player-card.guarded .pill {
  border-color: rgba(117, 167, 232, .5);
  color: #bcd8ff;
}

.player-card.poisoned {
  border-color: rgba(116, 197, 121, .68);
  box-shadow: inset 0 0 0 1px rgba(116, 197, 121, .18), 0 0 16px rgba(116, 197, 121, .11);
}

.player-card.marked {
  border-color: rgba(239, 196, 96, .68);
}

.player-card.regening {
  border-color: rgba(105, 200, 137, .66);
  box-shadow: inset 0 0 0 1px rgba(105, 200, 137, .16), 0 0 16px rgba(105, 200, 137, .1);
}

.player-card.acidic {
  border-color: rgba(186, 215, 82, .72);
  box-shadow: inset 0 0 0 1px rgba(186, 215, 82, .16), 0 0 16px rgba(186, 215, 82, .12);
}

.player-card.engulfed {
  border-color: rgba(82, 211, 185, .76);
  box-shadow: inset 0 0 0 1px rgba(82, 211, 185, .18), 0 0 18px rgba(82, 211, 185, .14);
}

.player-card.shield-gain {
  animation: shield-pulse .48s ease;
}

.shield-float {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 4;
  color: #cfe4ff;
  font-size: 16px;
  font-weight: 850;
  text-shadow: 0 0 14px rgba(87, 165, 255, .72);
  pointer-events: none;
  animation: shield-float .82s ease-out forwards;
}

.player-card.dead .bar > i,
.player-card.acted .bar > i {
  background: rgba(154, 163, 176, .55);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #111315;
}

.player-meta {
  min-width: 0;
}

.player-meta strong,
.player-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-meta span {
  color: var(--muted);
  font-size: 12px;
}

.player-meta .action-state {
  margin-top: 5px;
  color: var(--text);
  white-space: normal;
  line-height: 1.35;
}

.player-meta .status-line {
  margin-top: 4px;
  color: #d8efbd;
  font-weight: 750;
}

.player-card.acted .action-state,
.player-card.dead .action-state {
  color: var(--muted);
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.relic-card {
  border-left: 3px solid var(--line);
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.relic-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)),
    var(--panel-2);
}

.relic-card.item-card {
  border-left-color: var(--blue);
}

.relic-card.skill-card {
  border-left-color: var(--violet);
}

.relic-card.gear-card {
  border-left-color: var(--ok);
}

.relic-card.build-card {
  border-left-color: var(--hot);
}

.relic-card.build-card.active-build {
  border-color: rgba(239, 196, 96, .55);
  background: rgba(239, 196, 96, .08);
}

.relic-card .build-current,
.relic-card .build-next {
  display: block;
}

.relic-card .build-current {
  color: var(--text);
  font-weight: 700;
}

.relic-card .build-next {
  margin-top: 3px;
  color: var(--muted);
}

.relic-card.empty-gear {
  opacity: .72;
}

.relic-card.empty-skill {
  opacity: .72;
}

.relic-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.action-box {
  display: grid;
  gap: 10px;
}

.action-row {
  flex-wrap: wrap;
}

.action-row button {
  flex: 1 1 150px;
}

.rules-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  padding: 10px 12px;
  text-align: left;
}

.rules-box summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.rules-box ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.rules-box li + li {
  margin-top: 4px;
}

.term-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px dotted rgba(231, 189, 92, .72);
  color: #ffe2a2;
  font-weight: 800;
  cursor: help;
  outline: none;
}

.term-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 30;
  width: min(260px, 72vw);
  padding: 8px 10px;
  transform: translateX(-50%) translateY(4px);
  border: 1px solid rgba(231, 189, 92, .38);
  border-radius: 8px;
  color: var(--text);
  background: rgba(20, 25, 27, .96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .36);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}

.term-tip:hover::after,
.term-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.target-list {
  display: grid;
  gap: 8px;
}

.target-list button,
.choice-button,
.class-card {
  min-height: 58px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)),
    var(--panel-2);
  border-color: var(--line);
  text-align: left;
}

.target-list button.clash-target {
  border-color: rgba(231, 189, 92, .88);
  background:
    linear-gradient(90deg, rgba(231, 189, 92, .18), rgba(231, 189, 92, .04)),
    var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(231, 189, 92, .18), 0 0 18px rgba(231, 189, 92, .12);
}

.target-list button.clash-target strong {
  color: #ffe7ad;
}

.target-list button strong,
.choice-button strong,
.class-card strong {
  display: block;
  margin-bottom: 3px;
}

.target-list button span,
.choice-button span,
.class-card span {
  color: var(--muted);
  font-size: 12px;
}

.class-card.active {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px rgba(224, 184, 78, .28);
}

.danger {
  color: var(--text);
  background: #5f2f34;
  border-color: rgba(225, 91, 83, .72);
}

.mini-danger {
  min-height: 32px;
  padding: 0 9px;
  color: var(--text);
  background: #5f2f34;
  border-color: rgba(225, 91, 83, .65);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .58);
  z-index: 20;
}

.modal.open {
  display: grid;
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(680px, 86vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0)),
    var(--panel);
  padding: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .44);
}

.modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-card h2 {
  margin: 0;
  font-size: 16px;
}

.close {
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
  text-align: center;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .team-list,
  .relic-list {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .route-map-wrap {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .event-roll {
    grid-template-columns: 1fr;
  }

  .event-wheel-shell {
    min-height: 360px;
  }

  .event-wheel {
    width: 292px;
    height: 292px;
  }

  .event-wheel-label {
    width: 96px;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-104px) rotate(var(--back));
  }

  .player-card {
    grid-template-columns: 40px 1fr;
  }

  .player-card .pill {
    grid-column: 2;
    justify-self: start;
  }

  .route-card.jiuhu-event-card {
    min-height: 260px;
    padding: 14px;
    background:
      linear-gradient(0deg, rgba(13, 17, 19, .95), rgba(13, 17, 19, .18) 68%),
      url("assets/jiuhu-event.jpg") 58% center / cover no-repeat;
  }

  .route-card.jiuhu-event-card h3 {
    font-size: 22px;
  }

  .route-card.jiuhu-event-card button {
    width: 100%;
  }
}
