:root {
  color-scheme: dark;
  --bg: #0a171e;
  --panel: #102129;
  --panel-2: #13262e;
  --line: #26383e;
  --muted: #82999f;
  --text: #e6e9df;
  --teal: #82d7c3;
  --sand: #d5b991;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
a,
input,
select,
canvas {
  outline-offset: 5px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--teal);
}
button {
  color: inherit;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button {
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.site-header {
  height: 106px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 5%;
  max-width: 1600px;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 24px;
  letter-spacing: 5px;
  font-weight: 600;
  line-height: 1.2;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid #5d8c87;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  transform: rotate(-8deg);
}
.brand-tag {
  display: block;
  font-size: 7px;
  letter-spacing: 2px;
  margin-top: 7px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.local-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin-right: 19px;
}
.local-label i,
.status-dot,
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
  margin-right: 8px;
}
.icon-button {
  width: 35px;
  height: 35px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 16px;
  color: #b8c7c7;
}
.icon-button:hover {
  background: var(--panel-2);
}
main {
  width: 90%;
  max-width: 1370px;
  margin: 0 auto;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0 30px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.3px;
  color: var(--teal);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font: 46px/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: -1.3px;
  margin: 8px 0 9px;
}
.intro p {
  color: var(--muted);
  font-size: 13px;
}
.mode-switch {
  display: flex;
  background: #07131a;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
}
.mode-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  padding: 10px 19px;
  font-size: 12px;
}
.mode-switch button.active {
  background: #2b4145;
  color: #e5f1e8;
  box-shadow: 0 1px 5px #0004;
}
.game-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.score-panel,
.piece-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 21px;
  background: linear-gradient(130deg, #13262d, #0e1e26);
}
.panel-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1.7px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-label > span:last-child:not(:first-child) {
  font-size: 8px;
  color: #bdc7b7;
  letter-spacing: 1.1px;
}
.score {
  font-size: 48px;
  line-height: 1.25;
  letter-spacing: -2px;
  font-weight: 400;
  margin-top: 11px;
  font-variant-numeric: tabular-nums;
}
.best-line {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.3px;
  display: flex;
  gap: 11px;
  align-items: center;
}
.best-line strong {
  font-size: 11px;
  font-weight: 400;
  color: #c8d3cc;
  letter-spacing: 0;
}
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 22px;
}
.stats-row > div {
  position: relative;
  padding-left: 16px;
}
.stat-icon {
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 10px;
}
.water-icon {
  color: var(--teal);
}
.lost-icon {
  color: var(--sand);
  font-size: 15px;
  top: -2px;
}
.stats-row strong {
  font-size: 18px;
  font-weight: 400;
  display: block;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stats-row em {
  font-style: normal;
  font-size: 9px;
  color: var(--muted);
}
.stats-row small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.loss-track,
.timer-track {
  height: 3px;
  background: #26383e;
  overflow: hidden;
  border-radius: 3px;
}
.loss-track {
  margin-top: 15px;
}
.loss-track > div {
  height: 100%;
  background: var(--sand);
  width: 0;
  transition: width 0.3s;
}
.piece-panel {
  flex: 1;
}
.live-dot {
  margin: 0;
  width: 5px;
  height: 5px;
}
.piece-heading {
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 22px 0 14px;
}
.piece-symbol {
  width: 46px;
  height: 46px;
  border: 1px solid #76664e;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #342f25;
  color: var(--sand);
}
.piece-heading h2 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 3px;
}
.rotation-label {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.4px;
}
.piece-description {
  font-size: 11px;
  color: #99acae;
  min-height: 44px;
  line-height: 1.7;
}
.timer-label {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 8px;
  font-size: 8px;
  letter-spacing: 1.3px;
  color: var(--muted);
}
.timer-label strong {
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}
.timer-track > div {
  height: 100%;
  width: 100%;
  background: var(--teal);
  transition: width 0.1s linear;
}
.next-heading {
  margin: 24px 0 12px;
}
.next-queue {
  display: flex;
  gap: 8px;
}
.queue-item {
  border: 1px solid var(--line);
  background: #0b1b22;
  border-radius: 5px;
  flex: 1;
  min-width: 0;
  padding: 6px 3px 7px;
  text-align: center;
}
.queue-item canvas {
  width: 38px;
  height: 29px;
  display: block;
  margin: auto;
}
.queue-item span {
  display: block;
  font-size: 8px;
  color: #b2c0bd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-note {
  display: flex;
  gap: 12px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.field-note > span {
  color: var(--sand);
  font-size: 20px;
}
.board-panel {
  border: 1px solid #2a3d42;
  border-radius: 9px;
  background: radial-gradient(
    ellipse at 50% 43%,
    #1b333a 0%,
    #12262e 50%,
    #102129 100%
  );
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 608px;
  position: relative;
}
.board-topline {
  display: flex;
  justify-content: space-between;
  padding: 20px 23px;
  color: #91aaa9;
  font-size: 8px;
  letter-spacing: 1.7px;
  z-index: 1;
}
.board-topline > span:first-child {
  display: flex;
  align-items: center;
}
.status-dot {
  margin-right: 8px;
}
.canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 490px;
}
.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}
.board-hint {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #7c979a;
  pointer-events: none;
}
.board-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 23px;
  position: relative;
}
.legend {
  display: flex;
  gap: 21px;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #819b9d;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  transform: rotate(-30deg);
  border-radius: 1px;
}
.legend-land {
  background: #b89f78;
}
.legend-water {
  background: #63bca8;
}
.coordinates {
  font-size: 9px;
  color: #6b898d;
  font-variant-numeric: tabular-nums;
}
.text-button {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: #a9babb;
  padding: 5px 0;
}
.text-button:hover {
  color: var(--teal);
}
#pause-btn {
  display: flex;
  gap: 7px;
}
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 21px 0 31px;
  min-height: 40px;
}
.keyboard-guide {
  display: flex;
  gap: 17px;
  color: #839b9e;
  font-size: 10px;
}
.keyboard-guide span {
  white-space: nowrap;
}
kbd {
  background: #12242c;
  border: 1px solid #2d4046;
  border-bottom: 2px solid #2d4046;
  border-radius: 3px;
  padding: 3px 6px;
  font: 9px/1.3 inherit;
  color: #a1b6b7;
  margin-right: 5px;
}
.touch-controls {
  display: flex;
  gap: 9px;
}
.secondary-button,
.primary-button {
  border: 1px solid #365251;
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 11px;
}
.secondary-button {
  background: #172e35;
  color: #b9ccc7;
}
.secondary-button:hover {
  background: #224148;
}
.primary-button {
  background: var(--teal);
  color: #102a28;
  border-color: var(--teal);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.primary-button:hover {
  background: #a1ead7;
  border-color: #a1ead7;
}
.primary-button span {
  font-size: 17px;
  line-height: 1;
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}
.action-divider {
  height: 15px;
  width: 1px;
  background: var(--line);
}
footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 20px 0 26px;
  color: #59777c;
  font-size: 8px;
  letter-spacing: 1.7px;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: #0c1b24d9;
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  z-index: 2;
  text-align: center;
  padding: 30px;
}
.game-overlay h2 {
  font: 36px/1.2 Georgia, serif;
}
.game-overlay p {
  color: var(--muted);
  font-size: 12px;
}
.game-overlay .primary-button {
  margin-top: 8px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 32px);
  border: 1px solid #527971;
  border-radius: 7px;
  background: #1e3c3d;
  color: #d7f0e5;
  padding: 13px 23px;
  box-shadow: 0 10px 40px #0005;
  font-size: 12px;
}
.toast.error {
  border-color: #ab8067;
  color: #f3d4bd;
  background: #3c302c;
}
dialog {
  width: min(630px, calc(100% - 32px));
  padding: 38px;
  background: #11252d;
  color: var(--text);
  border: 1px solid #365057;
  border-radius: 12px;
  box-shadow: 0 30px 100px #0008;
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #040f16c9;
  backdrop-filter: blur(5px);
}
.dialog-close {
  position: absolute;
  right: 16px;
  top: 11px;
  border: 0;
  background: transparent;
  color: #8da5a6;
  font-size: 26px;
  width: 32px;
  height: 32px;
}
dialog h2 {
  font: 35px/1.15 Georgia, serif;
  margin: 13px 0 16px;
}
dialog > p {
  font-size: 12px;
  color: #9fb2b2;
  line-height: 1.8;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 21px;
  margin: 28px 0;
}
.help-grid > div > span {
  font: 21px Georgia, serif;
  color: var(--sand);
}
.help-grid h3 {
  font-size: 12px;
  margin: 9px 0;
}
.help-grid p {
  color: #8fa8a9;
  font-size: 11px;
  line-height: 1.8;
}
.help-controls {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 25px;
}
.help-controls strong {
  font-weight: 500;
  color: #d2ddd4;
}
.full-width {
  display: flex;
  width: 100%;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.form-grid label {
  font-size: 11px;
  color: #a9bfbd;
}
.form-grid input,
.form-grid select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid #365057;
  border-radius: 4px;
  background: #0c1d25;
  color: #dce8dc;
}
.addon-option {
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  gap: 11px;
  align-items: center;
  margin: 20px 0;
}
.addon-option input {
  accent-color: var(--teal);
}
.addon-option strong {
  display: block;
  font-weight: 500;
  font-size: 13px;
}
.addon-option small {
  display: block;
  color: #809c9f;
  font-size: 10px;
  margin-top: 3px;
}
.addon-badge {
  font-size: 8px;
  color: var(--teal);
  letter-spacing: 1px;
  margin-left: auto;
}
.data-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.data-actions button {
  flex: 1;
}
.storage-note {
  margin-top: 12px;
  font-size: 10px !important;
  color: #78959a !important;
}
.sandbox-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 18px;
}
.tool-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0d1e26;
  padding: 8px 5px;
  font-size: 10px;
  color: #99b1ae;
}
.tool-button.active {
  background: #24413f;
  border-color: #71b8a8;
  color: #b9f1dd;
}
.sandbox .timer-label,
.sandbox .timer-track,
.sandbox .next-heading,
.sandbox .next-queue {
  display: none;
}
.sandbox .piece-description {
  min-height: 30px;
}
.sandbox .piece-panel {
  padding-bottom: 18px;
}
@media (min-width: 1450px) {
  .board-panel {
    min-height: 670px;
  }
  .canvas-wrap {
    min-height: 550px;
  }
  .game-layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }
  .score-panel,
  .piece-panel {
    padding: 25px;
  }
  .piece-heading {
    margin-top: 25px;
  }
  .piece-description {
    font-size: 12px;
  }
  .intro {
    padding-top: 47px;
    padding-bottom: 35px;
  }
}
@media (max-width: 1100px) {
  main {
    width: 93%;
  }
  .site-header {
    padding: 0 3.5%;
    height: 88px;
  }
  .game-layout {
    grid-template-columns: 215px minmax(0, 1fr);
    gap: 13px;
  }
  .score-panel,
  .piece-panel {
    padding: 17px;
  }
  .keyboard-guide {
    gap: 8px;
  }
  .keyboard-guide span {
    font-size: 0;
  }
  .keyboard-guide kbd {
    font-size: 9px;
  }
  .game-actions {
    gap: 12px;
  }
  .control-bar {
    gap: 10px;
  }
  .board-panel {
    min-height: 570px;
  }
  .canvas-wrap {
    min-height: 450px;
  }
  .intro {
    padding-top: 30px;
  }
  .board-topline {
    padding: 18px;
  }
  .board-bottomline {
    padding: 17px 18px;
  }
}
@media (max-width: 760px) {
  .site-header {
    height: 77px;
    padding: 0 5%;
  }
  .brand {
    font-size: 19px;
    letter-spacing: 4px;
    gap: 10px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .brand-tag {
    font-size: 6px;
    letter-spacing: 1.3px;
  }
  .local-label {
    display: none;
  }
  main {
    width: 92%;
  }
  .intro {
    padding: 27px 0 23px;
    gap: 15px;
    align-items: flex-end;
  }
  h1 {
    font-size: 32px;
    letter-spacing: -0.6px;
  }
  .intro .eyebrow {
    font-size: 7px;
    letter-spacing: 1.4px;
  }
  .intro p {
    font-size: 11px;
    max-width: 215px;
    line-height: 1.7;
  }
  .mode-switch {
    flex-shrink: 0;
    margin-bottom: 4px;
  }
  .mode-switch button {
    padding: 8px 10px;
    font-size: 10px;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
  }
  .score-panel,
  .piece-panel {
    padding: 15px;
  }
  .score {
    font-size: 35px;
    margin-top: 5px;
  }
  .panel-label {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .panel-label > span:last-child:not(:first-child) {
    font-size: 7px;
  }
  .best-line {
    font-size: 7px;
    letter-spacing: 0.8px;
  }
  .stats-row {
    padding-top: 10px;
    margin-top: 11px;
    gap: 5px;
  }
  .stats-row strong {
    font-size: 15px;
  }
  .stats-row small {
    font-size: 8px;
  }
  .stats-row em {
    font-size: 8px;
  }
  .loss-track {
    margin-top: 10px;
  }
  .piece-heading {
    margin: 10px 0 5px;
    gap: 9px;
  }
  .piece-symbol {
    width: 34px;
    height: 34px;
    font-size: 21px;
    border-radius: 5px;
  }
  .piece-heading h2 {
    font-size: 13px;
  }
  .rotation-label {
    font-size: 6px;
  }
  .piece-description {
    display: none;
  }
  .timer-label {
    margin: 10px 0 5px;
    font-size: 7px;
  }
  .timer-label strong {
    font-size: 9px;
  }
  .next-heading {
    display: none;
  }
  .next-queue {
    margin-top: 9px;
    gap: 4px;
  }
  .queue-item {
    padding: 2px;
  }
  .queue-item canvas {
    height: 18px;
    width: 29px;
  }
  .queue-item span {
    font-size: 6px;
  }
  .field-note {
    display: none;
  }
  .board-panel {
    min-height: 410px;
    order: 2;
  }
  .canvas-wrap {
    min-height: 330px;
  }
  .board-topline {
    padding: 15px;
    font-size: 7px;
    letter-spacing: 1.1px;
  }
  .board-bottomline {
    padding: 14px 15px;
  }
  .board-hint {
    font-size: 9px;
  }
  .control-bar {
    flex-wrap: wrap;
    margin: 14px 0 22px;
    gap: 14px;
  }
  .touch-controls {
    order: 0;
    flex: 1;
  }
  .touch-controls .primary-button {
    flex: 1;
    justify-content: center;
    gap: 35px;
  }
  .keyboard-guide {
    display: none;
  }
  .game-actions {
    width: 100%;
    justify-content: center;
    gap: 25px;
    order: 2;
  }
  .control-bar .secondary-button,
  .control-bar .primary-button {
    padding: 12px 17px;
  }
  footer {
    font-size: 6px;
    letter-spacing: 1px;
    gap: 15px;
    padding-top: 16px;
  }
  footer span:last-child {
    text-align: right;
  }
  .sandbox-tools {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 10px;
  }
  .tool-button {
    font-size: 8px;
    padding: 6px 2px;
  }
  .sandbox .piece-panel {
    padding-bottom: 12px;
  }
  .help-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .help-grid > div {
    position: relative;
    padding-left: 34px;
  }
  .help-grid > div > span {
    position: absolute;
    left: 0;
    top: 2px;
  }
  .help-grid h3 {
    margin-top: 0;
  }
  .help-grid p {
    font-size: 12px;
  }
  .form-grid {
    gap: 14px;
  }
  dialog {
    padding: 30px 24px;
  }
  .game-overlay h2 {
    font-size: 29px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (min-width: 761px) and (max-height: 900px) {
  .site-header {
    height: 82px;
  }
  .intro {
    padding: 23px 0 22px;
  }
  .intro h1 {
    font-size: 40px;
  }
  .game-layout {
    grid-template-columns: 238px minmax(0, 1fr);
  }
  .score-panel,
  .piece-panel {
    padding: 17px;
  }
  .score {
    font-size: 42px;
    margin-top: 7px;
  }
  .stats-row {
    margin-top: 15px;
    padding-top: 14px;
  }
  .piece-heading {
    margin: 16px 0 10px;
  }
  .piece-description {
    min-height: 37px;
  }
  .timer-label {
    margin-top: 12px;
  }
  .next-heading {
    margin-top: 17px;
  }
  .field-note {
    font-size: 10px;
  }
  .board-panel {
    min-height: 565px;
  }
  .canvas-wrap {
    min-height: 435px;
  }
  .control-bar {
    margin: 16px 0 22px;
  }
}
/* The round has a visible objective, a changing forecast, and a reason to act. */
.challenge-bar {
  display: grid;
  grid-template-columns: 1.55fr 0.7fr 1.15fr 0.85fr;
  background: #10242c;
  border: 1px solid #2b464b;
  border-radius: 8px;
  margin: 0 0 17px;
  overflow: hidden;
}
.challenge-bar > div {
  padding: 15px 20px;
  min-width: 0;
}
.challenge-bar > div + div {
  border-left: 1px solid #294047;
}
.challenge-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #96aeac;
  font-weight: 600;
}
.challenge-label strong {
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 500;
  color: #e1eadc;
  font-variant-numeric: tabular-nums;
}
.goal-track,
.combo-track {
  height: 4px;
  background: #294145;
  border-radius: 3px;
  overflow: hidden;
}
.goal-track {
  margin: 12px 0 8px;
}
.goal-track > div {
  height: 100%;
  background: #8bdfb6;
  width: 0;
  transition: width 0.25s;
}
.goal-status > span,
.challenge-bar small {
  display: block;
  color: #78989b;
  font-size: 9px;
  line-height: 1.5;
}
.round-status > strong {
  font-size: 25px;
  line-height: 1.15;
  display: block;
  letter-spacing: -1px;
  color: #e6ebdc;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}
.round-status small {
  font-size: 7px;
  letter-spacing: 1.6px;
}
.storm-status > strong {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
  display: block;
  color: #a5d5fa;
  margin: 5px 0 2px;
}
.storm-status .challenge-label > strong {
  color: #a5d5fa;
}
.combo-status > strong {
  display: block;
  font-size: 17px;
  letter-spacing: 1px;
  color: #88a1a1;
  line-height: 1.5;
  margin: 4px 0;
}
.combo-status > strong.active {
  color: #ffda95;
}
.combo-track {
  height: 2px;
  margin-top: 7px;
}
.combo-track > div {
  height: 100%;
  background: #e7c385;
  width: 0;
}
.urgent {
  color: #f0ad89 !important;
}
.action-preview {
  padding: 10px 11px;
  background: #0b1e25;
  border: 1px solid #31484b;
  border-radius: 5px;
  margin-top: 9px;
  line-height: 1.55;
}
.action-preview > strong {
  font-size: 10px;
  font-weight: 500;
  display: block;
  color: #cbdace;
}
.action-preview > span {
  display: block;
  color: #7e9d9c;
  font-size: 9px;
  margin-top: 3px;
}
.action-preview.sun-preview {
  border-color: #7b6b44;
  background: #2b2a2090;
}
.sun-preview > strong {
  color: #ffdc97;
}
.sun-preview > span {
  color: #c8b98e;
}
.action-preview.crater-preview {
  border-color: #586b48;
  background: #202c2490;
}
.crater-preview > strong {
  color: #c2d8a7;
}
.piece-description {
  min-height: 0;
  font-size: 10px;
  line-height: 1.6;
}
.piece-heading {
  margin-top: 16px;
  margin-bottom: 10px;
}
.field-note {
  font-size: 10px;
}
.intro {
  padding-top: 28px;
  padding-bottom: 24px;
}
.intro p {
  max-width: 550px;
}
.score {
  font-size: 42px;
}
.stats-row {
  margin-top: 16px;
  padding-top: 15px;
}
.score-panel,
.piece-panel {
  padding: 18px;
}
.next-heading {
  margin-top: 18px;
}
.timer-label {
  margin-top: 12px;
}
.game-layout {
  align-items: stretch;
}
.board-panel {
  min-height: 620px;
}
.canvas-wrap {
  min-height: 480px;
}
#mute-btn[aria-pressed="true"] {
  color: #748c91;
}
#mute-btn {
  font-size: 18px;
}
.game-overlay p {
  max-width: 440px;
  line-height: 1.8;
}
.game-overlay:has(#overlay-eyebrow) .eyebrow {
  letter-spacing: 1.8px;
}
@media (min-width: 761px) and (max-height: 900px) {
  .intro {
    padding: 20px 0 17px;
  }
  .intro h1 {
    font-size: 36px;
  }
  .challenge-bar > div {
    padding: 12px 16px;
  }
  .challenge-bar {
    margin-bottom: 13px;
  }
  .board-panel {
    min-height: 585px;
  }
  .canvas-wrap {
    min-height: 445px;
  }
  .score-panel,
  .piece-panel {
    padding: 16px;
  }
  .score {
    font-size: 36px;
    margin-top: 6px;
  }
  .stats-row {
    margin-top: 12px;
    padding-top: 11px;
  }
  .piece-heading {
    margin-top: 12px;
    margin-bottom: 8px;
  }
  .piece-description {
    min-height: 0;
    font-size: 10px;
  }
  .next-heading {
    margin-top: 14px;
  }
  .timer-label {
    margin-top: 10px;
  }
  .field-note {
    padding-top: 0;
    padding-bottom: 0;
  }
  .action-preview {
    padding: 8px;
  }
  .control-bar {
    margin-top: 13px;
  }
}
@media (max-width: 1100px) {
  .challenge-bar > div {
    padding: 13px;
  }
  .challenge-label {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .challenge-bar small,
  .goal-status > span {
    font-size: 8px;
  }
  .intro p {
    max-width: 380px;
  }
  .action-preview > strong {
    font-size: 9px;
  }
  .action-preview > span {
    font-size: 8px;
  }
}
@media (max-width: 760px) {
  .intro {
    padding: 24px 0 18px;
    align-items: center;
  }
  .intro h1 {
    font-size: 32px;
  }
  .intro p {
    font-size: 10px;
    max-width: 235px;
  }
  .intro .eyebrow {
    font-size: 6px;
    letter-spacing: 1.3px;
  }
  .challenge-bar {
    grid-template-columns: 1.3fr 1fr;
    margin-bottom: 12px;
  }
  .challenge-bar > div {
    padding: 11px 13px;
  }
  .challenge-bar > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #294047;
  }
  .challenge-bar > div:nth-child(4) {
    border-top: 1px solid #294047;
  }
  .round-status {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 8px;
  }
  .round-status > strong {
    font-size: 26px;
    grid-row: 1/3;
    grid-column: 2;
    margin: 0;
  }
  .round-status small {
    grid-row: 2;
  }
  .goal-track {
    margin: 8px 0 6px;
  }
  .goal-status > span {
    font-size: 8px;
  }
  .challenge-label {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .storm-status > strong {
    font-size: 15px;
    margin: 2px 0;
  }
  .combo-status > strong {
    font-size: 15px;
    margin: 1px 0;
  }
  .challenge-bar small {
    font-size: 8px;
  }
  .combo-track {
    margin-top: 4px;
  }
  .score-panel,
  .piece-panel {
    padding: 13px;
  }
  .score {
    font-size: 32px;
  }
  .stats-row {
    margin-top: 9px;
    padding-top: 9px;
  }
  .piece-heading {
    margin-top: 9px;
    margin-bottom: 5px;
  }
  .piece-description {
    display: none;
  }
  .action-preview {
    padding: 6px 7px;
    margin-top: 7px;
  }
  .action-preview > strong {
    font-size: 8px;
    line-height: 1.5;
  }
  .action-preview > span {
    font-size: 7px;
    line-height: 1.5;
    margin-top: 2px;
  }
  .timer-label {
    margin: 7px 0 4px;
  }
  .timer-track {
    height: 2px;
  }
  .next-heading {
    display: none;
  }
  .next-queue {
    margin-top: 7px;
  }
  .board-panel {
    min-height: 405px;
  }
  .canvas-wrap {
    min-height: 320px;
  }
  .field-note {
    display: none;
  }
  .sandbox .action-preview {
    margin-bottom: 5px;
  }
  .sandbox-tools {
    margin-top: 7px;
  }
  .intro h1 {
    letter-spacing: -1px;
  }
  .mode-switch button {
    padding: 8px;
  }
  .board-topline {
    font-size: 6px;
  }
  .header-actions {
    gap: 8px;
  }
  .site-header .icon-button {
    width: 31px;
    height: 31px;
  }
  .site-header {
    padding: 0 4%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .goal-track > div {
    transition: none;
  }
}
/* Keep the play surface, forecast, and primary actions in the first viewport. */
@media (min-width: 761px) {
  .site-header {
    height: 72px;
  }
  .intro {
    padding: 18px 0 16px;
  }
  .intro h1 {
    font-size: 35px;
    margin: 5px 0 5px;
  }
  .intro p {
    font-size: 11px;
  }
  .intro .eyebrow {
    font-size: 8px;
  }
  .challenge-bar {
    margin-bottom: 12px;
  }
  .challenge-bar > div {
    padding: 11px 16px;
  }
  .challenge-label {
    font-size: 7px;
  }
  .goal-track {
    margin: 9px 0 6px;
  }
  .round-status > strong {
    font-size: 24px;
  }
  .storm-status > strong {
    font-size: 16px;
    margin: 3px 0 1px;
  }
  .combo-status > strong {
    font-size: 15px;
    margin: 3px 0;
  }
  .game-layout {
    height: clamp(460px, calc(100dvh - 345px), 610px);
    align-items: stretch;
  }
  .sidebar {
    min-height: 0;
    gap: 12px;
  }
  .field-note {
    display: none;
  }
  .score-panel {
    flex-shrink: 0;
    padding: 15px 17px;
  }
  .score {
    font-size: 36px;
    margin-top: 5px;
    line-height: 1.2;
  }
  .stats-row {
    margin-top: 12px;
    padding-top: 11px;
  }
  .loss-track {
    margin-top: 11px;
  }
  .piece-panel {
    min-height: 0;
    padding: 15px 17px;
    overflow: auto;
  }
  .piece-heading {
    margin: 12px 0 8px;
  }
  .piece-description {
    min-height: 0;
    font-size: 10px;
  }
  .action-preview {
    padding: 7px 9px;
    margin-top: 8px;
  }
  .timer-label {
    margin: 10px 0 6px;
  }
  .next-heading {
    margin: 14px 0 9px;
  }
  .board-panel {
    min-height: 0;
    height: 100%;
  }
  .canvas-wrap {
    min-height: 0;
  }
  .board-topline {
    padding: 16px 20px;
  }
  .board-bottomline {
    padding: 14px 20px;
  }
  .control-bar {
    margin: 13px 0 18px;
    min-height: 37px;
  }
  .sandbox-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
  }
  .tool-button {
    padding: 7px 3px;
    font-size: 9px;
  }
  footer {
    padding: 15px 0;
  }
}
@media (max-width: 760px) {
  main {
    width: 94%;
  }
  .site-header {
    height: 50px;
    padding: 0 3%;
  }
  .brand {
    font-size: 17px;
    gap: 8px;
    letter-spacing: 3px;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 29px;
    border-radius: 7px;
  }
  .brand-tag {
    display: none;
  }
  .header-actions {
    gap: 7px;
  }
  .site-header .icon-button {
    width: 27px;
    height: 27px;
    font-size: 14px;
  }
  #mute-btn {
    font-size: 16px;
  }
  .intro {
    min-height: 49px;
    padding: 9px 0;
    align-items: center;
    gap: 10px;
  }
  .intro .eyebrow,
  .intro p {
    display: none;
  }
  .intro h1 {
    font-size: 25px;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.6px;
  }
  .mode-switch {
    margin: 0;
    padding: 2px;
    border-radius: 5px;
  }
  .mode-switch button {
    padding: 6px 8px;
    font-size: 9px;
  }
  .challenge-bar {
    margin-bottom: 8px;
    border-radius: 6px;
    grid-template-columns: 1.2fr 1fr;
  }
  .challenge-bar > div {
    padding: 6px 10px;
  }
  .challenge-label {
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  .challenge-label strong {
    font-size: 10px;
  }
  .goal-track {
    height: 3px;
    margin: 7px 0 2px;
  }
  .goal-status > span {
    display: none;
  }
  .round-status {
    grid-template-columns: 1fr auto;
    gap: 0 5px;
  }
  .round-status > strong {
    font-size: 23px;
    line-height: 1;
  }
  .round-status small {
    font-size: 6px;
    letter-spacing: 0.9px;
  }
  .storm-status {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 8px;
  }
  .storm-status > .challenge-label {
    grid-column: 1 / 3;
  }
  .storm-status > strong {
    font-size: 12px;
    margin: 2px 0 0;
  }
  .storm-status > small {
    font-size: 6px;
    max-width: 90px;
    text-align: right;
    line-height: 1.3;
  }
  .combo-status {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 5px;
  }
  .combo-status > .challenge-label {
    grid-column: 1;
  }
  .combo-status > strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 11px;
    margin: 0;
    letter-spacing: 0.5px;
  }
  .combo-status > small {
    grid-column: 1 / 3;
    font-size: 7px;
    line-height: 1.2;
  }
  .combo-track {
    grid-column: 1 / 3;
    margin-top: 0;
    height: 2px;
  }
  .game-layout {
    gap: 8px;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .score-panel {
    display: grid;
    grid-template-columns: 67px 1fr;
    grid-template-rows: 11px 24px;
    padding: 7px 11px 9px;
    position: relative;
    border-radius: 6px;
  }
  .score-panel > .panel-label {
    grid-column: 1;
    grid-row: 1;
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  .score-panel > .panel-label > span {
    display: none;
  }
  .score {
    grid-column: 1;
    grid-row: 2;
    font-size: 22px;
    line-height: 1;
    margin: 2px 0 0;
    letter-spacing: -0.8px;
  }
  .best-line {
    display: none;
  }
  .stats-row {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    padding: 0 0 0 9px;
    border-top: 0;
    border-left: 1px solid #304249;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
  }
  .stats-row strong {
    font-size: 15px;
    line-height: 1;
  }
  .stats-row small {
    font-size: 7px;
    margin-top: 3px;
    line-height: 1;
  }
  .stats-row em {
    font-size: 8px;
  }
  .stats-row > div {
    padding-left: 14px;
  }
  .stat-icon {
    font-size: 8px;
    top: 0;
  }
  .lost-icon {
    font-size: 13px;
    top: -3px;
  }
  .loss-track {
    position: absolute;
    left: 87px;
    right: 11px;
    bottom: 5px;
    margin: 0;
    height: 2px;
  }
  .piece-panel {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 3px 10px;
    padding: 7px 10px 8px;
    border-radius: 6px;
  }
  .piece-panel > .panel-label {
    grid-column: 1;
    grid-row: 1;
    font-size: 6px;
    height: 11px;
  }
  .piece-panel .live-dot {
    display: none;
  }
  .piece-heading {
    grid-column: 1;
    grid-row: 2;
    gap: 7px;
    margin: 0;
  }
  .piece-symbol {
    width: 25px;
    height: 25px;
    font-size: 17px;
  }
  .piece-heading h2 {
    font-size: 12px;
    line-height: 1.1;
    margin-bottom: 2px;
  }
  .rotation-label {
    font-size: 5px;
    letter-spacing: 0.9px;
    display: block;
  }
  .piece-description {
    display: none;
  }
  .action-preview {
    grid-column: 1 / 3;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    margin: 1px 0 0;
    min-height: 25px;
  }
  .action-preview > strong {
    flex: 1;
    font-size: 8px;
    line-height: 1.35;
  }
  .action-preview > span {
    flex: 1;
    font-size: 7px;
    line-height: 1.35;
    margin: 0;
  }
  .timer-label {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin: 0;
    font-size: 6px;
  }
  .timer-label strong {
    font-size: 10px;
  }
  .timer-track {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    height: 2px;
    margin-bottom: 1px;
  }
  .next-heading {
    display: none;
  }
  .next-queue {
    grid-column: 2;
    grid-row: 1;
    height: 12px;
    margin: 0;
    gap: 4px;
    align-items: center;
  }
  .queue-item {
    height: 14px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .queue-item canvas {
    width: 25px;
    height: 15px;
  }
  .queue-item span {
    display: none;
  }
  .sandbox-tools {
    grid-column: 1 / 3;
    grid-row: 4;
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin: 3px -2px 0;
    padding: 1px 2px 4px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  .tool-button {
    flex: 0 0 auto;
    padding: 6px 8px;
    font-size: 9px;
    white-space: nowrap;
    scroll-snap-align: start;
    min-height: 28px;
  }
  .sandbox .piece-panel {
    padding-bottom: 5px;
  }
  .sandbox .action-preview {
    margin: 1px 0 0;
  }
  .sandbox .piece-panel > .panel-label {
    grid-column: 1 / 3;
  }
  .board-panel {
    height: 330px;
    min-height: 0;
    border-radius: 6px;
  }
  .canvas-wrap {
    min-height: 0;
  }
  .board-topline {
    padding: 10px 12px;
    font-size: 6px;
  }
  .board-bottomline {
    padding: 9px 12px;
  }
  .legend {
    gap: 14px;
    font-size: 6px;
    letter-spacing: 1px;
  }
  .legend i {
    width: 6px;
    height: 6px;
  }
  .coordinates {
    font-size: 8px;
  }
  .board-hint {
    font-size: 8px;
    bottom: 0;
  }
  .field-note {
    display: none;
  }
  .control-bar {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #0a171ef5;
    border-top: 1px solid #2d4448;
    border-radius: 6px 6px 0 0;
    margin: 8px 0 0;
    padding: 8px 0 5px;
    gap: 7px;
    box-shadow: 0 -5px 18px #07151a70;
  }
  .touch-controls {
    width: 100%;
    gap: 8px;
  }
  .control-bar .secondary-button,
  .control-bar .primary-button {
    padding: 10px 16px;
    font-size: 11px;
  }
  .game-actions {
    gap: 25px;
  }
  .game-actions .text-button {
    font-size: 10px;
    padding: 2px 0;
  }
  .action-divider {
    height: 11px;
  }
  footer {
    margin-top: 10px;
    padding: 10px 0 15px;
    font-size: 5px;
  }
  .game-overlay {
    padding: 20px;
    gap: 12px;
  }
  .game-overlay h2 {
    font-size: 27px;
  }
  .game-overlay p {
    font-size: 10px;
  }
}
@media (max-width: 760px) and (max-height: 700px) {
  .board-panel {
    height: 290px;
  }
}
.sandbox-tools [data-piece="heat"] {
  order: -3;
}
.sandbox-tools [data-piece="bomb"] {
  order: -2;
}
.sandbox-tools [data-piece="rain"] {
  order: -1;
}
@media (max-width: 760px) {
  /* The selected tool already names the sandbox controls; use that row first. */
  .sandbox .piece-panel {
    padding-top: 5px;
    padding-bottom: 4px;
  }
  .sandbox .piece-panel > .panel-label {
    display: none;
  }
  .sandbox .piece-heading {
    grid-row: 1;
  }
  .sandbox .action-preview {
    grid-row: 2;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .sandbox .sandbox-tools {
    grid-row: 3;
    margin-top: 1px;
  }
}
