/* One-time first-game tutorial: a small 6×6 win before the player enters the full world. */
.starter-sudoku-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(1, 13, 25, .76);
  backdrop-filter: blur(8px);
}
.starter-sudoku-card {
  width: min(530px, 100%);
  max-height: min(830px, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 26px;
  border: 1px solid rgba(246, 204, 84, .72);
  border-radius: 22px;
  background: radial-gradient(circle at 50% 0, rgba(53, 135, 135, .2), transparent 36%), linear-gradient(155deg, #092b3b, #041a2c 72%);
  box-shadow: 0 26px 72px rgba(0, 0, 0, .52), inset 0 1px rgba(255, 255, 255, .11);
  color: #dceff0;
  text-align: center;
}
.starter-sudoku-kicker {
  margin: 0 0 8px;
  color: #f7d56f;
  font-size: .69rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.starter-sudoku-card h2 {
  margin: 0;
  color: #fff1be;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  line-height: 1.02;
}
.starter-sudoku-intro,
.starter-sudoku-victory-copy {
  max-width: 29rem;
  margin: 11px auto 0;
  color: #c3dadd;
  font-size: .82rem;
  line-height: 1.46;
}
.starter-sudoku-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(121, 214, 205, .35);
  border-radius: 10px;
  background: rgba(8, 58, 67, .46);
  color: #b9dcdb;
  font-size: .72rem;
  font-weight: 800;
}
.starter-sudoku-progress b { color: #ffe28b; }
.starter-sudoku-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: min(348px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid #f3d778;
  border-radius: 12px;
  background: #e6f0ec;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}
.starter-sudoku-cell {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid rgba(20, 63, 78, .32);
  background: #f7fbf8;
  color: #12394a;
  cursor: pointer;
  font-size: clamp(1rem, 4.8vw, 1.42rem);
  font-weight: 900;
}
.starter-sudoku-cell:nth-child(3n) { border-right: 3px solid #6e987f; }
.starter-sudoku-cell:nth-child(6n) { border-right: 0; }
.starter-sudoku-cell:nth-child(n + 13):nth-child(-n + 18),
.starter-sudoku-cell:nth-child(n + 25):nth-child(-n + 30) { border-top: 3px solid #6e987f; }
.starter-sudoku-cell.is-given { cursor: default; background: #d7e8df; color: #1b5a50; }
.starter-sudoku-cell.is-selected:not(.is-given),
.starter-sudoku-cell:hover:not(.is-given) { background: #fff0bb; color: #5e3c14; }
.starter-sudoku-cell:focus-visible { position: relative; z-index: 1; outline: 3px solid #f2ad3d; outline-offset: -3px; }
.starter-sudoku-board.has-miss { animation: starter-sudoku-shake .38s ease both; }
@keyframes starter-sudoku-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.starter-sudoku-keypad {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  width: min(348px, 100%);
  margin: 12px auto 0;
}
.starter-sudoku-keypad button {
  min-height: 38px;
  border: 1px solid rgba(128, 211, 210, .48);
  border-radius: 9px;
  background: rgba(12, 62, 73, .86);
  color: #e8fbf7;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 900;
}
.starter-sudoku-keypad button:hover,
.starter-sudoku-keypad button:focus-visible { border-color: #ffe180; background: #245a63; outline: none; }
.starter-sudoku-keypad .starter-sudoku-clear { font-size: .65rem; }
.starter-sudoku-message { min-height: 1.2em; margin: 9px 0 0; color: #f7d879; font-size: .75rem; font-weight: 800; }
.starter-sudoku-submit,
.starter-sudoku-world-button,
.starter-sudoku-retry {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 1px solid #ffdd72;
  border-radius: 12px;
  background: linear-gradient(135deg, #ebbd3f, #c47e1e);
  color: #fffbea;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 950;
  box-shadow: inset 0 1px rgba(255, 255, 255, .35);
}
.starter-sudoku-submit:hover:not(:disabled),
.starter-sudoku-submit:focus-visible,
.starter-sudoku-world-button:hover:not(:disabled),
.starter-sudoku-world-button:focus-visible,
.starter-sudoku-retry:hover,
.starter-sudoku-retry:focus-visible { filter: brightness(1.1); outline: 2px solid #fff1ad; outline-offset: 2px; }
.starter-sudoku-submit:disabled,
.starter-sudoku-world-button:disabled { cursor: wait; filter: grayscale(.25); opacity: .72; }
.starter-sudoku-note { display: block; margin: 10px auto 0; color: #8fb9c2; font-size: .67rem; line-height: 1.35; }
.starter-sudoku-loading { display: flex; min-height: 150px; align-items: center; justify-content: center; gap: 10px; color: #e5f4f2; font-weight: 850; }
.starter-sudoku-loading span { width: 21px; height: 21px; border: 3px solid rgba(255, 224, 123, .28); border-top-color: #ffe17b; border-radius: 50%; animation: starter-sudoku-spin .8s linear infinite; }
@keyframes starter-sudoku-spin { to { transform: rotate(1turn); } }
.starter-sudoku-error p:not(.starter-sudoku-kicker) { color: #c7dbde; line-height: 1.46; }
.starter-sudoku-victory-gem { width: 58px; height: 58px; display: grid; place-items: center; margin: 4px auto 8px; border: 1px solid rgba(255, 226, 118, .84); border-radius: 50%; background: radial-gradient(circle, #fff2a4, #d9922c 48%, #70431c); color: #fffbe5; font-size: 1.75rem; box-shadow: 0 0 30px rgba(255, 213, 97, .55); }
.starter-sudoku-rank-stage { position: relative; min-height: 306px; margin-top: 16px; overflow: hidden; border: 1px solid rgba(119, 198, 207, .42); border-radius: 13px; background: rgba(2, 23, 40, .7); text-align: left; }
.starter-rank-stage-label { margin: 0; padding: 9px 11px; border-bottom: 1px solid rgba(119, 198, 207, .22); color: #9cc7cf; font-size: .69rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.starter-sudoku-ranks { position: absolute; inset: 35px 0 0; margin: 0; padding: 0; list-style: none; }
.starter-rank-row { display: grid; grid-template-columns: 27px 8px minmax(0, 1fr) auto auto; align-items: center; gap: 7px; min-height: 25px; padding: 0 10px; border-bottom: 1px solid rgba(148, 198, 203, .11); color: #b6d2d6; font-size: .69rem; transition: transform 1.3s cubic-bezier(.22,.87,.28,1), background .4s, box-shadow .4s; }
.starter-rank-number { color: #7fa7b0; font-weight: 900; }
.starter-rank-presence { width: 7px; height: 7px; border-radius: 50%; background: #e4af53; box-shadow: 0 0 8px rgba(232, 177, 76, .4); }
.starter-rank-presence.is-you { background: #6fe3bd; box-shadow: 0 0 10px rgba(82, 238, 171, .84); }
.starter-rank-row b { overflow: hidden; color: #dceff0; text-overflow: ellipsis; white-space: nowrap; }
.starter-rank-row small { color: #88aab2; font-size: .61rem; }
.starter-rank-row strong { color: #f3d575; font-size: .65rem; white-space: nowrap; }
.starter-sudoku-ranks--final { opacity: 0; transform: translateY(30px); }
.starter-sudoku-ceremony.is-climbing .starter-sudoku-ranks--start .is-starting-player { transform: translateY(-248px); background: rgba(72, 188, 154, .28); box-shadow: 0 0 21px rgba(80, 224, 167, .33); }
.starter-sudoku-ceremony.is-settled .starter-sudoku-ranks--start { opacity: 0; transition: opacity .22s ease; }
.starter-sudoku-ceremony.is-settled .starter-sudoku-ranks--final { opacity: 1; transform: translateY(0); transition: opacity .28s ease, transform .28s ease; }
.starter-sudoku-ceremony.is-settled .starter-sudoku-ranks--final .is-player { background: linear-gradient(90deg, rgba(243, 196, 72, .38), rgba(70, 177, 139, .25)); box-shadow: inset 3px 0 #ffe278, 0 0 19px rgba(255, 224, 112, .25); animation: starter-sudoku-first-pulse 1.15s ease-in-out 3; }
@keyframes starter-sudoku-first-pulse { 50% { filter: brightness(1.36); transform: scale(1.022); } }
.starter-sudoku-rank-message { min-height: 1.4em; margin: 11px 0 0; color: #ffe494; font-size: .82rem; font-weight: 900; }
@media (max-width: 620px) {
  .starter-sudoku-overlay { align-items: center; padding: 10px; }
  .starter-sudoku-card { max-height: calc(100dvh - 20px); padding: 20px 18px; border-radius: 18px; }
  .starter-sudoku-intro { font-size: .76rem; }
  .starter-sudoku-progress { margin-top: 12px; font-size: .66rem; }
  .starter-sudoku-keypad button { min-height: 35px; }
  .starter-sudoku-rank-stage { min-height: 292px; }
  .starter-rank-row { min-height: 23px; font-size: .64rem; }
  .starter-rank-row small { font-size: .57rem; }
  .starter-sudoku-ceremony.is-climbing .starter-sudoku-ranks--start .is-starting-player { transform: translateY(-228px); }
}
@media (prefers-reduced-motion: reduce) {
  .starter-sudoku-loading span,
  .starter-sudoku-board.has-miss,
  .starter-sudoku-ceremony.is-settled .starter-sudoku-ranks--final .is-player { animation: none; }
  .starter-rank-row, .starter-sudoku-ranks--final { transition-duration: .01ms !important; }
}

/* The Jewel stage has one clear next step; the strategic expansion message stays visible without adding another control. */
.starter-jewel-quick-tip {
  margin: 2px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(106, 228, 214, .34);
  border-radius: 11px;
  background: rgba(7, 71, 78, .3);
  color: #c7eeea;
  font-size: .76rem;
  font-weight: 780;
  line-height: 1.4;
  text-align: center;
}
.starter-jewel-quick-tip b { color: #86f0e1; }
@media (max-width: 620px) { .starter-jewel-quick-tip { font-size: .72rem; } }

/* Final rank must replace the moving list rather than cross-fading over it. */
.starter-sudoku-ceremony.is-settled .starter-sudoku-ranks--start { visibility: hidden; opacity: 0; transition: none; }
.starter-sudoku-ceremony.is-settled .starter-sudoku-ranks--final { transition: opacity .2s ease, transform .2s ease; }


/* Short mobile viewports: the entire first game must be playable without a cut-off finish control. */
@media (max-width: 430px) and (max-height: 800px) {
  .starter-sudoku-overlay { align-items: center; padding: 6px; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) {
    width: 100%;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    overflow: hidden;
    padding: 12px 14px;
    border-radius: 17px;
  }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-kicker { margin-bottom: 4px; font-size: .62rem; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) h2 { font-size: 1.48rem; line-height: 1.04; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-intro { margin-top: 6px; font-size: .71rem; line-height: 1.32; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-progress { min-height: 37px; margin: 9px 0 8px; padding: 7px 9px; font-size: .64rem; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-board,
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-keypad { width: min(292px, 100%); }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-cell { font-size: 1.05rem; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-keypad { gap: 6px; margin-top: 8px; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-keypad button { min-height: 34px; font-size: .88rem; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-message { min-height: 0; margin: 4px 0 0; font-size: .68rem; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-message:empty { display: none; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-submit { min-height: 43px; margin-top: 7px; font-size: .82rem; }
  .starter-sudoku-card:not(.starter-sudoku-victory-card) .starter-sudoku-note { display: none; }
}

/* Guided first game: every move is confirmed before a beginner can continue. */
.starter-sudoku-overlay.is-checking .starter-sudoku-board,
.starter-sudoku-overlay.is-checking .starter-sudoku-keypad { pointer-events: none; }
.starter-sudoku-cell.is-confirmed { color: #dfffee; border-color: rgba(92, 220, 154, .86); background: linear-gradient(145deg, rgba(25, 137, 95, .82), rgba(9, 72, 62, .88)); box-shadow: inset 0 0 0 1px rgba(225, 255, 235, .14), 0 0 14px rgba(66, 225, 156, .2); opacity: 1; }
.starter-sudoku-cell.is-confirmed:disabled { color: #e5fff0; cursor: default; opacity: 1; }
.starter-sudoku-cell.is-wrong { color: #ffe6e8; border-color: rgba(255, 112, 122, .98); background: linear-gradient(145deg, rgba(166, 47, 62, .92), rgba(84, 21, 37, .95)); box-shadow: 0 0 0 2px rgba(255, 120, 127, .15), 0 0 18px rgba(255, 79, 96, .28); animation: starter-sudoku-wrong .34s ease both; }
@keyframes starter-sudoku-wrong { 25% { transform: translateX(-4px); } 70% { transform: translateX(4px); } 100% { transform: translateX(0); } }
.starter-sudoku-message { min-height: 3.1em; display: grid; place-items: center; margin: 13px 0 9px; padding: 9px 11px; border: 1px solid rgba(126, 194, 183, .34); border-radius: 11px; background: rgba(9, 56, 66, .45); color: #c9edf0; font-size: .78rem; font-weight: 700; line-height: 1.42; text-align: center; }
.starter-sudoku-message.is-correction { border-color: rgba(255, 137, 143, .68); background: rgba(111, 29, 45, .48); color: #ffe6e8; }
.starter-sudoku-keypad button:disabled { cursor: default; opacity: .45; }
.starter-sudoku-submit:disabled { cursor: default; opacity: .52; filter: saturate(.55); }
@media (max-width: 390px), (max-height: 740px) {
  .starter-sudoku-message { min-height: 2.7em; margin: 9px 0 7px; padding: 7px 9px; font-size: .71rem; }
  .starter-sudoku-note { margin-top: 7px; }
}


/* After the first leaderboard, give the new Claimant a clear final departure. */
.starter-sudoku-farewell { background: radial-gradient(circle at 50% 37%, rgba(255, 206, 74, .24), transparent 24%), rgba(1, 13, 25, .82); }
.starter-sudoku-farewell-card {
  max-width: 450px;
  padding: 33px 28px 27px;
  border-color: rgba(255, 222, 114, .86);
  background: radial-gradient(circle at 50% 8%, rgba(215, 158, 39, .21), transparent 29%), linear-gradient(150deg, #26300e, #062c3c 54%, #063d43);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .66), 0 0 58px rgba(255, 193, 54, .18), inset 0 1px rgba(255, 246, 199, .22);
  animation: starter-sudoku-farewell-in .48s cubic-bezier(.16, .93, .25, 1) both;
}
.starter-sudoku-farewell-avatar {
  width: 92px;
  height: 92px;
  margin: 3px auto 17px;
  padding: 4px;
  border: 1px solid rgba(255, 224, 124, .96);
  border-radius: 22px;
  background: linear-gradient(145deg, #d69d2a, #071a29 44%, #f0cb68);
  box-shadow: 0 0 34px rgba(255, 196, 54, .45), inset 0 1px rgba(255, 249, 207, .8);
  animation: starter-sudoku-farewell-avatar .74s .15s cubic-bezier(.14, .9, .21, 1.22) both;
}
.starter-sudoku-farewell-avatar img { display: block; width: 100%; height: 100%; border-radius: 17px; object-fit: cover; }
.starter-sudoku-farewell-card > p:not(.starter-sudoku-kicker) { max-width: 310px; margin: 13px auto 0; color: #cbe2e3; font-size: .9rem; line-height: 1.5; }
.starter-sudoku-start-game {
  width: 100%;
  min-height: 50px;
  margin-top: 23px;
  border: 1px solid #ffe077;
  border-radius: 13px;
  background: linear-gradient(135deg, #efd05b, #c37c19);
  box-shadow: inset 0 1px rgba(255, 255, 255, .4), 0 10px 20px rgba(142, 84, 16, .24);
  color: #fffdf0;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  letter-spacing: .03em;
}
.starter-sudoku-start-game:hover, .starter-sudoku-start-game:focus-visible { filter: brightness(1.09); outline: 2px solid #fff0ad; outline-offset: 2px; }
@keyframes starter-sudoku-farewell-in { from { opacity: 0; transform: translateY(13px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes starter-sudoku-farewell-avatar { 0% { opacity: 0; transform: scale(.3) rotate(-14deg); } 65% { opacity: 1; transform: scale(1.1) rotate(3deg); } 100% { opacity: 1; transform: none; } }
@media (max-width: 620px) { .starter-sudoku-farewell-card { padding: 27px 20px 21px; }.starter-sudoku-farewell-avatar { width: 82px; height: 82px; margin-bottom: 14px; }.starter-sudoku-start-game { min-height: 48px; margin-top: 19px; } }
@media (prefers-reduced-motion: reduce) { .starter-sudoku-farewell-card, .starter-sudoku-farewell-avatar { animation: none; } }
