:root {
  --bg-color: #1a1a1a;
  --text-color: #f4f4f5;
  --tier-s: #ff7f7f;
  --tier-a: #ffbf7f;
  --tier-b: #ffff7f;
  --tier-c: #7fff7f;
  --tier-d: #7fbfff;
  --panel-bg: #2d2d2d;
  --border-color: #3f3f46;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.room-info {
  background-color: var(--panel-bg);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-family: monospace;
  font-size: 1.125rem;
  letter-spacing: 0.1em;
}

/* Grid Styles */
.grid-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 3rem;
  background-color: #111;
  padding: 1rem;
  border-radius: 0.5rem;
}

.tier-row {
  display: flex;
  min-height: 120px;
  background-color: #1a1a1a;
  border: 1px solid var(--border-color);
}

.tier-label {
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  color: #111;
  border-right: 1px solid #111;
  flex-shrink: 0;
}

/* Hardcode some basic colors to match demo layout */
.tier-row[data-tier-id="tier_1"] .tier-label { background-color: var(--tier-s); }
.tier-row[data-tier-id="tier_2"] .tier-label { background-color: var(--tier-a); }
.tier-row[data-tier-id="tier_3"] .tier-label { background-color: var(--tier-b); }

.tier-slots {
  display: flex;
  flex: 1;
  overflow-x: auto;
}

.tier-slot {
  flex: 1;
  min-width: 100px;
  border-right: 1px dashed var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  transition: background-color 0.15s ease, outline 0.15s ease;
}

.tier-slot.drag-over {
  background-color: rgba(59, 130, 246, 0.15) !important;
  outline: 2px dashed #2563eb !important;
  outline-offset: -3px;
}

.tier-slot:last-child {
  border-right: none;
}

/* Card Styles */
.card {
  width: 100%;
  height: 100%;
  max-width: 100px;
  max-height: 140px;
  background-color: var(--panel-bg);
  border-radius: 0.25rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.card:active {
  cursor: grabbing;
}

.card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border: 1px solid #3b82f6;
}

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

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.25rem;
  font-size: 0.75rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-power {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  font-weight: bold;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Admin Panel */
.admin-panel {
  background-color: var(--panel-bg);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

.admin-panel.hidden {
  display: none !important;
}

.admin-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #a1a1aa;
}

.form-group input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border-color);
  background-color: #111;
  color: white;
}

.btn {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #2563eb;
}

/* Utilities */
.hidden {
  display: none !important;
}

.w-full {
  width: 100% !important;
}

/* Lobby Screen Styles */
.lobby-screen {
  max-width: 750px;
  margin: 4rem auto;
  padding: 2.5rem;
  background-color: var(--panel-bg);
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
}

.lobby-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.lobby-header h1 {
  font-size: 2.75rem;
  font-weight: 900;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.lobby-header p {
  color: #a1a1aa;
  font-size: 1.1rem;
}

/* Lobby Home Choices */
.lobby-welcome {
  text-align: center;
  margin-bottom: 2.5rem;
  color: #a1a1aa;
  font-size: 1rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.lobby-grid-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.choice-card {
  background-color: #1e1e20;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: inherit;
  width: 100%;
}

.choice-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
  background-color: #27272a;
}

.choice-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.choice-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.choice-desc {
  font-size: 0.875rem;
  color: #8f8f96;
  line-height: 1.4;
}

@media(max-width: 640px) {
  .lobby-grid-choices {
    grid-template-columns: 1fr;
  }
}

/* Modal Backdrop Overlay */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

/* Modal Inner Box */
.modal-card {
  width: 100%;
  max-width: 500px;
  background-color: #1e1e20;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

@keyframes modalFadeIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #3b82f6;
  text-align: center;
}

.modal-desc {
  font-size: 0.875rem;
  color: #a1a1aa;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Avatar Layout Details */
.avatar-section {
  margin-bottom: 1.5rem;
}

.avatar-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #a1a1aa;
  margin-bottom: 0.75rem;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2px;
  background-color: #111;
  object-fit: cover;
}

.avatar-option:hover {
  transform: scale(1.1);
  border-color: #52525b;
}

.avatar-option.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transform: scale(1.1);
}

