/* ===== Lights Out — game-specific styles ===== */

.app {
  padding-bottom: 2rem;
}

/* ===== Grid ===== */
.lights-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px;
  background: #1a1a2e;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  margin: 0 auto;
  user-select: none;
}

/* ===== Light cells ===== */
.light-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  outline: none;
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.08s ease;
  background: #2c2c4a;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.light-cell:active {
  transform: scale(0.92);
}

/* OFF state */
.light-cell.off {
  background: #2c2c4a;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

/* ON state — glowing yellow */
.light-cell.on {
  background: radial-gradient(circle at 40% 35%, #fff7a0 0%, #f1c40f 40%, #e0a800 100%);
  box-shadow:
    0 0 8px 2px rgba(241, 196, 15, 0.6),
    0 0 20px 6px rgba(241, 196, 15, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.4);
}

/* Hint highlight */
.light-cell.hint {
  outline: 3px solid #2ecc71;
  outline-offset: 2px;
  animation: hint-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes hint-pulse {
  from { outline-color: #2ecc71; box-shadow: 0 0 8px 2px rgba(46,204,113,0.5); }
  to   { outline-color: #27ae60; box-shadow: 0 0 18px 6px rgba(46,204,113,0.8); }
}

/* Solve step highlight */
.light-cell.solve-step {
  outline: 3px solid #e74c3c;
  outline-offset: 2px;
  animation: solve-pulse 0.4s ease-in-out infinite alternate;
}

@keyframes solve-pulse {
  from { outline-color: #e74c3c; }
  to   { outline-color: #c0392b; }
}

/* ===== Action bar ===== */
.action-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.btn-hint {
  background: #27ae60;
  color: #fff;
}
.btn-hint:hover { background: #219a52; }

.btn-solve {
  background: #8e44ad;
  color: #fff;
}
.btn-solve:hover { background: #703888; }

/* ===== Win overlay ===== */
.lo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 20;
  backdrop-filter: blur(4px);
  animation: fade-in 0.3s ease;
}

.lo-overlay[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.lo-overlay-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 280px;
}

.lo-overlay-icon {
  font-size: 2.5rem;
}

.lo-overlay-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
}

.lo-overlay-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.lo-overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Position overlay relative to .app ===== */
.app {
  position: relative;
}

/* ===== Toolbar adjustments ===== */
.toolbar {
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Daily mode indicator ===== */
.daily-mode-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -4px;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

/* ===== Responsive ===== */
@media (max-width: 380px) {
  .lights-grid {
    gap: 6px;
    padding: 12px;
  }
}
