/* css/style.css */
body {
                  margin: 0;
                  background-color: #2b2b2b;
                  color: #fff;
                  font-family: "Courier New", Courier, monospace;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  min-height: 100vh;
                  overflow: hidden;
                  font-size: 14px;
}

#main-layout {
                  display: flex;
                  gap: 15px;
                  padding: 15px;
                  background: rgba(0, 0, 0, 0.85);
                  border-radius: 10px;
                  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
                  border: 2px solid #5d4037;
}

/* === 1. 左侧武器库 (高度800) === */
#cheat-sidebar {
                  width: 260px;
                  background: #263238;
                  border: 2px solid #455a64;
                  padding: 8px;
                  display: flex;
                  flex-direction: column;
                  overflow: hidden;
                  box-shadow: inset 0 0 20px #000;
                  transition: opacity 0.3s;
                  height: 800px;
                  /* 统一高度 */
                  box-sizing: border-box;
}

#cheat-sidebar.disabled {
                  opacity: 0.3;
                  pointer-events: none;
                  filter: grayscale(100%);
}

/* === 2. 游戏容器 (高度800) === */
#game-container {
                  position: relative;
                  width: 800px;
                  height: 800px;
                  /* 统一高度 */
                  border: 8px solid #5d4037;
                  border-radius: 4px;
                  background: #333;
                  overflow: hidden;
                  transition: filter 0.5s ease;
                  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="none" stroke="red" stroke-width="2"/><line x1="8" y1="2" x2="8" y2="14" stroke="red" stroke-width="2"/><line x1="2" y1="8" x2="14" y2="8" stroke="red" stroke-width="2"/></svg>') 8 8, crosshair;
}

#game-container.beer-cursor {
                  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text y="24" x="0" font-size="24">🍺</text></svg>') 16 16, pointer !important;
}

.grayscale-mode {
                  filter: grayscale(100%);
}

canvas {
                  display: block;
}

/* === 3. 右侧面板 (高度800) === */
#side-panel {
                  width: 300px;
                  background: #3e2723;
                  border: 4px solid #8d6e63;
                  padding: 10px;
                  color: #d7ccc8;
                  display: flex;
                  flex-direction: column;
                  gap: 8px;
                  box-shadow: inset 0 0 20px #222;
                  height: 800px;
                  /* 统一高度 */
                  box-sizing: border-box;
}

/* === 通用组件样式 === */
.sidebar-header {
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                  margin-bottom: 8px;
                  border-bottom: 1px solid #546e7a;
                  padding-bottom: 5px;
                  flex-shrink: 0;
}

.sidebar-title-box h2 {
                  color: #d32f2f;
                  text-shadow: 1px 1px black;
                  margin: 0;
                  font-size: 22px;
}

.sidebar-title-box p {
                  font-size: 12px;
                  color: #aaa;
                  margin: 0;
}

.saloon-square-btn {
                  width: 50px;
                  height: 50px;
                  background: #ff9800;
                  border: 2px solid #e65100;
                  color: #fff;
                  cursor: pointer;
                  display: flex;
                  flex-direction: column;
                  align-items: center;
                  justify-content: center;
                  border-radius: 6px;
                  box-shadow: 0 3px 0 #e65100;
                  transition: transform 0.1s;
}

.saloon-square-btn:hover {
                  background: #fb8c00;
}

.saloon-square-btn:active {
                  transform: translateY(3px);
                  box-shadow: none;
}

.saloon-icon {
                  font-size: 20px;
                  line-height: 1;
                  margin-bottom: 2px;
}

.saloon-text {
                  font-size: 12px;
                  font-weight: bold;
}

#weapon-library-list {
                  flex: 1;
                  display: flex;
                  flex-direction: column;
                  gap: 6px;
                  overflow-y: auto;
                  scrollbar-width: none;
}

#weapon-library-list::-webkit-scrollbar {
                  display: none;
}

.cheat-weapon-btn-wrapper {
                  background: #37474f;
                  border: 2px solid #546e7a;
                  padding: 5px;
                  border-radius: 4px;
                  margin-bottom: 0;
}

