:root {
  --paper: #faf6ee;
  --card: #fffdf8;
  --ink: #352e25;
  --muted: #82786d;
  --accent: #dc4b31;
  --line: #e5dfd3;
  --soft: #f2e9da;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, sans-serif;
  padding: 0 32px;
  align-items: flex-start;
}
body[data-theme="mint"] {
  --accent: #257663;
  --paper: #edf5ee;
  --soft: #dcece2;
}
body[data-theme="berry"] {
  --accent: #98539c;
  --paper: #f7eef5;
  --soft: #eddbeb;
}
body[data-theme="midnight"] {
  --paper: #20242e;
  --card: #2c313e;
  --ink: #faf2df;
  --muted: #bcb8b1;
  --accent: #a6afff;
  --line: #454a5a;
  --soft: #363c50;
}
.game-container {
  max-width: 1160px;
  padding: 0 20px 32px;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.club-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0 25px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
}
.brand span {
  font-size: 19px;
  letter-spacing: -1px;
  font-weight: 900;
}
.brand b {
  color: var(--accent);
}
.wallet {
  display: flex;
  gap: 12px;
  font-size: 13px;
  font-weight: bold;
  align-items: center;
}
.wallet span {
  background: var(--soft);
  padding: 10px 14px;
  border-radius: 24px;
}
.wallet span:last-child {
  background: #f4d974;
  color: #543d16;
}
.club-nav {
  display: flex;
  gap: 30px;
  padding: 24px 0 12px;
}
.club-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.club-nav button.selected {
  color: var(--accent);
  border-color: var(--accent);
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  min-height: 350px;
  padding: 30px 0 44px;
}
.eyebrow {
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 1.6px;
  margin-bottom: 16px;
  display: block;
  color: var(--muted);
}
h1 {
  font-family: Georgia, serif;
  font-size: 64px;
  letter-spacing: -2.5px;
  line-height: 1.06;
  font-weight: normal;
  margin: 0 0 20px;
}
h1 em {
  color: var(--accent);
  font-weight: normal;
}
.hero p:not(.eyebrow),
.page-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}
.chef-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.chef-progress > span {
  font-size: 24px;
  background: var(--soft);
  padding: 12px;
  border-radius: 50%;
}
.chef-progress strong {
  font-size: 12px;
}
.chef-progress small {
  font-size: 10px;
  color: var(--muted);
}
.xp-track {
  width: 210px;
  background: var(--line);
  height: 5px;
  margin: 8px 0 5px;
  border-radius: 5px;
  overflow: hidden;
}
.xp-track i {
  background: var(--accent);
  height: 100%;
  display: block;
}
.hero-burger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: radial-gradient(ellipse, #efdca760, transparent 65%);
}
.illustrated-burger {
  width: 265px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 24px 10px #70492020);
}
.illustrated-burger > div {
  position: relative;
  margin: auto;
  box-shadow: inset 0 -7px 0 #00000012;
}
.top-bun {
  height: 95px;
  border-radius: 130px 130px 20px 20px;
  background: linear-gradient(#efb75b, #d99133);
  text-align: center;
  font-size: 52px;
  line-height: 70px;
  color: #ffe8a0;
  letter-spacing: 8px;
}
.lettuce-layer {
  height: 26px;
  width: 105%;
  background: #6d9438;
  border-radius: 40% 20% 40% 10%;
  transform: rotate(3deg);
}
.tomato-layer {
  height: 23px;
  background: #da4a32;
  border-radius: 15px;
}
.cheese-layer {
  height: 15px;
  width: 104%;
  background: #efc743;
  transform: rotate(-3deg);
  border-radius: 3px;
}
.patty-layer {
  height: 40px;
  background: linear-gradient(#725039, #493322);
  border-radius: 16px;
}
.bottom-bun {
  height: 37px;
  background: #dca04a;
  border-radius: 10px 10px 35px 35px;
}
.spark {
  position: absolute;
  color: var(--accent);
  font-size: 32px;
}
.s1 {
  top: 25px;
  left: 35px;
}
.s2 {
  bottom: 35px;
  right: 15px;
  font-size: 22px;
}
.hero-sticker {
  position: absolute;
  bottom: 15px;
  left: 32px;
  transform: rotate(-13deg);
  border: 1px solid #b4974e;
  border-radius: 50%;
  background: #f5db87;
  color: #67511c;
  width: 92px;
  height: 92px;
  display: grid;
  place-content: center;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 20px;
  gap: 15px;
}
h2 {
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: normal;
  letter-spacing: -0.5px;
}
.renderer-choice {
  display: inline-flex;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 30px;
  gap: 4px;
}
.renderer-choice button {
  padding: 8px 14px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.renderer-choice button.selected {
  background: var(--ink);
  color: var(--paper);
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.mode-card {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.mode-card:hover,
.level-card:not(:disabled):hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px #392f2410;
}
.mode-icon {
  display: grid;
  place-items: center;
  border-radius: 12px;
  width: 45px;
  height: 45px;
  font-size: 28px;
  margin-bottom: 22px;
}
.zen .mode-icon {
  background: #e6eee6;
  color: #547651;
}
.arcade .mode-icon {
  background: #fce6c6;
  color: #cc7e20;
}
.levels .mode-icon {
  background: #f0dfe0;
  color: #b34f53;
}
.mode-card .eyebrow {
  font-size: 8px !important;
  margin-bottom: 10px;
  letter-spacing: 1.2px;
}
h3 {
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: -0.5px;
  font-weight: normal;
  margin: 0 0 12px;
}
.mode-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  min-height: 66px;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}
.card-bottom b {
  font-size: 21px;
  color: var(--accent);
}
.club-foot {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 30px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.page-heading {
  padding: 45px 0 28px;
}
.page-heading h1 {
  font-size: 48px;
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 25px;
}
.level-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  padding: 22px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s;
}
.level-number {
  display: block;
  font-family: Georgia, serif;
  font-size: 38px;
  color: var(--accent);
  margin-bottom: 15px;
}
.level-card h3 {
  font-size: 24px;
}
.level-card p,
.unlock {
  font-size: 12px;
  color: var(--muted);
  display: block;
  line-height: 1.7;
}
.unlock {
  margin: 15px 0;
}
.level-card strong {
  font-size: 12px;
  color: var(--accent);
}
.locked {
  opacity: 0.48;
}
.level-card:disabled {
  cursor: default;
}
.pantry {
  margin-top: 35px;
}
.pantry small {
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
}
.pantry > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.pantry span {
  background: var(--soft);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.shop-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.cosmetic-swatch {
  height: 145px;
  border-radius: 10px;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.cosmetic-swatch span {
  font-size: 8px;
  letter-spacing: 2px;
  color: white;
  font-weight: 700;
}
.shop-card h3 {
  font-size: 24px;
}
.shop-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  min-height: 44px;
  margin-bottom: 18px;
}
.small-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  padding: 11px 16px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.primary-button {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.play-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 24px 0;
}
.play-top > div {
  text-align: center;
}
.play-top strong {
  display: block;
  font-size: 15px;
}
.play-top span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.header,
.tabs,
#start-screen {
  display: none;
}
.stats {
  background: var(--soft);
  gap: 8px;
}
.stat-label {
  color: var(--muted);
}
.stat-value,
.hearts {
  color: var(--accent);
}
.order-section,
.controls,
.burger-building {
  background: var(--card);
  border-color: var(--line);
}
.order-title,
.building-title,
.controls-title {
  color: var(--ink);
}
.order-item,
.control-item,
.g3-pad button {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.control-item {
  cursor: pointer;
}
.control-item:hover:not(:disabled) {
  border-color: var(--accent);
}
.key {
  background: var(--accent);
}
.paused {
  filter: blur(7px);
  pointer-events: none;
}
.result-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #1e191c90;
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.result-card {
  background: var(--card);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  max-width: 530px;
  width: 100%;
  box-shadow: 0 20px 80px #0003;
}
.result-icon {
  font-size: 58px;
  display: block;
  margin-bottom: 20px;
}
.result-card h2 {
  font-size: 37px;
  margin-bottom: 18px;
}
.result-card p:not(.eyebrow) {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.rewards {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 25px 0;
}
.rewards strong {
  background: var(--soft);
  padding: 15px 24px;
  border-radius: 12px;
  color: var(--accent);
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
#shop-status {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 15px;
}
#save-notice {
  padding: 12px;
  background: var(--soft);
  font-size: 12px;
}
.hidden {
  display: none !important;
}
@media (max-width: 760px) {
  body {
    padding: 0 16px;
  }
  .game-container {
    padding: 0 0 25px;
  }
  .club-header {
    padding: 20px 0;
    gap: 8px;
    flex-wrap: wrap;
  }
  .wallet {
    gap: 5px;
    font-size: 10px;
  }
  .wallet span {
    padding: 8px 10px;
  }
  .brand {
    font-size: 23px;
  }
  .brand span {
    font-size: 16px;
  }
  .hero {
    grid-template-columns: 1fr 0.75fr;
    min-height: 300px;
    padding: 30px 0;
  }
  .hero h1 {
    font-size: 42px;
  }
  .hero p:not(.eyebrow) {
    font-size: 12px;
  }
  .hero-burger {
    min-height: 240px;
  }
  .illustrated-burger {
    width: 155px;
  }
  .top-bun {
    height: 60px;
    font-size: 30px;
    line-height: 48px;
  }
  .lettuce-layer {
    height: 18px;
  }
  .tomato-layer {
    height: 16px;
  }
  .cheese-layer {
    height: 10px;
  }
  .patty-layer {
    height: 25px;
  }
  .bottom-bun {
    height: 25px;
  }
  .hero-sticker {
    width: 65px;
    height: 65px;
    font-size: 8px;
    left: 0;
    bottom: 10px;
  }
  .spark {
    font-size: 20px;
  }
  .s1 {
    left: 0;
  }
  .mode-grid,
  .level-grid,
  .shop-grid {
    grid-template-columns: 1fr;
  }
  .mode-card p {
    min-height: 0;
  }
  .mode-card {
    padding: 22px;
  }
  .mode-icon {
    float: right;
  }
  .mode-card .eyebrow {
    padding-top: 8px;
  }
  .chef-progress {
    margin-top: 18px;
  }
  .xp-track {
    width: 155px;
  }
  .chef-progress > span {
    font-size: 20px;
    padding: 8px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .club-foot {
    flex-direction: column;
    gap: 5px;
  }
  .page-heading h1 {
    font-size: 38px;
  }
  .play-top {
    flex-wrap: wrap;
  }
  .play-top > div {
    order: 3;
    width: 100%;
  }
  .stats {
    padding: 12px 4px;
  }
  .stat-label {
    font-size: 10px;
  }
  .stat-value,
  .hearts {
    font-size: 18px;
  }
  .burger-building {
    height: 410px;
    min-height: 410px;
  }
  .result-card {
    padding: 30px 20px;
  }
  .result-card h2 {
    font-size: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .hero > div {
    min-width: 0;
  }
  .hero h1 {
    font-size: clamp(29px, 9vw, 36px);
    letter-spacing: -1.5px;
  }
  .illustrated-burger {
    width: calc(100% - 12px);
    max-width: 145px;
  }
  .hero-burger {
    overflow: hidden;
  }
  .hero-sticker {
    left: 0;
  }
  .club-header .wallet {
    flex-wrap: wrap;
  }
}
.play-instructions {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: -8px 0 20px;
  text-align: center;
}
.play-top > .session-actions {
  display: flex;
  gap: 8px;
  width: auto;
  order: initial;
}

.countdown-number {
  font-family: Georgia, serif;
  font-size: 120px;
  line-height: 1.2;
  font-weight: bold;
  color: var(--accent);
  margin: 12px 0 20px;
}
.countdown-card .small-button {
  margin-top: 24px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.settings-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
}
.settings-card h2 {
  margin-bottom: 20px;
}
.settings-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.setting-row label {
  font-size: 14px;
  font-weight: bold;
}
.setting-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: normal;
  line-height: 1.6;
  margin-top: 7px;
}
.setting-row select {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.setting-row input {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.save-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
.save-summary span {
  background: var(--soft);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.file-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin: 25px 0 10px;
}
#import-save {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
}
#import-save::file-selector-button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 12px;
  cursor: pointer;
  margin-right: 12px;
}
.confirmation {
  margin-top: 20px;
  background: var(--soft);
  border-radius: 10px;
  padding: 16px;
}
#settings-status {
  margin-top: 18px;
  color: var(--accent);
}
body[data-reduced-motion="true"] * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (max-width: 760px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .club-nav {
    gap: 20px;
    flex-wrap: wrap;
  }
  .settings-card {
    padding: 20px;
  }
}

.keybindings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin-bottom: 20px;
}
.binding-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.binding-row label { font-size: 13px; font-weight: bold; }
.binding-input {
  width: 44px; height: 40px; text-align: center; font-family: inherit; font-size: 16px; font-weight: bold;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
}
.binding-input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
#keybindings-status { margin-top: 14px; }
@media (max-width: 420px) { .keybindings-grid { grid-template-columns: 1fr; } }
