@import url('./fonts.css');
:root {
  font-family: Barlow, Arial, sans-serif;
  color: #f6edcf;
  background: #15252b;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
select,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
select:focus-visible {
  outline: 3px solid #ffd13d;
  outline-offset: 4px;
}
#game {
  position: fixed;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 24px 32px;
  gap: 24px;
  pointer-events: none;
  background: linear-gradient(#10242b99, transparent);
}
header button {
  pointer-events: auto;
}
.brand {
  font:
    900 32px/0.78 'Barlow Condensed',
    Impact,
    sans-serif;
  letter-spacing: -1px;
  transform: rotate(-4deg);
  text-shadow: 2px 3px #142027;
}
.brand span {
  color: #ffd13d;
}
.lab {
  font-size: 12px;
  letter-spacing: 2px;
  line-height: 1.7;
}
.lab b {
  display: block;
  font-size: 15px;
  letter-spacing: 1px;
}
.tools {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.tools button {
  background: #17282dc9;
  border: 1px solid #ffffff35;
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.tools #fullscreen {
  font-size: 22px;
  padding: 3px 12px;
}
.panel {
  position: fixed;
  left: 7vw;
  top: 50%;
  transform: translateY(-46%);
  width: 430px;
  max-width: 85vw;
  padding: 28px 30px;
  background: #14252bec;
  border-left: 4px solid #ffd13d;
  box-shadow: 0 24px 70px #0004;
}
.eyebrow {
  color: #ffd13d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}
.panel h1 {
  font:
    800 clamp(42px, 5.5vw, 72px) / 0.98 'Barlow Condensed',
    Impact,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: -1px;
  margin: 20px 0;
}
.panel h1 em {
  font-style: normal;
  color: #ffd13d;
}
.panel p {
  font-size: 16px;
  line-height: 1.5;
  color: #c5ced0;
}
.controls-guide {
  display: flex;
  gap: 15px;
  margin: 24px 0;
  font-size: 11px;
  font-weight: 700;
}
.controls-guide span {
  display: grid;
  gap: 6px;
}
kbd {
  font:
    700 12px Barlow,
    Arial;
  border: 1px solid #647275;
  padding: 6px;
  border-radius: 3px;
  color: #fff;
}
.primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffd13d;
  border: 0;
  border-radius: 2px;
  color: #17252b;
  padding: 16px 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.primary span {
  font-size: 22px;
}
.primary:hover {
  background: #ffe68b;
}
.fine {
  color: #95a5aa;
  font-size: 12px;
  margin-top: 13px;
}
.secondary {
  background: transparent;
  border: 1px solid #6a787d;
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 700;
}
.result-stats {
  display: flex;
  gap: 25px;
  margin: 20px 0;
  color: #ffd13d;
  font-weight: 700;
}
footer {
  position: fixed;
  bottom: 16px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #c5d1d3;
  pointer-events: none;
}
footer b {
  color: #ffd13d;
}
#hud {
  position: fixed;
  top: 110px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  text-shadow: 0 2px 4px #0008;
}
.controller-navigation :focus {
  outline: 3px solid #ffd13d;
  outline-offset: 3px;
}
.stat small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #c4d1d4;
}
.stat strong {
  display: block;
  font:
    700 24px 'Barlow Condensed',
    Impact;
}
.stat > span {
  font-size: 12px;
  letter-spacing: 1px;
}
#egg-advice {
  display: block;
  max-width: 190px;
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.5px;
}
.distance {
  text-align: right;
}
.time {
  text-align: center;
}
.time b {
  font:
    700 36px 'Barlow Condensed',
    Impact;
}
.time span {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
}
.stability {
  background: #15252b77;
  width: 140px;
  height: 5px;
  margin-top: 7px;
}
.stability i {
  display: block;
  background: #ffd13d;
  height: 100%;
  transition: width 0.1s;
}
#progress {
  position: fixed;
  top: 0;
  width: 100%;
  height: 4px;
}
#progress i {
  display: block;
  height: 100%;
  background: #ffd13d;
  width: 0;
}
#toast {
  position: fixed;
  top: 31%;
  left: 50%;
  transform: translateX(-50%);
  font:
    800 27px 'Barlow Condensed',
    Impact;
  letter-spacing: 1px;
  background: #15252bcd;
  padding: 8px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  text-align: center;
}
#toast.visible {
  opacity: 1;
}
#debug {
  position: fixed;
  right: 25px;
  bottom: 75px;
  padding: 15px;
  background: #102025df;
  color: #d4e9d4;
  font: 12px/1.5 monospace;
  pointer-events: none;
}
dialog {
  background: #17282f;
  color: #f6edcf;
  border: 1px solid #6d797b;
  border-top: 4px solid #ffd13d;
  max-width: 440px;
  width: 90vw;
  padding: 25px;
  max-height: 90dvh;
}
dialog::backdrop {
  background: #07141dd9;
}
dialog h2 {
  font:
    800 32px 'Barlow Condensed',
    Impact;
  margin: 15px 0;
}
label {
  display: block;
  margin: 16px 0;
  font-size: 15px;
}
select {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: #273b43;
  border: 1px solid #5a727d;
  color: #fff;
}
.hint {
  font-size: 13px;
  line-height: 1.5;
  color: #aec0c6;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: #ffd13d;
}
#touch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  touch-action: none;
}
.touch-zone {
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 2px solid #e4efd542;
  background: #17282f44;
  bottom: max(50px, env(safe-area-inset-bottom));
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.touch-zone i {
  position: absolute;
  left: 37px;
  top: 37px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f6edcf55;
  border: 1px solid #fff8;
}
.touch-zone span {
  position: absolute;
  bottom: -23px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
#stick {
  left: max(30px, env(safe-area-inset-left));
}
#balance {
  right: max(30px, env(safe-area-inset-right));
  border-color: #ffd13d66;
}
#balance.active {
  background: #ffd13d44;
}
#jump {
  position: absolute;
  right: 164px;
  bottom: 70px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #f7e8b276;
  background: #192b31a6;
  font-weight: 800;
  font-size: 13px;
  pointer-events: auto;
  touch-action: none;
}
.mirrored #stick {
  left: auto;
  right: 30px;
}
.mirrored #balance {
  right: auto;
  left: 30px;
}
.mirrored #jump {
  right: auto;
  left: 164px;
}
#rotate {
  display: none;
  position: fixed;
  bottom: 35%;
  left: 10%;
  right: 10%;
  text-align: center;
  background: #17282fe8;
  border: 1px solid #ffd13d;
  padding: 15px;
  font-weight: 700;
}
#rotate small {
  display: block;
  margin-top: 6px;
  font-weight: 400;
}
body.playing .panel {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (max-height: 600px) {
  header {
    padding: 16px 22px;
  }
  .brand {
    font-size: 27px;
  }
  .lab {
    font-size: 10px;
  }
  .lab b {
    font-size: 12px;
  }
  #hud {
    top: 80px;
    left: 22px;
    right: 22px;
  }
  .panel {
    padding: 20px 24px;
    width: 370px;
    transform: translateY(-40%);
  }
  .panel h1 {
    font-size: 42px;
    margin: 12px 0;
  }
  .panel p {
    font-size: 14px;
  }
  .controls-guide {
    margin: 12px 0;
  }
  .fine {
    font-size: 11px;
  }
  .primary {
    padding: 12px 16px;
  }
  footer {
    bottom: 8px;
    font-size: 9px;
  }
  .time b {
    font-size: 28px;
  }
  .stat strong {
    font-size: 20px;
  }
  .touch-zone {
    bottom: 35px;
    width: 104px;
    height: 104px;
  }
  .touch-zone i {
    left: 31px;
    top: 31px;
  }
  #jump {
    bottom: 55px;
    right: 148px;
    width: 65px;
    height: 65px;
  }
}
@media (pointer: coarse) {
  .controls-guide {
    display: none;
  }
  #footer-hint {
    display: none;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .lab {
    display: none;
  }
  .tools button {
    padding: 8px;
    font-size: 10px;
  }
  .panel {
    left: 6vw;
    top: 48%;
    width: 88vw;
  }
  .panel h1 {
    font-size: 54px;
  }
  body.playing #rotate {
    display: block;
  }
  #hud {
    top: 100px;
  }
  .time span {
    max-width: 120px;
    letter-spacing: 0.5px;
  }
  footer {
    left: 20px;
    right: 20px;
  }
  footer span:last-child {
    display: none;
  }
}

