/* ==========================================================================
   CRYPTIC CODEBREAKER - CYBERPUNK MASTERMIND LOGIC GAME STYLESHEET
   Touch-Friendly, Glassmorphic Matrix, Neon Feedback Beacons
   ========================================================================== */

.cb-arena-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

/* Top HUD Bar */
.cb-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.cb-hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-stat-pill {
  background: #111a2e;
  border: 1px solid #6366f1;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 700;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cb-stat-pill.timer {
  border-color: #f59e0b;
  color: #fcd34d;
}

/* Difficulty Selector */
.cb-diff-group {
  display: flex;
  background: #0f172a;
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid #334155;
  gap: 4px;
}

.cb-diff-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cb-diff-btn.active {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

/* Header Box */
.cb-header-box {
  text-align: center;
  margin-bottom: 16px;
}

.cb-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a5b4fc, #818cf8, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.cb-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
}

/* Main Matrix Board */
.cb-board-container {
  width: 100%;
  max-width: 580px;
  background: #0d1322;
  border: 2px solid #1e293b;
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.cb-board-row.current {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.cb-board-row.completed {
  border-color: #334155;
}

.cb-board-row.locked {
  opacity: 0.45;
}

.cb-row-num {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  width: 24px;
  font-family: 'Fira Code', monospace;
}

.cb-row-slots {
  display: flex;
  gap: 8px;
}

.cb-row-peg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px dashed #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cb-row-peg.filled {
  border: 2px solid var(--color-hex, #3b82f6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px var(--color-hex, #3b82f6);
}

/* How to Read Feedback Guide Box */
.cb-guide-box {
  width: 100%;
  max-width: 580px;
  background: #111a2e;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cb-guide-item {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cb-guide-badge {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
}

.cb-guide-badge.exact {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #86efac;
}

.cb-guide-badge.partial {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  color: #93c5fd;
}

.cb-guide-badge.miss {
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid #64748b;
  color: #94a3b8;
}

/* Feedback Badges Container per Row */
.cb-feedback-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 140px;
}

.cb-fb-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.cb-fb-pill.exact {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #86efac;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.cb-fb-pill.partial {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.cb-fb-pill.none {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  color: #64748b;
  font-size: 10.5px;
}

.cb-fb-pill.empty {
  color: #334155;
  font-size: 11px;
}
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Active Guess Construction Tray */
.cb-tray-container {
  width: 100%;
  max-width: 580px;
  background: #111a2e;
  border: 2px solid #3b82f6;
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

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

.cb-slot {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #0f172a;
  border: 2px dashed #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cb-slot.filled {
  border-style: solid;
  border-color: var(--color-hex, #3b82f6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px var(--color-hex, #3b82f6);
  transform: scale(1.05);
}

.cb-slot-emoji {
  font-size: 26px;
}

.cb-slot-num {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

/* Palette Bar */
.cb-palette-container {
  width: 100%;
  max-width: 580px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cb-palette-item {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #111a2e;
  border: 2px solid var(--color-hex, #334460);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}

.cb-palette-item:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px var(--color-hex, #3b82f6);
}

.cb-palette-emoji {
  font-size: 22px;
}

.cb-palette-name {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 1px;
}

.cb-palette-item.eliminated {
  opacity: 0.35;
  filter: grayscale(0.8);
}

.cb-scratch-x {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 900;
  color: #ef4444;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* Action Controls Bar */
.cb-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.cb-action-btn {
  padding: 11px 22px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  border: none;
  min-height: 48px;
  touch-action: manipulation;
}

.cb-action-btn.submit {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.cb-action-btn.submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.cb-action-btn.clear {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
}

.cb-action-btn.scratch {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fcd34d;
}

.cb-action-btn.scratch.active {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

.cb-action-btn.new {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
}

/* Win Modal Overlay */
.cb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.cb-modal-card {
  background: linear-gradient(145deg, #0f172a, #1e1b4b);
  border: 2px solid #818cf8;
  border-radius: 28px;
  padding: 32px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(99, 102, 241, 0.3);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cb-modal-icon {
  font-size: 54px;
  margin-bottom: 12px;
}

.cb-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: #818cf8;
  margin-bottom: 8px;
}

.cb-modal-secret {
  font-size: 24px;
  margin: 14px 0;
  letter-spacing: 6px;
}

.cb-modal-stats {
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.cb-modal-aura {
  font-size: 16px;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 20px;
}

.cb-modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.15s ease;
  min-height: 52px;
}
