/* ==================== DESIGN TOKENS ==================== */
:root {
  --primary: #ff6b8b;
  --primary-hover: #e85d7a;
  --primary-light: rgba(255, 107, 139, 0.12);
  --primary-glow: rgba(255, 107, 139, 0.2);
  --primary-gradient: linear-gradient(135deg, #ff6b8b 0%, #ff8e53 100%);

  --accent: #f59e0b;
  --accent2: #2dd4bf;
  --success: #2dd4bf;
  --success-light: rgba(45, 212, 191, 0.12);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.12);

  --bg: #0b0b12;
  --bg-secondary: #13131d;
  --surface: #181825;
  --surface-hover: #1e1e2e;
  --surface-glass: rgba(24, 24, 37, 0.85);
  --surface-glass-strong: rgba(24, 24, 37, 0.95);
  --text: #e4e2e8;
  --text-secondary: #9b99a3;
  --text-tertiary: #5c5a66;
  --border: #242434;
  --border-light: #1c1c2a;
  --border-glass: rgba(255, 255, 255, 0.04);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 24px rgba(255, 107, 139, 0.12);
  --shadow-glow-intense: 0 0 40px rgba(255, 107, 139, 0.2);

  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-2xl: 0;
  --radius-full: 9999px;

  --transition: 0.2s cubic-bezier(0.2, 0, 0, 1);
  --transition-slow: 0.35s cubic-bezier(0.2, 0, 0, 1);

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --navbar-height: 64px;
  --blur-strength: 12px;
}

body.light-mode {
  --bg: #e3e5eb;
  --bg-secondary: #d9dbe2;
  --surface: #ffffff;
  --surface-hover: #f5f5f8;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --surface-glass-strong: rgba(255, 255, 255, 0.95);
  --text: #14141c;
  --text-secondary: #44424e;
  --text-tertiary: #787680;
  --border: #c8cad2;
  --border-light: #dddde5;
  --border-glass: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 24px rgba(255, 107, 139, 0.12);
  --shadow-glow-intense: 0 0 36px rgba(255, 107, 139, 0.2);
  --primary-light: rgba(255, 107, 139, 0.08);
  --primary-glow: rgba(255, 107, 139, 0.12);
}

body.light-mode::before {
  background:
    radial-gradient(ellipse 70% 50% at 20% 80%, rgba(0, 0, 0, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(0, 0, 0, 0.02) 0%, transparent 50%);
}

body.light-mode .hero-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
body.light-mode .info-value {
  background: #f2f3f7;
  border-color: var(--border);
}
body.light-mode code.info-value {
  color: #0f766e;
  background: #f0fdfa;
  border-color: #5eead4;
}
body.light-mode .panel-card,
body.light-mode .detail-card {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.light-mode .profile-section,
body.light-mode .profile-sidebar {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.light-mode .admin-btn {
  background: var(--surface);
  border-color: var(--border);
}
body.light-mode .admin-btn:hover {
  background: var(--bg-secondary);
}
body.light-mode .action-card {
  background: var(--surface);
}
body.light-mode .action-card:hover {
  background: #f0f1f5;
}
body.light-mode .info-card {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.light-mode .room-card {
  background: var(--surface);
}
body.light-mode .room-card:hover {
  box-shadow: var(--shadow);
}
body.light-mode .navbar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: var(--border);
}

/* ==================== ANIMATIONS ==================== */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--primary-glow);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

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

@keyframes slide-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== BASE ==================== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg) url('https://pic.chuzoux.top/pic?img=ua') center / cover fixed;
  background-blend-mode: overlay;
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  transition: color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  font-size: 15px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.15) 50%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

