/* ==============================================================================
   MaidKids Master Controller UI - Modern Dark Glassmorphism
   Crafted & Engineered by MaidDev
   ============================================================================== */

:root {
  --bg-primary: #080B11;
  --bg-secondary: #0F1420;
  --bg-tertiary: #171E2F;
  --card-bg: rgba(23, 30, 47, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(0, 240, 255, 0.35);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-cyan: #00F0FF;
  --accent-blue: #3B82F6;
  --accent-purple: #8B5CF6;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-glow: 0 0 25px rgba(0, 240, 255, 0.15);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header & Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(15, 20, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-box, .logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #040814;
  box-shadow: var(--shadow-glow);
}

.logo-box svg, .logo-icon svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #FFFFFF, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  -webkit-text-fill-color: white;
}

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

.brand-credits strong {
  color: var(--accent-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.status-dot.pulse {
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #040814;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #FB7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Main Layout */
.main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sidebar-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.counter-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.device-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-2px);
  background: rgba(30, 41, 65, 0.8);
}

.device-card.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

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

.device-card-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.device-status-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.device-status-badge.online {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.device-status-badge.offline {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-rose);
}

.device-card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state small {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
}

.empty-state code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--accent-cyan);
}

.sidebar-footer {
  margin-top: 20px;
}

.credits-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.03);
  border: 1px dashed rgba(0, 240, 255, 0.2);
}

.dev-tag {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.credits-card p {
  font-size: 0.78rem;
}

/* Controller Viewport Area */
.controller-area {
  padding: 24px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.device-meta h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.device-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.viewport-wrapper {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

/* Phone Mockup Screen */
.screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.phone-frame {
  width: 340px;
  height: 680px;
  background: #020408;
  border-radius: 44px;
  border: 8px solid #1E293B;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.camera-punch {
  position: absolute;
  top: 12px;
  width: 14px;
  height: 14px;
  background: #0F172A;
  border-radius: 50%;
  z-index: 50;
  border: 1px solid rgba(255,255,255,0.1);
}

.screen-content {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  cursor: crosshair;
}

#remoteCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.stream-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 17, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  z-index: 30;
  transition: var(--transition);
}

.stream-idle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stream-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.touch-indicator {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.4);
  border: 2px solid var(--accent-cyan);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
  opacity: 0;
}

.touch-indicator.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.screen-controls-bar {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.touch-mode-badge {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Inspector Panels */
.inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
}

.log-card {
  flex: 1;
}

.log-stream {
  height: 220px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  padding: 12px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  color: var(--text-secondary);
}

.log-entry.system { color: var(--accent-cyan); }
.log-entry.command { color: var(--accent-amber); }
.log-entry.success { color: var(--accent-emerald); }
.log-entry.danger { color: var(--accent-rose); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-large {
  max-width: 780px;
}

.modal-xl {
  max-width: 1060px;
  width: 95%;
}

.modal-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-table-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Operation Tabs */
.table-op-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.op-tab {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.op-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.op-tab.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* Table Toolbar & Chips */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-chips-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-chip {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

/* 10x10 Comprehensive Matrix Grid */
.comprehensive-matrix-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.matrix-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.matrix-cell:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.08);
  transform: translateY(-2px);
}

.matrix-cell.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.matrix-cell .cell-eq {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.matrix-cell .cell-ans {
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.modal-footer-spaced {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selected-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.selected-counter strong {
  color: var(--accent-cyan);
  font-size: 1rem;
}

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

.text-sm {
  font-size: 0.8rem;
  line-height: 1.4;
}

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

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-close:hover {
  color: var(--text-primary);
}

/* Config Modal Sections */
.config-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Switch Toggle Slider */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  transition: .3s;
  border-radius: 34px;
}

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

input:checked + .switch-slider {
  background-color: var(--accent-emerald);
}

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

.toggle-label-text strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toggle-label-text p {
  font-size: 0.75rem;
}

/* Radio Cards Grid */
.radio-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.radio-card {
  position: relative;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
}

.radio-card:has(input:checked) {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.radio-card-content strong {
  font-size: 0.82rem;
  display: block;
  margin-bottom: 4px;
}

.radio-card-content p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Interactive Question Matrix Grid */
.matrix-subject-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.matrix-pill {
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.matrix-pill.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.interactive-question-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
}

.matrix-item-card {
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.matrix-item-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.06);
}

.matrix-item-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.matrix-eq {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.matrix-ans {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* 2FA PIN Display Box */
.pin-display-box {
  background: rgba(0, 240, 255, 0.05);
  border: 2px dashed rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.pin-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
}

.pin-digits {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #FFFFFF;
  text-shadow: 0 0 15px var(--accent-cyan);
}

.countdown-circle {
  font-size: 0.75rem;
  color: var(--accent-amber);
  font-weight: 600;
}

/* ==============================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS (Smartphones, Tablets & Desktops)
   ============================================================================== */

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 280px 1fr;
  }
  .viewport-wrapper {
    grid-template-columns: 360px 1fr;
    gap: 16px;
  }
  .phone-frame {
    width: 320px;
    height: 640px;
  }
}

@media (max-width: 860px) {
  .app-container {
    height: auto;
    min-height: 100vh;
  }

  .main-layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
    height: auto;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    max-height: 280px;
    overflow-y: auto;
    padding: 16px;
  }

  .top-nav {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .controller-area {
    padding: 16px;
    overflow: visible;
    height: auto;
  }

  .device-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .control-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }

  .control-actions .btn {
    justify-content: center;
    width: 100%;
  }

  .viewport-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .screen-container {
    width: 100%;
    max-width: 360px;
  }

  .telemetry-column {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Modals on Mobile */
  .modal-card {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    padding: 16px;
    margin: 10px;
    overflow-y: auto;
  }

  .modal-xl {
    max-width: 95vw;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding: 10px 12px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-credits {
    font-size: 0.68rem;
  }

  .server-status {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .controller-area {
    padding: 10px;
    gap: 14px;
  }

  .device-header {
    padding: 12px;
  }

  .device-meta h1 {
    font-size: 1.05rem;
  }

  .phone-frame {
    width: 100%;
    max-width: 320px;
    height: 560px;
    border-radius: 36px;
    border-width: 6px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .remote-nav-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .remote-nav-bar .btn {
    padding: 8px 4px;
    font-size: 0.72rem;
    justify-content: center;
  }

  .remote-text-bar {
    flex-direction: column;
    gap: 6px;
  }

  .remote-text-bar input {
    width: 100%;
  }

  .remote-text-bar button {
    width: 100%;
    justify-content: center;
  }

  .pin-digits {
    font-size: 2rem;
  }
}
