:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #030712;
  color: #f6efd9;
  font-synthesis: none;
  --cyan: #62e8ee;
  --gold: #f8c75f;
  --ink: #07101f;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 22% 18%, rgba(28, 112, 127, 0.2), transparent 30%),
    radial-gradient(circle at 78% 82%, rgba(161, 81, 34, 0.16), transparent 34%),
    #030712;
}

button { font: inherit; }
button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

.page-frame {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.game-shell,
.game-canvas {
  width: 100%;
  height: 100%;
}

.game-shell {
  position: relative;
  max-width: 540px;
  max-height: 960px;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.game-canvas {
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.audio-button {
  position: absolute;
  z-index: 45;
  top: max(20px, calc(env(safe-area-inset-top) + 12px));
  right: 62px;
  min-width: 42px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(98, 232, 238, 0.3);
  border-radius: 9px;
  background: rgba(4, 14, 27, 0.78);
  color: #9ce7e8;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.audio-button.muted { border-color: rgba(255, 130, 120, 0.32); color: #d3948e; }

.boss-intro {
  position: absolute;
  z-index: 38;
  inset: 0;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: rgba(1, 3, 10, 0.82);
  pointer-events: auto;
  animation: boss-intro-fade 2.7s ease both;
}

.boss-intro-vignette {
  position: absolute;
  inset: -12%;
  background:
    linear-gradient(112deg, transparent 0 36%, rgba(255, 54, 61, 0.18) 37% 39%, transparent 40% 100%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.025) 5px 6px),
    radial-gradient(circle, rgba(142, 33, 50, 0.3), rgba(0, 0, 0, 0.9) 68%);
  animation: boss-vignette-pulse 0.34s steps(2) infinite;
}

.boss-intro-copy {
  position: relative;
  width: min(88%, 430px);
  padding: 34px 22px 28px;
  border-top: 2px solid #ff5b61;
  border-bottom: 2px solid #ff5b61;
  text-align: center;
  transform: skewY(-2deg);
  animation: boss-copy-in 2.7s cubic-bezier(.18,.8,.25,1) both;
}

.boss-warning {
  color: #ff666d;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.32em;
}

.boss-portrait {
  position: relative;
  width: 114px;
  height: 78px;
  margin: 19px auto 13px;
  filter: drop-shadow(0 0 18px rgba(255, 69, 76, 0.72));
}

.boss-portrait::before,
.boss-portrait::after,
.boss-portrait i {
  position: absolute;
  display: block;
  content: '';
  background: #bd3543;
}

.boss-portrait::before {
  top: 4px;
  left: 20px;
  width: 74px;
  height: 64px;
  clip-path: polygon(50% 0, 98% 28%, 84% 100%, 16% 100%, 2% 28%);
}

.boss-portrait::after {
  top: 31px;
  left: 34px;
  width: 46px;
  height: 18px;
  border-radius: 50%;
  background: #ffe2b4;
  box-shadow: inset 0 0 0 7px #40111c;
}

.boss-portrait i:nth-child(1) { top: 0; left: 14px; width: 18px; height: 30px; transform: rotate(-32deg); }
.boss-portrait i:nth-child(2) { top: -8px; left: 48px; width: 18px; height: 34px; }
.boss-portrait i:nth-child(3) { top: 0; right: 14px; width: 18px; height: 30px; transform: rotate(32deg); }

.boss-intro h2 {
  margin: 0;
  color: #fff1cc;
  font-size: clamp(44px, 13vw, 68px);
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1;
  text-shadow: 0 4px 0 #681f2d, 0 0 24px rgba(255, 88, 94, 0.52);
}

.boss-intro p { margin: 11px 0 0; color: #ff9b92; font-size: 15px; font-weight: 800; letter-spacing: 0.28em; }
.boss-intro[data-theme="foundry"] .boss-portrait::before { background: #e75e2d; }
.boss-intro[data-theme="void"] .boss-portrait::before { background: #9a54dc; }

@keyframes boss-copy-in {
  0% { opacity: 0; transform: translateX(45%) scale(1.24) skewY(-2deg); }
  16%, 78% { opacity: 1; transform: translateX(0) scale(1) skewY(-2deg); }
  100% { opacity: 0; transform: translateX(-30%) scale(0.94) skewY(-2deg); }
}

@keyframes boss-intro-fade { 0% { opacity: 0; } 9%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes boss-vignette-pulse { 50% { transform: scale(1.025); filter: brightness(1.2); } }

.menu-screen,
.menu-cover,
.menu-shade,
.modal-backdrop {
  position: absolute;
  inset: 0;
}

.menu-screen { z-index: 20; background: var(--ink); }

.menu-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-shade {
  background: linear-gradient(180deg, rgba(3, 8, 20, 0.12), rgba(3, 8, 20, 0.22) 34%, rgba(3, 8, 20, 0.93) 76%, #030814);
}

.menu-content {
  position: absolute;
  right: 24px;
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 24px));
  left: 24px;
  text-align: center;
}

.eyebrow,
.modal-kicker {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.game-title {
  margin: 6px 0 0;
  color: #fff2c8;
  font-size: clamp(44px, 11vw, 64px);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0.09em;
  text-shadow: 0 4px 0 #6c351f, 0 0 24px rgba(247, 185, 85, 0.45);
}

.game-subtitle {
  margin: 8px 0 0;
  color: rgba(236, 245, 244, 0.72);
  font-size: 14px;
  letter-spacing: 0.24em;
}

.feature-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 16px;
}

.feature-row span {
  padding: 6px 10px;
  border: 1px solid rgba(98, 232, 238, 0.25);
  border-radius: 999px;
  background: rgba(5, 17, 31, 0.72);
  color: #bdebed;
  font-size: 12px;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffe099;
  border-radius: 13px;
  background: linear-gradient(180deg, #f8c75f, #d57a2d);
  box-shadow: 0 6px 0 #753a25, 0 12px 26px rgba(0, 0, 0, 0.42);
  color: #291b1b;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #753a25;
}

.primary-button.compact { min-height: 50px; margin-top: 24px; font-size: 16px; }
.menu-tip { margin: 19px 0 0; color: rgba(224, 237, 238, 0.52); font-size: 12px; }

.hud {
  position: absolute;
  z-index: 5;
  top: max(18px, calc(env(safe-area-inset-top) + 10px));
  right: 16px;
  left: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.hud-left { min-width: 116px; }
.heart-row { display: flex; gap: 6px; }

.heart {
  width: 15px;
  height: 15px;
  border: 2px solid #ffb28b;
  border-radius: 4px 4px 7px 7px;
  background: #ef5260;
  box-shadow: 0 0 7px rgba(239, 82, 96, 0.55);
  transform: rotate(45deg);
}

.heart.empty { border-color: #576170; background: #283342; box-shadow: none; }
.weapon-button {
  display: flex;
  min-height: 28px;
  margin-top: 8px;
  padding: 5px 8px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(98, 232, 238, 0.2);
  border-radius: 8px;
  background: rgba(4, 14, 27, 0.7);
  color: rgba(238, 245, 240, 0.78);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.05em;
  pointer-events: auto;
}

.weapon-key,
.skill-key {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
}

.room-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 12px;
  margin-left: auto;
}

.room-name { color: #f8e8b3; font-size: 14px; }
.room-index { margin-top: 4px; color: #6fdce1; font-size: 11px; letter-spacing: 0.14em; }

.pause-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(120, 215, 221, 0.28);
  border-radius: 10px;
  background: rgba(5, 16, 29, 0.72);
  color: #d9f4ef;
  cursor: pointer;
  pointer-events: auto;
}

.score-chip {
  position: absolute;
  z-index: 5;
  top: max(65px, calc(env(safe-area-inset-top) + 56px));
  left: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(247, 211, 110, 0.18);
  border-radius: 8px;
  background: rgba(4, 13, 26, 0.58);
  color: #c7d4d3;
  font-size: 11px;
  pointer-events: none;
}

.score-divider,
.stat-line { display: block; width: 1px; background: rgba(255, 255, 255, 0.16); }
.score-divider { height: 13px; }

.mini-map {
  position: absolute;
  z-index: 6;
  top: max(82px, calc(env(safe-area-inset-top) + 72px));
  right: 15px;
  width: 112px;
  height: 68px;
  border: 1px solid rgba(103, 228, 230, 0.16);
  border-radius: 9px;
  background: rgba(3, 10, 21, 0.62);
  pointer-events: none;
}

.map-room {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 1px solid #4a5965;
  border-radius: 4px;
  background: #172332;
  transform: translate(-50%, -50%);
}

.map-room.visited { border-color: #7a929a; background: #2a3b47; }
.map-room.cleared { border-color: var(--map-accent, #62e8ee); background: color-mix(in srgb, var(--map-accent, #62e8ee) 32%, #10202c); }
.map-room.current { box-shadow: 0 0 0 2px #fff0bd, 0 0 10px var(--map-accent, #62e8ee); }
.map-room.chest::after { content: "◆"; position: absolute; inset: -2px 0 0; color: #f7cf6a; font-size: 9px; text-align: center; }
.map-room.boss::after { content: "!"; position: absolute; inset: 0; color: #ff8990; font-size: 10px; font-weight: 900; text-align: center; }
.map-link { position: absolute; height: 2px; background: rgba(119, 147, 153, 0.42); transform-origin: 0 50%; }

.dash-button {
  position: absolute;
  z-index: 7;
  right: 20px;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 82px));
  display: flex;
  width: 68px;
  height: 68px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(247, 211, 110, 0.72);
  border-radius: 50%;
  background: rgba(18, 27, 40, 0.82);
  box-shadow: inset 0 0 14px rgba(247, 185, 85, 0.16), 0 6px 14px rgba(0, 0, 0, 0.28);
  color: #f8d777;
  cursor: pointer;
  line-height: 1;
  overflow: hidden;
}

.dash-button:active { background: rgba(247, 185, 85, 0.38); transform: scale(0.94); }
.dash-button.ready { box-shadow: inset 0 0 14px rgba(247, 185, 85, 0.2), 0 0 12px rgba(247, 211, 110, 0.16), 0 6px 14px rgba(0, 0, 0, 0.28); }
.dash-button:disabled { cursor: default; filter: saturate(0.5); opacity: 0.78; }
.dash-cooldown {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--cooldown, 0%);
  background: rgba(2, 7, 14, 0.68);
  transition: height 0.1s linear;
}
.dash-arrow { position: relative; z-index: 1; font-size: 22px; font-weight: 900; letter-spacing: -5px; }
.dash-count { position: relative; z-index: 1; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dash-text { position: relative; z-index: 1; margin-top: 4px; font-size: 11px; }

.skill-button {
  position: absolute;
  z-index: 7;
  right: 20px;
  bottom: max(174px, calc(env(safe-area-inset-bottom) + 160px));
  display: flex;
  width: 72px;
  height: 72px;
  padding: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(103, 228, 230, 0.55);
  border-radius: 18px;
  background: rgba(15, 35, 50, 0.88);
  color: #dffaff;
  cursor: pointer;
}

.skill-button.ready { box-shadow: inset 0 0 18px rgba(82, 226, 231, 0.15), 0 0 12px rgba(82, 226, 231, 0.12); }
.skill-button:disabled { cursor: default; filter: saturate(0.4); opacity: 0.72; }
.skill-name { position: relative; z-index: 1; max-width: 62px; font-size: 11px; font-weight: 800; line-height: 1.2; }
.skill-key { position: relative; z-index: 1; margin-top: 4px; }
.skill-cooldown {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--cooldown, 0%);
  background: rgba(2, 7, 14, 0.72);
  transition: height 0.1s linear;
}

.interact-button {
  position: absolute;
  z-index: 8;
  right: 104px;
  bottom: max(112px, calc(env(safe-area-inset-bottom) + 98px));
  display: flex;
  min-width: 64px;
  min-height: 44px;
  padding: 7px 12px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #f7cf6a;
  border-radius: 999px;
  background: rgba(69, 48, 25, 0.9);
  box-shadow: 0 0 18px rgba(247, 207, 106, 0.2);
  color: #fff0bd;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.interact-button small { color: #f7cf6a; font-size: 9px; }

.modal-backdrop {
  z-index: 15;
  display: flex;
  padding: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(2, 8, 18, 0.8);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: 100%;
  max-height: calc(100% - 20px);
  overflow: auto;
  border: 1px solid rgba(102, 221, 225, 0.28);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(20, 38, 55, 0.98), rgba(7, 18, 34, 0.99));
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.08);
}

.guide-card,
.result-card { padding: 30px 24px 24px; }
.pause-card { padding: 34px 24px 24px; text-align: center; }
.volume-group { margin: 18px 0 4px; text-align: left; }
.volume-label { display: flex; justify-content: space-between; align-items: baseline; color: #cfe8e9; font-size: 13px; margin-bottom: 8px; }
.volume-label span { color: #62e8ee; font-weight: 800; font-variant-numeric: tabular-nums; }
.volume-group input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none; cursor: pointer;
}
.volume-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #62e8ee; border: 2px solid #0a1622;
  box-shadow: 0 0 10px rgba(98, 232, 238, 0.6);
}
.volume-group input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #62e8ee; border: 2px solid #0a1622;
  box-shadow: 0 0 10px rgba(98, 232, 238, 0.6);
}
.modal-title { margin: 8px 0 0; color: #fff0bd; font-size: 29px; font-weight: 900; letter-spacing: 0.06em; }

.level-backdrop { z-index: 24; background: rgba(2, 7, 16, 0.92); }
.level-panel { padding: 28px 18px 20px; }
.level-lead { margin: 10px 0 20px; color: #82979c; font-size: 12px; line-height: 1.6; }
.level-list { display: grid; gap: 10px; }

.level-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 96px;
  padding: 14px 14px 14px 66px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--level-accent) 40%, #43515c);
  border-radius: 14px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--level-accent) 12%, #111d2b), rgba(7, 15, 29, 0.96));
  color: #eef7ef;
  cursor: pointer;
  text-align: left;
}

.level-card:hover,
.level-card:focus-visible { border-color: var(--level-accent); transform: translateY(-1px); }
.level-number { position: absolute; top: 15px; left: 16px; color: var(--level-accent); font-size: 31px; font-weight: 950; }
.level-card strong { color: #fff0bd; font-size: 17px; }
.level-card p { margin: 5px 0 0; color: #8da0a5; font-size: 11px; line-height: 1.45; }
.level-meta { display: flex; gap: 10px; margin-top: 8px; color: var(--level-accent); font-size: 10px; font-weight: 800; }

.guide-item {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  align-items: center;
}

.guide-number {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #5ddce1;
  border-radius: 12px;
  background: rgba(40, 191, 195, 0.12);
  color: #68e4e6;
  font-weight: 900;
}

.guide-item strong { display: block; color: #eef7ef; font-size: 15px; }
.guide-item p { margin: 4px 0 0; color: #81969c; font-size: 12px; line-height: 1.5; }

.text-button {
  margin-top: 18px;
  border: 0;
  background: transparent;
  color: #91a5aa;
  cursor: pointer;
  font-size: 14px;
}

.upgrade-backdrop { align-items: flex-end; padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 16px)); }
.reward-backdrop { align-items: center; }
.upgrade-panel { padding: 24px 16px 16px; }
.reward-panel { border-color: rgba(247, 207, 106, 0.44); }
.upgrade-panel .modal-kicker,
.upgrade-panel .modal-title { margin-left: 8px; }
.upgrade-panel .modal-title { margin-bottom: 18px; font-size: 24px; }
.upgrade-list { max-height: min(68vh, 590px); overflow-y: auto; padding-right: 2px; }

.upgrade-card {
  display: flex;
  width: 100%;
  min-height: 76px;
  margin-top: 10px;
  padding: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  color: #eef7ef;
  cursor: pointer;
  text-align: left;
}

.upgrade-card:hover,
.upgrade-card:focus-visible { border-color: #f5c96b; background: rgba(245, 201, 107, 0.12); }

.upgrade-icon {
  display: flex;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(103, 228, 230, 0.42);
  border-radius: 12px;
  background: #102e3e;
  color: #68e4e6;
  font-size: 11px;
  font-weight: 900;
}

.upgrade-copy { flex: 1; margin-left: 14px; }
.upgrade-copy strong { display: block; color: #fff0bd; font-size: 15px; }
.upgrade-copy span { display: block; margin-top: 5px; color: #8ea2a6; font-size: 12px; }
.upgrade-arrow { padding: 0 6px; color: #f5c96b; font-size: 28px; }

.weapon-reward-card { min-height: 126px; align-items: center; }
.power-reward-card { position: relative; overflow: hidden; }
.power-reward-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 20px rgba(92, 238, 224, 0.08); }
.tier-legendary { border-color: rgba(255, 207, 95, 0.66); background: linear-gradient(120deg, rgba(255, 194, 71, 0.13), rgba(120, 74, 198, 0.12)); box-shadow: inset 0 0 22px rgba(255, 207, 95, 0.08), 0 0 14px rgba(255, 184, 67, 0.08); }
.reward-tier { display: inline-block !important; width: fit-content; margin: 0 0 3px !important; padding: 2px 7px; border-radius: 999px; background: rgba(255, 204, 91, 0.16); color: #ffd878 !important; font-size: 9px !important; font-weight: 900; letter-spacing: 1px; }
.reward-bonus { display: block !important; margin-top: 4px !important; color: #69edbe !important; font-size: 10px !important; font-weight: 800; }

/* 宝箱奖励确认弹框 */
.confirm-backdrop { align-items: center; justify-content: center; padding: 20px; }
.confirm-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 26px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 38, 48, 0.98), rgba(14, 24, 32, 0.98));
  border: 1px solid rgba(255, 224, 153, 0.22);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.confirm-card .modal-kicker,
.confirm-card .modal-title { margin-left: 0; }
.confirm-reward-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0 4px;
  padding: 18px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.confirm-reward-kind {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(103, 228, 230, 0.16);
  color: #68e4e6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
}
.confirm-reward-title { display: block; margin-top: 4px; color: #fff0bd; font-size: 20px; font-weight: 900; }
.confirm-reward-desc { display: block; margin-top: 7px; color: #8ea2a6; font-size: 13px; line-height: 1.5; }
.confirm-actions { margin-top: 18px; }
.confirm-actions .primary-button.compact { margin-top: 0; }
.confirm-actions .text-button { margin-top: 12px; }

.weapon-preview {
  position: relative;
  width: 58px;
  height: 54px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), rgba(7, 18, 29, 0.9));
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--weapon-color) 18%, transparent);
}

.weapon-body,
.weapon-barrel,
.weapon-grip,
.weapon-detail {
  position: absolute;
  display: block;
  background: var(--weapon-color, #68e4e6);
  box-shadow: 0 0 6px color-mix(in srgb, var(--weapon-color) 46%, transparent);
}

.weapon-body { left: 14px; top: 18px; width: 24px; height: 12px; border-radius: 4px; }
.weapon-barrel { left: 36px; top: 20px; width: 15px; height: 6px; border-radius: 0 4px 4px 0; }
.weapon-grip { left: 19px; top: 28px; width: 8px; height: 14px; border-radius: 2px 2px 5px 5px; transform: rotate(-12deg); opacity: 0.76; }
.weapon-detail { left: 18px; top: 14px; width: 14px; height: 3px; border-radius: 3px; opacity: 0.68; }
.shape-shotgun .weapon-barrel,
.shape-rail .weapon-barrel,
.shape-sniper .weapon-barrel,
.shape-lance .weapon-barrel { left: 31px; width: 23px; height: 4px; }
.shape-rail .weapon-body,
.shape-lance .weapon-body { height: 8px; transform: skewX(-18deg); }
.shape-sniper .weapon-detail { left: 24px; top: 12px; width: 9px; height: 5px; border-radius: 50%; }
.shape-launcher .weapon-body,
.shape-cannon .weapon-body { left: 9px; top: 15px; width: 34px; height: 16px; border-radius: 9px; }
.shape-launcher .weapon-barrel,
.shape-cannon .weapon-barrel { left: 41px; top: 18px; width: 12px; height: 10px; }
.shape-smg .weapon-body,
.shape-carbine .weapon-body { left: 11px; width: 31px; }
.shape-smg .weapon-detail,
.shape-carbine .weapon-detail { left: 11px; width: 22px; }
.shape-prism .weapon-body { left: 17px; top: 13px; width: 23px; height: 23px; transform: rotate(45deg); border-radius: 3px; }
.shape-disc .weapon-body { left: 16px; top: 11px; width: 28px; height: 28px; border-radius: 50%; background: transparent; border: 5px solid var(--weapon-color); }
.shape-disc .weapon-barrel,
.shape-disc .weapon-grip,
.shape-disc .weapon-detail { display: none; }
.shape-needle .weapon-body,
.shape-vial .weapon-body { left: 11px; top: 17px; width: 31px; height: 10px; }
.shape-needle .weapon-barrel { left: 40px; width: 16px; height: 2px; }
.shape-vial .weapon-detail { left: 13px; top: 13px; width: 14px; height: 6px; border-radius: 50%; }
.shape-storm .weapon-detail,
.shape-flame .weapon-detail { left: 10px; top: 11px; width: 27px; height: 6px; transform: skewX(-25deg); }
.shape-mirror .weapon-body { left: 16px; top: 13px; width: 21px; height: 21px; transform: rotate(45deg); border-radius: 4px; background: transparent; border: 4px solid var(--weapon-color); }
.shape-mirror .weapon-barrel { left: 36px; top: 20px; width: 18px; height: 5px; }
.shape-mirror .weapon-detail { left: 8px; top: 11px; width: 10px; height: 28px; border-radius: 50%; opacity: 0.5; }
.shape-lasso .weapon-body { left: 11px; top: 13px; width: 22px; height: 22px; border-radius: 50%; background: transparent; border: 4px double var(--weapon-color); }
.shape-lasso .weapon-barrel { left: 31px; top: 21px; width: 23px; height: 5px; }
.shape-lasso .weapon-detail { left: 37px; top: 14px; width: 13px; height: 13px; border-radius: 50%; background: transparent; border: 3px solid var(--weapon-color); }
.shape-lasso .weapon-grip { left: 15px; top: 32px; height: 13px; background: #9b6535; }
.shape-coil .weapon-body { left: 10px; top: 16px; width: 27px; height: 17px; border-radius: 10px; background: transparent; border: 4px double var(--weapon-color); }
.shape-coil .weapon-barrel { left: 35px; top: 15px; width: 18px; height: 4px; transform: rotate(-18deg); box-shadow: 0 13px 0 var(--weapon-color); }
.shape-coil .weapon-detail { left: 19px; top: 11px; width: 6px; height: 28px; border-radius: 50%; background: transparent; border: 2px solid var(--weapon-color); }
.shape-coil .weapon-grip { left: 13px; top: 31px; }
.shape-gravity .weapon-body { left: 8px; top: 12px; width: 33px; height: 25px; border-radius: 50%; background: #080611; border: 4px solid var(--weapon-color); }
.shape-gravity .weapon-barrel { left: 37px; top: 19px; width: 18px; height: 10px; border-radius: 3px 8px 8px 3px; }
.shape-gravity .weapon-detail { left: 14px; top: 17px; width: 19px; height: 9px; border-radius: 50%; background: transparent; border: 2px solid #f4eaff; transform: rotate(-25deg); }
.shape-gravity .weapon-grip { left: 14px; top: 32px; }
.shape-dual .weapon-body { box-shadow: 0 11px 0 var(--weapon-color), 0 0 6px var(--weapon-color); }
.shape-dual .weapon-grip { box-shadow: 0 11px 0 var(--weapon-color); }

.current-weapon { display: block; margin-top: 5px; color: #71868c; font-size: 10px; }
.weapon-stat-grid { display: flex !important; gap: 5px; margin-top: 7px !important; }
.skill-stat-grid { display: flex !important; max-width: 190px; gap: 5px; margin-top: 7px !important; }
.weapon-stat {
  display: flex !important;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 4px 3px;
  border-radius: 6px;
  background: rgba(4, 12, 20, 0.56);
  text-align: center;
}
.weapon-stat small { color: #81969c; font-size: 9px; }
.weapon-stat .stat-number { margin-top: 2px; color: #eaf5f2; font-size: 11px; font-style: normal; }
.weapon-stat .stat-compare { margin-top: 2px; font-size: 9px; font-style: normal; font-weight: 800; }
.stat-compare.up { color: #66e695; }
.stat-compare.down { color: #ff8a82; }
.stat-compare.same { color: #899aa0; }

.result-backdrop { background: radial-gradient(circle at 50% 38%, rgba(38, 137, 145, 0.32), rgba(2, 8, 18, 0.94) 58%); }
.result-card { text-align: center; }

.result-emblem {
  display: flex;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  align-items: center;
  justify-content: center;
  border: 2px solid #f5c96b;
  border-radius: 50%;
  background: rgba(245, 201, 107, 0.09);
  box-shadow: 0 0 28px rgba(245, 201, 107, 0.2);
  color: #f5c96b;
  font-size: 34px;
}

.result-hint { margin: 12px 0 0; color: #91a4a8; font-size: 14px; }
.result-stats { display: flex; gap: 34px; margin: 28px 0 8px; align-items: center; justify-content: center; }
.stat-value,
.stat-label { display: block; }
.stat-value { color: #f8d777; font-size: 28px; font-weight: 900; }
.stat-label { margin-top: 4px; color: #6f858c; font-size: 12px; }
.stat-line { height: 44px; }
.desktop-caption { display: none; }
.touch-only { display: none; }

@media (min-width: 700px) and (min-height: 640px) {
  .game-shell {
    width: min(500px, calc((100vh - 48px) * 0.62));
    height: calc(100vh - 48px);
    border: 1px solid rgba(102, 221, 225, 0.22);
    border-radius: 22px;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58), 0 0 80px rgba(47, 154, 164, 0.08);
  }

  .desktop-caption {
    position: fixed;
    bottom: 5px;
    display: block;
    margin: 0;
    color: rgba(151, 190, 193, 0.34);
    font-size: 10px;
    letter-spacing: 0.18em;
  }
}

@media (hover: none), (pointer: coarse) {
  .desktop-only { display: none; }
  .touch-only { display: inline; }
  .game-canvas { cursor: default; }
}

@media (max-height: 650px) {
  .menu-content { bottom: max(16px, env(safe-area-inset-bottom)); }
  .game-title { font-size: 42px; }
  .feature-row { margin: 14px 0 12px; }
  .menu-tip { margin-top: 12px; }
  .guide-card { padding-top: 20px; }
  .guide-item { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
