/* 🎨 Express Server Live Console & Game client CSS Styling */

:root {
  --bg-primary: #07070a;
  --bg-card: rgba(16, 16, 25, 0.7);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-card-hover: rgba(255, 255, 255, 0.12);
  
  /* Accent Colors */
  --accent-blue: #00d2ff;
  --accent-purple: #9d4edd;
  --accent-green: #00f5d4;
  --accent-red: #ff0055;
  --accent-orange: #ffb703;
  --accent-yellow: #f1c40f;
  
  /* Text Colors */
  --text-main: #f3f3f6;
  --text-muted: #7b7e9a;
  
  /* Utilities */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* ==========================================
   🌈 7 Premium Visual Themes (Body Classes)
   ========================================== */

/* 1. Cyber Neon Theme (Default) */
body.theme-cyber {
  /* Inherits root variables */
}

/* 2. Deep Ocean Theme */
body.theme-ocean {
  --bg-primary: #020b14;
  --bg-card: rgba(10, 25, 47, 0.75);
  --border-card: rgba(0, 245, 212, 0.08);
  --border-card-hover: rgba(0, 245, 212, 0.2);
  --accent-blue: #00f5d4;
  --accent-purple: #3b82f6;
  --accent-green: #64ffda;
  --accent-red: #ef4444;
  --accent-orange: #ff9f1c;
  --text-main: #e6f1ff;
  --text-muted: #8892b0;
  --glow-shadow: 0 8px 32px 0 rgba(2, 11, 20, 0.6);
}

/* 3. Forest Emerald Theme */
body.theme-emerald {
  --bg-primary: #050e0b;
  --bg-card: rgba(12, 28, 22, 0.75);
  --border-card: rgba(16, 185, 129, 0.08);
  --border-card-hover: rgba(16, 185, 129, 0.2);
  --accent-blue: #34d399;
  --accent-purple: #059669;
  --accent-green: #10b981;
  --accent-red: #f87171;
  --accent-orange: #fbbf24;
  --text-main: #ecfdf5;
  --text-muted: #6ee7b7;
  --glow-shadow: 0 8px 32px 0 rgba(5, 14, 11, 0.6);
}

/* 4. Sakura Blossom Theme */
body.theme-sakura {
  --bg-primary: #1f1618;
  --bg-card: rgba(45, 30, 35, 0.75);
  --border-card: rgba(244, 114, 182, 0.1);
  --border-card-hover: rgba(244, 114, 182, 0.25);
  --accent-blue: #f472b6;
  --accent-purple: #db2777;
  --accent-green: #fda4af;
  --accent-red: #f43f5e;
  --accent-orange: #fbcfe8;
  --text-main: #ffe4e6;
  --text-muted: #f472b6;
  --glow-shadow: 0 8px 32px 0 rgba(31, 22, 24, 0.6);
}

/* 5. Retro Arcade (8-bit) Theme */
body.theme-arcade {
  --bg-primary: #11051c;
  --bg-card: rgba(25, 10, 40, 0.85);
  --border-card: rgba(240, 0, 255, 0.2);
  --border-card-hover: rgba(240, 0, 255, 0.4);
  --accent-blue: #00ffff;
  --accent-purple: #f000ff;
  --accent-green: #ffff00;
  --accent-red: #ff003c;
  --accent-orange: #ff5e00;
  --text-main: #ffffff;
  --text-muted: #b026ff;
  --radius-lg: 0px;
  --radius-md: 0px;
  --glow-shadow: 6px 6px 0px rgba(0, 0, 0, 0.7);
}
body.theme-arcade .card {
  border: 2px solid var(--accent-purple);
  box-shadow: 5px 5px 0px var(--accent-blue);
  border-radius: 0px !important;
}
body.theme-arcade .header {
  border: 2px solid var(--accent-purple);
  box-shadow: 5px 5px 0px var(--accent-blue);
  border-radius: 0px !important;
}
body.theme-arcade .btn {
  border-radius: 0px !important;
  box-shadow: 3px 3px 0px var(--accent-red);
}
body.theme-arcade .select-input, body.theme-arcade .text-input {
  border-radius: 0px !important;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 6. Solarized Hacker Theme */
body.theme-hacker {
  --bg-primary: #000000;
  --bg-card: rgba(5, 20, 5, 0.85);
  --border-card: rgba(0, 255, 0, 0.2);
  --border-card-hover: rgba(0, 255, 0, 0.4);
  --accent-blue: #00ff00;
  --accent-purple: #008000;
  --accent-green: #00ff66;
  --accent-red: #ff3333;
  --accent-orange: #adff2f;
  --text-main: #00ff00;
  --text-muted: #008000;
  --glow-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
  --font-sans: 'JetBrains Mono', monospace;
}
body.theme-hacker .card, body.theme-hacker .header {
  border: 1px solid rgba(0, 255, 0, 0.3);
  box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.05), 0 0 10px rgba(0, 255, 0, 0.05);
}
body.theme-hacker .btn {
  border: 1px solid var(--accent-blue) !important;
  background: rgba(0, 255, 0, 0.05) !important;
  color: var(--accent-blue) !important;
}
body.theme-hacker .btn:hover {
  background: rgba(0, 255, 0, 0.15) !important;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

/* 7. Clean Light Mode Theme */
body.theme-light {
  --bg-primary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --border-card: rgba(0, 0, 0, 0.08);
  --border-card-hover: rgba(0, 0, 0, 0.15);
  --accent-blue: #2563eb;
  --accent-purple: #4f46e5;
  --accent-green: #059669;
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  --accent-yellow: #d97706;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --glow-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}
body.theme-light select option {
  background-color: #ffffff;
  color: #0f172a;
}
body.theme-light .header h1 {
  background: linear-gradient(135deg, #0f172a 40%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.theme-light .canvas-card {
  background: #e2e8f0;
}
body.theme-light .canvas-wrapper {
  background-color: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
body.theme-light .canvas-overlay {
  background: rgba(248, 250, 252, 0.92);
}
body.theme-light .canvas-overlay h2 {
  color: #0f172a;
}
body.theme-light .canvas-overlay p {
  color: #475569;
}
body.theme-light .terminal-window {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
}
body.theme-light .terminal-body {
  color: #0f172a;
}
body.theme-light .game-log-row {
  color: #1e293b;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}
body.theme-light .sys-log-row {
  color: #1e293b;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}
body.theme-light .terminal-placeholder {
  color: #64748b;
}
body.theme-light .kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-bottom-width: 3px;
}
body.theme-light .nav-tabs {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
}
body.theme-light .tab-btn {
  color: #475569;
}
body.theme-light .tab-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.04);
}
body.theme-light .tab-btn.active {
  color: #2563eb;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(79, 70, 229, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.2);
}
body.theme-light .select-input, body.theme-light .text-input {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #0f172a;
}
body.theme-light .select-input:focus, body.theme-light .text-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.15);
}
body.theme-light .char-preview-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
body.theme-light .preview-info h4 {
  color: #0f172a;
}
body.theme-light .player-list-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
body.theme-light .player-name-tag {
  color: #0f172a;
}
body.theme-light .player-equip-info {
  background: rgba(0, 0, 0, 0.04);
  color: #334155;
}
body.theme-light .camera-control-bar {
  background: #f1f5f9;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
body.theme-light .hud-player-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.theme-light .hud-name {
  color: #0f172a;
}
body.theme-light .hud-bar-container {
  background: rgba(0, 0, 0, 0.06);
}
body.theme-light .instructions-card {
  background: rgba(37, 99, 235, 0.03);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
body.theme-light .instructions-content {
  color: #1e293b;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 2rem;
}

/* Dynamic Ambient Glow Background */
.glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-bg::before,
.glow-bg::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(160px);
  opacity: 0.08;
  animation: float 25s ease-in-out infinite alternate;
}

.glow-bg::before {
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 80%);
  top: -10%;
  left: -10%;
}

.glow-bg::after {
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 80%);
  bottom: -10%;
  right: -10%;
  animation-delay: -12s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8%, 8%) scale(1.1); }
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: var(--glow-shadow);
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.server-icon-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-blue);
}

