:root{
  --bg:#eaf4ff;
  --bg-soft:#f4f9ff;
  --card:#ffffff;
  --card-tint:#f7fbff;
  --ink:#16324f;
  --muted:#5f7996;
  --line:#cfe0f2;
  --line-strong:#b7d0ea;
  --accent:#5aa9e6;
  --accent-deep:#3f8fd1;
  --accent-soft:#dff0ff;
  --radius:18px;
  --shadow:0 12px 30px rgba(63,143,209,0.10);
}

*{box-sizing:border-box}

body{
  margin:0;
  background:
    radial-gradient(circle at top, #f7fbff 0%, #eef6ff 34%, var(--bg) 100%);
  color:var(--ink);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto;
}

/* HEADER */

.siteHeader{
  position:sticky;
  top:0;
  z-index:2000;

  background:rgba(255,255,255,0.88);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);

  padding:14px 16px 10px;
}


.siteHeaderInner{
  max-width:820px;
  margin:0 auto;
  text-align:center;
  position:relative;
}

.headerIconRow{
  display:contents;
}

#mobileStatsBtn{
  display:none;
}

#helpBtn,
#archiveBtn{
  display:flex;
  align-items:center;
  justify-content:center;

  position:absolute;
  top:50%;
  transform:translateY(-50%);

  width:42px;
  height:42px;

  padding:0;
  border-radius:999px;
  border:1px solid var(--line);

  background:#ffffff;
  color:var(--accent-deep);

  box-shadow:0 4px 12px rgba(63,143,209,0.10);
}

#helpBtn svg,
#archiveBtn svg{
  width:20px;
  height:20px;
}

#helpBtn svg{
  fill:currentColor;
}

#archiveBtn svg{
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

#helpBtn:hover,
#archiveBtn:hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

#helpMenu{
  position:absolute;

  top:58px;
  right:-290px;

  width:230px;

  display:none;
  flex-direction:column;
  gap:6px;

  padding:10px;

  background:#ffffff;
  border:1px solid var(--line);
  border-radius:18px;

  box-shadow:0 18px 40px rgba(63,143,209,0.16);

  z-index:3000;
}

#helpMenu.open{
  display:flex;
}

.helpMenuItem{
  width:100%;

  text-align:left;

  padding:12px 14px;

  background:#ffffff;
  border:none;
  border-radius:12px;

  color:var(--ink);

  font-size:15px;
}

.helpMenuItem:hover{
  background:var(--bg-soft);
}

#helpPanel,
#archivePanel{
  position:absolute;
  top:58px;
  width:300px;
  display:none;
  padding:18px;
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 18px 40px rgba(63,143,209,0.16);
  z-index:3000;
  text-align:left;
}

#helpPanel.open,
#archivePanel.open{
  display:block;
}

#helpPanelClose,
#archivePanelClose{
  position:absolute;
  top:10px;
  right:12px;
  background:none;
  border:none;
  color:var(--accent-deep);
  font-size:24px;
  line-height:1;
  padding:0;
}

#helpPanel h3,
#archivePanel h3{
  margin:0 24px 10px 0;
  color:var(--accent-deep);
  font-size:17px;
}

#helpPanelText{
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}

#helpPanelText p{
  margin:0 0 10px;
}

#archiveMonthPicker{
  display:block;
}

.archiveCalendarControls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.archiveYearLabel{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

#archiveYearSelect{
  min-width:104px;
  padding:8px 30px 8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#ffffff;
  color:var(--ink);
  font:inherit;
  font-size:14px;
  font-weight:700;
}

#archiveYearSelect:focus{
  outline:2px solid var(--accent-soft);
  border-color:var(--line-strong);
}

.archiveCalendar{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:8px;
}

.archiveMonthButton{
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:8px 6px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#ffffff;
  color:var(--ink);
  text-align:center;
}

.archiveMonthButton:not(:disabled):hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

.archiveMonthButton.complete{
  background:var(--accent-soft);
  border-color:var(--accent-deep);
  color:var(--accent-deep);
}

