:root {
  color-scheme: dark;
  --cursor-default: url("cursor-default-web.png") 2 2, auto;
  --cursor-pointer: var(--cursor-default);
  --cursor-press: url("cursor-pointer-web.png") 2 2, pointer;
  --cursor-move: url("cursor-drag-web.png") 32 27, move;
  --cursor-help: url("cursor-help-web.png") 2 2, help;
  --cursor-zoom: url("cursor-zoom-web.png") 32 27, zoom-in;
  font-family:
    "Segoe UI",
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
  background: #101113;
  color: #f6fbff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  cursor: var(--cursor-default);
}

button:active,
a:active,
[role="button"]:active,
.game-building-cheese-button:active,
.game-exit:active,
.game-control-toggle:active,
.start-run:active,
.team-run:active,
.stat-reset-button:active,
.weapon-option:active,
.equip-slot:active,
.card-item:active,
.synthesis-card:active {
  cursor: var(--cursor-press);
}

body.is-mouse-pressed,
body.is-mouse-pressed * {
  cursor: var(--cursor-press) !important;
}

body.is-card-drop-zoom,
body.is-card-drop-zoom * {
  cursor: var(--cursor-zoom) !important;
}

body.is-card-dragging,
body.is-card-dragging * {
  cursor: none !important;
}

body.is-card-previewing,
body.is-card-previewing * {
  cursor: none !important;
}

.card-drag-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 64px;
  height: 54px;
  pointer-events: none;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 0.04s linear;
  z-index: 2147483647;
}

.card-drag-cursor.is-visible {
  opacity: 1;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(120, 120, 164, 0.24), transparent 28%),
    linear-gradient(145deg, #121416 0%, #202322 46%, #08090c 100%);
}

button,
input {
  font: inherit;
}

.game-shell {
  position: relative;
  width: min(100vw, calc(100vh * 0.869565));
  aspect-ratio: 20 / 23;
  max-width: 1180px;
  max-height: 100vh;
  overflow: visible;
  border: 2px solid rgba(244, 250, 255, 0.16);
  background: #101010;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  user-select: none;
  -webkit-user-select: none;
}

.game-shell * {
  user-select: none;
  -webkit-user-select: none;
}

.game-shell input {
  user-select: text;
  -webkit-user-select: text;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #1d2b31;
}

.game-controls {
  position: absolute;
  z-index: 4;
  top: calc(100% * 6 / 920);
  right: calc(100% * 12 / 800);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 5px;
  max-width: calc(100% - 24px);
}

.game-controls.is-hidden {
  display: none;
}

.game-exit,
.game-control-toggle,
.game-room-label {
  min-width: 72px;
  min-height: 36px;
  padding: 0 9px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #f4f4ef;
  box-shadow:
    inset 0 0 0 1px #fff,
    4px 4px 0 rgba(0, 0, 0, 0.55);
  cursor: var(--cursor-pointer);
  font: 900 clamp(11px, 1.45vw, 14px) Consolas, "Noto Sans TC", monospace;
  white-space: nowrap;
}

.volume-control {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr) 42px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 9px;
  color: #f8f8ff;
  background: rgba(5, 5, 5, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font: 900 15px Consolas, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  text-shadow: 0 2px 0 #000;
}

.volume-control-compact {
  grid-template-columns: auto 72px 38px;
  min-height: 36px;
  padding: 4px 7px;
  font-size: clamp(11px, 1.35vw, 13px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

.volume-control input {
  width: 100%;
  min-width: 0;
  accent-color: #ffe16b;
  cursor: var(--cursor-pointer);
}

.volume-control strong {
  color: #ffe16b;
  text-align: right;
}

.game-room-label {
  display: inline-grid;
  place-items: center;
  color: #071116;
  background: #7cfbff;
  cursor: var(--cursor-default);
}

.game-room-label.is-offline {
  color: #111;
  background: #ffdd6a;
}

.game-exit:hover,
.game-exit:focus-visible,
.game-control-toggle:hover,
.game-control-toggle:focus-visible {
  background: #ffe16b;
  outline: none;
}

.game-control-toggle.is-active {
  color: #fff;
  background: #3a405e;
  border-color: #ffe16b;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    4px 4px 0 rgba(0, 0, 0, 0.55);
}

.game-building {
  position: absolute;
  z-index: 1;
  top: calc(100% * 6 / 920);
  left: 50%;
  height: calc(100% * 124 / 920);
  aspect-ratio: 577 / 433;
  pointer-events: none;
  transform: translate(calc(-50% + var(--shake-x, 0px)), var(--shake-y, 0px));
}

.game-building.is-hidden {
  display: none;
}

.game-building-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  opacity: 0;
}

.game-building-cheese-button {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 50%;
  aspect-ratio: 1024 / 811;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: var(--cursor-pointer);
  pointer-events: auto;
}

.game-building-cheese-button:hover,
.game-building-cheese-button:focus-visible {
  outline: none;
  filter: brightness(1.08);
}

.game-building-cheese {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
  opacity: 0;
}

.cheese-speech-bubble {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(100% + 5px);
  padding: 4px 7px 5px;
  color: #111;
  background: #fff7d6;
  border: 2px solid #111;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.52);
  font: 900 clamp(9px, 1.35vw, 12px) "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.05;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.96);
  transition:
    opacity 120ms ease,
    visibility 120ms ease,
    transform 120ms ease;
}

.cheese-speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 10px;
  height: 10px;
  background: #fff7d6;
  border-right: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: translateX(-50%) rotate(45deg);
}

