:root {
  color-scheme: light;
  --ink: #263127;
  --muted: #6f786f;
  --surface: #ffffff;
  --paper: #f6f7f1;
  --line: #e1e7df;
  --green: #2f6d3e;
  --green-soft: #e8f5e9;
  --gold: #ffb300;
  --gold-soft: #fff8d9;
  --orange: #e65100;
  --blue: #1976d2;
  --shadow: 0 12px 28px rgba(46, 61, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef6ee 0%, #fafaf6 100%);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.boot-screen {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: #f6f7f1;
  color: var(--ink);
  text-align: center;
}

.boot-screen strong {
  font-size: 18px;
}

.boot-screen span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, #f3f7f2 0%, #fafaf6 100%);
}

.top-status {
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  border: 1px solid #e6eae5;
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(180deg, #eaf5eb 0%, #ffffff 100%);
  box-shadow: var(--shadow);
}

.top-main {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  font-weight: 950;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 16px;
  line-height: 1.18;
}

.status-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 5px;
  padding: 0 8px;
  border-radius: 8px;
  background: #2e7d32;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.coins {
  min-width: 78px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  color: #5d4037;
  text-align: center;
  font-weight: 950;
}

.meter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(224, 229, 224, 0.8);
}

.meter-title {
  display: flex;
  justify-content: space-between;
  color: #5d4037;
  font-size: 11px;
  font-weight: 850;
}

.meter {
  height: 8px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f5e9;
}

.meter.energy {
  background: #ffecb3;
}

.meter > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4caf50;
}

.meter.energy > i {
  background: #ffa000;
}

.content-shell {
  min-height: 0;
  padding: 10px 14px 92px;
  overflow: auto;
}

.tab-page {
  display: grid;
  gap: 12px;
}

.hero-card,
.card,
.order-card,
.item-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 14px;
}

.hero-card.gold {
  border-color: #ffecb3;
  background: linear-gradient(90deg, #fffdf1, #fff9c4);
}

.hero-card.green {
  border-color: #c8e6c9;
  background: #e8f5e9;
}

.hero-card.orange {
  border-color: #ffcc80;
  background: linear-gradient(90deg, #fff3e0, #ffffff);
}

.hero-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
}

.hero-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 0;
  color: #3e2723;
  font-size: 16px;
  font-weight: 950;
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.subtabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.subtab {
  min-height: 38px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.subtab.active {
  background: var(--green-soft);
  color: var(--green);
}

.card-list {
  display: grid;
  gap: 10px;
}

.order-card,
.card {
  padding: 14px;
}

.order-head,
.row-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
}

.round-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff8d9;
  color: var(--orange);
  font-weight: 950;
}

.tile-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f1fcef;
  font-size: 24px;
}

.name {
  font-size: 15px;
  font-weight: 950;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.tag.warn {
  background: #fff3e0;
  color: var(--orange);
}

.tag.gray {
  background: #eceff1;
  color: #607d8b;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.requirements {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
}

.req-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fffdf6;
  color: #4a514a;
  font-size: 12px;
}

.req-row.ok {
  background: rgba(232, 245, 233, 0.7);
}