.archiveMonthButton.complete:not(:disabled):hover{
  background:#d4ebff;
}

.archiveMonthButton.complete .archiveMonthCount{
  color:var(--accent-deep);
}

.archiveMonthButton:disabled{
  cursor:not-allowed;
  opacity:.42;
}

.archiveMonthName{
  font-size:13px;
  font-weight:800;
  line-height:1;
}

.archiveMonthCount{
  min-height:14px;
  color:var(--muted);
  font-size:12px;
  line-height:1;
}

#archiveListHeader{
  display:none;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

#archiveBackToMonths{
  flex-shrink:0;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#ffffff;
  color:var(--accent-deep);
  font-size:12px;
  font-weight:800;
  line-height:1;
}

#archiveBackToMonths:hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

#archiveSelectedMonth{
  min-width:0;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  text-align:right;
}

#archiveList{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:360px;
  overflow-y:auto;
  padding-right:2px;
}

.archiveItem{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:#ffffff;
  color:var(--ink);
  text-align:left;
  min-height:58px;
}

.archiveItem:hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

.archiveItem.solved{
  background:var(--accent-soft);
  border-color:var(--line-strong);
}

.archiveItem.solved:hover{
  background:#d4ebff;
}

.archivePuzzleButton{
  min-width:0;
  flex:1;
  min-height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 12px;
  border:none;
  background:transparent;
  color:inherit;
  text-align:left;
}

.archivePuzzleButton:hover{
  transform:none;
  background:transparent;
}

.archiveReplay{
  flex-shrink:0;
  margin-right:8px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#ffffff;
  color:var(--accent-deep);
  font-size:12px;
  font-weight:800;
  line-height:1;
}

.archiveReplay:hover{
  background:var(--accent-soft);
  border-color:var(--line-strong);
}

.archivePuzzle{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.archiveNumber{
  font-size:14px;
  font-weight:800;
  color:var(--ink);
  line-height:1.15;
}

.archiveDate,
.archiveStatus{
  font-size:12px;
  color:var(--muted);
  line-height:1.2;
}

.archiveMeta{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
  flex-shrink:0;
  max-width:112px;
}

.archiveDifficulty{
  font-size:12px;
  font-weight:800;
  color:var(--accent-deep);
  line-height:1.2;
}

.archiveStatus{
  text-align:right;
}

.archiveEmpty,
.archiveError{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}

#resetPuzzleBtn{
  position:absolute;
  top:20px;
  left:140px;

  z-index:50;

  width:auto;
  margin:0;

  display:none;
}

/* Desktop */
@media (min-width:769px){

  #archiveBtn{
    left:-250px;
  }

  #helpBtn{ 
    right:-250px;
  }

  #helpPanel{
    right:-290px;
  }

  #archivePanel{
    left:-290px;
  }

}

/* Mobile */

@media (max-width:760px){

  #tutorialBox{
    transform:none;
  }

}
@media (max-width:768px){

  #helpBtn{
    z-index:5000;
  }

  #archiveBtn{
    z-index:5000;
  }

  .headerIconRow{
    display:contents;
  }

  #helpBtn,
  #archiveBtn,
  #mobileStatsBtn{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:36px;
    height:36px;
  }

  #helpBtn{
    left:8px;
  }

  #mobileStatsBtn{
    right:50px;
  }

  #archiveBtn{
    right:8px;
  }

  #helpBtn svg,
  #archiveBtn svg,
  #mobileStatsBtn svg{
    width:18px;
    height:18px;
  }

  #helpMenu{
    left:8px;
    right:auto;
    top:calc(100% + 8px);
    transform:none;
    z-index:5001;
  }

  #helpPanel,
  #archivePanel{
    left:50%;
    right:auto;
    width:min(320px, calc(100vw - 20px));
    top:calc(100% + 8px);
    transform:translateX(-50%);
    z-index:5001;
  }

}