.pulse-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: var(--accent-green);
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-green);
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 40%, #8ea1cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tab Navigation */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.tab-btn i {
  width: 16px;
  height: 16px;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(157, 78, 221, 0.2));
  border: 1px solid rgba(0, 210, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.1);
}

/* Tab Content toggling */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.header-badges {
  display: flex;
  align-items: center;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge {
  background: rgba(0, 245, 212, 0.06);
  border: 1px solid rgba(0, 245, 212, 0.15);
  color: var(--accent-green);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.green {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-dot 1.5s infinite;
}

.dot.red {
  background-color: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* Common Card Styles */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-shadow);
  padding: 1.25rem;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-card-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.card-title h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.card-content {
  flex-grow: 1;
}

/* ==========================================
   🎮 TAB 1: 大亂鬥遊戲戰場樣式
   ========================================== */

.game-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.25rem;
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.game-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.select-input, .text-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  outline: none;
  transition: var(--transition-smooth);
}

.select-input:focus, .text-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.15);
}

.select-input option {
  background-color: #0f0f15;
  color: var(--text-main);
}

/* Mini Character Preview Card */
.char-preview-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.preview-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.preview-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.preview-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.preview-level-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-blue);
  color: var(--bg-primary);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

.preview-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Ranks Styles (青銅 - 大師) */
.rank-badge-preview {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 20px;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

.rank-bronze { background: rgba(180, 83, 9, 0.15); border: 1px solid rgba(180, 83, 9, 0.3); color: #f59e0b; text-shadow: 0 0 4px rgba(180, 83, 9, 0.5); }
.rank-silver { background: rgba(203, 213, 225, 0.12); border: 1px solid rgba(203, 213, 225, 0.25); color: #e2e8f0; text-shadow: 0 0 4px rgba(203, 213, 225, 0.5); }
.rank-gold { background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.3); color: #facc15; text-shadow: 0 0 6px rgba(234, 179, 8, 0.6); }
.rank-platinum { background: rgba(34, 211, 238, 0.15); border: 1px solid rgba(34, 211, 238, 0.3); color: #22d3ee; text-shadow: 0 0 8px rgba(34, 211, 238, 0.7); }
.rank-diamond { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #60a5fa; text-shadow: 0 0 8px rgba(59, 130, 246, 0.7); }
.rank-master { 
  background: rgba(217, 70, 239, 0.18); 
  border: 1px solid rgba(217, 70, 239, 0.4); 
  color: #f472b6; 
  text-shadow: 0 0 10px rgba(217, 70, 239, 0.8);
  animation: master-glow 1.5s infinite alternate;
}

@keyframes master-glow {
  from { box-shadow: 0 0 2px rgba(217, 70, 239, 0.2); }
  to { box-shadow: 0 0 8px rgba(217, 70, 239, 0.4); }
}

.btn-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Player List UI */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.player-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.player-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-name-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.player-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.player-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.player-equip-info {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.empty-list-placeholder {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Canvas View & Layout */
.canvas-card {
  padding: 0.5rem;
  background: #040406;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 500;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #07070c;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Canvas Screen Overlay */
.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.overlay-content {
  text-align: center;
  max-width: 400px;
  padding: 1rem;
}

.overlay-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.overlay-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.overlay-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pulsing {
  animation: pulse-icon 2s infinite ease-in-out;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 8px var(--accent-blue)); }
}

/* Battle HUD (HP/MP bar) overlay */
.battle-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 0.5rem 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.hud-player-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hud-player-box.eliminated {
  opacity: 0.35;
  filter: grayscale(1);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-name {
  font-size: 0.78rem;
  font-weight: 700;
  max-width: 95px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-stocks {
  display: flex;
  gap: 2px;
}

.stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.hud-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.hud-hp-bar {
  height: 100%;
  background: var(--accent-green);
  transition: width 0.15s ease-out;
}

.hud-mp-bar {
  height: 100%;
  background: var(--accent-blue);
  transition: width 0.15s ease-out;
}

.hud-mp-container {
  height: 3px;
}

/* Battle Logs Card */
.console-card {
  margin-top: 0;
}

/* Control Panel Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  color: #ffffff;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.18) 0%, rgba(157, 78, 221, 0.18) 100%);
  border: 1px solid rgba(0, 210, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.3) 0%, rgba(157, 78, 221, 0.3) 100%);
  border-color: rgba(0, 210, 255, 0.6);
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.2);
}

.btn-warning {
  background: rgba(255, 183, 3, 0.08);
  border: 1px solid rgba(255, 183, 3, 0.25);
  color: var(--accent-orange);
}

.btn-warning:hover {
  background: rgba(255, 183, 3, 0.18);
  border-color: var(--accent-orange);
}

.btn-danger {
  background: rgba(255, 0, 85, 0.08);
  border: 1px solid rgba(255, 0, 85, 0.2);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(255, 0, 85, 0.18);
  border-color: var(--accent-red);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn i {
  width: 16px;
  height: 16px;
}

/* Instructions card */
.instructions-card {
  background: rgba(0, 210, 255, 0.02);
  border: 1px solid rgba(0, 210, 255, 0.1);
  padding: 0.8rem 1.25rem;
}

.instructions-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.kbd-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  color: var(--text-main);
}

.kbd {
  background: #1c1c28;
  border: 1px solid #323249;
  border-bottom-width: 3px;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  color: var(--accent-blue);
}

.notes-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Terminal Log Viewers */
.logs-header-container {
  margin-bottom: 0.5rem;
}

.logs-count-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.terminal-window {
  width: 100%;
  background: #040407;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.9);
}

.terminal-body {
  padding: 0.85rem 1rem;
  height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}
.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}
.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.terminal-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

.game-log-row {
  animation: log-slide-in 0.2s ease-out;
  color: #dfdfe6;
  white-space: pre-wrap;
  word-break: break-all;
}

@keyframes log-slide-in {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================
   🛠️ TAB 2: 角色編輯器樣式
   ========================================== */

.editor-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
}

/* Creator Layout with Preview */
.creator-container {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 600px) {
  .creator-container {
    grid-template-columns: 1fr;
  }
}

.creator-form {
  min-width: 0; /* prevent flex blowout */
}

.creator-preview {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 1.25rem;
}

.preview-header {
  text-align: center;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.4rem;
}

.preview-header h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.preview-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.preview-canvas-wrapper {
  width: 120px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(0, 210, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.08);
  background-color: #07070c;
}

#previewCanvas {
  width: 120px;
  height: 150px;
  display: block;
}

/* Tunnel Proxy Warning Banner */
.tunnel-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.03);
}
.tunnel-warning span {
  display: inline-block;
}
.tunnel-warning a {
  color: #fbbf24;
  text-decoration: underline;
  font-weight: 600;
}
.tunnel-warning a:hover {
  color: #ffffff;
}

/* Appearance Customize Panel */
.appearance-panel {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.appearance-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
}

.appearance-header h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.appearance-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Enhanced Color Picker Wrapper focus transition */
.color-picker-wrapper {
  transition: var(--transition-smooth);
}
.color-picker-wrapper:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.25);
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.flex-1 {
  flex: 1;
}

/* Color Input style */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.8rem;
}

.color-input {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  cursor: pointer;
  outline: none;
  border-radius: 4px;
}

.color-value-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  padding-left: 0.1rem;
}