.cheat-weapon-btn-wrapper.active-weapon {
                  border: 2px solid #ffca28 !important;
                  box-shadow: 0 0 10px rgba(255, 202, 40, 0.5);
}

.cheat-weapon-btn {
                  display: flex;
                  flex-direction: row;
                  align-items: center;
                  cursor: pointer;
                  margin-bottom: 5px;
}

.weapon-rect-icon {
                  width: 50px;
                  height: 20px;
                  margin-right: 8px;
                  border: 1px solid rgba(255, 255, 255, 0.3);
                  position: relative;
                  flex-shrink: 0;
}

.weapon-info-box {
                  flex: 1;
}

.weapon-info-box b {
                  font-size: 13px;
                  color: #ffca28;
                  display: block;
}

.weapon-info-box span {
                  font-size: 12px;
                  color: #aaa;
}

.ammo-config {
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  font-size: 12px;
                  border-top: 1px dashed #666;
                  padding-top: 4px;
                  margin-bottom: 4px;
}

.ammo-input {
                  width: 40px;
                  background: #222;
                  border: 1px solid #555;
                  color: #fff;
                  padding: 1px;
                  text-align: center;
                  font-size: 12px;
}

.confirm-weapon-btn {
                  width: 100%;
                  padding: 4px;
                  background: #00897b;
                  border: none;
                  color: white;
                  font-weight: bold;
                  cursor: pointer;
                  font-size: 12px;
                  border-radius: 3px;
}

.confirm-weapon-btn:hover {
                  background: #00695c;
}

/* HUD */
#hud-layer {
                  position: absolute;
                  top: 0;
                  left: 0;
                  width: 100%;
                  padding: 15px;
                  box-sizing: border-box;
                  display: flex;
                  justify-content: space-between;
                  pointer-events: none;
                  z-index: 100;
                  text-shadow: 2px 2px 0 #000;
}

.hud-left,
.hud-right {
                  display: flex;
                  flex-direction: column;
                  gap: 8px;
}

.hud-right {
                  text-align: right;
                  align-items: flex-end;
}

.status-row {
                  display: flex;
                  align-items: center;
                  gap: 5px;
                  font-size: 22px;
                  font-weight: bold;
}

.heart-icon {
                  width: 24px;
                  height: 24px;
}

.hidden {
                  display: none !important;
}

.hud-player-info {
                  display: flex;
                  align-items: center;
                  gap: 10px;
}

#player-avatar {
                  width: 50px;
                  height: 50px;
                  border: 3px solid #ffca28;
                  border-radius: 50%;
                  background: #5d4037 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><circle cx="30" cy="25" r="12" fill="%23d7ccc8"/><path d="M10,60 Q30,30 50,60 Z" fill="%238d6e63"/><rect x="10" y="10" width="40" height="10" fill="%233e2723"/><rect x="15" y="5" width="30" height="10" fill="%233e2723"/></svg>') no-repeat center;
                  background-size: cover;
                  box-shadow: 0 0 10px #000;
                  margin-bottom: 5px;
}

.weapon-info-container {
                  display: flex;
                  align-items: center;
                  gap: 10px;
                  background: rgba(0, 0, 0, 0.4);
                  padding: 5px;
                  border-radius: 4px;
}

#hud-weapon-icon {
                  width: 50px;
                  height: 20px;
                  border: 1px solid rgba(255, 255, 255, 0.5);
}

.weapon-text-col {
                  display: flex;
                  flex-direction: column;
                  align-items: flex-end;
}

#weapon-name {
                  font-size: 16px;
                  color: #ffca28;
                  font-weight: bold;
}

/* Right Panel Components */
.level-display-box {
                  background: #4e342e;
                  padding: 10px;
                  text-align: center;
                  border: 2px solid #8d6e63;
                  border-radius: 6px;
                  font-size: 18px;
                  margin-bottom: 5px;
}

.level-setting-box {
                  background: #37474f;
                  padding: 8px;
                  border-radius: 4px;
                  border: 1px solid #546e7a;
}

.level-set-btn {
                  background: #546e7a;
                  color: white;
                  border: none;
                  padding: 4px 8px;
                  cursor: pointer;
                  border-radius: 3px;
                  font-size: 12px;
}