/* Farm course controls and comfortable small-screen layout. */
#dive,
#sprint {
  position: absolute;
  right: 166px;
  bottom: 155px;
  width: 70px;
  height: 60px;
  border-radius: 24px;
  border: 2px solid #f7e8b276;
  background: #192b31bd;
  font-weight: 800;
  font-size: 13px;
  pointer-events: auto;
  touch-action: none;
}
#sprint {
  right: 248px;
  bottom: 82px;
}
.mirrored #dive {
  right: auto;
  left: 166px;
}
.mirrored #sprint {
  right: auto;
  left: 248px;
}
.controls-guide {
  flex-wrap: wrap;
  gap: 12px;
}
.panel {
  border-radius: 8px 30px 8px 8px;
}
.tools button {
  font-size: 14px;
}
.stat small,
.time span {
  font-size: 12px;
}
.fine {
  font-size: 13px;
}
footer {
  font-size: 12px;
}
body.playing header .lab {
  opacity: 0.7;
}
@media (max-height: 600px) {
  .panel {
    max-height: calc(100dvh - 100px);
    overflow: auto;
    top: 52%;
    transform: translateY(-45%);
  }
  #dive {
    right: 145px;
    bottom: 133px;
    width: 62px;
    height: 54px;
  }
  #sprint {
    right: 217px;
    bottom: 62px;
    width: 64px;
  }
  .tools button {
    font-size: 12px;
  }
  footer {
    font-size: 10px;
  }
}

