:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1510;
  color: #f6fff2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #0b1510;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app,
#game {
  width: 100vw;
  height: 100vh;
}

#game {
  display: block;
  touch-action: none;
}

.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(8, 15, 11, .9), rgba(8, 15, 11, .42)),
    radial-gradient(circle at 78% 26%, rgba(252, 93, 105, .24), transparent 32%),
    radial-gradient(circle at 36% 78%, rgba(83, 179, 135, .18), transparent 30%);
  backdrop-filter: blur(2px);
}

.hidden {
  display: none !important;
}

.site-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 6;
  min-width: 96px;
  padding: 10px 13px;
  border: 1px solid rgba(226, 255, 219, .24);
  border-radius: 8px;
  background: rgba(7, 15, 11, .78);
  color: #f6fff2;
  font-weight: 900;
  text-decoration: none;
}

.menu-panel,
.finish-panel {
  width: min(920px, 100%);
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(226, 255, 219, .2);
  border-radius: 8px;
  background: rgba(11, 21, 16, .78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

.eyebrow {
  margin: 0 0 10px;
  color: #9ee4b2;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(46px, 8vw, 92px);
  line-height: .92;
  letter-spacing: 0;
}

h2 {
  max-width: 12ch;
  font-size: clamp(42px, 7vw, 76px);
}

.subtitle {
  max-width: 58ch;
  margin: 22px 0 28px;
  color: #d7ead3;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.45;
}

.primary {
  min-width: 180px;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: #f3c84b;
  color: #1d1506;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 14px 0 #8a6621;
}

.secondary {
  min-width: 180px;
  min-height: 48px;
  margin-left: 10px;
  border: 1px solid rgba(226, 255, 219, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #f6fff2;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
}

.language-row,
.course-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #9ee4b2;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.language-row select,
.course-row select {
  min-height: 38px;
  border: 1px solid rgba(226, 255, 219, .22);
  border-radius: 8px;
  background: rgba(7, 15, 11, .82);
  color: #f6fff2;
  font: inherit;
  padding: 0 10px;
}

.records {
  margin-top: 18px;
  max-width: 560px;
  color: #d7ead3;
  font-size: 15px;
  line-height: 1.45;
}

.records span {
  display: block;
}

.map-select-panel {
  width: min(860px, 100%);
}

.map-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.map-choice {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(226, 255, 219, .26);
  border-radius: 8px;
  color: #f6fff2;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 -90px 80px rgba(0, 0, 0, .34);
}

.map-choice strong {
  font-size: 32px;
  line-height: 1;
}

.map-choice span {
  color: #f3f7d1;
  font-weight: 800;
}

.forest-choice {
  background:
    linear-gradient(135deg, rgba(24, 84, 44, .92), rgba(8, 28, 20, .72)),
    radial-gradient(circle at 75% 18%, rgba(216, 77, 88, .9) 0 10%, transparent 11%),
    #17351f;
}

.pirate-choice {
  background:
    linear-gradient(135deg, rgba(219, 180, 98, .9), rgba(15, 106, 128, .78)),
    radial-gradient(circle at 78% 22%, rgba(20, 20, 20, .82) 0 12%, transparent 13%),
    #167d93;
}

@media (max-width: 720px) {
  .map-choice-grid {
    grid-template-columns: 1fr;
  }
}

.primary:active {
  transform: translateY(5px);
  box-shadow: 0 9px 0 #8a6621;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 9, 6, .68);
  backdrop-filter: blur(4px);
}

.modal-panel {
  width: min(680px, 100%);
  padding: 24px;
  border: 1px solid rgba(226, 255, 219, .22);
  border-radius: 8px;
  background: rgba(11, 21, 16, .94);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-head h2 {
  font-size: 34px;
  line-height: 1;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(226, 255, 219, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #f6fff2;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 900;
}

.skin-panel {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 18px;
  margin: 0;
}

.settings-panel {
  display: grid;
  gap: 20px;
}

.settings-panel label {
  display: grid;
  gap: 10px;
  color: #f6fff2;
  font-weight: 900;
}

.settings-panel span {
  color: #9ee4b2;
  font-size: 12px;
  text-transform: uppercase;
}

.settings-panel input {
  width: 100%;
  accent-color: #f3c84b;
}

.skin-label {
  display: block;
  margin-bottom: 9px;
  color: #9ee4b2;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.skin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skin-choice,
.skin-option {
  height: 42px;
  border: 1px solid rgba(226, 255, 219, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: #f6fff2;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.skin-choice {
  width: 42px;
  display: grid;
  place-items: center;
  padding: 0;
}

.skin-choice span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, .25);
}

.skin-option {
  padding: 0 12px;
}

.skin-choice.selected,
.skin-option.selected {
  border-color: #f3c84b;
  box-shadow: 0 0 0 2px rgba(243, 200, 75, .28);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
  color: #e8ffe3;
}

.menu-grid span {
  min-height: 42px;
  padding: 11px 13px;
  border: 1px solid rgba(226, 255, 219, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 10px;
  pointer-events: none;
}

.hud div,
.hud-button {
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(226, 255, 219, .18);
  border-radius: 8px;
  background: rgba(7, 15, 11, .72);
}

.hud-button {
  color: #f6fff2;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  pointer-events: auto;
}

.hud span {
  display: block;
  color: #9ee4b2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
}

.message {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  min-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 8px;
  background: rgba(7, 15, 11, .82);
  color: #f6fff2;
  text-align: center;
  font-weight: 800;
}

.controls-hint {
  position: fixed;
  left: 16px;
  top: 96px;
  display: grid;
  gap: 7px;
  max-width: 230px;
  padding: 12px;
  border: 1px solid rgba(226, 255, 219, .18);
  border-radius: 8px;
  background: rgba(7, 15, 11, .72);
  color: #e8ffe3;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.controls-hint span {
  display: block;
}

.power {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 40px));
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.power span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #9ee4b2, #f3c84b, #f05e63);
}

#finalScore {
  margin: 22px 0 28px;
  color: #d7ead3;
  font-size: 22px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .screen {
    align-items: end;
    padding: 16px;
  }

  .menu-grid,
  .hud,
  .skin-panel {
    grid-template-columns: 1fr 1fr;
  }

  .skin-panel {
    grid-template-columns: 1fr;
  }

  .hud {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .hud div {
    min-height: 48px;
    padding: 7px 9px;
  }

  .hud strong {
    font-size: 19px;
  }

  .controls-hint {
    display: none !important;
  }
}