.level-set-btn:hover {
                  background: #78909c;
}

.sys-btn {
                  border: none;
                  padding: 8px;
                  color: white;
                  font-weight: bold;
                  cursor: pointer;
                  border-radius: 4px;
                  flex: 1;
                  font-size: 13px;
                  transition: 0.1s;
                  text-align: center;
}

.sys-btn.blue {
                  background: #2196f3;
                  box-shadow: 0 3px 0 #0d47a1;
                  border: 1px solid #1976d2;
}

.sys-btn.blue:hover {
                  background: #42a5f5;
}

.sys-btn.green {
                  background: #43a047;
                  box-shadow: 0 3px 0 #1b5e20;
                  border: 1px solid #388e3c;
}

.sys-btn.green:hover {
                  background: #66bb6a;
}

.controls-box p {
                  margin: 0 0 4px 0;
                  font-size: 13px;
                  color: #ffca28;
}

.controls-grid {
                  display: flex;
                  flex-wrap: wrap;
                  gap: 6px;
                  font-size: 12px;
}

.controls-grid span {
                  background: #4e342e;
                  padding: 3px 5px;
                  border-radius: 3px;
                  white-space: nowrap;
                  border: 1px solid #5d4037;
}

.key {
                  display: inline-block;
                  background: #3e2723;
                  color: #ffca28;
                  padding: 0 4px;
                  border-radius: 2px;
                  font-weight: bold;
                  border-bottom: 1px solid #3e2723;
                  margin-right: 3px;
}

hr {
                  border: 0;
                  border-top: 1px solid #5d4037;
                  margin: 10px 0;
}

#side-panel button.sys-btn {
                  margin: 0;
}

/* Manual & Pagination */
.guide-container {
                  flex: 1;
                  display: flex;
                  flex-direction: column;
                  overflow: hidden;
}

.guide-header {
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                  margin-bottom: 10px;
}

.guide-content {
                  flex: 1;
                  overflow-y: auto;
                  scrollbar-width: none;
}

.guide-content::-webkit-scrollbar {
                  display: none;
}

.guide-item {
                  display: flex;
                  gap: 8px;
                  margin-bottom: 8px;
                  align-items: flex-start;
                  background: rgba(0, 0, 0, 0.2);
                  padding: 6px;
                  border-radius: 4px;
}

.guide-item .icon {
                  font-size: 18px;
                  width: 20px;
                  text-align: center;
                  flex-shrink: 0;
}

.guide-item .text-col {
                  flex: 1;
}

.guide-item strong {
                  color: #ffca28;
                  display: block;
                  margin-bottom: 2px;
                  font-size: 13px;
}

.guide-item .sub-text {
                  color: #ccc;
                  font-size: 12px;
                  line-height: 1.3;
}

.guide-pagination {
                  display: flex;
                  justify-content: center;
                  gap: 10px;
                  margin-top: 5px;
                  border-top: 1px solid #5d4037;
                  padding-top: 5px;
}

.page-btn {
                  background: #5d4037;
                  border: 1px solid #8d6e63;
                  color: #fff;
                  width: 30px;
                  height: 24px;
                  cursor: pointer;
                  border-radius: 4px;
                  font-size: 12px;
                  display: flex;
                  align-items: center;
                  justify-content: center;
}

.page-btn:hover {
                  background: #795548;
}

/* ... (Other Screens) ... */
.screen {
                  position: absolute;
                  top: 0;
                  left: 0;
                  width: 100%;
                  height: 100%;
                  background: rgba(0, 0, 0, 0.85);
                  display: flex;
                  flex-direction: column;
                  justify-content: center;
                  align-items: center;
                  z-index: 200;
                  pointer-events: auto;
                  cursor: default;
}

#start-screen {
                  z-index: 300;
                  background: rgba(0, 0, 0, 0.95);
}

#countdown-screen {
                  z-index: 280;
                  background: rgba(0, 0, 0, 0.3);
                  pointer-events: none;
}