.cheese-speech-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.vtuber-life-icons {
  position: absolute;
  z-index: 2;
  top: calc(100% * 130 / 920);
  left: 50%;
  width: calc(100% * 170 / 800);
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 2px;
  pointer-events: none;
  transform: translate(calc(-50% + var(--shake-x, 0px)), var(--shake-y, 0px));
}

.vtuber-life-icons.is-hidden {
  display: none;
}

.vtuber-life-icons img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: auto;
  mix-blend-mode: screen;
  filter: drop-shadow(0 1px 0 #000);
  opacity: 0;
}

.vtuber-life-icons.is-warning img {
  animation: vtuberWarningPulse 320ms steps(2, end) infinite;
  filter:
    drop-shadow(0 1px 0 #000)
    drop-shadow(0 0 5px #ff4e7a)
    brightness(1.3);
}

.remote-name-overlays {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.remote-name-overlays.is-hidden {
  display: none;
}

.touch-joystick {
  position: absolute;
  z-index: 5;
  left: calc(100% * 28 / 800);
  bottom: calc(100% * 42 / 920);
  width: clamp(96px, 19vw, 138px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  background: rgba(12, 14, 18, 0.42);
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.34),
    0 8px 24px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  touch-action: none;
  opacity: 0.88;
}

.touch-joystick.is-hidden {
  display: none;
}

.touch-joystick-ring {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 225, 107, 0.72);
  pointer-events: none;
}

.touch-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #111;
  background: #ffe16b;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.55),
    3px 3px 0 rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@media (hover: hover) and (pointer: fine) {
  .touch-joystick {
    display: none;
  }
}

.player-name-overlay,
.remote-name-overlay {
  position: absolute;
  z-index: 2;
  left: var(--player-name-x, 50%);
  top: var(--player-name-y, 20%);
  max-width: calc(100% * 190 / 800);
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 1px 5px 2px;
  color: #fff;
  font: 900 clamp(14px, 2vw, 19px) "Noto Sans TC", "Microsoft JhengHei", Consolas, sans-serif;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 2px 0 #000,
    2px 0 0 #000,
    -2px 0 0 #000,
    0 -2px 0 #000;
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.player-level-label {
  color: #ffe16b;
  font-size: 0.78em;
  line-height: 0.95;
}

.player-id-label {
  max-width: 100%;
  overflow: hidden;
  line-height: 1;
  text-overflow: ellipsis;
}

.player-name-overlay.is-gm .player-id-label,
.remote-name-overlay.is-gm .player-id-label {
  color: #ff4c4c;
}

.player-name-overlay.is-hidden {
  display: none;
}

.remote-name-overlay.is-dimmed {
  opacity: 0.55;
}

.hud {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.chat-window {
  position: absolute;
  z-index: 3;
  top: calc(100% * 48 / 920);
  right: calc(100% * 12 / 800);
  width: var(--chat-width, calc(100% * 260 / 800));
  height: var(--chat-height, calc(100% * 144 / 920));
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  gap: 4px;
  padding: 0 8px 17px;
  color: #f5f5ee;
  background: rgba(2, 2, 2, 0.9);
  border-right: 5px solid #151515;
  border-bottom: 5px solid #151515;
  pointer-events: auto;
}

.chat-window.is-hidden {
  display: none;
}

.chat-window.is-dragged {
  right: auto;
}

.chat-window.is-dragging {
  opacity: 0.88;
}

.chat-window.is-resizing {
  opacity: 0.9;
}

.chat-title {
  margin: 0 -8px;
  padding: 3px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #111;
  background: #e7e7df;
  font: 900 clamp(11px, 1.7vw, 14px) Consolas, "Noto Sans TC", monospace;
  line-height: 1;
  cursor: var(--cursor-move);
  user-select: none;
  touch-action: none;
}

.chat-font-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.chat-font-controls button {
  min-width: 28px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid #111;
  border-radius: 0;
  color: #111;
  background: #f4f4ef;
  box-shadow: inset 0 0 0 1px #fff;
  font: 900 11px Consolas, "Noto Sans TC", monospace;
  line-height: 1;
  cursor: var(--cursor-pointer);
}

.chat-font-controls button:hover,
.chat-font-controls button:focus-visible {
  background: #ffe16b;
  outline: none;
}

.chat-messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 3px 3px 2px 0;
  scrollbar-color: #e7e7df #151515;
  scrollbar-width: thin;
  font: 800 var(--chat-font-size, clamp(10px, 1.45vw, 13px)) Consolas, "Noto Sans TC", monospace;
  line-height: 1.24;
  text-shadow:
    1px 0 #000,
    -1px 0 #000,
    0 1px #000,
    0 -1px #000;
}

.chat-messages::-webkit-scrollbar {
  width: 7px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #151515;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #e7e7df;
  border: 1px solid #050505;
}

.chat-message {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-form {
  display: block;
  padding-right: 20px;
}

.chat-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.chat-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0 6px;
  color: #111;
  background: #f0f0e8;
  font: 800 var(--chat-font-size, clamp(10px, 1.45vw, 13px)) Consolas, "Noto Sans TC", monospace;
}

.chat-form input:focus {
  outline: 2px solid #ffd34d;
  outline-offset: 1px;
}

.chat-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background:
    linear-gradient(135deg, transparent 0 38%, #050505 39% 45%, #ffe16b 46% 57%, #050505 58% 64%, transparent 65%),
    linear-gradient(135deg, transparent 0 60%, #050505 61% 66%, #ffe16b 67% 78%, #050505 79% 84%, transparent 85%);
  cursor: var(--cursor-zoom);
  touch-action: none;
}

.chat-resize-handle:focus-visible {
  outline: 2px solid #ffe16b;
  outline-offset: 2px;
}

.main-screen {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-areas:
    "title title"
    "status loadout";
  gap: 10px;
  padding: 10px;
  color: #fff;
  background: #323247;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #ffe16b rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
}

.main-screen::-webkit-scrollbar {
  width: 12px;
}

.main-screen::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.45);
}

.main-screen::-webkit-scrollbar-thumb {
  background: #ffe16b;
  border: 2px solid #171821;
}

.main-screen.is-hidden {
  display: none;
}

.game-title-bar {
  grid-area: title;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 6px 14px;
  background: #050505;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.online-status {
  position: absolute;
  right: 12px;
  bottom: 6px;
  color: #77ff9a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 #000;
}

.online-status.is-offline {
  color: #ffdd6a;
}

.online-player-count {
  position: absolute;
  top: 7px;
  right: 12px;
  padding: 2px 7px 3px;
  color: #77ff9a;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 #000;
}

.online-player-count.is-offline {
  color: #ffdd6a;
}

.online-room-label {
  position: absolute;
  top: 7px;
  left: 12px;
  padding: 2px 7px 3px;
  color: #7cfbff;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 #000;
}

.online-room-label.is-offline {
  color: #ffdd6a;
}

.game-title-bar h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 4.35vw, 44px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    0 3px 0 #000,
    3px 0 0 #000,
    -3px 0 0 #000,
    0 -3px 0 #000;
}

.panel-title-bar h1,
.status-panel h2,
.loadout-panel h2,
.weapon-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.panel-title-bar h1 {
  font-size: 32px;
  font-weight: 900;
  text-shadow: 0 2px 0 #000;
}

.start-run,
.team-run,
.weapon-option,
.equip-slot,
.card-item {
  border: 2px solid #a9a9aa;
  border-radius: 0;
  color: #4c4c4c;
  background: #f4f4f1;
  box-shadow: inset 0 0 0 1px #fff;
  cursor: var(--cursor-pointer);
}

.status-panel,
.loadout-panel {
  --panel-pad: 12px;
  min-width: 0;
  min-height: 0;
  background: #454761;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.status-panel {
  grid-area: status;
  position: relative;
  display: grid;
  grid-auto-rows: max-content;
  gap: 8px;
  padding: 12px;
}

.loadout-panel {
  grid-area: loadout;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.panel-title-bar,
.equip-header,
.inventory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 6px 12px;
  background: #050505;
}

.panel-title-bar,
.equip-header {
  margin: calc(var(--panel-pad) * -1) calc(var(--panel-pad) * -1) 0;
}

.inventory-header {
  margin: 0 calc(var(--panel-pad) * -1);
}

.inventory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.inventory-actions span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.inventory-actions button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 3px 12px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #f4f4ef;
  box-shadow: inset 0 0 0 1px #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
}