.req-row.miss {
  background: rgba(255, 235, 238, 0.7);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.btn.orange {
  background: var(--orange);
}

.btn.blue {
  background: var(--blue);
}

.btn.gold {
  background: var(--gold);
  color: #5d4037;
}

.btn.secondary {
  background: #eef2ed;
  color: #344336;
}

.btn:disabled {
  cursor: default;
  background: #cfd8dc;
  color: #607d8b;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f5e9;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4caf50;
}

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

.item-card {
  padding: 12px;
  text-align: center;
}

.item-card .name {
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count {
  margin-top: 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.shop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-stat {
  padding: 10px;
  border-radius: 12px;
  background: #fafafa;
}

.profile-stat small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.profile-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--orange);
  font-size: 15px;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -12px 24px rgba(40, 52, 40, 0.08);
}

.nav-btn {
  min-height: 52px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.nav-btn > span {
  display: block;
  margin-bottom: 3px;
  font-size: 18px;
}

.nav-btn.active {
  background: var(--green-soft);
  color: var(--green);
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.82);
}

.game-panel {
  width: min(100%, 420px);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #e7ded1;
  background: linear-gradient(180deg, #fffdf7, #f2eee7);
}

.game-head,
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f2e9de;
  color: #5f544b;
  font-size: 24px;
}

.score-row {
  margin: 14px 0;
}

.score-chip {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.score-chip small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.score-chip strong {
  display: block;
  margin-top: 2px;
  color: var(--orange);
  font-size: 18px;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 16px;
  background: #b8afa6;
  touch-action: none;
  user-select: none;
}

.tile {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #cdc4ba;
  color: white;
  font-size: clamp(18px, 8vw, 30px);
  font-weight: 950;
}

.tile.low {
  color: #5f544b;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: min(90vw, 380px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(38, 49, 39, 0.92);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.scene-card {
  overflow: hidden;
}

.garden-canvas {
  display: block;
  width: 100%;
  height: 260px;
  background: #cde3c7;
  touch-action: manipulation;
}

@media (min-width: 760px) {
  .app-shell {
    margin-top: 24px;
    min-height: calc(100dvh - 48px);
    border-radius: 18px;
    overflow: hidden;
  }
}

/* UI refresh: asset-backed mobile game shell */
body {
  background:
    linear-gradient(180deg, rgba(220, 239, 216, 0.86), rgba(255, 250, 236, 0.92)),
    url("public/assets/ui/paper-texture.svg");
}

.app-shell {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(241, 247, 238, 0.96)),
    url("public/assets/ui/paper-texture.svg");
}

.top-status {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  padding: max(16px, env(safe-area-inset-top)) 16px 14px;
  border: 0;
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(180deg, rgba(31, 74, 41, 0.08), rgba(255, 255, 255, 0.92)),
    url("public/assets/ui/bg-garden-terrace.svg") center top / cover no-repeat;
  box-shadow: 0 10px 24px rgba(48, 67, 43, 0.18);
}

.top-status::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 253, 238, 0.08), rgba(255, 253, 247, 0.88));
}

.top-status > * {
  position: relative;
  z-index: 1;
}

.top-main {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f6d3e, #7aa95c);
}

.coins {
  min-width: 76px;
  border: 1px solid rgba(146, 95, 43, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 -2px 0 rgba(91, 61, 22, 0.12);
}

.meter-grid {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.content-shell {
  padding: 12px 12px 94px;
}

.hero-card,
.card,
.order-card,
.item-card,
.profile-card {
  border-radius: 8px;
  border-color: rgba(91, 112, 87, 0.18);
  box-shadow: 0 8px 20px rgba(47, 68, 45, 0.1);
}

.hero-card {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 14px 128px 14px 14px;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -8px;
  width: 152px;
  height: 90px;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 8px 14px rgba(58, 52, 40, 0.14));
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.contract-hero::after {
  background-image: url("public/assets/ui/contract-board.svg");
}

.chores-hero::after {
  background-image: url("public/assets/ui/chore-minigames.svg");
}

.backpack-hero::after {
  background-image: url("public/assets/ui/backpack-room.svg");
}

.shop-hero::after {
  background-image: url("public/assets/ui/market-stall.svg");
}

.profile-hero::after {
  background-image: url("public/assets/ui/profile-passport.svg");
}

.hero-card.gold {
  background:
    linear-gradient(90deg, rgba(255, 253, 241, 0.98), rgba(255, 245, 194, 0.84)),
    url("public/assets/ui/paper-texture.svg");
}

.hero-card.green {
  background:
    linear-gradient(90deg, rgba(232, 245, 233, 0.98), rgba(250, 255, 247, 0.88)),
    url("public/assets/ui/paper-texture.svg");
}

.hero-card.orange {
  background:
    linear-gradient(90deg, rgba(255, 243, 224, 0.98), rgba(255, 255, 255, 0.9)),
    url("public/assets/ui/paper-texture.svg");
}

.hero-icon,
.round-icon,
.tile-icon,
.close,
.btn,
.subtab,
.tag,
.profile-stat {
  border-radius: 8px;
}

.order-card,
.card,
.item-card,
.profile-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 253, 247, 0.94)),
    url("public/assets/ui/paper-texture.svg");
}