/* Sliders panel */
.stat-points-panel {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.points-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
}

.points-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.stat-points-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.points-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(0, 210, 255, 0.08);
  padding: 0.25rem 0.6rem;
  border-radius: 30px;
}

.stat-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.stat-name {
  color: var(--text-muted);
  font-weight: 500;
}

.stat-val-display {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-weight: 600;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 0 6px var(--accent-blue);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

/* Character Grid UI */
.char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  padding: 0.5rem;
  max-height: 480px;
  overflow-y: auto;
}

.char-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.char-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.char-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.char-card-level {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

.char-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.char-stats-mini {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.mini-stat-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 0.25rem;
  text-align: center;
  font-size: 0.65rem;
  font-family: var(--font-mono);
}

.mini-stat-label {
  color: var(--text-muted);
  display: block;
  font-size: 0.55rem;
}

.mini-stat-val {
  font-weight: 600;
}

/* ==========================================
   🖥️ TAB 3: 系統主機狀態監控器樣式（保留原版）
   ========================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.sys-card {
  grid-column: span 1;
}

.metric-card {
  grid-column: span 1;
}

.control-card {
  grid-column: span 1;
}

.syslogs-card {
  grid-column: span 3;
}

/* System info details */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  font-weight: 500;
  color: var(--text-main);
  max-width: 170px;
}