/* Modal Button Controls */
.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-cancel {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: #a1a1aa;
}

.btn-cancel:hover {
  background-color: #27272a;
  color: white;
}

.btn-large {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-secondary {
  background-color: #10b981;
}

.btn-secondary:hover {
  background-color: #059669;
}

/* Footer & Version */
.app-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

#app-version {
  display: inline-block;
  font-family: monospace;
  font-size: 0.875rem;
  color: #71717a;
  background-color: var(--panel-bg);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

/* Active Players List Display */
.players-list-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background-color: var(--panel-bg);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  align-items: center;
}

.player-bubble {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #1a1a1a;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.player-bubble.me {
  border-color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.15);
}

.player-bubble img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.player-bubble .player-name {
  font-weight: 500;
}

.player-bubble .admin-badge {
  font-size: 0.75rem;
  background-color: #f59e0b;
  color: #111;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-left: 0.25rem;
}

/* Server Connection / Wakeup Overlay styling */
.connection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1.5rem;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.connection-overlay.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.connection-modal-card {
  width: 100%;
  max-width: 520px;
  background-color: #1a1a1c;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.status-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  display: inline-block;
}

.status-icon.spinner {
  animation: connectionSpin 2s linear infinite;
}

.status-icon.pulse {
  animation: connectionPulse 1.5s ease-in-out infinite;
}

@keyframes connectionSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes connectionPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.connection-modal-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #3b82f6;
  margin-bottom: 0.5rem;
  letter-spacing: 0.025em;
}

.connection-modal-card p {
  font-size: 0.925rem;
  color: #a1a1aa;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* Progress track - Simplified Thick Visual */
.progress-bar-container-thick {
  position: relative;
  width: 100%;
  height: 42px;
  background-color: #27272a;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}

.progress-bar-fill-thick {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.25, 1);
  z-index: 1;
}

.progress-bar-text {
  position: relative;
  z-index: 2;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  letter-spacing: 0.03em;
}

/* ==========================================
   Admin Edit Mode Styles & Card Bucket Panel
   ========================================== */

/* Card Bucket Panel Styling */
.card-bucket-panel {
  background-color: var(--panel-bg);
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1.5rem;
}

.card-bucket-panel.collapsed {
  border-color: rgba(255, 255, 255, 0.05);
}

.card-bucket-panel.editing-active {
  border-color: #3b82f6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

/* Header Trigger */
.admin-bucket-header {
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bucket-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bucket-icon {
  font-size: 1.5rem;
  animation: bucket-bounce 3s infinite ease-in-out;
}

@keyframes bucket-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.bucket-label-info {
  display: flex;
  flex-direction: column;
}

.bucket-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.card-count-badge {
  font-size: 0.75rem;
  color: #a1a1aa;
  font-family: monospace;
}

.btn-toggle-bucket {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s, transform 0.2s;
}

.btn-toggle-bucket:hover {
  color: #fff;
}

/* Collapsible Content wrapper */
.admin-bucket-content {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Styles */
.card-bucket-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.btn-add-card {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 600;
  padding: 0.65rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.btn-add-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
}

/* Preset Cards Selector */
.preset-images-container {
  margin-top: 0.5rem;
}

.preset-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717a;
  margin-bottom: 0.5rem;
}

.preset-images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.preset-card-option {
  background-color: #1a1a1c;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.4rem;
  font-size: 0.7rem;
  text-align: center;
  cursor: pointer;
  color: #a1a1aa;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-card-option:hover {
  border-color: #52525b;
  color: #fff;
  background-color: #242426;
}

.preset-card-option.selected {
  border-color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-weight: 600;
  box-shadow: inset 0 0 4px rgba(59, 130, 246, 0.3);
}

/* Inventory Showcase in Bucket */
.bucket-inventory-section {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.25rem;
}

.bucket-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.65rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Custom Scrollbar for Inventory */
.bucket-inventory-grid::-webkit-scrollbar {
  width: 4px;
}
.bucket-inventory-grid::-webkit-scrollbar-track {
  background: transparent;
}
.bucket-inventory-grid::-webkit-scrollbar-thumb {
  background-color: #3f3f46;
  border-radius: 9999px;
}

.bucket-inventory-item {
  background-color: #111;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s;
}

.bucket-inventory-item:hover {
  transform: translateY(-2px);
  border-color: rgb(71, 85, 105);
}

.bucket-inventory-item img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  background-color: #0b0b0c;
}

.bucket-item-txt {
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bucket-item-name {
  font-size: 0.65rem;
  font-weight: 500;
  color: #e4e4e7;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.no-cards-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.75rem;
  color: #71717a;
  padding: 1.5rem 0.5rem;
  border: 1px dashed var(--border-color);
  border-radius: 0.375rem;
}

.edit-mode-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: #111;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e4e4e7;
}

/* Premium Sliding Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #3f3f46;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
}

input:checked + .slider {
  background-color: #3b82f6;
}

input:focus + .slider {
  box-shadow: 0 0 1px #3b82f6;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Edit Mode Active Indicator */
.admin-actions-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeInDown 0.3s ease-out;
}

.edit-mode-active-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.375rem;
  color: #60a5fa;
  font-size: 0.825rem;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #3b82f6;
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: inherit;
  border-radius: inherit;
  animation: radar-pulse 1.5s infinite ease-out;
}

