:root {
  --bg-color: #121212;
  --card-bg: rgba(30, 30, 30, 0.6);
  --text-main: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent-primary: #3b82f6;
  /* Blue */
  --accent-secondary: #64748b;
  /* Slate */
  --accent-danger: #ef4444;
  /* Red */
  --accent-success: #22c55e;
  /* Green */
  --accent-warm: #f97316;
  /* Orange */
  --accent-cool: #06b6d4;
  /* Cyan */
  --accent-utility: #8b5cf6;
  /* Purple */
  --accent-warning: #eab308;
  /* Yellow */

  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.2);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  /* Remove tap highlight on mobile */
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 10px;
  /* Reduced from 20px */
}

.app-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Reduced from 20px */
}

/* Header */
.app-header {
  text-align: center;
  padding: 4px 0;
  /* Reduced from 10px */
}

.app-header h1 {
  font-weight: 700;
  font-size: 1.25rem;
  /* Reduced from 1.5rem */
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-header h1 i {
  color: var(--accent-primary);
}

/* Dashboard Grid */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Reduced from 24px */
}

/* Sections */
.control-group {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  /* Reduced from 20px */
  padding: 14px;
  /* Reduced from 20px */
  border: var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.control-group h2 {
  font-size: 0.9rem;
  /* Reduced from 1rem */
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  /* Reduced from 16px */
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Grids */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  /* Reduced from 12px */
}

.btn-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  /* Reduced from 12px */
}

.btn-grid.input-selector {
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 8px;
  /* Reduced from 12px */
}

/* Room Control Headers */
.room-control h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  /* Reduced from 8px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 4px;
  border-left: 3px solid var(--accent-secondary);
  line-height: 1;
}

/* Buttons container (form) */
form {
  display: contents;
  /* Allows buttons to participate in the grid directly */
}

/* Button Styles */
.btn-item {
  width: 100%;
  aspect-ratio: 2.2;
  /* Was 1.6 - made significantly shorter */
  border: none;
  border-radius: 12px;
  /* Reduced from 16px */
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  /* Reduced from 8px */

  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  /* Reduced from 0.9rem */
  color: white;

  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.btn-item i {
  font-size: 1.25rem;
  /* Reduced from 1.5rem */
  margin-bottom: 0;
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

.btn-warm {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.btn-cool {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-neutral {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-utility {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
  color: #000;
}

/* Interactive States */
.btn-item:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-item:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

/* Special Case Adjustments */
.input-selector .btn-item {
  aspect-ratio: 1.8;
  /* Slightly taller than others for better text fit if needed, but still reduced */
}

.input-selector .btn-item i {
  font-size: 1.1rem;
}

.input-selector .btn-item span {
  font-size: 0.75rem;
}

/* Mobile Adjustments */
@media (max-width: 380px) {
  .app-container {
    gap: 8px;
    padding: 5px;
  }

  .control-group {
    padding: 10px;
  }

  .btn-item {
    aspect-ratio: 2.0;
  }

  .btn-item i {
    font-size: 1.1rem;
  }

  .btn-item span {
    font-size: 0.75rem;
  }
}