:root {
  --leaf: #1d7158;
  --deep: #174f45;
  --lime: #a8cf62;
  --bark: #70452d;
  --cream: #fff8d8;
  --ink: #203b31;
}
html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #174f45;
}
body.torque-day {
  color: var(--ink);
  background: linear-gradient(#68c8ba 0 48%, #287159 48%);
  touch-action: manipulation;
}
.torque-day .game-shell {
  height: 100dvh;
  min-height: 0;
  padding: max(7px, env(safe-area-inset-top))
    max(9px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom))
    max(9px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: 50px auto minmax(190px, 1fr) auto;
  gap: 6px;
  max-width: 760px;
  background: transparent;
}
.torque-day header {
  padding: 0;
  min-height: 50px;
}
.torque-day .brand {
  color: #fff;
}
.torque-day .brand small {
  color: #dff79c;
}
.torque-day .round-button {
  width: 46px;
  height: 46px;
  min-height: 46px;
  background: #fff8d8;
  color: #174f45;
  border-color: #fff;
}
.torque-day .mission-card {
  margin: 0;
  padding: 6px 12px;
  min-height: 86px;
  background: #fff8d8f7;
  border: 2px solid #1d7158;
  color: var(--ink);
}
.torque-day .mission-card > div:first-child {
  display: flex;
  justify-content: space-between;
}
.torque-day .mission-card p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.15;
}
.torque-readout {
  display: flex;
  justify-content: center !important;
  gap: 18px;
  align-items: center;
  font-size: 12px;
  color: #174f45;
}
.torque-readout b {
  min-width: 54px;
  text-align: center;
}
.torque-day .progress-track {
  height: 6px;
  margin: 3px 0 0;
}
.torque-day .progress-track i {
  background: linear-gradient(90deg, #e09b42, #61a956);
}
#stage {
  position: relative;
  min-height: 0;
  height: auto;
  border: 2px solid #e8ffd2;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(#70d0c1 0 68%, #31765d 68%);
  isolation: isolate;
  box-shadow: 0 8px 18px #123c3566;
}
#stage canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}
.scene-caption {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 999px;
  background: #174f45dd;
  color: #efffc7;
  white-space: nowrap;
  font-size: 9px;
  letter-spacing: 0.12em;
}
#targets {
  display: contents;
}
.hook {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border: 3px solid #fff8c8;
  border-radius: 50%;
  background: #226853dd;
  color: #fff;
  font:
    900 14px/1 Nunito,
    sans-serif;
  pointer-events: auto;
  box-shadow: 0 0 0 3px #9bd37866;
  touch-action: manipulation;
}
.hook::after {
  content: attr(data-distance) "×";
  display: block;
  font-size: 10px;
  margin-top: 2px;
  color: #efffb7;
}
.hook.ready {
  animation: hookGlow 0.75s ease-in-out infinite alternate;
}
.hook.filled {
  background: #e09943;
  border-color: #fff4b2;
  color: #2f412f;
}
.hook.hinted {
  outline: 4px solid #fff;
  outline-offset: 2px;
}
.hook:disabled {
  opacity: 0.7;
}
.hook:active {
  transform: translate(-50%, -50%) scale(0.96);
}
@keyframes hookGlow {
  to {
    filter: brightness(1.24);
    box-shadow: 0 0 16px #efffae;
  }
}
#loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: #174f45;
  color: #efffc7;
  font-weight: 900;
}
.dock {
  margin: 0;
  padding: 7px 9px;
  background: #fff8d8f7;
  border: 2px solid #1d7158;
  border-radius: 17px;
  color: var(--ink);
  display: grid;
  gap: 7px;
}
#pieces {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 50px;
}
.piece {
  min-width: 74px;
  min-height: 50px;
  padding: 4px 8px;
  border: 2px solid #276a52;
  border-radius: 15px;
  background: linear-gradient(#d6e77a, #9bc65c);
  color: #203b31;
  font:
    900 11px/1 Nunito,
    sans-serif;
  box-shadow: 0 3px 0 #426f42;
}
.piece .shape {
  display: block;
  font-size: 20px;
  line-height: 21px;
}
.piece.selected {
  outline: 4px solid #e79b43;
  outline-offset: 1px;
  background: #fff09b;
}
.piece.hinted {
  box-shadow: 0 0 0 4px #fff;
}
.piece:disabled {
  opacity: 0.42;
  box-shadow: none;
}
.dock-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.torque-day #hint,
.torque-day #undo,
.torque-day #restart {
  min-width: 82px;
  min-height: 44px;
  padding: 6px 8px;
}
.torque-day .intro-card {
  border-color: #2d7a5d;
  background: #fffced;
}
.torque-day .primary {
  background: linear-gradient(135deg, #2d8a67, #175742);
}
.torque-day .eyebrow {
  color: #287159;
}
.torque-day #announcement {
  z-index: 20;
}
.torque-day button:focus-visible,
.torque-day a:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 2px;
}
body.stage-complete #stage {
  box-shadow:
    0 0 0 4px #eaff9a,
    0 0 30px #dcff8b;
}
@media (prefers-reduced-motion: reduce) {
  .hook {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 360px) {
  .torque-day .brand small {
    display: none;
  }
  .torque-day .mission-card {
    min-height: 76px;
  }
  .torque-day .mission-card p {
    font-size: 11px;
  }
  .piece {
    min-width: 62px;
    padding: 3px;
    font-size: 10px;
  }
  .torque-day #hint,
  .torque-day #undo,
  .torque-day #restart {
    min-width: 72px;
    font-size: 11px;
  }
}
@media (max-height: 620px) and (orientation: portrait) {
  .torque-day .game-shell {
    grid-template-rows: 46px 76px minmax(166px, 1fr) 106px;
    gap: 4px;
  }
  .torque-day header {
    min-height: 46px;
  }
  .torque-day .round-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .torque-day .mission-card {
    min-height: 0;
    padding: 4px 10px;
  }
  .dock {
    padding: 4px 7px;
    gap: 4px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .torque-day .game-shell {
    max-width: 920px;
    grid-template-columns: 170px minmax(0, 1fr) 240px;
    grid-template-rows: 48px minmax(240px, 1fr);
    gap: 6px;
  }
  .torque-day header {
    grid-column: 1/4;
  }
  .torque-day .mission-card {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: auto;
  }
  .torque-day .mission-card > div:first-child {
    display: block;
  }
  .torque-day .mission-card p {
    font-size: 12px;
    margin: 7px 0;
  }
  .torque-day #stage {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    width: auto;
  }
  .torque-day .dock {
    grid-column: 3;
    grid-row: 2;
    width: auto;
    align-content: center;
  }
  .torque-day #pieces {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .piece {
    min-width: 0;
  }
  .torque-day #hint,
  .torque-day #undo,
  .torque-day #restart {
    width: auto;
    min-width: 0;
    flex: 1;
  }
}