#hud .stat,
#hud .time {
  background: #15252bb8;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 3px 15px #0001;
}
.time span {
  letter-spacing: 1px;
}
#hud .time {
  background: #15252b;
}
@media (min-width: 760px) and (min-height: 601px) {
  #hud .time {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 240px;
  }
}
footer {
  color: #fff;
  text-shadow: 0 1px 4px #13291b;
}
@media (max-width: 600px) and (orientation: portrait) {
  #hud {
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  #hud .stat,
  #hud .time {
    padding: 8px;
    min-width: 0;
  }
  #hud .stat strong {
    font-size: 20px;
    white-space: nowrap;
  }
  #hud .stat small,
  #hud .stat > span,
  #hud .time span {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  #hud .time b {
    font-size: 28px;
  }
  #hud .stability {
    width: 100%;
  }
}
input[type='range'] {
  display: block;
  width: 100%;
  margin-top: 10px;
  accent-color: #ffd13d;
}
@media (max-height: 600px) {
  #hud .stat,
  #hud .time {
    padding: 6px 10px;
  }
  #hud {
    top: 70px;
  }
  #hud .time {
    position: fixed;
    left: 110px;
    top: 12px;
    max-width: 160px;
    text-align: left;
  }
  header .lab {
    display: none;
  }
  #hud .time b {
    font-size: 25px;
  }
  #hud .time span {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  #toast {
    top: auto;
    bottom: 22px;
    width: max-content;
    max-width: calc(100vw - 320px);
    font-size: 18px;
    padding: 6px 12px;
  }
}
@media (max-height: 450px) {
  .panel {
    top: 54%;
    transform: translateY(-50%);
    padding: 16px 22px;
    max-height: calc(100dvh - 90px);
  }
  .panel h1 {
    font-size: 30px;
    line-height: 0.95;
    margin: 10px 0;
  }
  .panel p {
    font-size: 14px;
    line-height: 1.3;
    margin: 8px 0;
  }
  .panel .controls-guide,
  .panel .fine {
    display: none;
  }
  .panel .primary {
    padding: 12px 16px;
  }
  .panel .eyebrow {
    font-size: 12px;
  }
  .panel .result-stats {
    margin: 10px 0;
  }
}