body.light-mode::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(255, 107, 139, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(255, 142, 83, 0.02) 0%, transparent 50%);
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-strength));
  -webkit-backdrop-filter: blur(var(--blur-strength));
  border-bottom: 1px solid var(--border-glass);
  z-index: 1000;
  transition: all var(--transition);
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-icon {
  flex-shrink: 0;
  display: block;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.navbar-nav {
  display: flex;
  gap: 1px;
}

.nav-item[data-page='admin'] {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.nav-item.active {
  color: #fff;
  background: var(--primary);
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.nav-item:hover .nav-icon {
  opacity: 0.8;
}
.nav-item.active .nav-icon {
  opacity: 1;
  color: #fff;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-switch {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.lang-switch:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

.theme-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.theme-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

.login-btn {
  background: var(--primary);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
}

.login-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.user-menu {
  position: relative;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: var(--transition);
}

.user-avatar:hover {
  border-color: var(--primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  min-width: 190px;
  display: none;
  overflow: hidden;
  animation: slide-in-right 0.15s ease;
  z-index: 1001;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  text-align: left;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

/* ==================== MOBILE MENU ==================== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px;
  gap: 4px;
  z-index: 1100;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-secondary);
}

.mobile-menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.mobile-menu-btn.open .mobile-menu-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-btn.open .mobile-menu-bar:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.open .mobile-menu-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1090;
  animation: fade-in 0.15s ease;
}

.mobile-menu-backdrop.show {
  display: block;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  z-index: 1100;
  transition: right 0.3s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-nav-drawer.show {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.mobile-nav-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.mobile-nav-close:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.mobile-nav-items {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
}

.mobile-nav-items .nav-item {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius);
}

/* ==================== AUTH MODAL ==================== */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  animation: fade-in 0.1s ease;
}

.auth-modal.show {
  display: flex;
}

.auth-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.auth-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: scale-in 0.12s ease;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.auth-form h2 {
  margin: 0 0 20px 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  background: var(--bg-secondary);
  color: var(--text);
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

.submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
}

.submit-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}
.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.error-msg {
  color: var(--danger);
  font-size: 0.76rem;
  margin-top: 8px;
  text-align: center;
  display: none;
}

.error-msg.show {
  display: block;
}

.error-message {
  color: var(--danger);
  font-size: 0.76rem;
  margin-top: 8px;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--danger-light);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
  position: relative;
  z-index: 1;
}

.page-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 32px 20px;
  animation: slide-in-up 0.25s ease;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
  background: var(--surface);
  padding: 72px 48px 48px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  z-index: 1;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto 72px;
}

.hero-eyebrow {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero-content h1 {
  margin: 0 0 12px;
  font-size: 2.8rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-desc {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}

.stat-card {
  background: var(--surface);
  padding: 40px 20px 48px;
  text-align: center;
  transition: background 0.2s;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.stat-card:hover {
  background: var(--surface-hover);
}

.stat-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 2.8rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ==================== DASHBOARD GRID ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.info-card {
  background: var(--surface);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info-card-header svg {
  color: var(--primary);
}

.info-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 0.64rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
  display: block;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

code.info-value {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent2);
  position: relative;
}

code.info-value::after {
  content: 'click to copy';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-sans);
  font-size: 0.6rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.15s;
}

code.info-value:hover {
  border-color: var(--accent2);
}
code.info-value:hover::after {
  opacity: 0.6;
}

.copyable {
  cursor: pointer;
  user-select: all;
  transition: border-color 0.15s;
}
.copyable:hover {
  border-color: var(--accent2);
}

/* ==================== ACTION GRID ==================== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  font-family: var(--font-sans);
  color: var(--text-secondary);
}

.action-card:hover {
  background: var(--surface-hover);
  color: var(--primary);
}
.action-icon {
  width: 20px;
  height: 20px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.action-card:hover .action-icon {
  opacity: 1;
}
.action-card span {
  font-size: 0.78rem;
  font-weight: 500;
}

/* ==================== ROOM LIST ==================== */
.room-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

.room-card:hover {
  border-color: rgba(255, 107, 139, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.room-card h2 {
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-info p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  gap: 8px;
}

.room-info span {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
  text-align: right;
}

.room-mode-tag {
  color: var(--accent2) !important;
  font-weight: 600 !important;
}
.locked-status {
  color: var(--danger) !important;
}
.unlocked-status {
  color: var(--accent2) !important;
}

.room-card-remote {
  border-left: 3px solid var(--primary);
}

.room-server-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 4px;
  vertical-align: middle;
}

.room-server-remote {
  background: rgba(255, 107, 139, 0.1);
  color: var(--primary);
}
.room-server-local {
  background: var(--success-light);
  color: var(--accent2);
}

/* ==================== PLAYER LIST ==================== */
.player-list-scroll {
  min-height: 180px;
  max-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
}
.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  transition: var(--transition);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  gap: 10px;
}

.player-item:hover {
  border-color: var(--border);
  background: var(--surface);
}

.player-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.player-info-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.player-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.player-name {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--primary);
  transition: var(--transition);
}

.player-name:hover {
  color: var(--primary-hover);
}

.name-prefix {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  text-transform: uppercase;
  margin-right: 5px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.prefix-owner {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}
.prefix-admin {
  background: var(--primary-light);
  color: var(--primary);
}
.prefix-player {
  background: rgba(91, 90, 102, 0.12);
  color: var(--text-tertiary);
}
.prefix-bot {
  background: rgba(91, 90, 102, 0.12);
  color: var(--text-tertiary);
}

.player-status {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.status-ready {
  background: var(--success-light);
  color: var(--accent2);
}
.status-not-ready {
  background: var(--danger-light);
  color: var(--danger);
}
.status-bot {
  background: rgba(91, 90, 102, 0.1);
  color: var(--text-tertiary);
}

.name-owner {
  color: var(--warning) !important;
  font-weight: 600 !important;
}
.name-member {
  color: var(--text) !important;
}
.name-bot {
  color: var(--text-tertiary) !important;
}

.kick-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(248, 113, 113, 0.15);
  background: var(--danger-light);
  color: var(--danger);
  font-family: var(--font-sans);
}

.kick-btn:hover {
  background: var(--danger);
  color: #fff;
}

/* ==================== ADMIN PANEL ==================== */
.admin-warning {
  background: var(--warning-light);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warning);
  font-weight: 500;
  font-size: 0.82rem;
}

.admin-panel-container {
  display: grid;
  gap: 18px;
}

.panel-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  overflow: hidden;
  padding: 0 20px 20px 20px;
}

.panel-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 0 0;
}

.panel-card-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.panel-card-header .card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.panel-card h2 {
  margin: 0 0 14px 0;
  padding-top: 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.panel-card-body {
  padding: 0;
}

.ban-add-section {
  background: var(--bg-secondary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.ban-add-section strong,
.ban-add-section h4 {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  font-weight: 600;
}

.ban-add-section h4 {
  margin-top: 0;
}

.ban-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ban-table th,
.ban-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.ban-table thead th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ban-table tbody tr:hover {
  background: var(--bg-secondary);
}
.ban-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.08);
}

.ban-table td {
  color: var(--text);
  vertical-align: middle;
}

.ban-table-container {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.ban-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .ban-columns {
    grid-template-columns: 1fr;
  }
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.action-group + .action-group {
  margin-top: 10px;
}

.action-group input,
.action-group select {
  flex: 1;
  min-width: 110px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}

.action-group input:focus,
.action-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.action-group input::placeholder {
  color: var(--text-tertiary);
}

.admin-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.admin-btn:hover {
  background: var(--bg-secondary);
}

.admin-btn.action-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.2);
}
.admin-btn.action-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.admin-btn.action-primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(255, 107, 139, 0.2);
}
.admin-btn.action-primary:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.admin-btn.action-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.2);
}
.admin-btn.action-warning:hover {
  background: var(--warning);
  color: #0d0d12;
  border-color: var(--warning);
}
.admin-btn.action-success {
  background: var(--success-light);
  color: var(--accent2);
  border-color: rgba(45, 212, 191, 0.2);
}
.admin-btn.action-success:hover {
  background: var(--accent2);
  color: #0d0d12;
  border-color: var(--accent2);
}