@media (max-width:768px){

  #mobileStatsBtn{
    display:flex;
    align-items:center;
    justify-content:center;

    padding:0;
    border-radius:999px;
    border:1px solid var(--line);

    background:#ffffff;
    color:var(--accent-deep);

    box-shadow:0 4px 12px rgba(63,143,209,0.10);
  }

  #mobileStatsBtn svg{
    width:18px;
    height:18px;
    fill:currentColor;
  }

  #mobileStatsBtn:hover{
    background:var(--bg-soft);
    border-color:var(--line-strong);
  }

}

.masthead{
  font-size:28px;
  font-weight:800;
  letter-spacing:.2px;
  color:var(--accent-deep);
}

.tagline{
  font-size:14px;
  color:var(--muted);
  margin-top:2px;
}

.headerMeta{
  font-size:12px;
  color:#7f9ab7;
  margin-top:2px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

#todayPuzzleBtn,
#backToArchiveBtn{
  display:none;
  align-items:center;
  justify-content:center;
  margin:8px 4px 0;
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#ffffff;
  color:var(--accent-deep);
  font-size:13px;
  font-weight:700;
  box-shadow:0 4px 12px rgba(63,143,209,0.08);
}

#todayPuzzleBtn:hover,
#backToArchiveBtn:hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

/* WRAP */

.wrap{
  max-width:820px;
  margin:0 auto;
  padding:30px 16px 120px;
}

#entryBar{
  display:none;
}

/* GAME CARD */

.game-card{
  position:relative;

  background:linear-gradient(180deg, var(--card) 0%, var(--card-tint) 100%);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  border:1px solid var(--line);
  padding:20px;
}

/* TOP BAR */

#topBar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}

#statusMessage{
  max-width:820px;
  margin:0 auto 8px;

  font-size:14px;
  text-align:left;

  min-height:20px;
}

#timer{
  font-weight:700;
  color:var(--accent-deep);
}

#timer.completePulse{
  animation: timerCompletePulse 520ms ease-out both;
}

@keyframes timerCompletePulse{
  0%{
    transform:scale(1);
    text-shadow:none;
  }

  45%{
    transform:scale(1.28);
    text-shadow:0 0 18px rgba(63,143,209,0.45);
  }

  100%{
    transform:scale(1);
    text-shadow:none;
  }
}

/* CANVAS */

.canvasShell{
  position:relative;
  display:flex;
  justify-content:center;
  overflow:visible;
}

#stage{
  width:100%;
  max-width:100%;
  height:auto;
  display:block;
  background:transparent;
}

/* ENTRY BAR */

#entryBar{
  position:fixed;
  bottom:0;
  left:0;
  right:0;

  background:rgba(255,255,255,0.96);
  backdrop-filter:blur(10px);
  border-top:1px solid var(--line);

  padding:14px 18px calc(14px + env(safe-area-inset-bottom));
  z-index:1500;
}

#entryBar .entryControls,
#entryBar #entryLabel{
  max-width:820px;
  margin:0 auto;
}

#entryLabel{
  font-size:13px;
  font-weight:700;
  color:var(--muted);
}

.entryControls{
  display:flex;
  gap:8px;
  margin-top:6px;
}

#wordInput{
  flex:1;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#ffffff;
  color:var(--ink);
  font:inherit;
}

#wordInput:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 4px rgba(90,169,230,0.16);
}

button{
  font:inherit;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .12s ease,box-shadow .18s ease;
}

button:hover{
  transform:translateY(-1px);
}

.primary{
  background:linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color:#fff;
  border:none;
  padding:10px 18px;
  border-radius:999px;
  box-shadow:0 8px 18px rgba(63,143,209,0.18);
}

.primary:hover{
  box-shadow:0 10px 22px rgba(63,143,209,0.22);
}

.secondary{
  background:#ffffff;
  color:var(--ink);
  border:1px solid var(--line);
  padding:10px 18px;
  border-radius:999px;
}

.secondary:hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

/* HINT */

.hint{
  text-align:center;
  font-size:13px;
  color:var(--muted);
  margin-top:12px;
  display:none;
}

