#hive-sudoku-app {
  --hs-ivory: #f7fff8;
  --hs-grey: #3a526a;
  --hs-pink: #e03c7f;
  --hs-gold: #e8a94c;
  --hs-teal: #2f8f7a;
  --hs-plum: #6b4a7a;

  font-family: 'Quattrocento Sans', sans-serif;
  color: var(--hs-grey);
  display: flex;
  justify-content: center;
  padding: 24px 16px 60px;
}
#hive-sudoku-app * { box-sizing: border-box; }
#hive-sudoku-app .hs-wrap { width: 100%; max-width: 480px; position: relative; }

#hive-sudoku-app .hs-header { text-align: center; margin-bottom: 14px; }
#hive-sudoku-app .hs-logo { font-size: 32px; font-weight: 700; }
#hive-sudoku-app .hs-logo .hs-accent { color: var(--hs-pink); }
#hive-sudoku-app .hs-sub { font-size: 13px; opacity: 0.7; margin-top: 4px; }

#hive-sudoku-app .hs-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 12px;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  border: 1.5px solid #e5e5e5;
}
#hive-sudoku-app .hs-tab {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--hs-grey);
  transition: background 0.15s ease, color 0.15s ease;
}
#hive-sudoku-app .hs-tab.hs-active { background: var(--hs-grey); color: #fff; }

#hive-sudoku-app .hs-meta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 12.5px;
  flex-wrap: wrap;
}
#hive-sudoku-app .hs-meta-row .hs-meta-item { display: flex; align-items: center; gap: 5px; }
#hive-sudoku-app .hs-cal-btn {
  border: 1.5px solid var(--hs-grey);
  background: #fff;
  color: var(--hs-grey);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#hive-sudoku-app .hs-cal-btn:hover { background: var(--hs-grey); color: #fff; }

#hive-sudoku-app .hs-replay-banner {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--hs-plum);
  border-radius: 999px;
  padding: 4px 12px;
  display: inline-block;
  margin: 0 auto 10px;
}
#hive-sudoku-app .hs-replay-banner-row { text-align: center; }

#hive-sudoku-app .hs-board-wrap { display: flex; justify-content: center; margin: 12px 0 16px; position: relative; }

#hive-sudoku-app .hs-start-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(247,255,248,0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 10px;
  z-index: 5;
}
#hive-sudoku-app .hs-start-overlay button {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  background: var(--hs-pink);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(224,60,127,0.35);
}
#hive-sudoku-app .hs-start-overlay button:hover { background: #c02f6a; }
#hive-sudoku-app table.hs-board {
  border-collapse: collapse;
  background: #fff;
  border: 2.5px solid var(--hs-grey);
}
#hive-sudoku-app table.hs-board td {
  width: 42px;
  height: 42px;
  text-align: center;
  vertical-align: middle;
  border: 1px solid #d7ddda;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  color: var(--hs-grey);
  user-select: none;
}
#hive-sudoku-app table.hs-board.hs-size6 td { width: 52px; height: 52px; }
#hive-sudoku-app table.hs-board td.hs-given { color: var(--hs-grey); background: #f2f4f3; cursor: default; }
#hive-sudoku-app table.hs-board td.hs-peer { background: #eef2f1; }
#hive-sudoku-app table.hs-board td.hs-selected {
  background: #fbdcea;
  box-shadow: inset 0 0 0 3px var(--hs-pink);
  z-index: 1;
}
#hive-sudoku-app table.hs-board td.hs-conflict { color: var(--hs-pink); }
#hive-sudoku-app table.hs-board td.hs-filled-good { color: var(--hs-teal); }
#hive-sudoku-app table.hs-board td.hs-hint { color: var(--hs-gold); background: #fdf3e4; }

#hive-sudoku-app table.hs-board.hs-size9 td:nth-child(3n) { border-right: 2.5px solid var(--hs-grey); }
#hive-sudoku-app table.hs-board.hs-size9 tr:nth-child(3n) td { border-bottom: 2.5px solid var(--hs-grey); }
#hive-sudoku-app table.hs-board.hs-size6 td:nth-child(3n) { border-right: 2.5px solid var(--hs-grey); }
#hive-sudoku-app table.hs-board.hs-size6 tr:nth-child(2n) td { border-bottom: 2.5px solid var(--hs-grey); }