.system-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.system-info-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
}

.system-info-item:hover {
  border-color: rgba(255, 107, 139, 0.3);
  transform: translateY(-1px);
}

.system-info-item .label {
  font-size: 0.66rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 4px;
}

.system-info-item .value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--primary);
}

/* ==================== ROOM ANNOUNCEMENT / STATUS ==================== */
.room-announcement {
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  margin: 0 0 18px 0;
  border-radius: var(--radius);
  white-space: pre-line;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: var(--transition);
}

.connection-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.connection-status.connected {
  background: var(--success-light);
  color: var(--accent2);
}
.connection-status.connected::before {
  background: var(--accent2);
  animation: pulse-dot 2s ease-in-out infinite;
}

.connection-status.disconnected {
  background: var(--danger-light);
  color: var(--danger);
}
.connection-status.disconnected::before {
  background: var(--danger);
}

/* ==================== ANNOUNCEMENT POPUP (room.html) ==================== */
#announcement-popup {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

#announcement-popup.show {
  opacity: 1;
}

/* ==================== ROOM DETAIL PAGE (room.html) ==================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px;
  min-height: 100vh;
}

.container header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.container header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
}

#total-players {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

#total-players a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

#total-players a:hover {
  color: var(--primary-hover);
}

.details-grid {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 16px;
  align-items: start;
}

.left-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.center-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
}

.detail-card h3 {
  margin: 0 0 14px 0;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.detail-card p {
  margin: 6px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.detail-card p strong {
  color: var(--text);
  font-weight: 500;
}

/* Chart styles */
.chart-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-illustration img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  max-height: 200px;
}