.level-row,
.equip-header,
.inventory-header {
  font-size: 21px;
  font-weight: 900;
  text-shadow: 0 2px 0 #000;
}

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.exp-bar {
  height: 16px;
  border: 2px solid #dedee9;
  background: #24263a;
  box-shadow: inset 0 0 0 1px #111;
}

#exp-fill {
  width: 59.4%;
  height: 100%;
  background: linear-gradient(90deg, #ffda56, #7cff7c);
}

.profile-name {
  display: grid;
  gap: 4px;
}

.profile-name span {
  font-size: 14px;
  color: #e6e6ff;
}

.profile-name input {
  width: 100%;
  height: 38px;
  border: 2px solid #d8d8d8;
  border-radius: 0;
  color: #050505;
  background: #fff;
  font-size: 27px;
  text-align: center;
}

.stats-panel {
  display: grid;
  gap: 7px;
}

.points-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #f8f8ff;
  font-size: 19px;
  font-weight: 900;
  text-shadow: 0 2px 0 #000;
}

.stat-reset-button {
  flex: 0 0 auto;
  min-width: 90px;
  min-height: 30px;
  padding: 2px 10px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #ffe16b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 3px 3px 0 rgba(0, 0, 0, 0.45);
  font: 900 15px Consolas, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.1;
  text-shadow: none;
}

