:root {
  color-scheme: light;
  --paper-bg: #f4ead2;
  --paper-surface: #fff8df;
  --paper-muted: #f6e8c5;
  --paper-hover: #fff0bd;
  --paper-ink: #201813;
  --paper-soft-ink: #59463a;
  --paper-red: #b72f24;
  --paper-red-dark: #7f221c;
  --paper-red-soft: #f4d4ca;
  --paper-border: #211915;
  --paper-border-subtle: #c5b28d;
  --paper-shadow-color: rgba(32, 24, 19, .22);
  --paper-shadow: 6px 6px 0 var(--paper-shadow-color);
  --paper-shadow-sm: 3px 3px 0 var(--paper-shadow-color);
  --paper-font-heading: "Arial Black", Impact, "Noto Sans SC", "PingFang SC", sans-serif;
  --paper-font-body: Inter, "Noto Sans SC", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --paper-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg: var(--paper-bg);
  --panel: var(--paper-surface);
  --panel-2: var(--paper-muted);
  --text: var(--paper-ink);
  --muted: var(--paper-soft-ink);
  --line: var(--paper-border-subtle);
  --accent: var(--paper-red);
  --accent-2: #f0b45d;
  --danger: var(--paper-red);
  --gold: #d99b28;
  --shadow: var(--paper-shadow);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper-bg);
  color: var(--text);
  font-family: var(--paper-font-body);
}

.page-shell.raid-page-shell {
  width: auto;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 22px;
}

.raid-page-shell.is-run {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 20px 22px;
}

.raid-page-shell.is-run .site-header {
  margin: 0 -20px 16px;
  padding: 0 20px;
}

.raid-page-shell .raid-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 132px);
  padding: 0;
  background: none;
}

.raid-shell {
  min-height: 100vh;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(32, 24, 19, .035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 24, 19, .025) 1px, transparent 1px);
  background-size: 24px 24px;
}

.raid-topbar,
.raid-layout,
.raid-panel,
.raid-stage-panel,
.raid-modal-card {
  border: 2px solid var(--paper-border);
  background: var(--panel);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.raid-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  margin-bottom: 16px;
  background: var(--paper-surface);
}

.raid-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--paper-font-heading);
  font-weight: 800;
}

.raid-brand img { width: 32px; height: 32px; }
.raid-star-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--paper-ink);
  font-size: 14px;
  font-weight: 900;
  padding: 7px 10px;
  border-radius: 0;
  background: var(--paper-hover);
  border: 2px solid var(--paper-border);
  box-shadow: var(--paper-shadow-sm);
}
.raid-star-pill strong {
  font-size: 16px;
}
.raid-star-pill svg,
.raid-dust-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}
.raid-dust-pill {
  background: var(--paper-red-soft);
}
.raid-badge {
  color: var(--paper-red-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 0;
  background: var(--paper-red-soft);
  border: 2px solid var(--paper-border);
}

.raid-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--paper-muted);
  box-shadow: var(--paper-shadow);
}
.raid-shell:not(.is-run) .raid-layout {
  max-width: 1180px;
  margin: 0 auto;
}
.raid-shell.is-run .raid-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.raid-stage-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  min-width: 0;
}
.raid-stage-panel::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -2px;
  width: 58px;
  height: 10px;
  background: var(--paper-red);
  border: 2px solid var(--paper-border);
  border-top: 0;
}
.raid-shell:not(.is-run):not(.is-warehouse) .raid-stage-panel {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.raid-shell:not(.is-run):not(.is-warehouse) .raid-stage-panel::before,
.raid-shell:not(.is-run):not(.is-warehouse) .raid-stage-head,
.raid-shell:not(.is-run):not(.is-warehouse) .raid-route {
  display: none;
}
.raid-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.raid-stage-head p { margin: 0 0 4px; color: var(--muted); }
.raid-stage-head h1 {
  margin: 0;
  color: var(--paper-ink);
  font-family: var(--paper-font-heading);
  font-size: 30px;
  letter-spacing: 0;
}
.raid-wallet-summary {
  min-width: 168px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.raid-wallet-summary span {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  background: var(--paper-hover);
  border: 2px solid var(--paper-border);
  box-shadow: var(--paper-shadow-sm);
}
.raid-wallet-summary b {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-weight: 900;
}
.raid-wallet-summary b svg {
  width: 18px;
  height: 18px;
  display: block;
}
.raid-wallet-summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--paper-ink);
  font-size: 22px;
  line-height: 1;
}