.info-value.highlight {
  font-family: var(--font-mono);
  color: var(--accent-blue);
}

/* Metrics styles */
.metric-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.cpu-metric .metric-value { color: var(--accent-blue); }
.mem-metric .metric-value { color: var(--accent-purple); }
.conn-metric .metric-value { color: var(--accent-green); }

/* Progress bar container */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50px;
  overflow: hidden;
  margin: 0.65rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--accent-blue), #80ffdb);
  transition: width 0.6s ease-out;
}

.mem-metric .progress-bar {
  background: linear-gradient(90deg, var(--accent-purple), #ff85a1);
}

.metric-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mem-details {
  display: flex;
  justify-content: flex-end;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-family: var(--font-mono);
}

.mem-details #mem-used {
  color: var(--text-main);
}

.divider {
  margin: 0 0.2rem;
  opacity: 0.4;
}

/* Connections Visual Ring */
.connections-visual {
  position: relative;
  width: 50px;
  height: 50px;
  margin: 0.25rem auto 0.75rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conn-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-green);
  z-index: 2;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--accent-green);
  border-radius: 50%;
  opacity: 0.5;
  animation: ripple 2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.pulse-ring.ring-2 {
  animation-delay: 1s;
}

@keyframes ripple {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

.button-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Footer Styling */
.footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sys-card { grid-column: span 2; }
  .syslogs-card { grid-column: span 2; }
}