.chart-details-box h4 {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.chart-details-box p {
  font-size: 0.78rem;
  margin: 3px 0;
}

/* Star ratings */
.star-filled {
  color: var(--warning);
}
.star-half {
  color: var(--warning);
  opacity: 0.5;
}
.star-empty {
  color: var(--border);
}

/* Uploader/Host info */
.uploader-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.uploader-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.uploader-text {
  min-width: 0;
}

.uploader-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.uploader-rks {
  margin: 2px 0;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.uploader-bio {
  margin: 3px 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.uploader-id {
  margin: 2px 0;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Message display */
.message-container {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message-item {
  padding: 5px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.message-item:last-child {
  border-bottom: none;
}

.msg-user {
  font-weight: 600;
  color: var(--primary);
  margin-right: 4px;
}
.msg-chat {
  color: var(--text);
}
.msg-system {
  color: var(--text-tertiary);
  font-style: italic;
}
.msg-ready {
  color: var(--accent2);
  font-weight: 600;
}
.msg-playing {
  color: var(--warning);
  font-weight: 600;
}

/* Results table */
.results-scroll {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.results-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
  color: var(--text);
}

.rank-1 {
  color: var(--warning) !important;
  font-weight: 700 !important;
}
.rank-2 {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}
.rank-3 {
  color: #d97706 !important;
  font-weight: 600 !important;
}

.score-val {
  font-weight: 600;
  color: var(--primary) !important;
}

/* Admin panel card in room */
.admin-panel-card {
  border-color: rgba(255, 107, 139, 0.15);
}

.admin-panel-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
}

.admin-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
}

.admin-input-row input {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
}

.admin-input-row input:focus {
  border-color: var(--primary);
}

.admin-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  padding-top: 4px;
}

/* Other rooms */
.other-rooms-scroll {
  max-height: 320px;
  overflow-y: auto;
}

.other-room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
  font-size: 0.8rem;
}

.other-room-item:hover {
  border-color: var(--border);
  background: var(--surface);
}

.other-room-remote {
  border-left: 2px solid var(--primary);
}

.other-room-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.other-room-count {
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
  margin-left: 6px;
}

.other-room-server-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 107, 139, 0.1);
  color: var(--primary);
  margin-left: 4px;
}

.refresh-rooms-btn {
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.refresh-rooms-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(255, 107, 139, 0.2);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border);
  width: 100%;
}

.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.3;
}
.empty-text {
  font-size: 0.88rem;
  font-weight: 500;
}

/* ==================== FOOTER ==================== */
.footer {
  text-align: center;
  padding: 28px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.78rem;
  margin-top: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  transition: var(--transition);
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.back-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.logout-icon {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 8px;
  transition: var(--transition);
}

.logout-icon:hover {
  color: var(--danger);
}

/* Server IP container */
.server-ip-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.server-ip-container:hover {
  border-color: var(--primary);
}

.server-ip-container code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

.copy-icon {
  font-size: 0.85rem;
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.theme-toggle-btn,
.lang-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  transition: var(--transition);
}

.theme-toggle-btn:hover,
.lang-toggle-btn:hover {
  border-color: var(--text-tertiary);
  color: var(--text);
}

/* ==================== ADMIN SECRET MODAL (room.html) ==================== */
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8000;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  animation: fade-in 0.15s ease;
}

.admin-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  animation: scale-in 0.12s ease;
}

.admin-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition);
}

.admin-modal-close:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.admin-modal-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
}

.admin-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

/* ==================== LOGIN CARD ==================== */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
  animation: scale-in 0.14s ease;
}

.login-card h2 {
  margin: 0 0 20px 0;
  font-size: 1.3rem;
  font-weight: 600;
  font-family: var(--font-display);
  text-align: center;
  color: var(--text);
}