.share-controls {
  display: flex;
  gap: 10px;
}
.share-controls button {
  font-size: 12px;
}
.result-stats {
  font-size: 14px;
  line-height: 1.6;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}

.panel .earned {
  font-size: 14px;
  color: #b9e899;
  margin: 8px 0 16px;
  line-height: 1.4;
}
.course-picker {
  display: block;
  margin-top: 12px;
  font-size: 12px;
}
#course-board {
  max-width: 980px;
  overflow-y: auto;
}
#course-board h2 {
  margin: 10px 0;
}
#course-board-summary {
  color: #c5d6ce;
  font-size: 14px;
}
#course-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.course-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #65797a;
  border-radius: 12px;
  background: #22383e;
}
.course-card.selected {
  border-color: #ffd13d;
  box-shadow: inset 0 3px #ffd13d;
}
.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 1px;
  color: #c6d2ce;
}
.course-number {
  font:
    800 36px 'Barlow Condensed',
    sans-serif;
  color: #ffcc49;
}
.course-card h3 {
  font:
    800 30px 'Barlow Condensed',
    sans-serif;
  margin: 12px 0 6px;
}
.course-card p {
  font-size: 14px;
  line-height: 1.45;
}
.course-record {
  margin-top: auto;
  padding: 12px 0;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid #52686b;
  color: #becdc7;
}
.course-record.gold {
  color: #ffcc49;
}
.course-record.silver {
  color: #e5eeee;
}
.course-record.bronze {
  color: #edac7c;
}
.course-targets {
  color: #d9e4db;
}
.course-link {
  display: block;
  padding: 12px 8px;
  border-radius: 5px;
  text-align: center;
  background: #ffcc49;
  color: #17282f;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
}
.course-link:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
}
@media (max-width: 700px) {
  #course-cards {
    grid-template-columns: 1fr;
  }
  .course-card h3 {
    margin-top: 4px;
  }
}
.course-picker select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid #627276;
  border-radius: 6px;
  color: #fff0c7;
  background: #22363c;
}
#wardrobe {
  margin-right: 5vw;
  max-width: 360px;
  max-height: 80dvh;
  overflow: auto;
  background: #15252be8;
}
#wardrobe::backdrop {
  background: #07181c44;
}
#achievement-list {
  list-style: none;
  padding: 0;
}
#achievement-list li {
  margin: 12px 0;
  line-height: 1.35;
}
#achievement-list small {
  color: #c2d2cd;
}
#wardrobe-progress {
  color: #ffcc49;
  font-weight: bold;
}
@media (max-width: 600px) {
  #wardrobe {
    margin: auto;
    max-height: 75dvh;
  }
}
#loading-status {
  color: #ffcc49;
  font-size: 14px;
}
#start:disabled,
#settings:disabled {
  cursor: wait;
}
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #ffd13d;
  outline-offset: 4px;
}
#dodge {
  position: absolute;
  left: 184px;
  bottom: 150px;
  width: 72px;
  height: 54px;
  border-radius: 18px;
  border: 2px solid #f7e8b276;
  background: #192b31a6;
  font-weight: 800;
  font-size: 13px;
  pointer-events: auto;
  touch-action: none;
}
.mirrored #dodge {
  left: auto;
  right: 184px;
}
#crouch {
  position: absolute;
  right: 248px;
  bottom: 155px;
  width: 70px;
  height: 60px;
  border-radius: 24px;
  border: 2px solid #f7e8b276;
  background: #192b31bd;
  font-weight: 800;
  font-size: 13px;
  pointer-events: auto;
  touch-action: none;
}
.mirrored #crouch {
  right: auto;
  left: 248px;
}
@media (max-height: 600px) {
  #crouch {
    right: 217px;
    bottom: 133px;
    width: 64px;
    height: 54px;
  }
  .mirrored #crouch {
    right: auto;
    left: 217px;
  }
}