.stat-reset-button:disabled {
  color: #777;
  background: #d8d8d8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  opacity: 0.6;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.stat-control {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 38px 26px;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px;
  background: #393b55;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 0 #000;
}

.stat-name {
  min-width: 0;
  cursor: var(--cursor-help);
}

.stat-name:hover::after,
.stat-name:focus-visible::after {
  position: absolute;
  z-index: 6;
  left: 0;
  top: calc(100% + 6px);
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  color: #111;
  background: #fff7c4;
  border: 2px solid #1a1a1a;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  text-shadow: none;
  font-size: 13px;
  line-height: 1.35;
  content: attr(data-tooltip);
}

.stat-value {
  color: #fff;
  text-align: center;
}

.stat-step {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 2px solid #bfc0cc;
  border-radius: 0;
  color: #222;
  background: #f3f3ef;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.stat-step:disabled {
  color: #9c9ca6;
  background: #c9c9d0;
  cursor: var(--cursor-default);
}

.weapon-panel {
  display: grid;
  align-content: start;
  gap: 6px;
}

.weapon-panel h2,
.equip-header h2,
.inventory-header h2 {
  font-size: 25px;
  text-shadow: 0 2px 0 #000;
}

.weapon-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.weapon-option {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 5px;
  min-height: 90px;
  overflow: hidden;
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 900;
  color: #f5f5f5;
  background: #2e3147;
  border-color: #c9c9d4;
  text-align: center;
}

.weapon-option.is-active {
  color: #111;
  background: #ffd966;
}

.weapon-icon {
  width: min(58px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.weapon-label {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 17px;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 #000;
  white-space: nowrap;
}

.weapon-option.is-active .weapon-label {
  text-shadow: none;
}

#weapon-description {
  min-height: 36px;
  margin: 0;
  color: #f3f3ff;
  font-size: 17px;
  line-height: 1.35;
  text-shadow: 0 2px 0 #000;
}

.play-guide {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  color: #f7f7ff;
  background: rgba(5, 5, 5, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.16);
  text-shadow: 0 2px 0 #000;
}

.play-guide h2,
.play-guide p {
  margin: 0;
}

.play-guide h2 {
  color: #ffe889;
  font-size: 21px;
  line-height: 1;
}

.play-guide p {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.12;
}

.play-guide strong {
  font-weight: 900;
}

.join-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
}

.start-run,
.team-run {
  width: 100%;
  min-height: 48px;
  align-self: stretch;
  color: #111;
  background: #fff;
  font-size: 26px;
  font-weight: 900;
}

.team-run {
  background: #ffe16b;
  font-size: 24px;
}

.status-panel > .volume-control {
  margin-bottom: 2px;
}

.don-gif {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: auto;
  pointer-events: none;
}

.equipment-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 7px;
}

.equip-slot {
  position: relative;
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  color: #eee;
  background: #2d2f47;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  touch-action: none;
  -webkit-user-drag: none;
}

.equip-slot:not(.is-empty) {
  display: block;
  min-height: 0;
  overflow: visible;
  color: #f5f5f5;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.equip-slot:not(.is-empty):hover,
.equip-slot:not(.is-empty):focus-visible {
  z-index: 20;
  outline: none;
}

.equip-slot:not(.is-empty):hover > .card-art,
.equip-slot:not(.is-empty):focus-visible > .card-art {
  filter: brightness(1.08);
}

.equip-slot.is-empty {
  color: #9c9cad;
  background: #393a52;
}

.card-grid {
  --inventory-gap: 10px;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  align-items: start;
  gap: var(--inventory-gap);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 4px 12px 10px;
  scrollbar-color: #c9c9d4 #2b2c41;
}

.card-item {
  position: relative;
  flex: 0 0 calc((100% - var(--inventory-gap) * 2) / 3);
  display: block;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  padding: 0;
  color: #f5f5f5;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
  touch-action: none;
  -webkit-user-drag: none;
}

.collection-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  color: #f5f5f5;
  background: transparent;
  filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.38));
}

.collection-card.is-undiscovered {
  filter: saturate(0.72) brightness(0.9) drop-shadow(0 9px 10px rgba(0, 0, 0, 0.38));
}

.card-item.is-equipped {
  color: #bcbcc9;
  background: #323348;
  filter: saturate(0.45);
  opacity: 0.72;
}

