:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #10192e;
  --bg-card: rgba(18, 28, 51, 0.75);
  --border-color: rgba(66, 99, 158, 0.25);
  --border-highlight: rgba(79, 140, 255, 0.5);
  --text-main: #f0f4fc;
  --text-muted: #8ca0c3;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  
  /* Cube Facet Colors */
  --cube-white: #f8fafc;
  --cube-yellow: #facc15;
  --cube-green: #22c55e;
  --cube-blue: #3b82f6;
  --cube-orange: #f97316;
  --cube-red: #ef4444;
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Ambient glow */
.background-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #2563eb, transparent);
  top: -100px;
  left: -100px;
}
.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #06b6d4, transparent);
  bottom: -150px;
  right: -100px;
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 15, 29, 0.8);
  backdrop-filter: blur(16px);
  padding: 1.25rem 2rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.badge-mono {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Layout */
.main-layout {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  flex: 1;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}
.card:hover {
  border-color: var(--border-highlight);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Cube 2D Net */
.cube-net-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.net-grid {
  display: grid;
  grid-template-areas:
    ". U . ."
    "L F R B"
    ". D . .";
  grid-template-columns: repeat(4, 108px);
  grid-template-rows: repeat(3, auto);
  gap: 12px;
  justify-content: center;
  align-items: start;
}

#face-U { grid-area: U; }
#face-L { grid-area: L; }
#face-F { grid-area: F; }
#face-R { grid-area: R; }
#face-B { grid-area: B; }
#face-D { grid-area: D; }

.face-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 108px;
}

.face-label {
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.face-tag {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 700;
}

.face-grid {
  width: 96px;
  height: 96px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
  background: #000000;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.facet {
  border-radius: 2px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.facet:hover {
  transform: scale(1.15);
  z-index: 2;
  filter: brightness(1.2);
}

/* Facet colors */
.color-white  { background-color: var(--cube-white); }
.color-yellow { background-color: var(--cube-yellow); }
.color-green  { background-color: var(--cube-green); }
.color-blue   { background-color: var(--cube-blue); }
.color-orange { background-color: var(--cube-orange); }
.color-red    { background-color: var(--cube-red); }

/* Cube Controls */
.cube-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.controls-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  border-radius: 6px;
}

.btn-move {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 38px;
  text-align: center;
}
.btn-move:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-move:active {
  transform: translateY(1px);
}

.btn-wide {
  min-width: 44px;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.25);
  color: #a5f3fc;
}
.btn-wide:hover {
  background: rgba(6, 182, 212, 0.3);
  border-color: #06b6d4;
  color: #ffffff;
}

/* Cube Actions */
.cube-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.cube-state-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.cube-state-badge.scrambled {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.btn {
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* History */
.moves-history {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  color: #93c5fd;
  min-height: 50px;
  word-break: break-all;
}

/* Status Grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.stat-item {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #ffffff;
}

.status-indicator {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.status-indicator.live {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Roadmap */
.phase-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.phase-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}
.phase-item.completed {
  border-color: rgba(16, 185, 129, 0.4);
}
.phase-item.completed .phase-badge {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-color: #10b981;
}
.phase-item.active {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(37, 99, 235, 0.1);
}
.phase-item.active .phase-badge {
  background: #2563eb;
  color: #ffffff;
}
.phase-item.pending {
  opacity: 0.65;
}
.phase-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  flex-shrink: 0;
}
.phase-info h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.15rem;
}
.phase-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Verifier Box */
.verifier-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.verifier-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.text-success { color: #34d399; }
.text-info { color: #60a5fa; }

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}
