.lightsout-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  color: #fff;
}

.lightsout-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.lightsout-config {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.lightsout-config label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #111827;
}

.lightsout-config select,
.lightsout-config button,
#lightsoutPlayAgain,
.lightsout-modal-actions button,
.lightsout-score-step input {
  height: 44px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
  color: #fff;
  padding: 0 14px;
  font-size: 15px;
}

.lightsout-score-step input {
  background: #fff;
  color: #111827;
  width: 100%;
  box-sizing: border-box;
}

.lightsout-config button,
#lightsoutPlayAgain,
.lightsout-modal-actions button {
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.lightsout-config button:hover,
#lightsoutPlayAgain:hover,
.lightsout-modal-actions button:hover {
  transform: translateY(-1px);
  background: #1f2937;
}

#lightsoutCustom.is-active {
  background: #f59e0b;
  color: #000;
  border-color: #f59e0b;
}

.lightsout-stats {
  display: flex;
  gap: 18px;
  font-size: 15px;
  align-items: center;
  color: #111827;
}

.lightsout-stats span {
  color: #111827;
  font-weight: 600;
}

.lightsout-board-wrap {
  width: 100%;
  overflow: auto;
}

.lightsout-board {
  display: grid;
  gap: 8px;
  justify-content: center;
  align-content: center;
  padding: 14px;
  background: #0b132b;
  border-radius: 18px;
  min-height: 220px;
}

.lightsout-cell {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lightsout-cell:hover {
  transform: scale(1.03);
}

.lightsout-cell.is-off {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.lightsout-cell.is-on {
  background: #1f2937;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.lightsout-cell.is-hint {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.lightsout-message {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  min-height: 28px;
  color: #f59e0b;
}

.lightsout-message.msg-win {
  color: #22c55e;
}

.lightsout-message.msg-hint {
  color: #f59e0b;
}

.lightsout-actions-after-win {
  margin-top: 14px;
  text-align: center;
}

.lightsout-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.lightsout-modal.hidden {
  display: none;
}

.lightsout-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(6px);
}

.lightsout-modal-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 120px auto 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #111827;
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 24px 80px rgba(2, 6, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.lightsout-modal-content h3 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
}

.lightsout-modal-content p {
  margin: 0 0 24px;
  line-height: 1.6;
  font-size: 16px;
  color: #334155;
}

.lightsout-modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lightsout-modal-actions button {
  height: 48px;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lightsout-modal-actions button:hover {
  transform: translateY(-1px);
}

#lightsoutContinueCustom,
#lightsoutScoreNo,
#lightsoutScoreNoMore,
#lightsoutCancelScoreBtn {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

#lightsoutContinueCustom:hover,
#lightsoutScoreNo:hover,
#lightsoutScoreNoMore:hover,
#lightsoutCancelScoreBtn:hover {
  background: #cbd5e1;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.24);
}

#lightsoutForceStart,
#lightsoutScoreYes,
#lightsoutSaveScoreBtn {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.06);
}

#lightsoutForceStart:hover,
#lightsoutScoreYes:hover,
#lightsoutSaveScoreBtn:hover {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
}

.lightsout-score-modal-content {
  max-width: 560px;
}

.lightsout-score-step.hidden {
  display: none;
}

.lightsout-input-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.lightsout-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 20px;
  color: #334155;
  font-size: 14px;
}

.lightsout-checkbox-row input {
  width: auto;
  height: auto;
  margin-top: 2px;
}

.lightsout-leaderboard {
  margin-top: 50px;
}

.lightsout-leaderboard h2 {
  margin: 0 0 22px;
  color: #111827;
}

.lightsout-leaderboard-content {
  display: grid;
  gap: 18px;
}

.lightsout-leaderboard-empty {
  color: #475569;
  font-size: 15px;
}

.lightsout-leaderboard-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.lightsout-leaderboard-group h3 {
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 20px;
}

.lightsout-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.lightsout-leaderboard-table th,
.lightsout-leaderboard-table td {
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}

.lightsout-leaderboard-table th {
  color: #0f172a;
  font-weight: 700;
}

.lightsout-leaderboard-table tr:last-child td {
  border-bottom: 0;
}

.lightsout-rank {
  font-weight: 700;
  color: #0f172a;
}

@media (max-width: 640px) {
  .lightsout-cell {
    width: 44px;
    height: 44px;
  }

  .lightsout-modal-content {
    margin: 80px 16px 0;
    padding: 24px;
    border-radius: 20px;
  }

  .lightsout-modal-actions {
    flex-direction: column;
  }

  .lightsout-modal-actions button {
    width: 100%;
  }

  .lightsout-stats {
    flex-wrap: wrap;
  }

  .lightsout-leaderboard-table th,
  .lightsout-leaderboard-table td {
    font-size: 13px;
    padding: 8px 6px;
  }
}