.card-item:not(.is-equipped):hover,
.card-item:not(.is-equipped):focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.card-item.is-dragging,
.equip-slot.is-dragging {
  opacity: 0.45;
}

.card-item.is-drag-target,
.equip-slot.is-drag-target {
  outline: 2px solid #ffe26b;
  outline-offset: -3px;
}

.card-art {
  --card-image-left: 9.6%;
  --card-image-top: 10.6%;
  --card-image-width: 80.9%;
  --card-image-height: 73.5%;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  height: 178px;
  min-height: 178px;
  overflow: hidden;
  background: transparent;
}

.card-art[data-rarity="SR"] {
  --card-image-left: 9.3%;
  --card-image-top: 10.1%;
  --card-image-width: 81.1%;
  --card-image-height: 79.7%;
}

.card-art[data-rarity="SSR"] {
  --card-image-left: 11.3%;
  --card-image-top: 12.1%;
  --card-image-width: 77.7%;
  --card-image-height: 75.2%;
}

.card-item > .card-art {
  height: 100%;
  min-height: 0;
}

.collection-card > .card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.card-art.is-compact {
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  min-height: 0;
}

.card-art-image,
.card-rarity-frame {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.card-art-image {
  top: var(--card-image-top);
  right: auto;
  bottom: auto;
  left: var(--card-image-left);
  width: var(--card-image-width);
  height: var(--card-image-height);
  object-fit: cover;
  background: #050508;
  border-radius: 4px;
  z-index: 1;
}

.card-art-mystery {
  display: grid;
  place-items: center;
  color: #fff;
  background: #020204;
  font-size: clamp(42px, 16vw, 92px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 3px 0 #000;
}

.card-rarity-frame {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 2;
}

.card-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.card-item > .card-info,
.collection-card > .card-info,
.card-hover-preview > .card-info,
.inventory-card-preview-layer > .card-info,
.synthesis-card > .card-info,
.synthesis-card-preview-layer > .card-info,
.result-card-preview-layer > .card-info {
  position: absolute;
  z-index: 3;
  left: 16px;
  right: 16px;
  bottom: 20px;
  padding: 6px 5px;
  color: #fff;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.42), rgba(6, 10, 18, 0.78));
  border: 0;
  border-radius: 4px;
  text-align: center;
  text-shadow:
    0 2px 0 #000,
    1px 0 0 #000,
    -1px 0 0 #000;
}

.equip-slot > .card-info {
  position: absolute;
  z-index: 3;
  right: 6%;
  bottom: 8%;
  left: 6%;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 3px 4px;
  color: #fff;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.42), rgba(6, 10, 18, 0.78));
  border: 0;
  border-radius: 3px;
  text-align: center;
  text-shadow:
    0 2px 0 #000,
    1px 0 0 #000,
    -1px 0 0 #000;
}

.card-info.is-compact .card-effect,
.card-info.is-compact .card-extra-effect,
.equip-slot > .card-info .card-effect,
.equip-slot > .card-info .card-extra-effect {
  display: none;
}

.equip-slot > .card-info .card-name {
  font-size: 12.5px;
  line-height: 1.06;
}

.equip-slot > .card-info .card-stars,
.card-info.is-compact .card-stars {
  font-size: 10px;
  line-height: 0.9;
}

.card-hover-preview {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 50%;
  width: 236px;
  aspect-ratio: 2 / 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(0.96);
  transform-origin: top center;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55));
  transition:
    opacity 120ms ease,
    visibility 120ms ease,
    transform 120ms ease;
}

.equip-slot:first-child .card-hover-preview {
  left: 0;
  transform: translate(0, -8px) scale(0.96);
  transform-origin: top left;
}

.equip-slot:last-child .card-hover-preview {
  right: 0;
  left: auto;
  transform: translate(0, -8px) scale(0.96);
  transform-origin: top right;
}

.equip-slot:hover .card-hover-preview,
.equip-slot:focus-visible .card-hover-preview {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.equip-slot:first-child:hover .card-hover-preview,
.equip-slot:first-child:focus-visible .card-hover-preview,
.equip-slot:last-child:hover .card-hover-preview,
.equip-slot:last-child:focus-visible .card-hover-preview {
  transform: translate(0, 0) scale(1);
}

.card-hover-preview > .card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.inventory-card-preview-layer {
  position: fixed;
  z-index: 240;
  top: 0;
  left: 0;
  width: min(320px, calc(100vw - 24px), calc((100vh - 24px) * 2 / 3));
  aspect-ratio: 2 / 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top left;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.72));
  transition:
    opacity 120ms ease,
    visibility 120ms ease,
    transform 120ms ease;
}

.inventory-card-preview-layer.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.inventory-card-preview-layer > .card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.inventory-card-preview-layer > .card-info {
  right: 26px;
  bottom: 38px;
  left: 26px;
  gap: 4px;
  padding: 7px 7px;
}

.inventory-card-preview-layer .card-name {
  font-size: 17px;
}