/* SIDE PANELS */

.sidePanel{
  position:fixed;
  top:160px;
  width:200px;
  background:linear-gradient(180deg, #ffffff 0%, var(--card-tint) 100%);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}

.leftPanel{
  left:20px;
}

.rightPanel{
  right:20px;
}

.sidePanel h3{
  margin:0 0 10px;
  font-size:16px;
  color:var(--accent-deep);
}

.stat{
  display:flex;
  justify-content:space-between;
  margin-bottom:6px;
  font-size:14px;
}

.label{
  color:var(--muted);
}

.value{
  font-weight:700;
  color:var(--ink);
}

.leaderboardPanel{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.leaderboardList{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:7px;
}

.leaderboardEntry{
  display:grid;
  grid-template-columns:22px 1fr auto;
  align-items:center;
  gap:8px;
  font-size:13px;
}

.leaderboardRank{
  color:var(--muted);
  font-weight:800;
}

.leaderboardName{
  color:var(--ink);
  font-weight:700;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.leaderboardTime{
  color:var(--accent-deep);
  font-weight:800;
  font-variant-numeric:tabular-nums;
}

.leaderboardEmpty{
  color:var(--muted);
  font-size:13px;
}

/* START OVERLAY */

#startOverlay{
  position:fixed;
  top:120px;
  left:0;
  right:0;
  bottom:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  z-index:900;
  pointer-events:auto;
}

#startBox{
  width:min(420px, calc(100% - 32px));
  background:rgba(255,255,255,0.97);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 20px 55px rgba(63,143,209,0.14);
  text-align:center;
  padding:32px 28px 26px;
}

#startBox h2{
  margin:0 0 10px;
  font-size:40px;
  line-height:1;
  font-weight:800;
  color:var(--accent-deep);
}

#startBox p{
  margin:0;
  font-size:19px;
  line-height:1.4;
  color:var(--muted);
}

.startButtons{
  margin-top:22px;
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

.startButtons .primary,
.startButtons .secondary{
  min-width:120px;
}

/* COMPLETE OVERLAY */


#completeClose{
  position:absolute;
  top:12px;
  right:14px;

  padding:0;
  margin:0;

  background:none;
  border:none;
  box-shadow:none;

  color:var(--accent-deep);

  font-size:34px;
  line-height:1;
  font-weight:300;

  cursor:pointer;
}

#completeClose:hover{
  transform:translateY(-1px);
}

#completeBadge{
  width:56px;
  height:56px;
  margin:0 auto 14px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:50%;
  background:linear-gradient(180deg, var(--accent-soft), #ffffff);
  border:1px solid var(--line);
  color:var(--accent-deep);

  font-size:30px;
  font-weight:900;
  box-shadow:0 8px 20px rgba(63,143,209,0.12);
}

#completeBox h2{
  margin:0;
  font-size:26px;
  line-height:1.1;
  color:var(--ink);
}

#completeSubtitle{
  margin:8px 0 18px;
  color:var(--muted);
  font-size:15px;
}

#completeTime{
  margin:0 0 22px;
  font-size:36px;
  line-height:1;
  font-weight:900;
  letter-spacing:-2px;
  color:var(--accent-deep);
}

#completeStreak{
  margin:0 0 18px;
  font-size:18px;
  font-weight:700;
  color:var(--muted);
}

#leaderboardResult{
  margin:0 0 18px;
}

#leaderboardPrompt,
#leaderboardInvalid{
  display:none;
}

#leaderboardPrompt{
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#ffffff;
  margin-bottom:12px;
}

#leaderboardPrompt p{
  margin:0 0 10px;
  color:var(--accent-deep);
  font-size:14px;
  font-weight:800;
}

.leaderboardNameRow{
  display:flex;
  gap:8px;
}

#leaderboardNameInput{
  min-width:0;
  flex:1;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--ink);
  font:inherit;
}

#leaderboardNameInput:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(90,169,230,0.16);
}