.raid-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.raid-route[hidden] { display: none; }
.raid-route-node {
  position: relative;
  min-height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 0;
  border: 2px solid var(--paper-border);
  background: var(--paper-surface);
  box-shadow: var(--paper-shadow-sm);
}
.raid-route-node strong,
.raid-route-node em {
  position: relative;
  z-index: 1;
  display: block;
  font-style: normal;
}
.raid-route-node strong { color: var(--paper-ink); font-size: 18px; }
.raid-route-node em { color: var(--paper-soft-ink); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.raid-route-node.is-cleared {
  background: #e7dfc5;
  color: var(--paper-soft-ink);
}
.raid-route-node.is-current {
  border-color: var(--paper-red);
  background: var(--paper-red-soft);
  box-shadow: var(--paper-shadow-sm);
}
.raid-route-node.is-boss {
  background: var(--paper-hover);
  border-color: var(--paper-border);
}

.raid-battlefield {
  position: relative;
  width: 100%;
  min-height: max(600px, var(--raid-board-height, 0px));
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 16px;
  background: #f8efd3;
  border: 2px solid var(--paper-border);
  border-radius: 0;
  box-shadow: inset 0 0 0 6px rgba(255,248,223,.72);
}
.raid-shell.is-warehouse .raid-stage-head,
.raid-shell.is-warehouse .raid-route {
  display: none;
}
.raid-shell.is-warehouse .raid-stage-panel {
  padding: 12px;
}
.raid-shell.is-warehouse .raid-battlefield {
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.raid-shell:not(.is-run):not(.is-warehouse) .raid-battlefield {
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.raid-empty { color: var(--muted); align-self: center; justify-self: center; }
.raid-loading {
  min-height: 420px;
  width: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: #365a42;
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.78), transparent 24%),
    repeating-linear-gradient(90deg, rgba(109, 153, 91, .08) 0 12px, transparent 12px 24px),
    #f4eccb;
}
.raid-loading span {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid rgba(79, 140, 92, 0.18);
  border-top-color: #70b66f;
  animation: raid-loading-spin 0.8s linear infinite;
}
.raid-loading strong {
  font-size: 15px;
  letter-spacing: 0;
}
.raid-playground,
.raid-battlefield .playground {
  margin: 0 auto;
}
.raid-playground .player,
.raid-battlefield .playground .player {
  overflow: visible;
}
.raid-playground .player-body,
.raid-battlefield .playground .player-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  transform-origin: 50% 50%;
  image-rendering: auto !important;
}
.raid-playground .player .skill-aura,
.raid-battlefield .playground .player .skill-aura {
  z-index: 1;
}
.raid-playground .star.raid-treasure-star,
.raid-battlefield .playground .star.raid-treasure-star {
  display: grid;
  place-items: center;
  background-image: var(--asset-star);
  color: #3a2404;
  font-size: 23px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 0 8px rgba(255, 214, 92, .95);
}
.raid-playground .player.is-invulnerable .skill-aura,
.raid-battlefield .playground .player.is-invulnerable .skill-aura {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.76), 0 0 28px rgba(251, 191, 36, 0.48);
  animation: pulse-skill 0.65s ease-in-out infinite;
}