.row-card {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.row-card > div:nth-child(2),
.order-head > div:nth-child(2) {
  min-width: 0;
}

.tile-icon {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(47, 109, 62, 0.12);
  background: linear-gradient(180deg, #f7fff2, #edf6e8);
  font-size: 20px;
}

.bottom-tabs {
  border-top: 1px solid rgba(54, 83, 53, 0.16);
  background: rgba(255, 253, 247, 0.96);
}

.nav-btn {
  border-radius: 8px;
}

.nav-btn.active {
  background: linear-gradient(180deg, #e8f5e9, #fff8d9);
  box-shadow: inset 0 -2px 0 rgba(47, 109, 62, 0.14);
}

.game-panel {
  width: min(100%, 380px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf7, #f2eee7),
    url("public/assets/ui/paper-texture.svg");
}

.board {
  --board-size: min(320px, calc(100vw - 56px));
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  flex: 0 0 var(--board-size);
  width: var(--board-size);
  height: var(--board-size);
  margin: 0 auto;
  gap: 8px;
  border-radius: 8px;
  background: #a99b8f;
}

.tile {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  font-size: 26px;
  line-height: 1;
}

.game-modal .actions {
  justify-content: center;
}

@media (max-width: 380px) {
  .hero-card {
    min-height: 104px;
    padding-right: 104px;
  }

  .hero-card::after {
    width: 124px;
    height: 76px;
  }

  .tile {
    font-size: 22px;
  }
}

/* Game shell v2: mobile-first manor game UI */
:root {
  --ink: #f5f7ed;
  --muted: #a8b7a6;
  --surface: rgba(16, 28, 34, 0.88);
  --paper: #101b22;
  --line: rgba(187, 218, 165, 0.18);
  --green: #78c66f;
  --green-soft: rgba(120, 198, 111, 0.16);
  --gold: #f4c95d;
  --gold-soft: rgba(244, 201, 93, 0.16);
  --orange: #ff9f43;
  --blue: #6ab6ff;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(120, 198, 111, 0.28), transparent 34%),
    linear-gradient(180deg, #0c1820 0%, #142720 52%, #0e171b 100%);
  color: var(--ink);
}

.app-shell {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 16, 23, 0.28), rgba(12, 19, 25, 0.9)),
    url("public/assets/ui/bg-garden-terrace.svg") center top / 760px auto no-repeat,
    #0f1b22;
}

.top-status {
  min-height: 178px;
  padding: max(14px, env(safe-area-inset-top)) 12px 12px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(6, 13, 18, 0.34), rgba(8, 18, 24, 0.76));
  box-shadow: none;
}

.top-status::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(7, 14, 20, 0.38));
}

.top-main,
.meter-grid,
.ad-restore-bar {
  border: 1px solid rgba(212, 232, 184, 0.18);
  background: rgba(11, 24, 31, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.22);
}