#saveLeaderboardName{
  padding:9px 12px;
}

#leaderboardStatus{
  min-height:18px;
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
}

#leaderboardInvalid{
  margin-bottom:12px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
}

#completeTime.copiedMessage{
  font-size:20px;
  line-height:1.4;
  letter-spacing:0;
  font-weight:700;
  color:var(--muted);
}

#shareResults{
  background:linear-gradient(
    180deg,
    var(--accent) 0%,
    var(--accent-deep) 100%
  );

  color:white;
  border:none;

  box-shadow:0 10px 24px rgba(63,143,209,0.22);
}

#shareResults:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(63,143,209,0.28);
}

#shareResults{
  width:100%;
  margin:0;
}

#completeOverlay.show{
  animation: completeFadeIn 220ms ease-out both;
}

#completeOverlay.show #completeBox{
  animation: completePopIn 260ms ease-out both;
}

@keyframes completeFadeIn{
  from{
    opacity:0;
  }
  to{
    opacity:1;
  }
}

@keyframes completePopIn{
  from{
    opacity:0;
    transform:translateY(12px) scale(0.96);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

#completeOverlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(36,83,130,0.28);
  z-index:2500;
}

#completeBox{
  position:relative;

  width:min(390px, calc(100% - 32px));
  max-width:390px;

  padding:26px 24px 22px;
  border-radius:28px;

  background:linear-gradient(180deg, #ffffff 0%, var(--card-tint) 100%);
  text-align:center;
  border:1px solid var(--line);
  box-shadow:0 18px 45px rgba(63,143,209,0.16);
}

/* TUTORIAL */

#tutorialOverlay{
  position:fixed;
  inset:0;
  display:none;

  align-items:flex-start;
  justify-content:center;

  padding-top:110px;

  background:rgba(36,83,130,0.12);
  z-index:1000;
}

#tutorialBox{
  width:min(460px, calc(100% - 32px));
  background:linear-gradient(180deg, #ffffff 0%, var(--card-tint) 100%);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 24px 70px rgba(63,143,209,0.16);
  padding:28px 28px 22px;
  transform:translateX(-480px);
}

#tutorialContent h3{
  margin:0 0 12px;
  font-size:18px;
  line-height:1.2;
  font-weight:800;
  color:var(--accent-deep);
}

#tutorialContent p{
  margin:0;
  font-size:16px;
  line-height:1.45;
  color:var(--muted);
}

#tutorialDots{
  margin:18px 0 20px;
  display:flex;
  justify-content:center;
  gap:8px;
}

.dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#c8daee;
}

.dot.active{
  background:var(--accent-deep);
}

.tutorialButtons{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.tutorialNavButtons{
  display:flex;
  gap:10px;
}

#tutorialExit,
#tutorialBack{
  background:#ffffff;
  border:1px solid var(--line);
  color:var(--ink);
  padding:10px 16px;
  border-radius:999px;
  font:inherit;
  cursor:pointer;
}

#tutorialExit:hover,
#tutorialBack:hover{
  background:var(--bg-soft);
  border-color:var(--line-strong);
}

#tutorialNext{
  min-width:96px;
}

@media (max-width:760px){
  #tutorialOverlay{
    padding-top:90px;
    align-items:flex-start;
  }

  #tutorialBox{
  width:100%;
  max-width:460px;
  margin:0 auto;

  padding:22px 20px 18px;
  transform:none;
}

  .tutorialButtons{
    flex-direction:column;
    align-items:stretch;
  }

  .tutorialNavButtons{
    width:100%;
  }

  .tutorialNavButtons button{
    flex:1;
  }

  #tutorialExit{
    width:100%;
  }
}

#tutorialDots{
  margin-top:10px;
  display:flex;
  justify-content:center;
  gap:6px;
}

.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#c8daee;
}

.dot.active{
  background:var(--accent-deep);
}

#shareSavedResult{
  position:absolute;
  top:20px;
  left:20px;
  z-index:50;
  width:auto;
  margin:0;
  display:none;
}