.raid-battlefield .playground .bullet-cosmetic .bullet-sprite {
  background-image: none;
  border-radius: 999px;
}
.raid-battlefield .playground .bullet-cosmetic .bullet-sprite::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.raid-battlefield .playground .bullet-cosmetic-plasma .bullet-sprite::before {
  background: #dffaff;
  box-shadow: 0 0 18px #48e0ff, 0 0 28px #7b5cff;
}
.raid-battlefield .playground .bullet-cosmetic-plasma .bullet-sprite::after {
  display: block;
  height: 42%;
  background: radial-gradient(circle at 50% 16%, rgba(235, 252, 255, .95), rgba(102, 88, 255, .62) 40%, rgba(72, 224, 255, 0) 74%);
}
.raid-battlefield .playground .bullet-cosmetic-ember .bullet-sprite::before {
  background: #fff0a4;
  box-shadow: 0 0 18px #ff7a32, 0 0 28px #ff3d2e;
}
.raid-battlefield .playground .bullet-cosmetic-ember .bullet-sprite::after {
  display: block;
  height: 45%;
  background: radial-gradient(circle at 50% 16%, rgba(255, 245, 188, .95), rgba(255, 108, 35, .72) 42%, rgba(255, 48, 28, 0) 76%);
}

@keyframes spawn-effect {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(var(--spawn-effect-start-scale, 0.52)); filter: saturate(1.25) brightness(1.1); }
  18% { opacity: var(--spawn-effect-peak-opacity, 0.95); }
  72% { opacity: var(--spawn-effect-peak-opacity, 0.95); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(var(--spawn-effect-end-scale, 1.32)); filter: saturate(1.08) brightness(1.2); }
}