.inventory-card-preview-layer .card-stars {
  font-size: 14px;
}

.inventory-card-preview-layer .card-effect {
  font-size: 13.5px;
}

.inventory-card-preview-layer .card-extra-effect {
  font-size: 13px;
}

.run-result-card .synthesis-card {
  cursor: var(--cursor-zoom);
}

.result-card-preview-layer,
.synthesis-card-preview-layer {
  position: absolute;
  z-index: 90;
  top: 50%;
  left: 50%;
  width: min(460px, calc(100% - 32px), calc((100vh - 32px) * 2 / 3));
  aspect-ratio: 2 / 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.94);
  transform-origin: center;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.72));
  transition:
    opacity 120ms ease,
    visibility 120ms ease,
    transform 120ms ease;
}

.result-card-preview-layer.is-visible,
.synthesis-card-preview-layer.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.result-card-preview-layer > .card-art,
.synthesis-card-preview-layer > .card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.result-card-preview-layer > .card-info,
.synthesis-card-preview-layer > .card-info {
  right: 34px;
  bottom: 52px;
  left: 34px;
  gap: 4px;
  padding: 7px 7px;
}

.result-card-preview-layer .card-name,
.synthesis-card-preview-layer .card-name {
  font-size: 19px;
}

.result-card-preview-layer .card-stars,
.synthesis-card-preview-layer .card-stars {
  font-size: 16px;
}

.result-card-preview-layer .card-effect,
.synthesis-card-preview-layer .card-effect {
  font-size: 14.5px;
}

.result-card-preview-layer .card-extra-effect,
.synthesis-card-preview-layer .card-extra-effect {
  font-size: 14px;
}

.run-result-modal {
  position: absolute;
  z-index: 55;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
}

.run-result-modal.is-hidden {
  display: none;
}

