:root {
  font-family:
    "Arcade Sans",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: #272e2a;
  background: #eef3fa;
  font-synthesis: none;
  --ink: #252e29;
  --muted: #8c958c;
  --line: #e4e6db;
  --lime: #d0ed91;
  --dark: #202c28;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior-y: none;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #98b87b;
  outline-offset: 4px;
}
a {
  text-decoration: none;
  color: inherit;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button,
a {
  -webkit-user-select: none;
  user-select: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
.lobby {
  max-width: 1440px;
  margin: auto;
}
.site-header {
  height: 91px;
  display: flex;
  align-items: center;
  gap: 57px;
  margin: 0 46px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand > svg {
  height: 39px;
  width: 39px;
  padding: 7px;
  background: #d0ed91;
  border-radius: 11px;
  stroke-width: 2.5;
  color: #304633;
}
.brand > span {
  font-size: 23px;
  font-weight: 850;
  letter-spacing: 1px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2.6px;
  margin-top: 2px;
  color: #859078;
  font-weight: 750;
}
.header-nav {
  display: flex;
  gap: 27px;
  height: 100%;
  align-items: center;
}
.header-nav > button {
  height: 100%;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  color: #92998c;
  position: relative;
}
.header-nav > .current {
  color: #354330;
}
.header-nav > .current:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 10%;
  width: 80%;
  height: 3px;
  background: #9cb979;
  border-radius: 2px;
}
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.saved-note {
  font-size: 10px;
  color: #a0a591;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 13px;
}
.saved-note > svg {
  height: 13px;
  width: 13px;
}
.icon-button {
  width: 45px;
  height: 45px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fafaf5;
  border-radius: 12px;
  color: #7d8876;
}
.icon-button svg {
  height: 20px;
  width: 20px;
}
.icon-button.muted {
  opacity: 0.5;
}
.lobby-main {
  padding: 30px 46px 24px;
}
.hero {
  display: grid;
  grid-template-columns: 1.02fr 1.35fr 0.53fr;
  min-height: 305px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 23px;
  overflow: hidden;
  background: #eeeee3;
  box-shadow: 0 15px 40px #69774906;
}
.hero-copy {
  padding: 31px 18px 28px 32px;
  z-index: 1;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 750;
  color: #8e9880;
  display: block;
}
.hero-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  letter-spacing: 1.6px;
}
.hero-copy .eyebrow > b {
  height: 5px;
  width: 5px;
  background: #8bb775;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #9abb7415;
}
.hero h1 {
  font-size: clamp(30px, 3.1vw, 43px);
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: 1px;
  margin: 14px 0 13px;
}
.hero h1 span {
  position: relative;
  white-space: nowrap;
}
.hero h1 span:after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 8px;
  background: #c6db9b;
  left: 1px;
  right: 0;
  z-index: -1;
  transform: rotate(-2deg);
}
.hero-copy p {
  font-size: 11px;
  line-height: 1.9;
  color: #8b927f;
}
.solid-button,
.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.solid-button {
  background: var(--dark);
  color: #f4f6e4;
  border: 1px solid var(--dark);
  box-shadow: 0 3px 0 #19271e0d;
}
.solid-button:hover {
  background: #3e5142;
}
.outline-button {
  border: 1px solid #dce1d3;
  color: #738066;
  background: #fafbf3;
}
.solid-button > svg,
.outline-button > svg {
  height: 17px;
  width: 17px;
}
.hero-copy > .solid-button {
  margin-top: 19px;
  min-height: 43px;
  padding: 10px 16px;
}
.hero-meta {
  display: flex;
  gap: 13px;
  margin-top: 17px;
  color: #9ba18c;
  font-size: 8px;
}
.hero-meta > span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hero-meta svg {
  width: 12px;
  height: 12px;
}
.hero-art {
  position: relative;
  overflow: hidden;
  background: #c7d7c6;
  margin: 13px 0;
  border-radius: 15px;
}
.hero-art canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
}
.hero-sticker {
  position: absolute;
  left: 23px;
  top: 28px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 600;
  color: #e8f0d5;
  transform: rotate(-6deg);
  line-height: 1.45;
  text-shadow: 0 2px #385c3522;
}
.hero-sticker strong {
  font-size: 27px;
  font-weight: 950;
  letter-spacing: 1px;
}
.hero-art-tag {
  position: absolute;
  bottom: 19px;
  left: 21px;
  color: #374e3e;
  font-size: 8px;
  letter-spacing: 1.8px;
  font-weight: 750;
  background: #eaf1d9b0;
  backdrop-filter: blur(6px);
  padding: 7px 9px;
  border-radius: 5px;
}
.hero-art-tag b {
  margin-left: 14px;
  color: #719473;
  font-size: 10px;
}
.hero-side {
  padding: 34px 25px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.hero-side > span:first-child {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #9ca28b;
  font-weight: 750;
}
.hero-side > strong {
  font-size: 45px;
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1.25;
  margin: 15px 0 3px;
  color: #4c6149;
}
.hero-side > strong > span {
  font-size: 13px;
  letter-spacing: 0;
  color: #a4a58f;
  margin-left: 5px;
}
.hero-side > p {
  font-size: 10px;
  color: #969b86;
}
.overall-track {
  height: 4px;
  background: #dbe0cc;
  width: 100%;
  max-width: 150px;
  border-radius: 5px;
  overflow: hidden;
  margin: 19px 0 14px;
}
.overall-track > i {
  height: 100%;
  display: block;
  background: #91b47a;
}
.star-total {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: #a7a68d;
}
.star-total svg {
  width: 14px;
  height: 14px;
  fill: #d9c482;
  color: #c4ae73;
}
.star-total b {
  color: #8b946f;
  font-weight: 700;
}
.small-note {
  border-top: 1px dashed #d7dbca;
  padding-top: 18px;
  margin-top: 20px;
  font-size: 10px;
  line-height: 1.9;
  color: #a3a790;
  width: 100%;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 31px 0 18px;
}
.section-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.section-heading h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.library-count {
  font-size: 10px;
  color: #969d89;
  padding-bottom: 3px;
}
.library-count i {
  font-style: normal;
  padding: 0 7px;
  color: #bec5af;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.game-card {
  padding: 0;
  overflow: hidden;
  border-radius: 17px;
  border: 1px solid #e1e5d9;
  background: #fcfcf6;
  text-align: left;
  box-shadow: 0 6px 18px #4c695e05;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px #50615113;
}
.game-cover {
  position: relative;
  aspect-ratio: 1.43;
  overflow: hidden;
  background: #253544;
}
.game-cover canvas {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}
.game-card:hover canvas {
  transform: scale(1.05);
}
.cover-number {
  position: absolute;
  left: 12px;
  top: 11px;
  font-size: 9px;
  font-weight: 700;
  color: #f6f9eacc;
  background: #162d3575;
  border: 1px solid #ffffff20;
  padding: 3px 6px;
  border-radius: 5px;
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
.cover-play {
  position: absolute;
  bottom: 10px;
  right: 10px;
  height: 29px;
  width: 29px;
  border-radius: 9px;
  background: #f8faeacc;
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  color: #475749;
}
.cover-play svg {
  width: 16px;
  height: 16px;
}
.card-details {
  padding: 15px 14px 13px;
}
.card-genre {
  font-size: 9px;
  color: #9c9f8b;
  letter-spacing: 0.7px;
}
.card-details h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 6px 0 12px;
  color: #3b4838;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}
.card-bottom > span {
  font-size: 7px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #aaa992;
}
.card-bottom > strong {
  font-size: 9px;
  font-weight: 500;
  color: #9b9e87;
  white-space: nowrap;
}
.card-progress {
  display: flex;
  gap: 4px;
  margin-top: 11px;
}
.card-progress > i {
  height: 3px;
  background: #e9ecdf;
  border-radius: 4px;
  flex: 1;
}
.card-progress > i.done {
  background: #afc784;
}
.lobby-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  color: #adb19d;
  font-size: 9px;
}
.resume-banner {
  margin-top: 20px;
  border: 1px solid #dce2cd;
  background: #edf0e2;
  border-radius: 13px;
  padding: 14px 19px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.resume-banner > div {
  display: flex;
  gap: 13px;
  align-items: center;
  color: #7e9471;
}
.resume-banner strong {
  display: block;
  font-size: 12px;
  color: #6b805e;
}
.resume-banner small {
  display: block;
  font-size: 9px;
  margin-top: 5px;
  color: #99a289;
}
.resume-banner .outline-button {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 11px;
}
.in-game {
  height: 100dvh;
  overflow: hidden;
  background: #e8eadf;
}
.play-screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.play-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 18px 35px;
  height: 90px;
  flex-shrink: 0;
}
.game-back {
  height: 44px;
  width: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #d8ded0;
  background: #f6f8ef;
  border-radius: 12px;
  color: #78876a;
}
.game-heading > span {
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #a1a38b;
  display: block;
}
.game-heading h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.game-level {
  font-size: 11px;
  color: #a0a28c;
  letter-spacing: 0.5px;
  border-left: 1px solid #ced6c2;
  padding-left: 18px;
  margin-left: 9px;
}
.play-tools {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.play-body {
  min-height: 0;
  flex: 1;
  padding: 0 30px 24px;
  display: flex;
  justify-content: center;
}
.game-frame {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 19px;
  overflow: hidden;
  background: #1f2c35;
  box-shadow: 0 12px 40px #233e331c;
  border: 1px solid #9aab9250;
}
.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 21px;
  min-height: 68px;
  color: #f1f1d6;
  background: #223039;
  flex-shrink: 0;
}
.game-hud > div:first-child > strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.4px;
}
.game-hud > div:first-child > span {
  display: block;
  font-size: 9px;
  color: #9fafad;
  margin-top: 5px;
}
.hud-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 12px;
}
.hud-stats > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hud-stats svg {
  width: 15px;
  height: 15px;
  color: #92a9a6;
}
.hud-stats b {
  font-size: 13px;
  color: #cfdcbe;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.hp {
  display: inline-block;
  width: 9px;
  height: 13px;
  transform: skew(-12deg);
  border: 1px solid #687c7b;
  border-radius: 2px;
  background: #526364;
}
.hp.full {
  background: #b9d2ac;
  border-color: #c5deb4;
}
.score-count {
  font-size: 13px;
  color: #d6c59a;
}
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  background: #162029;
}
.canvas-wrap > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 13px;
  padding: 13px 21px;
  min-height: 43px;
  background: #223039;
  color: #8d9e9d;
  font-size: 9px;
  flex-shrink: 0;
}
.practice-badge {
  border: 1px solid #a7be9647;
  color: #b8c79d;
  font-size: 9px;
  border-radius: 5px;
  padding: 3px 6px;
  white-space: nowrap;
}
.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.joystick {
  position: absolute;
  left: 24px;
  bottom: 20px;
  width: 114px;
  height: 114px;
  border-radius: 50%;
  border: 1px solid #d0e0c849;
  box-shadow: inset 0 0 0 16px #c9e3d508;
  background: #172e343c;
  pointer-events: auto;
  touch-action: none;
}
.knob {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 49px;
  width: 49px;
  border-radius: 50%;
  background: #d9e9d4b0;
  border: 1.5px solid #f4f4d4a3;
  display: grid;
  place-items: center;
  color: #536d66;
  pointer-events: none;
  box-shadow: 0 4px 15px #1629353b;
}
.knob svg {
  width: 22px;
  height: 22px;
}
.touch-buttons {
  position: absolute;
  bottom: 20px;
  right: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  pointer-events: none;
}
.touch-action {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid #f5ecd978;
  background: #d2e3c7a8;
  backdrop-filter: blur(3px);
  pointer-events: auto;
  touch-action: none;
  color: #344e45;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 5px 15px #12293023;
}
.touch-action > span {
  font-size: 11px;
  font-weight: 750;
}
.touch-action > svg {
  width: 25px;
  height: 25px;
}
.secondary-action {
  height: 65px;
  width: 65px;
  margin-bottom: 21px;
  background: #a6c9c29c;
  border-color: #cfdfcf88;
}
.secondary-action > span {
  font-size: 10px;
}
.secondary-action > svg {
  height: 21px;
  width: 21px;
}
.touch-action.pressed {
  transform: scale(0.94);
  background: #d5ebb8e8;
}
.launch-ball {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  pointer-events: auto;
  padding: 10px 17px;
  min-height: 45px;
  background: #d0e8cbd9;
  color: #405b50;
  font-size: 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.launch-ball > svg {
  height: 16px;
  width: 16px;
}
.launch-ball:active {
  transform: translateX(-50%) translateY(1px);
}
dialog {
  color: var(--ink);
  padding: 29px;
  border: 1px solid #e0e5d6;
  background: #f8f9f1;
  border-radius: 22px;
  width: min(740px, calc(100% - 32px));
  max-height: 88dvh;
  overflow: auto;
  box-shadow: 0 30px 90px #18352944;
}
dialog::backdrop {
  background: #1e302b7a;
  backdrop-filter: blur(9px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.dialog-heading .eyebrow {
  font-size: 9px;
  margin-bottom: 6px;
}
.dialog-heading h2,
dialog > div > h2 {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.dialog-description {
  font-size: 12px;
  color: #989f8a;
  line-height: 1.9;
  margin: 11px 0 22px;
}
.level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 13px 15px;
  min-height: 65px;
  border: 1px solid #e0e5d6;
  background: #fdfff7;
  border-radius: 12px;
  width: 100%;
}
.level-row.selected {
  background: #edf3df;
  border-color: #a4bf7f;
  box-shadow: inset 0 0 0 1px #c4dba655;
}
.level-number {
  font-size: 20px;
  color: #a6b89b;
  font-weight: 600;
  width: 33px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.level-name {
  flex: 1;
}
.level-name strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.level-name small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  color: #a4aa96;
  margin-top: 5px;
}
.level-rating {
  font-size: 14px;
  letter-spacing: 2px;
  color: #b7a675;
  white-space: nowrap;
}
.level-rating > svg {
  width: 16px;
  height: 16px;
  color: #a5b497;
}
.level-row.locked .level-name strong {
  color: #8e9888;
}
.level-row.locked .level-number {
  color: #c0c9b6;
}
.level-explanation {
  font-size: 10px;
  color: #9ba389;
  margin-top: 18px;
  line-height: 1.7;
}
.dialog-actions {
  display: flex;
  gap: 11px;
  justify-content: flex-end;
  margin-top: 22px;
}
.dialog-footnote {
  font-size: 9px;
  color: #b4baa5;
  margin-top: 14px;
  text-align: right;
  line-height: 1.7;
}
.result-dialog {
  text-align: center;
  max-width: 590px;
  padding: 32px;
}
.result-top > .eyebrow {
  font-size: 9px;
  margin-bottom: 22px;
}
.result-stars {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 19px;
}
.result-stars svg {
  width: 34px;
  height: 34px;
  fill: #e5e9db;
  color: #cad2bc;
}
.result-stars .lit svg {
  fill: #e2cb85;
  color: #c5ac6e;
}
.result-stars > span:nth-child(2) {
  transform: translateY(-6px) scale(1.12);
}
.result-top h2 {
  font-size: 28px;
  font-weight: 800;
}
.result-top p {
  font-size: 12px;
  color: #a1a991;
  line-height: 1.8;
  margin-top: 12px;
}
.result-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0;
}
.result-score strong {
  font-size: 56px;
  line-height: 1.2;
  letter-spacing: -1px;
  color: #69845b;
  font-weight: 650;
}
.result-score span {
  font-size: 10px;
  color: #a6b094;
  margin-top: 5px;
}
.result-detail {
  font-size: 11px;
  color: #9fa88f;
}
.result-dialog .dialog-actions {
  justify-content: center;
}
.pause-dialog,
.help-dialog {
  max-width: 560px;
}
.pause-dialog .eyebrow,
.help-dialog .eyebrow {
  margin-bottom: 12px;
}
.pause-level {
  border: 1px solid #dde5d1;
  border-radius: 13px;
  background: #edf2e1;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #768b65;
}
.pause-level > span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #a3ad95;
  margin-top: 7px;
}
.upgrade-dialog {
  width: min(880px, calc(100% - 32px));
}
.upgrade-dialog .eyebrow {
  margin-bottom: 12px;
}
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 20px;
}
.upgrade-grid > button {
  text-align: left;
  background: #eef1e3;
  border: 1px solid #dfe5d0;
  border-radius: 14px;
  padding: 22px 18px;
  transition: border-color 0.2s;
}
.upgrade-grid > button:hover {
  border-color: #9fba81;
  background: #e8efd9;
}
.upgrade-grid > button > span {
  display: grid;
  place-items: center;
  height: 45px;
  width: 45px;
  border-radius: 12px;
  background: #dce6cc;
  color: #879b70;
  margin-bottom: 18px;
}
.upgrade-grid h3 {
  font-size: 17px;
  font-weight: 750;
}
.upgrade-grid p {
  font-size: 11px;
  line-height: 1.85;
  margin-top: 10px;
  color: #a1a78e;
  min-height: 70px;
}
.upgrade-grid b {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 18px;
  font-size: 11px;
  color: #81946a;
}
.upgrade-grid b > svg {
  height: 15px;
  width: 15px;
}
.control-card {
  font-size: 14px;
  font-weight: 600;
  padding: 20px;
  background: #eaf0df;
  border-radius: 13px;
  border: 1px solid #dce5ce;
  line-height: 2;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e4e9d8;
  padding: 18px 0;
  font-size: 14px;
}
.setting-row small {
  display: block;
  font-size: 11px;
  color: #a4ab95;
  margin-top: 6px;
}
.setting-row input {
  width: 22px;
  height: 22px;
  accent-color: #849d6e;
}
.settings-dialog {
  max-width: 520px;
}
.history-list article {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #e3e8d7;
}
.history-icon {
  height: 43px;
  width: 43px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--game-color) 20%, #f7f9ef);
  color: #8c9a77;
  display: grid;
  place-items: center;
}
.history-list article > div {
  flex: 1;
}
.history-list strong {
  font-size: 13px;
  font-weight: 650;
}
.history-list p {
  font-size: 10px;
  color: #a8af98;
  margin-top: 6px;
}
.history-list small {
  font-size: 9px;
  margin-left: 5px;
  font-weight: 400;
  color: #a1aa8d;
}
.history-stars {
  font-size: 12px;
  color: #b9a770;
  letter-spacing: 1px;
}
.empty-state {
  text-align: center;
  color: #adb699;
  padding: 35px 10px;
}
.empty-state > svg {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  color: #bdc8a7;
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 650;
}
.empty-state p {
  font-size: 12px;
  line-height: 1.8;
  margin-top: 12px;
}
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 10px);
  max-width: calc(100% - 28px);
  background: #314337ed;
  color: #eef5d7;
  box-shadow: 0 8px 30px #2442341a;
  font-size: 12px;
  border: 1px solid #809a6333;
  padding: 13px 21px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  text-align: center;
  line-height: 1.8;
  backdrop-filter: blur(6px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.load-error {
  max-width: 500px;
  margin: 20vh auto;
  padding: 30px;
  text-align: center;
}
.load-error h1 {
  font-size: 27px;
  margin-bottom: 16px;
}
.load-error button {
  background: #344b39;
  color: #eff6df;
  border-radius: 9px;
  padding: 13px 20px;
  margin-top: 20px;
}
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
  .touch-controls {
    opacity: 0.55;
    transition: opacity 0.2s;
  }
  .canvas-wrap:hover .touch-controls {
    opacity: 0.8;
  }
}
@media (max-width: 1100px) {
  .site-header {
    margin: 0 28px;
    height: 81px;
    gap: 40px;
  }
  .lobby-main {
    padding: 23px 28px;
  }
  .hero {
    grid-template-columns: 1.03fr 1.15fr 0.5fr;
    min-height: 292px;
  }
  .hero-copy {
    padding: 25px 14px 23px 25px;
  }
  .hero h1 {
    font-size: 33px;
  }
  .hero-copy p {
    font-size: 10px;
  }
  .hero-meta {
    gap: 10px;
    font-size: 7px;
  }
  .hero-side {
    padding: 26px 19px;
  }
  .hero-side > strong {
    font-size: 39px;
  }
  .hero-side > span:first-child {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .small-note {
    font-size: 9px;
  }
  .games-grid {
    gap: 12px;
  }
  .card-details {
    padding: 12px 11px;
  }
  .card-details h3 {
    font-size: 16px;
  }
  .card-bottom > span {
    font-size: 6px;
    letter-spacing: 0.5px;
  }
  .card-bottom > strong {
    font-size: 8px;
  }
  .section-heading {
    margin: 25px 0 16px;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .play-header {
    padding: 14px 25px;
    height: 79px;
  }
  .play-body {
    padding: 0 23px 20px;
  }
  .game-hud {
    padding: 12px 17px;
    min-height: 63px;
  }
  .game-footer {
    padding: 12px 17px;
    font-size: 8px;
  }
  .hero-sticker {
    left: 15px;
    top: 20px;
  }
  .hero-sticker strong {
    font-size: 23px;
  }
}
@media (max-width: 800px) {
  .site-header {
    margin: 0 20px;
    height: 78px;
    gap: 28px;
  }
  .brand > span {
    font-size: 20px;
  }
  .brand > svg {
    height: 36px;
    width: 36px;
  }
  .header-nav > button {
    font-size: 12px;
  }
  .header-nav {
    gap: 21px;
  }
  .saved-note {
    display: none;
  }
  .lobby-main {
    padding: 21px 20px;
  }
  .hero {
    grid-template-columns: 1fr 1.04fr;
    min-height: 290px;
  }
  .hero-side {
    display: none;
  }
  .hero-art {
    margin-right: 12px;
  }
  .hero h1 {
    font-size: 33px;
  }
  .hero-copy {
    padding: 26px 10px 23px 22px;
  }
  .hero-meta {
    gap: 12px;
    font-size: 8px;
  }
  .games-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  .game-cover {
    aspect-ratio: 1.65;
  }
  .card-details h3 {
    font-size: 18px;
  }
  .card-details {
    padding: 14px;
  }
  .card-bottom > span {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .card-bottom > strong {
    font-size: 9px;
  }
  .game-level {
    font-size: 10px;
    max-width: 230px;
    line-height: 1.8;
  }
  .game-header {
    gap: 10px;
  }
  .play-tools > .icon-button {
    height: 42px;
    width: 42px;
  }
  .hud-stats {
    gap: 14px;
  }
  .game-hud > div:first-child > strong {
    font-size: 12px;
  }
  .game-hud > div:first-child > span {
    font-size: 8px;
  }
  .score-count {
    font-size: 11px;
  }
  .game-footer > span:nth-child(2) {
    display: none;
  }
  .game-footer {
    font-size: 9px;
  }
  .joystick {
    left: 18px;
    bottom: 15px;
    width: 101px;
    height: 101px;
  }
  .touch-buttons {
    right: 18px;
    bottom: 17px;
  }
  .touch-action {
    height: 75px;
    width: 75px;
  }
  .secondary-action {
    height: 60px;
    width: 60px;
  }
  .modal-body {
    padding: 24px;
  }
  .upgrade-grid {
    gap: 9px;
  }
  .upgrade-grid > button {
    padding: 19px 14px;
  }
  .upgrade-grid h3 {
    font-size: 15px;
  }
}
@media (max-width: 550px) {
  .site-header {
    margin: 0 17px;
    height: 73px;
    gap: 15px;
  }
  .brand {
    gap: 8px;
  }
  .brand > span {
    font-size: 20px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 2px;
  }
  .brand > svg {
    height: 34px;
    width: 34px;
    border-radius: 9px;
  }
  .header-nav {
    gap: 15px;
  }
  .header-nav button {
    font-size: 11px;
  }
  .header-nav > .current {
    display: none;
  }
  .header-tools {
    gap: 7px;
  }
  .header-tools > .icon-button {
    height: 39px;
    width: 39px;
    border-radius: 10px;
  }
  .header-tools > .icon-button > svg {
    height: 18px;
    width: 18px;
  }
  .lobby-main {
    padding: 17px;
  }
  .hero {
    min-height: 264px;
    grid-template-columns: 1.2fr 1fr;
    border-radius: 18px;
  }
  .hero-copy {
    padding: 23px 0 22px 18px;
  }
  .hero-copy .eyebrow {
    font-size: 6px;
    letter-spacing: 1px;
    white-space: nowrap;
  }
  .hero-copy h1 {
    font-size: 27px;
    margin: 15px 0 10px;
    line-height: 1.4;
    letter-spacing: 0.5px;
  }
  .hero-copy p {
    font-size: 9px;
    line-height: 1.9;
    max-width: 167px;
  }
  .hero-copy > .solid-button {
    font-size: 10px;
    padding: 9px 12px;
    min-height: 42px;
    margin-top: 17px;
    gap: 8px;
  }
  .hero-copy > .solid-button > svg {
    height: 14px;
    width: 14px;
  }
  .hero-meta {
    gap: 7px;
    flex-wrap: wrap;
    font-size: 6px;
    margin-top: 16px;
  }
  .hero-meta > span:last-child {
    display: none;
  }
  .hero-meta svg {
    height: 10px;
    width: 10px;
  }
  .hero-art {
    margin: 10px 10px 10px 4px;
    border-radius: 12px;
  }
  .hero-art > canvas {
    object-position: 58%;
  }
  .hero-sticker {
    top: 17px;
    left: 12px;
    font-size: 8px;
    letter-spacing: 0.8px;
  }
  .hero-sticker strong {
    font-size: 19px;
  }
  .hero-art-tag {
    font-size: 6px;
    letter-spacing: 0.7px;
    bottom: 15px;
    left: 7px;
    right: 7px;
    padding: 6px;
    text-align: center;
  }
  .hero-art-tag b {
    display: none;
  }
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .section-heading {
    margin: 26px 0 16px;
    align-items: center;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .section-heading .eyebrow {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .library-count {
    font-size: 8px;
  }
  .library-count i {
    padding: 0 4px;
  }
  .game-cover {
    aspect-ratio: 1.48;
  }
  .card-details {
    padding: 12px;
  }
  .card-genre {
    font-size: 8px;
  }
  .card-details h3 {
    font-size: 18px;
    margin: 5px 0 10px;
  }
  .card-bottom > span {
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  .card-bottom > strong {
    font-size: 8px;
  }
  .lobby-footer {
    font-size: 8px;
    line-height: 1.8;
    padding-top: 21px;
  }
  .lobby-footer > span:last-child {
    display: none;
  }
  .resume-banner {
    padding: 12px;
    gap: 10px;
  }
  .resume-banner strong {
    font-size: 10px;
  }
  .resume-banner small {
    font-size: 8px;
  }
  .resume-banner > .outline-button {
    font-size: 9px;
    padding: 8px 10px;
    gap: 6px;
  }
  .resume-banner > div {
    gap: 8px;
  }
  .resume-banner > div > svg {
    width: 17px;
  }
  .play-header {
    padding: 10px 12px;
    height: 71px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .game-back {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .game-back > svg {
    width: 18px;
    height: 18px;
  }
  .game-heading > span {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .game-heading h2 {
    font-size: 17px;
  }
  .game-level {
    border: 0;
    padding: 0;
    margin: 0;
    max-width: 89px;
    font-size: 8px;
    letter-spacing: 0;
  }
  .play-tools {
    gap: 5px;
  }
  .play-tools > .icon-button {
    height: 35px;
    width: 35px;
    border-radius: 9px;
  }
  .play-tools > .icon-button > svg {
    width: 16px;
    height: 16px;
  }
  .play-body {
    padding: 0 9px 12px;
  }
  .game-frame {
    border-radius: 14px;
  }
  .game-hud {
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    min-height: 75px;
  }
  .game-hud > div:first-child {
    max-width: 58%;
  }
  .game-hud > div:first-child > strong {
    font-size: 11px;
    line-height: 1.4;
  }
  .game-hud > div:first-child > span {
    font-size: 8px;
    line-height: 1.7;
    margin-top: 4px;
  }
  .hud-stats {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 125px;
  }
  .hud-stats > span {
    gap: 4px;
  }
  .hud-stats b {
    font-size: 11px;
  }
  .hud-stats svg {
    height: 12px;
    width: 12px;
  }
  .hp {
    height: 10px;
    width: 6px;
  }
  .score-count {
    font-size: 9px;
  }
  .game-footer {
    padding: 10px 12px;
    font-size: 8px;
    line-height: 1.7;
    min-height: 52px;
  }
  .game-footer > span:first-child {
    max-width: 240px;
  }
  .joystick {
    left: 17px;
    bottom: 25px;
    width: 107px;
    height: 107px;
  }
  .knob {
    height: 49px;
    width: 49px;
  }
  .touch-buttons {
    right: 16px;
    bottom: 25px;
    gap: 9px;
  }
  .touch-action {
    height: 75px;
    width: 75px;
  }
  .secondary-action {
    height: 57px;
    width: 57px;
    margin-bottom: 31px;
  }
  .touch-action > span {
    font-size: 10px;
  }
  .touch-action > svg {
    width: 22px;
    height: 22px;
  }
  .launch-ball {
    bottom: 33px;
  }
  .game-footer .practice-badge {
    font-size: 7px;
    white-space: normal;
    max-width: 74px;
  }
  dialog {
    padding: 23px 19px;
    border-radius: 17px;
    max-height: 89dvh;
  }
  .dialog-heading h2,
  dialog > div > h2 {
    font-size: 23px;
  }
  .dialog-heading .eyebrow {
    font-size: 7px;
  }
  .dialog-description {
    font-size: 11px;
    line-height: 1.8;
  }
  .level-row {
    padding: 11px 10px;
    gap: 9px;
    min-height: 67px;
  }
  .level-number {
    font-size: 19px;
    width: 26px;
  }
  .level-name strong {
    font-size: 13px;
  }
  .level-name small {
    font-size: 9px;
  }
  .level-rating {
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  .level-rating > svg {
    height: 14px;
    width: 14px;
  }
  .dialog-actions {
    gap: 8px;
  }
  .dialog-actions > .solid-button,
  .dialog-actions > .outline-button {
    font-size: 11px;
    padding: 10px 14px;
    gap: 7px;
  }
  .dialog-footnote {
    font-size: 8px;
    line-height: 1.8;
  }
  .result-dialog {
    padding: 28px 20px;
  }
  .result-top h2 {
    font-size: 24px;
  }
  .result-top p {
    font-size: 11px;
  }
  .result-score strong {
    font-size: 47px;
  }
  .result-detail {
    font-size: 10px;
  }
  .upgrade-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .upgrade-grid > button {
    padding: 17px 16px 17px 72px;
    position: relative;
  }
  .upgrade-grid > button > span {
    position: absolute;
    left: 15px;
    top: 18px;
    height: 40px;
    width: 40px;
  }
  .upgrade-grid h3 {
    font-size: 16px;
  }
  .upgrade-grid p {
    font-size: 11px;
    min-height: 0;
    margin-top: 6px;
  }
  .upgrade-grid b {
    margin-top: 10px;
    font-size: 10px;
  }
  .history-list article {
    gap: 10px;
  }
  .history-icon {
    height: 37px;
    width: 37px;
  }
  .history-list strong {
    font-size: 11px;
  }
  .history-list p {
    font-size: 9px;
  }
  .history-stars {
    font-size: 10px;
  }
  .toast {
    font-size: 11px;
    padding: 12px 17px;
  }
  .game-hud .hud-stats #health {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .play-header {
    height: 57px;
    padding: 8px 17px;
  }
  .game-heading h2 {
    font-size: 16px;
  }
  .game-heading > span {
    font-size: 6px;
  }
  .game-back {
    height: 36px;
    width: 36px;
  }
  .play-tools > .icon-button {
    height: 35px;
    width: 35px;
  }
  .play-body {
    padding: 0 10px 8px;
  }
  .game-frame {
    border-radius: 12px;
  }
  .game-hud {
    min-height: 46px;
    padding: 8px 14px;
    align-items: center;
  }
  .game-hud > div:first-child > strong {
    font-size: 11px;
  }
  .game-hud > div:first-child > span {
    font-size: 8px;
    margin-top: 3px;
  }
  .game-footer {
    min-height: 29px;
    padding: 7px 14px;
    font-size: 8px;
  }
  .joystick {
    width: 82px;
    height: 82px;
    left: 20px;
    bottom: 12px;
  }
  .knob {
    width: 40px;
    height: 40px;
  }
  .touch-buttons {
    bottom: 13px;
    right: 20px;
    gap: 10px;
  }
  .touch-action {
    height: 61px;
    width: 61px;
  }
  .secondary-action {
    height: 47px;
    width: 47px;
    margin-bottom: 18px;
  }
  .touch-action > svg {
    height: 18px;
    width: 18px;
  }
  .touch-action > span {
    font-size: 9px;
  }
  .launch-ball {
    bottom: 10px;
    font-size: 10px;
    min-height: 36px;
    padding: 7px 13px;
  }
  .upgrade-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .upgrade-grid > button {
    padding: 14px;
  }
  .upgrade-grid > button > span {
    position: static;
    margin-bottom: 10px;
    height: 30px;
    width: 30px;
  }
  .upgrade-grid h3 {
    font-size: 13px;
  }
  .upgrade-grid p {
    font-size: 9px;
  }
  .upgrade-grid b {
    font-size: 9px;
    margin-top: 10px;
  }
  dialog {
    max-height: 92dvh;
    padding: 22px;
  }
  .result-score {
    margin: 16px 0;
  }
  .result-score strong {
    font-size: 37px;
  }
  .result-top h2 {
    font-size: 23px;
  }
  .result-stars {
    margin-bottom: 11px;
  }
  .result-stars svg {
    width: 26px;
    height: 26px;
  }
  .result-top > .eyebrow {
    margin-bottom: 13px;
  }
  .result-dialog .dialog-actions {
    margin-top: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* A held control must never become a browser selection or touch callout. */
.play-screen,
.play-screen *,
.joystick,
.joystick *,
.touch-controls,
.touch-controls * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.canvas-wrap,
.touch-controls,
.joystick,
.touch-action {
  touch-action: none;
}
.touch-controls svg,
.touch-controls span,
.knob * {
  pointer-events: none;
}
.in-game {
  overscroll-behavior: none;
}

.library-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.difficulty-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 13px;
  background: #edf0e5;
}
.difficulty-tabs button {
  flex: 1;
  min-height: 44px;
  padding: 8px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #63715c;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.difficulty-tabs button[aria-pressed="true"] {
  background: #364f47;
  color: #fff6da;
  box-shadow: 0 2px 5px #263e4220;
}
.difficulty-tabs small {
  font-size: 9px;
  margin-left: 6px;
  opacity: 0.7;
}
.difficulty-description {
  font-size: 11px;
  color: #73826c;
  margin: 10px 0 18px;
  line-height: 1.7;
}
.difficulty-tabs.compact {
  padding: 3px;
}
.difficulty-tabs.compact button {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 11px;
}
@media (max-width: 550px) {
  .library-filter {
    gap: 5px;
  }
  .difficulty-tabs.compact button {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 10px;
  }
  .difficulty-description {
    font-size: 10px;
    margin-bottom: 10px;
  }
}