@keyframes spawn-drop-tank {
  0% { opacity: 0; transform: translateY(-156px) scale(0.92); filter: brightness(1.18) drop-shadow(0 32px 0 rgba(21, 18, 15, 0.14)); }
  62% { opacity: 1; transform: translateY(7px) scale(1.04); }
  78% { transform: translateY(-4px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: none; }
}

@keyframes spawn-warp-tank {
  0% { opacity: 0; transform: scale(0.66) rotate(-8deg); filter: saturate(1.5) brightness(1.6) hue-rotate(22deg); clip-path: polygon(45% 0, 56% 0, 54% 100%, 43% 100%); }
  18% { opacity: 0.55; transform: scale(0.86) rotate(6deg); clip-path: polygon(18% 0, 40% 0, 35% 100%, 12% 100%); }
  38% { opacity: 0.78; transform: scale(0.98) rotate(-3deg); clip-path: polygon(0 16%, 82% 0, 100% 84%, 18% 100%); }
  68% { opacity: 1; transform: scale(1.06); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  100% { opacity: 1; transform: scale(1); filter: none; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes raid-loading-spin {
  to { transform: rotate(360deg); }
}

@keyframes spawn-gold-tank {
  0%, 34% { opacity: 0; transform: scale(0.82); filter: brightness(2) saturate(1.35); }
  56% { opacity: 1; transform: scale(1.1); filter: brightness(1.7) saturate(1.2); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}

@keyframes spawn-fog-tank {
  0%, 22% { opacity: 0; transform: translateX(-18px) scale(0.96); filter: blur(5px) saturate(0.8); }
  58% { opacity: 1; transform: translateX(4px) scale(1.03); filter: blur(1px) saturate(0.92); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: none; }
}
.raid-map {
  position: relative;
  flex: 0 0 auto;
}
.raid-cell {
  position: absolute;
  width: 38px;
  height: 38px;
  background: #cbe0bc;
  border: 1px solid rgba(95, 118, 88, .12);
}
.raid-cell.is-stone { background: #a8afa8; }
.raid-cell.is-dirt { background: #c79c74; }
.raid-cell.is-grass { background: #91c891; }
.raid-star,
.raid-tank,
.raid-bullet {
  position: absolute;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transition: transform 120ms linear, opacity 120ms linear;
  z-index: 3;
}
.raid-star {
  font-size: 25px;
  filter: drop-shadow(0 0 8px rgba(251,191,36,.55));
}
.raid-tank {
  border-radius: 7px;
  border: 2px solid rgba(255,255,255,.85);
  font-size: 22px;
  background: #315b86;
}
.raid-tank.enemy { background: #7f3347; }
.raid-tank.crashed { opacity: .3; }
.raid-tank.shielded { box-shadow: 0 0 0 4px rgba(110,231,183,.28); }
.raid-tank.invulnerable { box-shadow: 0 0 0 4px rgba(251,191,36,.38); }
.raid-bullet {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fafc;
  margin: 12px;
  z-index: 2;
}

.raid-log {
  display: none;
  height: 116px;
  overflow: auto;
  margin-top: 12px;
  padding: 10px;
  color: var(--muted);
  background: var(--paper-surface);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  font-family: var(--paper-font-mono);
  font-size: 12px;
  white-space: pre-wrap;
}

.raid-sidebar { display: none; gap: 12px; align-content: start; }
.raid-shell.is-run .raid-sidebar { display: grid; }
.raid-control-panel { display: none !important; }
.raid-panel {
  position: relative;
  padding: 14px;
  background: var(--paper-surface);
}
.raid-panel h2 {
  margin: 0 0 12px;
  font-family: var(--paper-font-heading);
  font-size: 18px;
}
.raid-panel h3 { margin: 14px 0 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; }
.raid-risk-card {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 0;
  border: 2px solid var(--paper-border);
  background: var(--paper-red-soft);
  box-shadow: var(--paper-shadow-sm);
}
.raid-risk-card[hidden] { display: none; }
.raid-risk-card strong {
  color: #6d4025;
  font-size: 18px;
}
.raid-risk-card span {
  color: #8a5145;
  font-size: 12px;
  font-weight: 800;
}
.raid-field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
select, button {
  font: inherit;
}
select {
  width: 100%;
  height: 40px;
  color: var(--text);
  background: var(--paper-surface);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  padding: 0 10px;
}
button {
  position: relative;
  height: 40px;
  border: 2px solid var(--paper-border);
  border-radius: 0;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
button:not(:disabled):active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .55; }
button.is-loading {
  color: transparent !important;
  pointer-events: none;
}
button.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  border: 2px solid rgba(60, 84, 66, .22);
  border-top-color: #4f8f62;
  animation: raid-loading-spin .74s linear infinite;
}
.raid-primary.is-loading::after {
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
}
.raid-primary {
  background: var(--paper-ink);
  color: #fff8df;
  width: 100%;
  margin-top: 10px;
  box-shadow: var(--paper-shadow-sm);
}
.raid-secondary {
  background: var(--paper-surface);
  color: var(--text);
  border: 2px solid var(--paper-border);
  box-shadow: var(--paper-shadow-sm);
}
.raid-wide-action { width: 100%; margin-top: 8px; }
.raid-link-button {
  height: 34px;
  color: var(--paper-ink);
  background: var(--paper-surface);
  border: 2px solid var(--paper-border);
}

.raid-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.raid-stat-grid div {
  background: var(--paper-muted);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  padding: 9px;
}
.raid-stat-grid span { display: block; color: var(--muted); font-size: 12px; }
.raid-stat-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.raid-chip-list,
.raid-loot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}
.raid-chip,
.raid-loot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  background: var(--paper-surface);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  font-size: 13px;
}
.raid-mini-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.raid-mini-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.raid-treasure-toast {
  position: absolute;
  left: 50%;
  top: 72px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: min(360px, calc(100% - 36px));
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, .68);
  background: linear-gradient(180deg, rgba(255, 251, 226, .98), rgba(255, 238, 181, .98));
  box-shadow: 0 16px 48px rgba(95, 78, 42, .22), 0 0 34px rgba(251, 191, 36, .22);
  transform: translateX(-50%) translateY(-12px) scale(.96);
  animation: raid-treasure-toast-in .22s ease-out forwards, raid-treasure-toast-pulse .9s ease-in-out .22s 2;
  pointer-events: none;
}
.raid-treasure-toast > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: radial-gradient(circle, #fff7bb, #fbbf24 62%, #7c4a03);
  color: #2f1b03;
  font-size: 27px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(251, 191, 36, .48);
}
.raid-treasure-toast svg {
  width: 38px;
  height: 38px;
  display: block;
}
.raid-treasure-toast strong,
.raid-treasure-toast em {
  display: block;
  font-style: normal;
}
.raid-treasure-toast strong {
  color: #7a5312;
  font-size: 13px;
}
.raid-treasure-toast em {
  margin-top: 2px;
  color: #243629;
  font-size: 18px;
  font-weight: 900;
}
.raid-treasure-toast.is-leaving {
  animation: raid-treasure-toast-out .42s ease-in forwards;
}

.raid-home-view {
  width: 100%;
  display: grid;
  gap: 14px;
  align-self: stretch;
}
.raid-home-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 18px;
  padding: 22px;
  color: var(--paper-ink);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  background: var(--paper-surface);
  box-shadow: var(--paper-shadow-sm);
}
.raid-home-command p,
.raid-home-command h2 {
  margin: 0;
}
.raid-home-command p {
  color: var(--paper-red-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.raid-home-command h2 {
  margin-top: 4px;
  color: var(--paper-ink);
  font-family: var(--paper-font-heading);
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}
.raid-home-command small {
  display: block;
  margin-top: 9px;
  color: #5f735f;
  font-weight: 750;
}
.raid-home-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.raid-home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.raid-home-metrics div {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 2px solid var(--paper-border);
  border-radius: 0;
  background: var(--paper-surface);
  box-shadow: var(--paper-shadow-sm);
}
.raid-home-metrics span {
  color: var(--paper-soft-ink);
  font-size: 12px;
  font-weight: 850;
}
.raid-home-metrics strong {
  color: var(--paper-ink);
  font-size: 30px;
  line-height: 1;
}
.raid-home-metrics .raid-link-button {
  width: max-content;
  margin-top: 3px;
}
.raid-home-lower {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 14px;
}
.raid-home-brief {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--paper-border);
  border-radius: 0;
  background: var(--paper-muted);
  box-shadow: var(--paper-shadow-sm);
}
.raid-home-brief h3,
.raid-home-brief p {
  margin: 0;
}
.raid-home-brief h3 {
  color: var(--paper-red-dark);
  font-size: 15px;
}
.raid-home-brief p {
  color: #7d6552;
  line-height: 1.45;
  font-size: 13px;
  font-weight: 700;
}
.raid-home-brief button {
  width: max-content;
  margin-top: 2px;
}
.raid-home-runs {
  min-width: 0;
}
.raid-home-start {
  align-self: center;
  justify-self: end;
  width: min(180px, 100%);
  height: 52px;
  margin: 0;
  font-size: 17px;
}
.raid-home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.raid-home-section-head h3 {
  margin: 0;
  color: var(--paper-ink);
  font-family: var(--paper-font-heading);
  font-size: 16px;
}

.raid-warehouse-view {
  width: 100%;
  display: grid;
  gap: 10px;
  color: #223129;
}
.raid-warehouse-hero,
.raid-warehouse-wallet,
.raid-warehouse-item,
.raid-warehouse-runs {
  border: 2px solid var(--paper-border);
  border-radius: 0;
  background: var(--paper-surface);
  box-shadow: var(--paper-shadow-sm);
}
.raid-warehouse-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 10px;
  background: var(--paper-surface);
}
.raid-warehouse-hero > div {
  min-width: 0;
  flex: 1;
}
.raid-warehouse-back {
  flex: 0 0 auto;
  min-width: 92px;
  height: 34px;
}
.raid-warehouse-hero p,
.raid-warehouse-hero h2 {
  margin: 0;
}
.raid-warehouse-hero p { color: var(--paper-red-dark); font-size: 11px; font-weight: 800; }
.raid-warehouse-hero h2 {
  margin-top: 1px;
  color: var(--paper-ink);
  font-family: var(--paper-font-heading);
  font-size: 18px;
  letter-spacing: 0;
}
.raid-warehouse-wallet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  justify-content: start;
  gap: 10px;
  padding: 10px;
  background: var(--paper-muted);
}
.raid-warehouse-wallet > div {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 2px solid var(--paper-border);
  background: var(--paper-surface);
}
.raid-warehouse-wallet span {
  color: var(--paper-soft-ink);
  font-size: 11px;
  font-weight: 900;
}
.raid-warehouse-wallet strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--paper-ink);
  font-size: 18px;
  line-height: 1;
}
.raid-warehouse-wallet b {
  font: inherit;
}
.raid-warehouse-wallet svg {
  width: 18px;
  height: 18px;
}
.raid-warehouse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 240px));
  justify-content: start;
  gap: 12px;
}
.raid-warehouse-item {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  box-shadow: var(--paper-shadow-sm);
}
.raid-warehouse-item::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 7px;
  border: 1px dashed rgba(48, 78, 60, .12);
  pointer-events: none;
}
.raid-warehouse-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--paper-muted);
  border: 2px solid var(--paper-border);
  box-shadow: none;
  z-index: 1;
}
.raid-warehouse-icon svg {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 3px 0 rgba(36, 55, 48, .12));
}
.raid-warehouse-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.raid-warehouse-copy strong,
.raid-warehouse-copy span {
  display: block;
}
.raid-warehouse-copy strong {
  color: var(--paper-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.raid-warehouse-copy span {
  margin-top: 4px;
  color: var(--paper-soft-ink);
  font-size: 12px;
  line-height: 1.35;
}
.raid-warehouse-copy small {
  display: block;
  margin-top: 4px;
  color: var(--paper-soft-ink);
  font-size: 11px;
  font-weight: 800;
}
.raid-market-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.raid-market-line b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--paper-ink);
  font-size: 12px;
}
.raid-market-line svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.raid-market-line i {
  display: inline-block;
  padding: 2px 5px;
  color: var(--paper-soft-ink);
  border: 2px solid var(--paper-border);
  background: var(--paper-surface);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.raid-market-line .trend-up {
  color: var(--paper-red-dark);
  background: var(--paper-red-soft);
}
.raid-market-line .trend-down {
  color: #264b3b;
  background: #d9e6cf;
}
.raid-warehouse-item em {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 0;
  background: var(--paper-surface);
  border: 2px solid var(--paper-border);
  color: var(--paper-ink);
  text-align: center;
  font-style: normal;
  font-weight: 900;
}
.raid-warehouse-actions {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.raid-warehouse-actions button {
  height: 34px;
  padding: 0 8px;
  font-size: 12px;
}
.raid-warehouse-item.tone-clay { background: #f5e2c4; }
.raid-warehouse-item.tone-mint { background: #d7f4dd; }
.raid-warehouse-item.tone-sky { background: #d6eef7; }
.raid-warehouse-item.tone-gold { background: #f7e6a8; }
.raid-warehouse-item.tone-leaf { background: #d8efc4; }
.raid-warehouse-item.tone-coral { background: #f8d6c7; }
.raid-warehouse-item.tone-cream { background: #f7edc9; }
.raid-warehouse-item.tone-berry { background: #f4d2de; }
.raid-warehouse-item.tone-sand { background: #efe1bd; }
.raid-warehouse-item.tone-violet { background: #e0d7f8; }
.raid-warehouse-item.is-empty {
  opacity: .58;
  filter: saturate(.72);
}
.raid-warehouse-item.is-empty .raid-warehouse-icon svg {
  filter: grayscale(.45) drop-shadow(0 3px 0 rgba(36, 55, 48, .1));
}
.raid-warehouse-item.is-empty em {
  color: #8b9b90;
}
.raid-warehouse-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--paper-soft-ink);
  background: var(--paper-surface);
  border: 2px dashed var(--paper-border-subtle);
  border-radius: 0;
  text-align: center;
}
.raid-warehouse-runs { padding: 14px; }
.raid-warehouse-runs h3 { margin: 0 0 10px; color: var(--paper-red-dark); font-size: 13px; text-transform: uppercase; }
.raid-warehouse-runs ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.raid-warehouse-runs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.58);
}
.raid-warehouse-runs strong { color: var(--paper-ink); }
.raid-warehouse-runs span { color: #6d7e72; font-size: 12px; }

.raid-exchange-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 150px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px dashed var(--paper-border-subtle);
  background: var(--paper-hover);
}
.raid-exchange-panel {
  display: grid;
  border: 2px solid var(--paper-border);
  background: var(--paper-surface);
  box-shadow: var(--paper-shadow-sm);
}
.raid-exchange-box strong,
.raid-exchange-box span {
  display: block;
}
.raid-exchange-box span {
  margin-top: 3px;
  color: var(--paper-soft-ink);
  font-size: 12px;
  font-weight: 800;
}
.raid-exchange-box input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  color: var(--paper-ink);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  background: var(--paper-surface);
  font: inherit;
  font-weight: 900;
}
.raid-exchange-box .raid-primary {
  width: 100%;
  margin: 0;
}

@keyframes raid-treasure-toast-in {
  to { transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes raid-treasure-toast-pulse {
  50% { box-shadow: 0 16px 48px rgba(95, 78, 42, .24), 0 0 48px rgba(251, 191, 36, .48); }
}
@keyframes raid-treasure-toast-out {
  to { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(.96); }
}

.raid-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(32, 24, 19, .42);
  backdrop-filter: blur(2px);
  padding: 20px;
  z-index: 20;
}
.raid-modal[hidden] { display: none; }
.raid-modal-card {
  width: min(680px, 100%);
  padding: 20px;
  background: var(--paper-surface);
}
.raid-start-card {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  display: grid;
}
.raid-start-card .raid-primary {
  margin-top: 0;
}
.raid-tank-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-height: min(430px, calc(100vh - 260px));
  overflow-y: auto;
  padding-right: 4px;
}
.raid-tank-card {
  height: auto;
  min-height: 112px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: var(--paper-surface);
  border: 2px solid var(--paper-border);
  border-radius: 0;
  box-shadow: var(--paper-shadow-sm);
}
.raid-tank-card.is-selected {
  border-color: var(--paper-red);
  background: var(--paper-red-soft);
  box-shadow: var(--paper-shadow-sm);
}
.raid-tank-card-art {
  width: 72px;
  height: 72px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 0;
  background-color: var(--paper-muted);
  border: 2px solid var(--paper-border);
  box-shadow: none;
}
.raid-tank-card-art img {
  width: 82px;
  height: 82px;
  display: block;
  object-fit: contain;
}
.raid-tank-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.raid-tank-card-copy strong,
.raid-tank-card-copy em,
.raid-tank-card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.raid-tank-card-copy strong {
  color: var(--paper-ink);
  font-size: 16px;
}
.raid-tank-card-copy em {
  color: var(--paper-red-dark);
  font-size: 12px;
  font-style: normal;
}
.raid-tank-card-copy small {
  color: var(--paper-soft-ink);
  font-size: 12px;
  font-weight: 750;
}
.raid-start-cost {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  color: #5a4420;
  background: var(--paper-hover);
  border: 2px solid var(--paper-border);
  border-radius: 0;
}
.raid-start-cost span,
.raid-start-cost em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.raid-start-cost strong {
  color: #6a4707;
}
.raid-start-cost em {
  grid-column: 1 / -1;
}
.raid-modal-card p { margin: 0 0 6px; color: var(--muted); }
.raid-modal-card h2 { margin: 0 0 14px; }
.raid-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.raid-choice {
  height: auto;
  min-height: 118px;
  display: block;
  text-align: left;
  background: var(--paper-surface);
  color: var(--text);
  border: 2px solid var(--paper-border);
  box-shadow: var(--paper-shadow-sm);
}
.raid-choice strong { display: block; margin-bottom: 6px; font-size: 18px; }
.raid-choice span { color: var(--muted); font-weight: 500; }
.raid-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.raid-modal-actions[hidden] {
  display: none;
}
.raid-modal-actions .raid-primary {
  width: 100%;
}
.raid-decision-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 12px;
  margin: 16px 0 6px;
}
.raid-decision-actions[hidden] {
  display: none;
}
.raid-decision-actions button {
  min-width: min(420px, 100%);
  height: 58px;
  border-radius: 0;
  font-size: 18px;
  letter-spacing: 0;
}
.raid-decision-actions .raid-primary,
.raid-decision-actions .raid-secondary {
  width: min(420px, 100%);
  margin-top: 0;
  justify-self: center;
}
.raid-choice-separator {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 30px;
  color: var(--paper-soft-ink);
  font-size: 15px;
  font-weight: 900;
}
.raid-choice-separator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 3px dashed var(--paper-border-subtle);
}
.raid-choice-separator span {
  position: relative;
  z-index: 1;
  min-width: 42px;
  padding: 0 12px;
  background: var(--paper-surface);
  text-align: center;
}
.raid-escape-action {
  background: var(--paper-hover);
  color: var(--paper-ink);
  border: 2px solid var(--paper-border);
  box-shadow: var(--paper-shadow-sm);
}
.raid-continue-action {
  background: var(--paper-ink);
}
.raid-decision-loot {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  background: var(--paper-muted);
  border: 2px solid var(--paper-border);
  border-radius: 0;
}
.raid-decision-loot[hidden] {
  display: none;
}
.raid-decision-loot-head {
  display: grid;
  gap: 3px;
}
.raid-decision-loot-head strong {
  color: var(--text);
  font-size: 15px;
}
.raid-decision-loot-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.raid-decision-loot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.raid-loss-actions {
  grid-template-columns: 1fr;
}
.raid-loss-card,
.raid-error-state {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 2px solid var(--paper-border);
  border-radius: 0;
  background: var(--paper-red-soft);
  color: #614338;
}
.raid-loss-card strong,
.raid-error-state strong {
  color: #7c3f3f;
  font-size: 18px;
}
.raid-loss-loot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.raid-error-state {
  width: min(520px, 100%);
  align-self: center;
  justify-self: center;
  text-align: center;
}

@media (max-width: 980px) {
  .raid-shell.is-run .raid-layout,
  .raid-layout { grid-template-columns: 1fr; }
  .raid-battlefield { min-height: 420px; }
}

@media (max-width: 640px) {
  .raid-shell { padding: 10px; }
  .raid-topbar { align-items: flex-start; height: auto; gap: 8px; flex-direction: column; padding: 12px; }
  .raid-layout { padding: 10px; }
  .raid-stage-head { align-items: stretch; flex-direction: column; }
  .raid-wallet-summary { width: 100%; min-width: 0; }
  .raid-home-command { grid-template-columns: 1fr; }
  .raid-home-metrics,
  .raid-home-lower,
  .raid-exchange-box { grid-template-columns: 1fr; }
  .raid-warehouse-hero { align-items: flex-start; flex-direction: column; }
  .raid-warehouse-back { width: 100%; }
  .raid-home-command h2 { font-size: 34px; }
  .raid-home-start { justify-self: stretch; width: 100%; }
  .raid-choice-grid,
  .raid-modal-actions { grid-template-columns: 1fr; }
}