.team-join-modal {
  position: absolute;
  z-index: 62;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.team-join-modal.is-hidden {
  display: none;
}

.team-join-dialog {
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  color: #fff;
  background: #34364f;
  border: 3px solid #f0f0e8;
  box-shadow:
    inset 0 0 0 2px #111,
    10px 10px 0 rgba(0, 0, 0, 0.52);
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.team-join-dialog h2 {
  margin: 0 0 8px;
  padding: 8px 10px;
  color: #ffe16b;
  background: #050505;
  font-size: 30px;
  line-height: 1;
}

.team-join-dialog p {
  margin: 10px 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.team-join-dialog input {
  width: min(210px, 100%);
  height: 48px;
  border: 3px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #fff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
}

.team-join-message {
  min-height: 24px;
  color: #ff8792;
}

.team-join-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.team-join-actions button {
  min-width: 112px;
  min-height: 42px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #f4f4ef;
  box-shadow: inset 0 0 0 1px #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
}

.team-join-confirm {
  background: #ffd966;
}

.team-join-confirm:disabled {
  color: #777;
  background: #c9c9d0;
  cursor: var(--cursor-default);
}

.run-result-dialog {
  width: min(520px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  color: #fff;
  background: #34364f;
  border: 3px solid #f0f0e8;
  box-shadow:
    inset 0 0 0 2px #111,
    10px 10px 0 rgba(0, 0, 0, 0.52);
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.duplicate-tab-notice {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.76);
}

.duplicate-tab-notice.is-hidden {
  display: none;
}

.duplicate-tab-card {
  width: min(520px, 92%);
  padding: 22px;
  color: #fff;
  background: #2f3149;
  border: 3px solid #f0f0e8;
  box-shadow:
    inset 0 0 0 2px #111,
    10px 10px 0 rgba(0, 0, 0, 0.55);
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.duplicate-tab-card h2 {
  margin: 0 0 14px;
  padding: 8px;
  color: #ffe16b;
  background: #050506;
  font-size: clamp(24px, 4vw, 34px);
}

.duplicate-tab-card p {
  margin: 0 0 18px;
  font-weight: 900;
  font-size: clamp(15px, 2.5vw, 19px);
  line-height: 1.55;
}

.duplicate-tab-card button {
  min-width: 150px;
  min-height: 44px;
  border: 2px solid #fff;
  color: #111;
  background: #ffda63;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  cursor: var(--cursor-pointer);
  font-weight: 1000;
}

.duplicate-tab-card button:hover,
.duplicate-tab-card button:focus-visible {
  background: #fff2a6;
  outline: none;
}

.run-result-dialog h2 {
  margin: 0 0 8px;
  padding: 8px 10px;
  color: #ffe889;
  background: #050505;
  font-size: 32px;
  line-height: 1;
}

.run-result-dialog p {
  margin: 8px 0 12px;
  font-size: 17px;
  font-weight: 900;
}

.run-result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.run-result-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  background: rgba(5, 5, 5, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.run-result-stats span {
  color: #e7e7f7;
  font-size: 15px;
}

.run-result-stats strong {
  color: #7cff7c;
  font-size: 22px;
}

.run-result-stats .result-grade.is-grade-c {
  color: #9ee7ff;
}

.run-result-stats .result-grade.is-grade-b {
  color: #7cff7c;
}

.run-result-stats .result-grade.is-grade-a {
  color: #ffe45c;
}

.run-result-stats .result-grade.is-grade-s {
  color: #ff74d4;
}

.run-result-stats .result-grade.is-grade-pop {
  animation: resultGradePop 420ms ease-out both;
}

.run-result-stats .result-exp {
  color: #ffe45c;
  font-size: 20px;
}

.run-result-reward {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.run-result-reward h3 {
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  background: #050505;
  font-size: 24px;
  line-height: 1;
}

.run-result-card {
  min-height: 258px;
  display: grid;
  place-items: center;
}

.run-result-card .synthesis-card {
  width: 172px;
  will-change: transform, opacity, filter;
}

.run-result-card.has-multiple {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  padding: 0 4px 8px;
  scroll-snap-type: x mandatory;
}

.run-result-card.has-multiple .synthesis-card {
  flex: 0 0 132px;
  width: 132px;
  scroll-snap-align: start;
}

.run-result-card .synthesis-card.is-reward-pending {
  opacity: 0;
  pointer-events: none;
  transform: perspective(500px) rotateY(82deg) translateY(14px) scale(0.86);
  filter: brightness(0.42) saturate(0.55);
}

.run-result-card .synthesis-card.is-revealed {
  animation: rewardCardReveal 420ms ease-out both;
}

.run-result-card .synthesis-card.is-rare-reward.is-revealed::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, 0.72) 44%, transparent 68%),
    radial-gradient(circle at 50% 8%, rgba(255, 232, 137, 0.62), transparent 28%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: rareRewardShine 780ms ease-out 120ms both;
}

.run-result-empty {
  width: min(320px, 100%);
  padding: 18px 16px;
  color: #ffe889;
  background: rgba(5, 5, 5, 0.68);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.run-result-confirm {
  min-width: 126px;
  min-height: 44px;
  margin-top: 12px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #ffd966;
  box-shadow: inset 0 0 0 1px #fff;
  font-size: 24px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
}

.card-collection-modal {
  position: absolute;
  z-index: 63;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
}

.card-collection-modal.is-hidden {
  display: none;
}

.card-collection-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(940px, 100%);
  max-height: 100%;
  padding: 14px;
  color: #fff;
  background: #34364f;
  border: 3px solid #f0f0e8;
  box-shadow:
    inset 0 0 0 2px #111,
    10px 10px 0 rgba(0, 0, 0, 0.52);
  text-shadow: 0 2px 0 #000;
}

.card-collection-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #050505;
}

.card-collection-header h2 {
  margin: 0;
  color: #ffe16b;
  font-size: 30px;
  line-height: 1;
}

.card-collection-header span {
  color: #78ff83;
  font-size: 22px;
  font-weight: 900;
}

.card-collection-header button {
  min-height: 36px;
  padding: 3px 14px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #f4f4ef;
  box-shadow: inset 0 0 0 1px #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
}

.card-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px 8px 4px;
  scrollbar-color: #c9c9d4 #2b2c41;
}

.collection-card > .card-info {
  left: 13px;
  right: 13px;
  bottom: 17px;
  padding: 5px 4px;
}

.collection-card .card-name {
  font-size: 13.5px;
}

.collection-card .card-effect {
  font-size: 11px;
}

.synthesis-modal {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.64);
}

.synthesis-modal.is-hidden,
.synthesis-actions .is-hidden {
  display: none;
}

.synthesis-dialog {
  width: min(470px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  color: #fff;
  background: #34364f;
  border: 3px solid #f0f0e8;
  box-shadow:
    inset 0 0 0 2px #111,
    10px 10px 0 rgba(0, 0, 0, 0.52);
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.synthesis-dialog h2 {
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #050505;
  font-size: 30px;
  line-height: 1;
}

.synthesis-dialog p {
  margin: 8px 0;
  font-size: 17px;
  font-weight: 800;
}

.synthesis-cards {
  display: flex;
  justify-content: center;
  align-items: start;
  gap: 18px;
  margin: 12px 0;
}

.synthesis-card {
  position: relative;
  display: block;
  width: 156px;
  aspect-ratio: 2 / 3;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.42));
  cursor: var(--cursor-zoom);
}

.synthesis-card:focus-visible {
  outline: 2px solid #ffe889;
  outline-offset: 3px;
}

.synthesis-card > .card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.synthesis-card > .card-info {
  left: 14px;
  right: 14px;
  bottom: 18px;
  padding: 5px 4px;
}

.synthesis-card .card-name {
  font-size: 14px;
}

.synthesis-card .card-stars {
  font-size: 11px;
}

.synthesis-card .card-effect {
  font-size: 11.5px;
}

.synthesis-card .card-extra-effect {
  font-size: 11px;
}

.synthesis-odds {
  color: #ffe889;
}

.synthesis-odds.is-hidden {
  display: none;
}

.synthesis-result {
  min-height: 22px;
  color: #7cff7c;
}

.synthesis-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.synthesis-actions button {
  min-width: 112px;
  min-height: 42px;
  border: 2px solid #deded5;
  border-radius: 0;
  color: #111;
  background: #f4f4ef;
  box-shadow: inset 0 0 0 1px #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
}

.synthesis-confirm {
  background: #ffd966;
}

.synthesis-random {
  color: #101010;
  background: #d7f0ff;
}

.card-name {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-stars {
  display: block;
  min-height: 0.9em;
  color: #ffe36e;
  font-size: 12px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.card-stars.is-empty {
  display: none;
}

.card-effect {
  display: block;
  overflow: visible;
  font-size: 12.4px;
  font-weight: 800;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.card-extra-effect {
  display: block;
  overflow: visible;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.card-extra-effect.is-positive {
  color: #78ff83;
}

.card-extra-effect.is-negative {
  color: #ff6464;
}

@keyframes vtuberWarningPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-1px) scale(1.12);
  }
}

@keyframes resultGradePop {
  0% {
    transform: scale(0.72);
    filter: brightness(1.8);
  }

  62% {
    transform: scale(1.16);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes rewardCardReveal {
  0% {
    opacity: 0;
    transform: perspective(500px) rotateY(82deg) translateY(14px) scale(0.86);
    filter: brightness(0.45) saturate(0.55);
  }

  68% {
    opacity: 1;
    transform: perspective(500px) rotateY(-6deg) translateY(-4px) scale(1.05);
    filter: brightness(1.25) saturate(1.1);
  }

  100% {
    opacity: 1;
    transform: perspective(500px) rotateY(0deg) translateY(0) scale(1);
    filter: brightness(1) saturate(1);
  }
}

@keyframes rareRewardShine {
  0% {
    opacity: 0;
    transform: translateX(-48%);
  }

  30% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    transform: translateX(48%);
  }
}

@media (max-width: 640px) {
  .game-shell {
    width: 100vw;
    max-height: calc(100vw / 0.869565);
    align-self: center;
  }

  .main-screen {
    gap: 7px;
    padding: 7px;
  }

  .panel-title-bar h1 {
    font-size: 26px;
  }

  .status-panel,
  .loadout-panel {
    --panel-pad: 9px;
    padding: 9px;
  }

  .stat-list div,
  .level-row {
    font-size: 17px;
  }

  .weapon-option {
    font-size: 12px;
  }

  .card-name {
    font-size: 15px;
  }

  .card-effect {
    font-size: 11.4px;
  }
}

@media (max-width: 720px), (max-height: 760px) {
  .main-screen {
    grid-template-rows: auto auto auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "status"
      "loadout";
    align-content: start;
    gap: 8px;
    padding: 8px;
  }

  .game-title-bar {
    position: sticky;
    z-index: 12;
    top: 0;
    grid-template-rows: auto auto auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "room count"
      "title title"
      "status status";
    gap: 3px 8px;
    min-height: 0;
    padding: 5px 8px;
  }

  .game-title-bar h1 {
    grid-area: title;
    font-size: clamp(25px, 7.2vw, 36px);
    line-height: 1;
  }

  .online-room-label,
  .online-player-count,
  .online-status {
    position: static;
    max-width: 100%;
    font-size: 12px;
    line-height: 1;
  }

  .online-room-label {
    grid-area: room;
    justify-self: start;
  }

  .online-player-count {
    grid-area: count;
    justify-self: end;
  }

  .online-status {
    grid-area: status;
    justify-self: end;
  }

  .status-panel {
    grid-template-rows: auto;
    gap: 7px;
    padding: 9px;
    overflow: visible;
  }

  .loadout-panel {
    min-height: 560px;
  }

  .join-actions {
    order: -10;
  }

  .start-run,
  .team-run {
    min-height: 54px;
    color: #111;
    border-color: #fff4bd;
    box-shadow:
      inset 0 0 0 1px #fff,
      4px 4px 0 rgba(0, 0, 0, 0.55);
  }

  .don-gif {
    max-height: min(42vh, 270px);
  }

  .equipment-slots {
    gap: 5px;
  }

  .equip-slot {
    min-height: 122px;
  }
}

@media (max-height: 620px) {
  .main-screen {
    gap: 6px;
    padding: 6px;
  }

  .status-panel,
  .loadout-panel {
    --panel-pad: 8px;
    padding: 8px;
  }

  .panel-title-bar,
  .equip-header,
  .inventory-header {
    min-height: 34px;
    padding: 4px 9px;
  }

  .panel-title-bar h1 {
    font-size: 25px;
  }

  .profile-name input {
    height: 34px;
    font-size: 23px;
  }

  .play-guide {
    max-height: 108px;
    overflow: auto;
  }

  .don-gif {
    display: none;
  }
}