@media (max-width: 650px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-tabs {
    width: 100%;
    justify-content: space-around;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .sys-card, .metric-card, .control-card, .syslogs-card {
    grid-column: span 1;
  }
  .battle-hud {
    grid-template-columns: repeat(2, 1fr);
  }
  .instructions-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================
   📷 戰場相機控制與縮放樣式
   ========================================== */
.camera-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.camera-control-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-main);
}

.cam-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-blue);
}

.camera-control-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Switch Toggle Slider */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.toggle-container input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 28px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  transition: var(--transition-smooth);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.toggle-container input:checked + .toggle-slider {
  background-color: rgba(0, 245, 212, 0.2);
  border-color: var(--accent-green);
}

.toggle-container input:checked + .toggle-slider::before {
  transform: translateX(12px);
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.toggle-label {
  font-size: 0.78rem;
  font-weight: 500;
}

/* Zoom Slider Group */
.zoom-slider-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zoom-icon-small {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}

.zoom-range-input {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.zoom-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 0 4px var(--accent-blue);
}

.zoom-value-display {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-blue);
  width: 32px;
  text-align: right;
  font-weight: 600;
}

/* ==========================================
   🔍 捏角即時預覽控制樣式
   ========================================== */
#previewCanvas {
  cursor: grab;
}

