/* ==========================================================
   HIGH BEAM Challenge Portal - Global Styles
   ========================================================== */

:root {
  --size: 6;
  --accent-glow: #00d2ff;
  --flame-orange: #ff6b4a;
  --deep-navy: #080e1a;
  --card-bg: rgba(18, 28, 48, 0.7);
}

body {
  background: radial-gradient(circle at top center, #13223f 0%, #080e1a 60%, #030712 100%);
  color: #f1f5f9;
  font-family: 'Prompt', 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navbar */
.navbar-portal {
  background: rgba(8, 14, 26, 0.92);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand-portal {
  font-family: 'Space Grotesk', 'Prompt', sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.game-portal-card {
  background: rgba(18, 28, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.game-portal-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 210, 255, 0.5);
  box-shadow: 0 16px 35px rgba(0, 210, 255, 0.15);
  background: rgba(23, 37, 66, 0.75);
}

.game-badge-top {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.game-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

/* Buttons */
.btn-custom {
  border-radius: 0.75rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-custom:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.stat-pill {
  background: rgba(8, 14, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.progress-custom {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-custom {
  background: linear-gradient(90deg, #00d2ff, #10b981);
  transition: width 0.3s ease;
}

/* ==========================================================
   Knight's Tour Specific Styles
   ========================================================== */
.board-container {
  position: relative;
  max-width: min(85vmin, 470px);
  margin: 0 auto;
}

.chessboard {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  grid-template-columns: repeat(var(--size), 1fr);
  grid-template-rows: repeat(var(--size), 1fr);
  border: 3px solid #334155;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), inset 0 0 15px rgba(0, 0, 0, 0.5);
  background-color: #0b1329;
  position: relative;
  user-select: none;
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 0.5px solid rgba(255, 255, 255, 0.04);
}

.cell.light { background: linear-gradient(135deg, #2d3c59 0%, #1a253c 100%); }
.cell.dark { background: linear-gradient(135deg, #162035 0%, #0d1526 100%); }

.cell.highlight {
  cursor: pointer;
  position: relative;
  background: linear-gradient(135deg, #0a3d52 0%, #062b3a 100%) !important;
  box-shadow: inset 0 0 12px rgba(0, 210, 255, 0.6);
  animation: pulseHighlight 1.6s infinite ease-in-out;
}

.cell.highlight::after {
  content: '';
  position: absolute;
  width: 24%;
  height: 24%;
  background: var(--accent-glow);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow);
  transition: transform 0.2s ease;
}

.cell.highlight:hover { transform: scale(1.02); filter: brightness(1.2); }

@keyframes pulseHighlight {
  0%, 100% { box-shadow: inset 0 0 8px rgba(0, 210, 255, 0.4); }
  50% { box-shadow: inset 0 0 16px rgba(0, 210, 255, 0.8), 0 0 10px rgba(0, 210, 255, 0.3); }
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.85rem, 2.2vw, 1.25rem);
  font-weight: 700;
  color: #ffd166;
  background: rgba(8, 14, 26, 0.7);
  border-radius: 50%;
  width: 65%;
  height: 65%;
  border: 1px solid rgba(255, 209, 102, 0.35);
  animation: stepPop 0.25s ease-out;
}

@keyframes stepPop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.knight-piece {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1;
  color: #ff5252;
  text-shadow: 0 0 15px rgba(255, 82, 82, 0.85);
  animation: knightDrop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 5;
}

@keyframes knightDrop {
  0% { transform: translateY(-10px) scale(0.6); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.path-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ==========================================================
   Silo Grain Transfer Specific Styles (Agricultural Theme)
   ========================================================== */
.silo-stage {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  min-height: 270px;
  background: rgba(11, 19, 41, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 25px 10px 15px;
  margin-bottom: 1.5rem;
  gap: 8px;
}

.silo-unit {
  flex: 1;
  max-width: 31%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 8px 4px;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
}

.silo-unit:hover {
  background: rgba(0, 210, 255, 0.06);
  border-color: rgba(0, 210, 255, 0.4);
  transform: translateY(-2px);
}

.silo-unit.selected-silo {
  background: rgba(0, 210, 255, 0.12);
  border-color: #00d2ff;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.35);
}

.silo-roof {
  width: 70%;
  height: 12px;
  background: linear-gradient(180deg, #64748b 0%, #334155 100%);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  margin-bottom: 2px;
}

.silo-chamber {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.3) 50%, rgba(30, 41, 59, 0.5) 100%);
  border: 2px solid #475569;
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: 8px 4px 4px;
}

.silo-unit.selected-silo .silo-chamber {
  border-color: #00d2ff;
}

.silo-base {
  width: 85%;
  height: 10px;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-radius: 0 0 6px 6px;
  margin-top: 2px;
}

.grain-batch {
  height: 24px;
  border-radius: 5px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #080e1a;
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  white-space: nowrap;
}

/* Floating animation when selected */
.grain-batch.grain-lifted {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 210, 255, 0.6), 0 0 10px rgba(255, 255, 255, 0.8);
  filter: brightness(1.2);
  border: 1px solid #ffffff;
}

.grain-1 { width: 38%; background: linear-gradient(90deg, #ffd166, #ffbe0b); }
.grain-2 { width: 48%; background: linear-gradient(90deg, #fb8500, #ffb703); }
.grain-3 { width: 58%; background: linear-gradient(90deg, #06d6a0, #2ec4b6); color: #080e1a; }
.grain-4 { width: 68%; background: linear-gradient(90deg, #118ab2, #00b4d8); color: white; }
.grain-5 { width: 78%; background: linear-gradient(90deg, #3a86ff, #4361ee); color: white; }
.grain-6 { width: 88%; background: linear-gradient(90deg, #7209b7, #b5179e); color: white; }
.grain-7 { width: 98%; background: linear-gradient(90deg, #f72585, #e63946); color: white; }

/* Soft Engineering Box */
.quote-box {
  border-left: 3px solid #00d2ff;
  background: rgba(0, 210, 255, 0.05);
  padding: 1rem 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
}