.top-main {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.avatar {
  background: linear-gradient(135deg, #f4c95d, #78c66f 55%, #3d7fb4);
  color: #102016;
}

h1,
.section-title,
.name {
  color: #fffdf1;
}

.status-sub,
.muted,
.profile-stat small,
.score-chip small {
  color: var(--muted);
}

.level-pill,
.tag {
  background: rgba(120, 198, 111, 0.17);
  color: #c6f7be;
}

.coins {
  color: #21170a;
  background: linear-gradient(180deg, #ffe69a, #f4b84f);
}

.meter {
  background: rgba(205, 228, 186, 0.13);
}

.meter > i {
  background: linear-gradient(90deg, #75d46b, #b5ee7c);
}

.meter.energy > i {
  background: linear-gradient(90deg, #f7b24c, #f7db73);
}

.ad-restore-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
}

.ad-restore-bar strong,
.ad-restore-bar span {
  display: block;
}

.ad-restore-bar strong {
  color: #fffdf1;
  font-size: 13px;
}

.ad-restore-bar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ad-btn {
  min-width: 98px;
  background: linear-gradient(180deg, #5aa7ff, #3975d2);
  box-shadow: 0 8px 18px rgba(47, 116, 210, 0.28);
}

.content-shell {
  padding: 12px 12px 96px;
}

.hero-card,
.card,
.order-card,
.item-card,
.profile-card,
.scene-card {
  border: 1px solid rgba(195, 227, 174, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 36, 44, 0.94), rgba(11, 22, 29, 0.9)),
    url("public/assets/ui/paper-texture.svg");
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.hero-card {
  min-height: 112px;
  padding: 14px 124px 14px 14px;
  background:
    linear-gradient(105deg, rgba(21, 45, 47, 0.96), rgba(18, 32, 47, 0.88)),
    url("public/assets/ui/paper-texture.svg");
}

.hero-card.gold,
.hero-card.green,
.hero-card.orange {
  border-color: rgba(244, 201, 93, 0.18);
  background:
    linear-gradient(105deg, rgba(22, 48, 45, 0.96), rgba(18, 30, 45, 0.9)),
    url("public/assets/ui/paper-texture.svg");
}

.hero-icon,
.round-icon,
.tile-icon {
  color: #102016;
  background: linear-gradient(180deg, #f5d66c, #7bc96f);
}

.subtabs,
.shop-tabs {
  padding: 4px;
  border: 1px solid rgba(195, 227, 174, 0.14);
  border-radius: 8px;
  background: rgba(8, 18, 24, 0.72);
}

.subtab.active,
.nav-btn.active {
  background: rgba(120, 198, 111, 0.18);
  color: #d7ffd2;
}

.req-row,
.profile-stat,
.score-chip {
  background: rgba(255, 255, 255, 0.06);
  color: #ecf5e8;
}

.req-row.ok {
  background: rgba(95, 179, 102, 0.16);
}

.req-row.miss {
  background: rgba(255, 112, 97, 0.14);
}

.tag.warn {
  background: rgba(244, 201, 93, 0.16);
  color: #ffe39a;
}

.tag.gray {
  background: rgba(181, 195, 203, 0.14);
  color: #cbd7dc;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #66bd6d, #347f45);
  box-shadow: 0 8px 18px rgba(17, 78, 38, 0.24);
}

.btn.orange {
  background: linear-gradient(180deg, #f7ad55, #d96e2d);
}

.btn.blue {
  background: linear-gradient(180deg, #6ab6ff, #3977d6);
}

.btn.gold {
  background: linear-gradient(180deg, #f6d777, #c9922c);
  color: #241809;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e7f3df;
}

.bottom-tabs {
  border-top: 1px solid rgba(195, 227, 174, 0.16);
  background: rgba(8, 17, 23, 0.94);
}

.nav-btn {
  color: #96a796;
}

.game-panel {
  width: min(100%, 390px);
  border: 1px solid rgba(230, 245, 204, 0.2);
  background: linear-gradient(180deg, #14252f, #0b151c);
}

.game2048-board {
  --game2048-size: min(320px, calc(100vw - 56px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: var(--game2048-size);
  height: var(--game2048-size);
  max-width: 100%;
  max-height: var(--game2048-size);
  margin: 14px auto 0;
  padding: 8px;
  border: 1px solid rgba(244, 201, 93, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #101a24, #243246);
  touch-action: none;
  user-select: none;
}

.game2048-cell {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  color: #fffdf1;
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.game2048-cell > span {
  display: block;
  max-width: 100%;
  transform: translateY(-1px);
}

.game2048-cell.empty {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.game2048-cell.low {
  color: #3e3429;
}

.game2048-cell.large {
  font-size: 22px;
}

.game2048-cell.huge {
  font-size: 19px;
}

@media (max-width: 360px) {
  .game2048-board {
    --game2048-size: min(300px, calc(100vw - 48px));
    gap: 7px;
    padding: 7px;
  }

  .game2048-cell {
    font-size: 23px;
  }

  .game2048-cell.large {
    font-size: 20px;
  }

  .game2048-cell.huge {
    font-size: 17px;
  }
}