.admin-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.admin-footer-server-ip {
  margin: 10px 0;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.admin-footer-server-ip span:last-child {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.captcha-container {
  margin-bottom: 14px;
  min-height: 50px;
}

/* ==================== PROFILE PAGE ==================== */
.profile-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.profile-sidebar {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
  position: sticky;
  top: calc(var(--navbar-height) + 32px);
  height: fit-content;
}

.profile-avatar-wrapper {
  position: relative;
  text-align: center;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  transition: var(--transition);
}

.profile-avatar:hover {
  border-color: var(--primary);
}

.profile-role-badge {
  position: absolute;
  bottom: 2px;
  right: 50%;
  transform: translateX(50%);
  background: var(--primary);
  color: #fff;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.profile-info {
  text-align: center;
  margin-bottom: 20px;
}

.profile-name {
  margin: 0 0 6px 0;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.profile-id,
.profile-email {
  margin: 3px 0;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.profile-id {
  font-family: var(--font-mono);
}

.profile-stats {
  display: flex;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.profile-stat-item {
  flex: 1;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--primary);
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-section {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
}

.profile-section h3 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-form .form-group {
  margin-bottom: 0;
}
.settings-form .form-group input {
  margin-bottom: 6px;
}
.settings-form .form-group input:last-child {
  margin-bottom: 0;
}

.session-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.info-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
}

.info-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  font-weight: 600;
}

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

.activity-list {
  min-height: 160px;
}

/* ==================== PANEL PAGE (panel.html) ==================== */
.ban-section {
  margin-bottom: 0;
}

.ban-section h3,
.ban-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px 0;
}

.room-selector-container {
  margin: 8px 0;
}

.select-all-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.select-all-row input[type='checkbox'] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

.room-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.room-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  user-select: none;
}

.room-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

.room-chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.room-chip small {
  color: var(--text-tertiary);
  font-size: 0.68rem;
}

/* ==================== PLAYERS STANDALONE ==================== */
#all-players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#all-players-list .player-item {
  margin-bottom: 2px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  .left-sidebar,
  .center-column,
  .right-sidebar {
    gap: 14px;
  }
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: none;
  }
  .brand-link {
    cursor: pointer;
  }
  .navbar-nav {
    display: none;
  }
  .navbar-container {
    padding: 0 12px;
  }
  .brand-name {
    font-size: 0.85rem;
  }
  .page-content {
    padding: 20px 12px;
  }
  .hero-section {
    padding: 40px 16px 0;
  }
  .hero-content {
    max-width: 100%;
    margin-bottom: 32px;
  }
  .hero-content h1 {
    font-size: 1.6rem;
  }
  .hero-desc {
    font-size: 0.82rem;
  }
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-value {
    font-size: 1.8rem;
  }
  .stat-card {
    padding: 18px 10px;
  }
  .stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .info-card {
    padding: 18px 16px;
  }
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .action-card {
    padding: 20px 8px;
    min-height: 72px;
  }
  .action-card span {
    font-size: 0.7rem;
  }
  .action-icon {
    width: 18px;
    height: 18px;
  }
  .room-list {
    grid-template-columns: 1fr;
  }
  .action-group {
    flex-direction: column;
    align-items: stretch;
  }
  .action-group input,
  .action-group select {
    min-width: 0;
  }
  .profile-container {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .profile-stats {
    justify-content: center;
  }
  .details-grid {
    grid-template-columns: 1fr;
  }
  .hero-pattern {
    background-size: 18px 18px;
  }
  .ban-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .system-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }
  .navbar-container {
    padding: 0 8px;
  }
  .brand-link {
    gap: 6px;
  }
  .brand-name {
    font-size: 0.78rem;
    display: block !important;
  }
  .brand-icon {
    width: 22px;
    height: 22px;
  }
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    padding: 7px;
  }
  .mobile-menu-bar {
    width: 16px;
  }
  .lang-switch,
  .theme-btn {
    padding: 6px 7px;
  }
  .login-btn {
    font-size: 0.72rem;
    padding: 7px 12px;
  }
  .page-content {
    padding: 14px 8px;
  }
  .container {
    padding: 12px 8px;
  }
  .hero-section {
    padding: 36px 16px 16px;
  }
  .hero-content {
    margin-bottom: 28px;
  }
  .hero-content h1 {
    font-size: 1.3rem;
  }
  .hero-eyebrow {
    font-size: 0.6rem;
  }
  .hero-desc {
    font-size: 0.76rem;
  }
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stat-value {
    font-size: 1.4rem;
  }
  .stat-card {
    padding: 16px 8px;
  }
  .stat-label {
    font-size: 0.52rem;
  }
  .stat-card-inner {
    gap: 4px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .info-card {
    padding: 16px 14px;
  }
  .info-card-header {
    font-size: 0.72rem;
    padding-bottom: 10px;
  }
  .info-row {
    gap: 8px;
  }
  .info-rows {
    gap: 10px;
  }
  .info-label {
    font-size: 0.6rem;
  }
  .info-value {
    font-size: 0.8rem;
    padding: 8px 10px;
  }
  code.info-value {
    font-size: 0.68rem;
  }
  code.info-value::after {
    display: none;
  }
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .action-card {
    padding: 18px 6px;
    gap: 6px;
    min-height: 72px;
  }
  .action-card span {
    font-size: 0.66rem;
  }
  .action-icon {
    width: 16px;
    height: 16px;
  }
  .room-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .room-card {
    padding: 14px;
  }
  .room-card h2 {
    font-size: 0.9rem;
  }
  .room-info p {
    font-size: 0.76rem;
  }
  .system-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .session-info-grid {
    grid-template-columns: 1fr;
  }
  .admin-panel-container {
    gap: 14px;
  }
  .panel-card {
    padding: 0 14px 14px 14px;
  }
  .panel-card h2 {
    margin: 0 0 10px 0;
    padding-top: 12px;
    font-size: 0.85rem;
  }
  .ban-add-section {
    padding: 10px 12px;
  }
  .admin-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-card {
    padding: 14px;
  }
  .details-grid {
    gap: 12px;
  }
  .left-sidebar,
  .center-column,
  .right-sidebar {
    min-width: 0;
  }
  .results-table td,
  .results-table th {
    padding: 6px 8px;
    font-size: 0.7rem;
  }
  .navbar-right {
    gap: 4px;
  }
  .navbar-right svg {
    width: 14px;
    height: 14px;
  }
  .auth-content {
    padding: 20px;
    width: 95%;
  }
  .auth-form h2 {
    font-size: 1.15rem;
  }
  .form-group input {
    font-size: 16px;
  }
  .login-card {
    padding: 20px;
  }
  .hero-pattern {
    background-size: 14px 14px;
    opacity: 0.03;
  }
  .footer {
    padding: 20px 10px;
    font-size: 0.7rem;
  }
  .page-header h1 {
    font-size: 1.2rem;
  }
  .player-item {
    padding: 10px 10px;
  }
  .player-name {
    font-size: 0.78rem;
  }
  .connection-status {
    font-size: 0.62rem;
    padding: 4px 10px;
  }
  .ban-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ban-table {
    font-size: 0.72rem;
  }
  .results-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .results-table {
    font-size: 0.7rem;
  }
}