@keyframes radar-pulse {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* State Placeholder when Edit Mode is OFF */
.admin-state-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: 0.5rem;
  animation: fadeInUp 0.3s ease-out;
}

.state-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.state-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f4f4f5;
  margin-bottom: 0.5rem;
}

.state-desc {
  font-size: 0.8rem;
  color: #a1a1aa;
  line-height: 1.4;
}

/* General Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Roster Customizations */
.player-bubble .admin-badge.editing-badge {
  background-color: #3b82f6;
  color: white;
  animation: edit-badge-glimmer 2.5s infinite ease-in-out;
}

@keyframes edit-badge-glimmer {
  0%, 100% {
    background-color: #2563eb;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.4);
  }
  50% {
    background-color: #60a5fa;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.7);
  }
}

/* ==========================================
   Real-time Room Renaming styles
   ========================================== */
.theme-title-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-title-view {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.4rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: translateY(1px);
}

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

.theme-title-edit input {
  font-size: 1.25rem;
  font-weight: 700;
  background-color: #111113;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  outline: none;
  width: 100%;
  max-width: 250px;
  box-sizing: border-box;
}

.theme-title-edit input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.btn-save {
  background-color: #10b981;
  color: white;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save:hover {
  background-color: #059669;
}

.btn-cancel {
  background-color: #27272a;
  color: #e4e4e7;
  border: 1px solid var(--border-color);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background-color: #18181b;
  border-color: #3f3f46;
}

/* ==========================================
   Superadmin Dashboard Styling
   ========================================== */
.superadmin-dashboard-card {
  max-width: 850px !important;
  width: 100%;
}

.superadmin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.superadmin-header .modal-title {
  margin-bottom: 0;
  color: #ef4444; /* Differentiate from regular blue titles */
}

.superadmin-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: #121214;
  max-height: 380px;
  overflow-y: auto;
}

.superadmin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.superadmin-table th,
.superadmin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.superadmin-table th {
  background-color: #1a1a1c;
  color: #a1a1aa;
  font-weight: 600;
  font-family: monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 5;
}

.superadmin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.superadmin-table code {
  font-family: monospace;
  background-color: #27272a;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  color: #3b82f6;
  font-weight: 600;
}

.btn-delete-room {
  background-color: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-delete-room:hover {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Ensure the version button indicates it is actionable */
#app-version {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

#app-version:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.admin-tools-divider {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #71717a;
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  text-align: center;
}

/* ==========================================
   Interactive Edit Mode Table Layout Styles
   ========================================== */

.grid-super-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
}

.col-delete-row {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
}

.col-delete-left-spacer {
  width: 140px; /* 40px (minus button spacer) + 100px (tier label) = 140px */
  flex-shrink: 0;
}

.col-delete-buttons-wrapper {
  display: flex;
  flex: 1;
  height: 100%;
}

.btn-col-delete {
  flex: 1;
  min-width: 100px;
  height: 100%;
  background-color: transparent;
  color: transparent !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start; /* Align circle to touch the top bounds of the button */
  justify-content: center;
  transition: all 0.2s;
}