#previewCanvas:active {
  cursor: grabbing;
}

.preview-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.preview-zoom-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.preview-control-icon {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.preview-zoom-input {
  -webkit-appearance: none;
  flex-grow: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  outline: none;
}

.preview-zoom-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
}

.preview-instruction {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* ==========================================
   🎓 互動式新手引導樣式
   ========================================== */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
  transition: opacity 0.35s ease;
}

.tutorial-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Highlighted spotlight box */
.tutorial-highlight {
  position: absolute;
  z-index: 10000;
  border: 2px solid var(--accent-green);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65), 
              0 0 15px var(--accent-green),
              inset 0 0 10px rgba(0, 245, 212, 0.2);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.tutorial-card {
  position: absolute;
  z-index: 10001;
  background: rgba(16, 16, 25, 0.95);
  border: 1px solid var(--accent-green);
  border-radius: 14px;
  width: 320px;
  padding: 1.15rem;
  box-shadow: 0 10px 40px rgba(0, 245, 212, 0.15), 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  backdrop-filter: blur(15px);
  pointer-events: auto;
}

body.tutorial-active {
  overflow: hidden !important;
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}

.tutorial-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-green);
  text-shadow: 0 0 8px rgba(0, 245, 212, 0.4);
}

.tutorial-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.tutorial-close-btn:hover {
  color: var(--accent-red);
}

.tutorial-body {
  font-size: 0.82rem;
  color: #dfdfe6;
  line-height: 1.5;
}

.tutorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.tutorial-step-indicator {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tutorial-nav-buttons {
  display: flex;
  gap: 0.4rem;
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* ==========================================
   📺 全螢幕與地圖編輯器樣式
   ========================================== */

/* 全螢幕樣式 */
.canvas-card:fullscreen {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: #050508;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.canvas-card:fullscreen .canvas-wrapper {
  flex-grow: 1;
  width: 100%;
  max-width: 100vw;
  max-height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  border-radius: 12px;
  border: 1px solid rgba(0, 210, 255, 0.25);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.1);
  overflow: hidden;
}

.canvas-card:fullscreen #gameCanvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.canvas-card:fullscreen .camera-control-bar {
  width: 100%;
  max-width: 1000px;
  margin-top: 1rem;
  background: rgba(16, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.canvas-card:fullscreen .battle-hud {
  position: absolute;
  top: 2rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 1200px;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.canvas-card:fullscreen .battle-hud .hud-player-box {
  pointer-events: auto;
  background: rgba(16, 16, 28, 0.9);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

/* 地圖編輯器選單按鈕組與輸入框 */
.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.btn-group-vertical .btn {
  justify-content: flex-start;
  text-align: left;
  font-weight: 500;
  gap: 0.5rem;
}

.btn-group-vertical .btn.active {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.2);
}

.text-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.15);
}

/* ⚡ 快速自動配對等待 Overlay 樣式 */
.matchmaking-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20000;
  background: rgba(4, 4, 7, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.matchmaking-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.matchmaking-card {
  background: rgba(20, 20, 30, 0.85);
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 45px rgba(0, 245, 212, 0.15), 0 0 25px rgba(0, 0, 0, 0.8);
  width: 340px;
  padding: 2.25rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: matchmaking-pulse 2s infinite alternate;
}

@keyframes matchmaking-pulse {
  from { box-shadow: 0 15px 35px rgba(0, 245, 212, 0.1), 0 0 20px rgba(0, 0, 0, 0.8); }
  to { box-shadow: 0 15px 45px rgba(0, 245, 212, 0.25), 0 0 30px rgba(0, 0, 0, 0.9); }
}

.matchmaking-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, #fff 30%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.matchmaking-timer {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.matchmaking-timer span {
  color: var(--accent-green);
  font-weight: 700;
}

/* 雷達掃描視覺特效 */
.radar-scan {
  position: relative;
  width: 90px;
  height: 90px;
  border: 2px solid rgba(0, 245, 212, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.03) 0%, transparent 70%);
  overflow: hidden;
}

