/* FlexFox CSS - Core styles for the Flexbox learning game */

:root {
  --ff-bg: #080c14;
  --ff-surface: #111827;
  --ff-border: #1f2937;
  --ff-accent: #6366f1;
  --ff-accent-light: rgba(99, 102, 241, 0.1);
  --ff-green: #10b981;
  --ff-green-light: rgba(16, 185, 129, 0.1);
  --ff-orange: #f59e0b;
  --ff-red: #ef4444;
  --ff-text: #f3f4f6;
  --ff-muted: #9ca3af;
  --ff-code-bg: #0d1117;
  --ff-code-text: #a5d6a7;
  --ff-code-muted: #636e8a;
}

.flexfox-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--ff-bg);
  color: var(--ff-text);
  font-family: 'Nunito', sans-serif;
}

/* HEADER */
.ff-header {
  background: var(--ff-surface);
  border-bottom: 2px solid var(--ff-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.ff-logo-title {
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  color: var(--ff-accent);
  line-height: 1;
}

.ff-logo-sub {
  font-size: 12px;
  color: var(--ff-muted);
  font-weight: 700;
  margin-top: 4px;
}

.ff-level-badge {
  margin-left: auto;
  background: var(--ff-accent-light);
  border: 2px solid var(--ff-accent);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 14px;
  color: var(--ff-accent);
  font-weight: 800;
}

/* LEVEL NAV */
.ff-level-nav {
  background: var(--ff-surface);
  border-bottom: 2px solid var(--ff-border);
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  overflow-x: auto;
}

.ff-nav-label {
  font-size: 13px;
  color: var(--ff-muted);
  font-weight: 800;
  margin-right: 8px;
  white-space: nowrap;
}

.ff-level-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--ff-border);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--ff-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ff-level-dot:hover {
  border-color: var(--ff-accent);
  color: var(--ff-accent);
  background: var(--ff-accent-light);
}

.ff-level-dot.active {
  background: var(--ff-accent);
  border-color: var(--ff-accent);
  color: #fff;
}

.ff-level-dot.done {
  background: var(--ff-green);
  border-color: var(--ff-green);
  color: #fff;
}

/* MAIN */
.ff-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* LEFT PANEL */
.ff-panel-left {
  width: 420px;
  min-width: 320px;
  background: var(--ff-surface);
  border-right: 2px solid var(--ff-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .ff-panel-left {
    width: 350px;
  }
}

.ff-mission {
  padding: 24px;
  border-bottom: 2px solid var(--ff-border);
}

.ff-mission-tag {
  font-size: 12px;
  color: var(--ff-orange);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ff-dot-pulse {
  width: 10px;
  height: 10px;
  background: var(--ff-orange);
  border-radius: 50%;
  display: inline-block;
  animation: ff-pulse 1.4s infinite;
}

@keyframes ff-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.ff-mission h2 {
  font-size: 20px;
  color: var(--ff-text);
  margin-bottom: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.ff-mission p {
  font-size: 15px;
  color: var(--ff-muted);
  line-height: 1.7;
}

.ff-prop-highlight {
  color: #a78bfa;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.ff-val-highlight {
  color: #fbbf24;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* EDITOR */
.ff-editor {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ff-editor-label {
  font-size: 13px;
  color: var(--ff-muted);
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ff-editor-label::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--ff-border);
  border-radius: 2px;
}

.ff-code-wrap {
  background: var(--ff-code-bg);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--ff-border);
}

.ff-code-prefix {
  padding: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: var(--ff-code-muted);
  border-bottom: 1px solid var(--ff-border);
  line-height: 1.8;
  white-space: pre;
}

.ff-code-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: var(--ff-code-text);
  caret-color: #fff;
  line-height: 1.8;
  resize: none;
  min-height: 90px;
}

.ff-code-input::placeholder {
  color: #3d4a6a;
}

.ff-code-suffix {
  padding: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: var(--ff-code-muted);
  border-top: 1px solid var(--ff-border);
  line-height: 1.8;
}

.ff-error-msg {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--ff-red);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ff-red);
  font-weight: 700;
  line-height: 1.5;
}

.ff-hint-box {
  margin-top: 12px;
  padding: 14px 18px;
  background: rgba(167, 139, 250, 0.1);
  border: 2px solid #8b5cf6;
  border-radius: 12px;
  font-size: 14px;
  color: #a78bfa;
  line-height: 1.8;
  font-weight: 600;
}

.ff-hint-box code {
  font-family: 'Space Mono', monospace;
  background: rgba(167, 139, 250, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 13px;
}

.ff-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.ff-btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid var(--ff-border);
  background: var(--ff-surface);
  color: var(--ff-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ff-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ff-btn-primary {
  background: var(--ff-accent);
  border-color: var(--ff-accent);
  color: #fff;
}

.ff-btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.ff-btn-hint {
  border-color: #8b5cf6;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.05);
}

.ff-btn-hint:hover {
  background: rgba(139, 92, 246, 0.1);
}

.ff-btn-reset {
  color: var(--ff-muted);
}

.ff-btn-reset:hover {
  border-color: var(--ff-red);
  color: var(--ff-red);
  background: rgba(239, 68, 68, 0.05);
}

.ff-shortcut-tip {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ff-muted);
  text-align: center;
}

/* RIGHT PANEL */
.ff-panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d111a;
}

.ff-scene-header {
  padding: 14px 24px;
  font-size: 13px;
  color: var(--ff-muted);
  font-weight: 700;
  border-bottom: 2px solid var(--ff-border);
  flex-shrink: 0;
  background: var(--ff-surface);
}

.ff-scene {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow-y: auto;
}

.ff-section-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CAJAS CONTENEDOR */
.ff-play-area {
  background: #111827;
  border: 2px solid var(--ff-border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ff-play-area.goal {
  border-color: var(--ff-green);
  background: rgba(16, 185, 129, 0.05);
}

.ff-area-tag {
  position: absolute;
  top: -12px;
  left: 20px;
  padding: 2px 12px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ff-goal .ff-area-tag {
  background: #064e3b;
  border-color: var(--ff-green);
  color: white;
}

.ff-play-inner {
  display: flex;
  gap: 12px;
  min-height: 120px;
  transition: all 0.35s ease;
}

/* CAJAS */
.ff-caja {
  min-width: 80px;
  min-height: 80px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  padding: 8px;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ff-caja span {
  font-size: 10px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ff-caja-1 { background: #fbbf24; color: #78350f; }
.ff-caja-2 { background: #60a5fa; color: #1e3a5f; }
.ff-caja-3 { background: #f87171; color: #7f1d1d; }
.ff-caja-4 { background: #34d399; color: #064e3b; }
.ff-caja-5 { background: #a78bfa; color: #3b0764; }

.ff-caja.goal-item {
  background: transparent !important;
  border: 3px dashed rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.ff-caja-1.goal-item { border-color: rgba(251, 191, 36, 0.5); color: rgba(251, 191, 36, 0.8); }
.ff-caja-2.goal-item { border-color: rgba(96, 165, 250, 0.5); color: rgba(96, 165, 250, 0.8); }
.ff-caja-3.goal-item { border-color: rgba(248, 113, 113, 0.5); color: rgba(248, 113, 113, 0.8); }
.ff-caja-4.goal-item { border-color: rgba(52, 211, 153, 0.5); color: rgba(52, 211, 153, 0.8); }
.ff-caja-5.goal-item { border-color: rgba(167, 139, 250, 0.5); color: rgba(167, 139, 250, 0.8); }

/* OVERLAYS */
.ff-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 5, 15, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ff-card {
  background: var(--ff-surface);
  border: 2px solid var(--ff-border);
  border-radius: 28px;
  padding: 48px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ff-card h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 28px;
  margin-bottom: 12px;
  color: #fff;
}

.ff-card p {
  color: var(--ff-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.ff-card-success { border-color: var(--ff-green); }
.ff-card-success h2 { color: var(--ff-green); }

.ff-trophy {
  font-size: 80px;
  margin-bottom: 24px;
  display: block;
}

.ff-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.ff-skill-tag {
  background: var(--ff-accent-light);
  border: 2px solid var(--ff-accent);
  color: var(--ff-accent);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 800;
}

/* SCROLLBAR */
.ff-main *::-webkit-scrollbar { width: 10px; }
.ff-main *::-webkit-scrollbar-track { background: transparent; }
.ff-main *::-webkit-scrollbar-thumb {
  background: var(--ff-border);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.ff-main *::-webkit-scrollbar-thumb:hover { background-color: var(--ff-muted); }