#hive-sudoku-app .hs-notes-grid {
  display: grid;
  width: 100%;
  height: 100%;
  font-size: 8.5px;
  font-weight: 700;
  color: #9aa7b0;
  line-height: 1;
}
#hive-sudoku-app .hs-notes-grid.hs-size9 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
#hive-sudoku-app .hs-notes-grid.hs-size6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
#hive-sudoku-app .hs-notes-grid span { display: flex; align-items: center; justify-content: center; }

#hive-sudoku-app .hs-pad { display: grid; gap: 8px; margin-bottom: 14px; }
#hive-sudoku-app .hs-pad.hs-size9 { grid-template-columns: repeat(5, 1fr); }
#hive-sudoku-app .hs-pad.hs-size6 { grid-template-columns: repeat(4, 1fr); }
#hive-sudoku-app .hs-pad button {
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 0;
  border-radius: 8px;
  border: 1.5px solid var(--hs-grey);
  background: #fff;
  color: var(--hs-grey);
  cursor: pointer;
}
#hive-sudoku-app .hs-pad button:hover { background: var(--hs-grey); color: #fff; }

#hive-sudoku-app .hs-toggle-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
#hive-sudoku-app button.hs-action {
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--hs-grey);
  background: transparent;
  color: var(--hs-grey);
  cursor: pointer;
}
#hive-sudoku-app button.hs-action:hover { background: var(--hs-grey); color: #fff; }
#hive-sudoku-app button.hs-action.hs-on { background: var(--hs-gold); color: #fff; border-color: var(--hs-gold); }
#hive-sudoku-app button.hs-action.hs-primary { background: var(--hs-pink); color: #fff; border-color: var(--hs-pink); }
#hive-sudoku-app button.hs-action.hs-primary:hover { background: #c02f6a; }
#hive-sudoku-app button.hs-action:disabled { opacity: 0.35; cursor: default; }
#hive-sudoku-app button.hs-action:disabled:hover { background: transparent; color: var(--hs-grey); }

#hive-sudoku-app .hs-msg { text-align: center; min-height: 20px; font-size: 13px; font-weight: 700; color: var(--hs-pink); margin-bottom: 4px; }

.hs-cal-popover {
  display: none;
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 14px;
  padding: 14px;
  width: 280px;
  box-shadow: 0 12px 28px rgba(58,82,106,0.18);
  z-index: 30;
}
.hs-cal-popover.hs-show { display: block; }
.hs-cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hs-cal-nav button {
  border: none; background: none; font-size: 16px; cursor: pointer; color: var(--hs-grey);
  padding: 2px 8px; font-weight: 700;
}
.hs-cal-nav button:disabled { opacity: 0.25; cursor: default; }
.hs-cal-month-label { font-weight: 700; font-size: 13px; }
.hs-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 11.5px;
}
.hs-cal-grid .hs-cal-wd { text-align: center; font-weight: 700; opacity: 0.55; padding-bottom: 4px; }
.hs-cal-day {
  text-align: center;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
}
.hs-cal-day:hover:not(.hs-disabled):not(.hs-empty) { background: #f2f4f3; }
.hs-cal-day.hs-disabled { opacity: 0.25; cursor: default; }
.hs-cal-day.hs-empty { cursor: default; }
.hs-cal-day.hs-today { border: 1.5px solid var(--hs-pink); font-weight: 700; }
.hs-cal-day.hs-active-date { background: var(--hs-grey); color: #fff; }
.hs-cal-day.hs-completed::after {
  content: "";
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--hs-teal);
}
.hs-cal-day.hs-active-date.hs-completed::after { background: #fff; }

.hs-modal-overlay {
  position: fixed; inset: 0; background: rgba(58,82,106,0.55);
  display: none; align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.hs-modal-overlay.hs-show { display: flex; }
.hs-modal {
  background: var(--hs-ivory, #f7fff8);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  font-family: 'Quattrocento Sans', sans-serif;
  color: var(--hs-grey, #3a526a);
}
.hs-modal h2 { margin: 0 0 6px; font-size: 24px; }
.hs-modal p { font-size: 14px; margin: 6px 0 16px; opacity: 0.85; }
.hs-modal .hs-streak-line { font-weight: 700; color: #e03c7f; }

@media (prefers-reduced-motion: reduce) {
  #hive-sudoku-app *, .hs-modal-overlay, .hs-cal-popover { transition: none !important; }
}