.btn-col-delete::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: 
    linear-gradient(#f87171, #f87171) no-repeat center / 10px 2px,
    rgba(239, 68, 68, 0.15);
  transition: all 0.2s;
  margin-top: 0; /* Placed at the very top of the 40px space, making it exactly 16px from container top */
}

.btn-col-delete:hover::after {
  border-color: #ef4444;
  background: 
    linear-gradient(#ffffff, #ffffff) no-repeat center / 10px 2px,
    #ef4444;
  transform: scale(1.1);
  transform-origin: center 12px;
}

.col-delete-right-spacer {
  width: 40px; /* Aligns with the add-column button width */
  flex-shrink: 0;
}

.grid-middle-section {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.grid-table-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.tier-row-wrapper-edit {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.btn-row-delete {
  width: 40px;
  background-color: transparent;
  color: transparent !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Align circle to touch the very left bounds of the button */
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-row-delete::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: 
    linear-gradient(#f87171, #f87171) no-repeat center / 10px 2px,
    rgba(239, 68, 68, 0.15);
  transition: all 0.2s;
  margin-left: 0; /* Placed at the very left of the 40px space, making it exactly 16px from the container left */
}

.btn-row-delete:hover::after {
  border-color: #ef4444;
  background: 
    linear-gradient(#ffffff, #ffffff) no-repeat center / 10px 2px,
    #ef4444;
  transform: scale(1.1);
  transform-origin: 12px center;
}

.btn-add-col-right {
  width: 40px;
  background-color: transparent;
  color: transparent !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-add-col-right::after {
  content: '';
  display: block;
  width: 18px;
  height: 54px;
  border-radius: 9px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: 
    linear-gradient(#34d399, #34d399) no-repeat center / 10px 2px,
    linear-gradient(#34d399, #34d399) no-repeat center / 2px 10px,
    rgba(16, 185, 129, 0.15);
  transition: all 0.2s;
  margin-left: 19px; /* Centered perfectly: 16px container padding + 3px spacer = 19px */
}

.btn-add-col-right:hover::after {
  border-color: #10b981;
  background: 
    linear-gradient(#ffffff, #ffffff) no-repeat center / 10px 2px,
    linear-gradient(#ffffff, #ffffff) no-repeat center / 2px 10px,
    #10b981;
  transform: scale(1.05);
  transform-origin: 28px center;
}

.btn-add-row-bottom {
  width: calc(100% - 40px);
  margin-left: 40px;
  height: 40px;
  background-color: transparent;
  color: transparent !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: all 0.2s;
}

.btn-add-row-bottom::after {
  content: '';
  display: block;
  width: 76px;
  height: 18px;
  border-radius: 9px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: 
    linear-gradient(#a78bfa, #a78bfa) no-repeat center / 10px 2px,
    linear-gradient(#a78bfa, #a78bfa) no-repeat center / 2px 10px,
    rgba(139, 92, 246, 0.15);
  transition: all 0.2s;
  margin-top: 19px; /* Centered perfectly: 16px container padding + 3px spacer = 19px */
}

.btn-add-row-bottom:hover::after {
  border-color: #8b5cf6;
  background: 
    linear-gradient(#ffffff, #ffffff) no-repeat center / 10px 2px,
    linear-gradient(#ffffff, #ffffff) no-repeat center / 2px 10px,
    #8b5cf6;
  transform: scale(1.05);
  transform-origin: center 28px;
}

.tier-cell-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: #111;
  font-weight: bold;
  font-size: 1.125rem;
  text-align: center;
  outline: none;
  font-family: inherit;
  padding: 0.25rem;
}

.tier-cell-input:focus {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 0.25rem;
}

/* Header administrative buttons and layouts */
.header-right-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-icon {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  padding: 0;
}

.btn-header-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #52525b;
  transform: translateY(-1px);
}

.btn-header-icon:active {
  transform: translateY(1px);
}

.btn-header-icon.active-edit {
  background-color: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.6);
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
  animation: key-pulse 2s infinite ease-in-out;
}

@keyframes key-pulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
    border-color: rgba(139, 92, 246, 1);
  }
}