#countdown-number {
                  font-size: 120px;
                  color: #ffca28;
                  font-weight: bold;
                  text-shadow: 4px 4px 0 #3e2723;
}

#pause-screen {
                  z-index: 250;
                  background: rgba(0, 0, 0, 0.5);
                  backdrop-filter: blur(5px);
}

#boss-dialog {
                  position: absolute;
                  top: 100px;
                  left: 50%;
                  transform: translateX(-50%);
                  width: 400px;
                  display: flex;
                  align-items: center;
                  gap: 15px;
                  z-index: 150;
                  pointer-events: none;
                  transition: opacity 0.5s;
}

#dialog-portrait {
                  width: 80px;
                  height: 80px;
                  border: 3px solid #d32f2f;
                  background: #222;
                  border-radius: 50%;
                  overflow: hidden;
                  flex-shrink: 0;
                  box-shadow: 0 0 10px black;
}

#dialog-portrait img {
                  width: 100%;
                  height: 100%;
                  object-fit: cover;
}

#dialog-text {
                  background: rgba(255, 255, 255, 0.9);
                  color: #000;
                  padding: 10px 15px;
                  border-radius: 10px;
                  border: 2px solid #3e2723;
                  font-weight: bold;
                  font-size: 16px;
                  position: relative;
                  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.5);
}

#dialog-text::after {
                  content: '';
                  position: absolute;
                  left: -10px;
                  top: 50%;
                  transform: translateY(-50%);
                  border-width: 10px 10px 10px 0;
                  border-style: solid;
                  border-color: transparent rgba(255, 255, 255, 0.9) transparent transparent;
}

#poster-container {
                  width: 320px;
                  background: #f3e5ab;
                  color: #3e2723;
                  padding: 30px;
                  text-align: center;
                  box-shadow: 10px 10px 40px rgba(0, 0, 0, 0.9);
                  transform: rotate(-2deg);
                  border: 1px solid #8d6e63;
                  position: relative;
}

#poster-container.shake-anim {
                  animation: shake 0.3s ease-in-out;
}

@keyframes stamp-in {
                  0% {
                                    transform: translate(-50%, -50%) scale(5);
                                    opacity: 0;
                  }

                  50% {
                                    transform: translate(-50%, -50%) scale(1);
                                    opacity: 1;
                  }

                  100% {
                                    transform: translate(-50%, -50%) scale(1);
                                    opacity: 1;
                  }
}

@keyframes shake {
                  0% {
                                    transform: rotate(-2deg) translate(0, 0);
                  }

                  20% {
                                    transform: rotate(-2deg) translate(-10px, 10px);
                  }

                  40% {
                                    transform: rotate(-2deg) translate(10px, -10px);
                  }

                  60% {
                                    transform: rotate(-2deg) translate(-5px, 5px);
                  }

                  80% {
                                    transform: rotate(-2deg) translate(5px, -5px);
                  }

                  100% {
                                    transform: rotate(-2deg) translate(0, 0);
                  }
}

#boss-portrait-container {
                  width: 200px;
                  height: 200px;
                  background: #222;
                  margin: 0 auto 15px;
                  position: relative;
                  border: 4px solid #3e2723;
                  overflow: hidden;
                  display: flex;
                  align-items: center;
                  justify-content: center;
}

#boss-portrait-container img {
                  width: 100%;
                  height: 100%;
                  object-fit: cover;
                  display: block;
}

.skull-stamp {
                  position: absolute;
                  top: 50%;
                  left: 50%;
                  transform: translate(-50%, -50%);
                  font-size: 150px;
                  color: #d32f2f;
                  text-shadow: 0 0 5px black;
                  pointer-events: none;
                  opacity: 0;
}

.skull-stamp.animate {
                  animation: stamp-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#boss-name {
                  font-size: 28px;
                  font-weight: bold;
                  margin-bottom: 10px;
                  text-transform: uppercase;
}

.reward-text {
                  font-size: 24px;
                  font-weight: bold;
                  margin-bottom: 20px;
}

.bullet-hole {
                  position: absolute;
                  width: 20px;
                  height: 20px;
                  background: #111;
                  border-radius: 50%;
                  box-shadow: inset 2px 2px 5px #000;
                  pointer-events: none;
}