@media (max-width: 400px) {
  .brand-name {
    font-size: 0.7rem;
  }
  .brand-icon {
    width: 20px;
    height: 20px;
  }
  .mobile-menu-btn {
    width: 34px;
    height: 34px;
    padding: 6px;
  }
  .login-btn {
    font-size: 0.66rem;
    padding: 6px 10px;
  }
  .hero-section {
    padding: 24px 8px 0;
  }
  .hero-content h1 {
    font-size: 1.15rem;
  }
  .hero-eyebrow {
    font-size: 0.55rem;
  }
  .hero-desc {
    font-size: 0.7rem;
  }
  .hero-content {
    margin-bottom: 18px;
  }
  .stat-value {
    font-size: 1.25rem;
  }
  .stat-label {
    font-size: 0.48rem;
    letter-spacing: 0.04em;
  }
  .stat-card {
    padding: 12px 4px;
  }
  .action-card {
    padding: 12px 2px;
    min-height: 56px;
  }
  .action-card span {
    font-size: 0.58rem;
  }
  .action-icon {
    width: 15px;
    height: 15px;
  }
  .navbar-container {
    gap: 2px;
  }
  .lang-switch,
  .theme-btn {
    padding: 5px 5px;
  }
  .lang-switch svg,
  .theme-btn svg {
    width: 14px;
    height: 14px;
  }
  .page-content {
    padding: 12px 6px;
  }
}
