/* ===============================
   Global
================================ */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #white;
  margin: 0;
  overflow-x: hidden;
  color: #2c3e50;
}

/* ===============================
   Shared page container
   (must match header width)
================================ */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===============================
   Sudoku layout
================================ */
.sudoku-wrapper {
  display: flex;
  justify-content: center;
  padding: 8px;
  width: 100%;
}

.sudoku {
  width: 100%;
  max-width: 100%;
}

/* Title */
.sudoku h3 {
  text-align: center;
  margin: 6px 0 10px;
  font-size: 20px;
}

/* ===============================
   Sudoku grid
================================ */
.sudoku table {
  border-collapse: collapse;
  margin: 0 auto 10px;
}

.sudoku td {
  border: 1px solid #9fa6ad;
  padding: 0;
}

/* GUARANTEED mobile-fit cells */
.sudoku input {
  width: calc((100vw - 16px) / 9);
  height: calc((100vw - 16px) / 9);
  max-width: 38px;
  max-height: 38px;

  font-size: clamp(13px, 3.5vw, 17px);
  text-align: center;
  border: none;
  background: #ffffff;
  cursor: pointer;
}

/* Given numbers */
.sudoku input:disabled {
  background: #f1f3f5;
  font-weight: bold;
  color: #374151;
  cursor: default;
}

/* 3×3 block borders */
.sudoku tr:nth-child(3n) td {
  border-bottom: 2px solid #111827;
}
.sudoku td:nth-child(3n) {
  border-right: 2px solid #111827;
}
.sudoku tr:first-child td {
  border-top: 2px solid #111827;
}
.sudoku td:first-child {
  border-left: 2px solid #111827;
}

/* ===============================
   Cell states
================================ */
.sudoku input.active {
  background: #e6f2ff;
  box-shadow: inset 0 0 0 2px #4da3ff;
}

.sudoku input.wrong {
  background: #ffe6e6;
}

/* ===============================
   Number keypad
================================ */
.sudoku .keypad {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 10px 0;
}

.sudoku .keypad button {
  width: calc((100vw - 16px) / 9);
  height: calc((100vw - 16px) / 9);
  max-width: 38px;
  max-height: 38px;

  font-size: clamp(13px, 3.5vw, 16px);
  border-radius: 8px;
  border: 1px solid #cfd4da;
  background: #f9fafb;
  color: #374151;
  font-weight: bold;
  cursor: pointer;
}

.sudoku .keypad button:hover {
  background: #eef2f7;
}

.sudoku .keypad button.active-num {
  background: linear-gradient(135deg, #4da3ff, #6cc1ff);
  color: #ffffff;
  border-color: #4da3ff;
}

/* ===============================
   Action buttons
================================ */
.sudoku .buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.sudoku .buttons button {
  width: 110px;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid #9fa6ad;
  background: #f4f6f8;
  color: #374151;
  cursor: pointer;
}

.sudoku .buttons button:first-child {
  background: #e8f5e9;
  border-color: #8bc34a;
}

.sudoku .buttons .danger {
  background: #ffe8e8;
  border-color: #ff9e9e;
}

/* ===============================
   SUCCESS PAGE
================================ */

/* Success message */
.success-message {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  margin: 32px auto 16px;
  text-align: center;

  font-size: 1.1em;
  font-weight: bold;
  color: #2e7d32;
}

.success-message .emoji {
  font-size: 2em;
}

/* Blue Facebook box */
.success-box-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
}

.success-box {
  background: #4468b0;
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 12px;
  text-align: center;

  max-width: 420px;
  width: fit-content;
}

/* Social icons row */
.social-wrapper {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.social-icons .icon {
  max-width: 32px;
  height: auto;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.social-icons a:hover .icon {
  transform: scale(1.1);
}