.inventory-grid {
                  display: grid;
                  grid-template-columns: repeat(4, 1fr);
                  gap: 15px;
                  padding: 20px;
                  background: #3e2723;
                  border: 4px solid #8d6e63;
                  border-radius: 8px;
                  max-width: 400px;
}

.inv-slot {
                  width: 60px;
                  height: 60px;
                  background: #5d4037;
                  border: 2px solid #8d6e63;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  position: relative;
                  color: #aaa;
                  font-size: 12px;
                  cursor: pointer;
}

.inv-slot:hover {
                  border-color: #ffca28;
}

.inv-item {
                  width: 80%;
                  height: 80%;
                  object-fit: contain;
}

.inv-item.photo {
                  background: #ffccbc;
                  border: 2px solid white;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  color: black;
                  font-weight: bold;
}

.inv-item.potion {
                  background: #ef5350;
                  border-radius: 50%;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  color: white;
                  font-weight: bold;
}

.inv-item.ammo {
                  background: #ffca28;
                  clip-path: polygon(20% 0%, 80% 0%, 80% 100%, 20% 100%);
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  color: black;
                  font-size: 12px;
}

#item-action-menu {
                  position: absolute;
                  background: #3e2723;
                  border: 2px solid #ffca28;
                  padding: 5px;
                  display: flex;
                  flex-direction: column;
                  gap: 5px;
                  z-index: 250;
                  box-shadow: 5px 5px 10px black;
}

#item-action-menu button {
                  font-size: 12px;
                  padding: 5px 10px;
                  width: 80px;
}

#photo-viewer {
                  position: absolute;
                  top: 0;
                  left: 0;
                  width: 100%;
                  height: 100%;
                  background: rgba(0, 0, 0, 0.9);
                  z-index: 500;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  flex-direction: column;
}

#photo-display {
                  max-width: 90%;
                  max-height: 80%;
                  border: 10px solid #fff;
                  box-shadow: 0 0 20px #000;
}

.shop-container {
                  width: 90%;
                  max-height: 90%;
                  background: #4e342e;
                  border: 4px solid #8d6e63;
                  padding: 20px;
                  border-radius: 8px;
                  display: flex;
                  flex-direction: column;
                  align-items: center;
                  overflow-y: auto;
}

#shop-items-grid {
                  display: grid;
                  grid-template-columns: repeat(3, 1fr);
                  gap: 10px;
                  width: 100%;
                  margin-top: 10px;
                  padding-right: 5px;
}

.shop-item {
                  background: #3e2723;
                  border: 2px solid #6d4c41;
                  padding: 10px;
                  border-radius: 4px;
                  text-align: center;
                  display: flex;
                  flex-direction: column;
                  justify-content: space-between;
                  min-height: 120px;
}

.shop-item h4 {
                  margin: 0 0 5px;
                  color: #ffca28;
                  font-size: 14px;
}

.shop-item p {
                  font-size: 12px;
                  color: #ccc;
                  flex-grow: 1;
                  margin-bottom: 5px;
}

.shop-item.owned {
                  opacity: 0.6;
                  border-color: #4caf50;
}

#arcade-overlay {
                  position: absolute;
                  top: 0;
                  left: 0;
                  width: 100%;
                  height: 100%;
                  background: rgba(0, 0, 0, 0.9);
                  z-index: 400;
                  display: flex;
                  flex-direction: column;
                  align-items: center;
                  justify-content: center;
}

#arcade-frame {
                  width: 500px;
                  height: 600px;
                  border: 4px solid #ffca28;
                  background: #000;
}

#bar-menu {
                  position: absolute;
                  top: 50%;
                  left: 50%;
                  transform: translate(-50%, -50%);
                  width: 400px;
                  background: #3e2723;
                  border: 4px solid #8d6e63;
                  padding: 20px;
                  z-index: 300;
                  color: #fff;
                  text-align: center;
}

.bar-item {
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                  background: #5d4037;
                  margin: 10px 0;
                  padding: 10px;
                  border: 1px solid #8d6e63;
}