@media (max-width:760px) {
  #shareSavedResult {
    position:static;
    margin-top:12px;
    margin-left:12px;
  }
}


/* MOBILE STATS PANEL */

#mobileStatsOverlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:flex-end;
  justify-content:center;
  background:rgba(36,83,130,0.28);
  z-index:1000;
}

#mobileStatsOverlay.open{
  display:flex;
}

#mobileStatsSheet{
  width:100%;
  max-width:520px;
  background:linear-gradient(180deg, #ffffff 0%, var(--card-tint) 100%);
  border-radius:20px 20px 0 0;
  padding:20px;
  border-top:1px solid var(--line);
  box-shadow:0 -10px 30px rgba(63,143,209,0.12);
}

.mobileStatsHeader{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
}

.mobileStatsSection{
  margin-top:10px;
}

.mobileStatsHeader h3,
.mobileStatsSection h3{
  color:var(--accent-deep);
}

#pauseLeaderboardWarning{
  margin:10px 0 0;
  color:var(--muted);
  font-size:14px;
  line-height:1.35;
}

/* MOBILE */

@media (max-width:760px){

  .canvasShell{
    flex-direction:column;
    align-items:center;
  }

   #startOverlay{
    position:static !important;
    top:auto !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;

    display:flex;
    align-items:flex-start;
    justify-content:center;

    padding:28px 16px 80px;
  }



#tutorialOverlay{
  position:fixed;
  inset:0;

  overflow-y:auto;
  -webkit-overflow-scrolling:touch;

  align-items:flex-start;
  justify-content:center;

  padding:
    calc(420px + env(safe-area-inset-top))
    16px
    calc(120px + env(safe-area-inset-bottom));
}

#startBox{
  width:min(92vw, 420px);
  padding:28px 22px 24px;
}

  .sidePanel{
    display:none;
  }

  .wrap{
    padding:16px 10px 24px;
  }

  

  .game-card{
  padding:10px;
  display:flex;
  flex-direction:column;
}

  #entryBar{
    position:static;
    order:-1;
    display:none;
    margin-bottom:12px;
    padding:0;
    background:transparent;
    backdrop-filter:none;
    border-top:none;
    z-index:auto;
  }

  #statusMessage{
    margin:0 0 8px;
  }

  .entryControls{
    flex-direction:row;
    gap:8px;
    margin-top:0;
  }

  .primary{
    width:auto;
  }

  .hint{
    margin-top:8px;
    font-size:12px;
  }

}

#entryStatus{
  max-width:820px;
  margin:0 auto 8px;
  font-size:14px;
  min-height:20px;
  color:var(--muted);
}

#entryMessage{
  max-width:820px;
  margin:0 auto 6px;

  font-size:14px;
  text-align:left;

  min-height:20px;

  color:#b74a4a;
}

.siteFooter{
  text-align:center;
  font-size:12px;
  color:#7f9ab7;
  padding:20px;
}

#pauseBtn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;

  width:28px;
  height:28px;

  padding:0;
  margin-right:8px;

  border:1px solid var(--line);
  border-radius:999px;

  background:#ffffff;
  color:var(--accent-deep);
}

#pauseBtn span{
  width:4px;
  height:12px;
  border-radius:2px;
  background:var(--accent-deep);
}

#pauseOverlay{
  position:absolute;
  inset:0;

  display:none;
  align-items:center;
  justify-content:center;

  background:rgba(255,255,255,0.72);
  z-index:800;
}

#pauseBox{
  width:min(360px, calc(100% - 32px));

  background:rgba(255,255,255,0.97);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 20px 55px rgba(63,143,209,0.14);

  text-align:center;
  padding:32px 28px 26px;
}

#pauseBox h2{
  margin:0 0 10px;
  font-size:40px;
  line-height:1;
  font-weight:800;
  color:var(--accent-deep);
}

#pauseTime{
  margin:0;
  font-size:24px;
  font-weight:800;
  color:var(--ink);
}