.radar-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(0, 245, 212, 0.08);
  border-radius: 50%;
  box-sizing: border-box;
}

.radar-circle.ring-2 {
  transform: scale(0.6);
  border-style: dashed;
}

.radar-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(to right, rgba(0, 245, 212, 0.8) 0%, transparent 90%);
  transform-origin: 0% 50%;
  animation: radar-sweep 2.8s linear infinite;
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-green);
  filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.8));
  animation: matchmaking-spin 1.8s ease-in-out infinite alternate;
  z-index: 10;
}

@keyframes matchmaking-spin {
  0% { transform: scale(1) rotate(-15deg); filter: drop-shadow(0 0 5px rgba(0, 245, 212, 0.5)); }
  100% { transform: scale(1.15) rotate(15deg); filter: drop-shadow(0 0 15px rgba(0, 245, 212, 0.9)); }
}

/* 👑 房主與準備狀態標章樣式 */
.badge-host {
  background: rgba(241, 196, 15, 0.12) !important;
  border: 1px solid rgba(241, 196, 15, 0.35) !important;
  color: var(--accent-yellow) !important;
  text-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-ready {
  background: rgba(0, 245, 212, 0.12) !important;
  border: 1px solid rgba(0, 245, 212, 0.35) !important;
  color: var(--accent-green) !important;
  text-shadow: 0 0 5px rgba(0, 245, 212, 0.5);
  font-weight: 700;
}

.badge-unready {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
}

/* 📱 手機虛擬控制按鈕樣式 */
.mobile-controls-overlay {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1.5rem;
  pointer-events: none;
  z-index: 20;
}

.mobile-controls-overlay.hidden {
  display: none !important;
}

.mobile-dir-keys, .mobile-action-keys {
  display: flex;
  gap: 1rem;
  pointer-events: auto;
}

.mbtn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(16, 16, 28, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.mbtn:active {
  background: rgba(0, 210, 255, 0.25);
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
  transform: scale(0.92);
}

.mbtn svg, .mbtn i {
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.mbtn-jump {
  width: 85px;
  height: 58px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  background: rgba(157, 78, 221, 0.45);
  border-color: rgba(157, 78, 221, 0.35);
}

.mbtn-jump:active {
  background: rgba(157, 78, 221, 0.75);
  border-color: var(--accent-purple);
  box-shadow: 0 0 18px rgba(157, 78, 221, 0.5);
}

/* 🗳️ 投票踢人系統 Overlay 樣式 */
.vote-kick-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20500;
  background: rgba(4, 4, 7, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.vote-kick-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.vote-kick-card {
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 0, 85, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 45px rgba(255, 0, 85, 0.15), 0 0 25px rgba(0, 0, 0, 0.8);
  width: 380px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: vote-kick-bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes vote-kick-bounce {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.vote-kick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.vote-kick-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vote-kick-title h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, #fff 40%, var(--accent-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.vote-kick-timer {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.vote-kick-body {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
}

.vote-kick-body strong {
  color: var(--accent-blue);
}

.vote-kick-progress {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vote-progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.vote-progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-green));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-progress-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: right;
}

.vote-kick-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* 踢人按鈕 (用於大廳就緒名冊項目內) */
.btn-vote-kick {
  background: rgba(255, 0, 85, 0.06);
  border: 1px solid rgba(255, 0, 85, 0.2);
  color: var(--accent-red);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition-smooth);
}

.btn-vote-kick:hover {
  background: rgba(255, 0, 85, 0.18);
  border-color: rgba(255, 0, 85, 0.5);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.15);
}


