/* Cód an Bheacháin - Stylesheet */
:root {
  --bee-yellow: #facc15;
  --bee-amber: #eab308;
  --bee-dark: #1e1b4b;
  --bee-stripe: #0f172a;
  --emerald: #10b981;
  --sky: #0ea5e9;
  --coral: #ef4444;
  --bg: #fefce8;
  --surface: #ffffff;
  --line: #fde047;
  --muted: #64748b;
  --text: #1e293b;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Lexend', system-ui, sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 10px 25px -5px rgba(234, 179, 8, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 3px solid var(--bee-amber);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.back-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: #fef08a;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: all 0.2s;
}
.back-link:hover { color: var(--bee-dark); background: var(--bee-yellow); }
.logo-icon {
  font-size: 2.2rem;
  background: #fef08a;
  border: 2px solid var(--bee-amber);
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #854d0e;
  line-height: 1.1;
}
.subtitle {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Header Stats */
.header-stats {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.stat-pill {
  background: #fef08a;
  border: 1px solid var(--bee-amber);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-label { color: #854d0e; font-weight: 600; }
.stat-val { color: #713f12; font-weight: 800; }
.ctrl-btn {
  background: var(--surface);
  border: 1px solid #ca8a04;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.ctrl-btn:hover { background: #fef9c3; }

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.2rem;
  width: 100%;
  flex: 1;
}

/* Theme Bar */
.theme-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.theme-label { font-weight: 800; font-size: 0.9rem; color: #854d0e; }
.theme-btn {
  background: var(--surface);
  border: 2px solid #fef08a;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: #713f12;
  cursor: pointer;
  transition: all 0.2s;
}
.theme-btn:hover { border-color: var(--bee-amber); background: #fef9c3; }
.theme-btn.active {
  background: var(--bee-amber);
  color: #451a03;
  border-color: #d97706;
}

/* Coding Arena Layout */
.coding-arena {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 950px) {
  .coding-arena { grid-template-columns: 1fr; }
}

/* 6x6 Grid Mat */
.grid-mat-wrapper {
  background: var(--surface);
  border: 3px solid #fde047;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.grid-mat {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  background: #f0fdf4;
  border: 4px solid #16a34a;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.06);
}

.mat-tile {
  border: 1px dashed rgba(22, 163, 74, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  position: relative;
  user-select: none;
}
.mat-tile.obstacle { background: #fee2e2; }
.mat-tile.flower-target { background: #fef9c3; animation: pulseTarget 1.5s infinite; }
@keyframes pulseTarget {
  0%, 100% { background: #fef9c3; }
  50% { background: #fef08a; }
}

/* Virtual Bee Sprite */
.bee-sprite {
  position: absolute;
  width: 16.666%;
  height: 16.666%;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.45s ease-out, left 0.45s ease-out;
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  pointer-events: none;
}

.mat-footer {
  margin-top: 1.2rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.target-objective-box {
  background: #fef9c3;
  border-left: 4px solid var(--bee-amber);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  flex: 1;
}
.obj-badge { font-size: 0.76rem; font-weight: 800; color: #854d0e; text-transform: uppercase; }
#objective-text { font-size: 0.92rem; font-weight: 700; color: #713f12; margin-top: 0.2rem; }
.secondary-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.secondary-btn:hover { background: #e2e8f0; color: var(--text); }

/* Console Wrapper */
.console-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Command Queue Strip */
.command-queue-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}
.queue-header h4 { font-size: 0.92rem; font-weight: 800; color: #854d0e; }
.queue-count { font-size: 0.78rem; font-weight: 800; color: var(--muted); }

.queue-strip {
  display: flex;
  gap: 0.5rem;
  min-height: 52px;
  background: #fefce8;
  border: 2px dashed #fde047;
  border-radius: 12px;
  padding: 0.5rem;
  overflow-x: auto;
  align-items: center;
}
.empty-queue-msg {
  font-size: 0.85rem;
  color: #a16207;
  font-style: italic;
  width: 100%;
  text-align: center;
}
.queue-card-pill {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  border: 2px solid #ca8a04;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: all 0.2s;
}
.queue-card-pill.executing {
  transform: scale(1.15);
  border-color: #16a34a;
  background: #dcfce7;
}

/* Chunky Bee-Bot Keypad */
.beebot-keypad {
  background: #fef08a;
  border: 4px solid var(--bee-amber);
  border-radius: 28px;
  padding: 1.8rem;
  box-shadow: 0 12px 24px rgba(180, 83, 9, 0.15), inset 0 2px 6px rgba(255,255,255,0.8);
}
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1rem;
  align-items: center;
  justify-items: center;
}
.empty-corner { width: 100%; height: 100%; }

.cmd-btn {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: #f8fafc;
  border: 3px solid #cbd5e1;
  box-shadow: 0 6px 0 #94a3b8, 0 8px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}
.cmd-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #94a3b8;
}
.cmd-btn .btn-arrow { font-size: 1.8rem; line-height: 1; }
.cmd-btn .btn-caption {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
}

.cmd-forward { background: #dbeafe; border-color: #60a5fa; box-shadow: 0 6px 0 #3b82f6; }
.cmd-left { background: #fed7aa; border-color: #fb923c; box-shadow: 0 6px 0 #ea580c; }
.cmd-right { background: #fed7aa; border-color: #fb923c; box-shadow: 0 6px 0 #ea580c; }
.cmd-back { background: #dbeafe; border-color: #60a5fa; box-shadow: 0 6px 0 #3b82f6; }
.cmd-clear { background: #fee2e2; border-color: #f87171; box-shadow: 0 6px 0 #dc2626; }
.cmd-pause { background: #f1f5f9; border-color: #cbd5e1; box-shadow: 0 6px 0 #94a3b8; }

/* The Famous Green Bee-Bot GO Button */
.go-circle-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: 4px solid #fff;
  box-shadow: 0 8px 0 #15803d, 0 10px 18px rgba(22, 163, 74, 0.4);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}
.go-circle-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #15803d;
}
.go-circle-btn .go-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.go-circle-btn .go-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: #bbf7d0;
}

/* Debug Tips Card */
.debug-tips-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}
.tip-head { font-size: 0.8rem; font-weight: 800; color: #854d0e; text-transform: uppercase; }
#debug-tip-text { font-size: 0.88rem; color: #713f12; margin-top: 0.25rem; line-height: 1.45; }
