:root {
  color-scheme: dark;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  background: #12151d;
  color: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 12%, rgba(93, 158, 255, 0.22), transparent 28%),
    linear-gradient(160deg, #141924 0%, #222333 52%, #171a21 100%);
}

body.lobby-page {
  display: block;
  min-height: 100dvh;
  overflow: auto;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  background:
    radial-gradient(circle at 18% 8%, rgba(117, 191, 255, 0.18), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 203, 98, 0.16), transparent 26%),
    linear-gradient(165deg, #111821 0%, #202833 54%, #14171f 100%);
}

.lobby-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(32px + env(safe-area-inset-bottom));
}

.lobby-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) minmax(170px, 210px) minmax(220px, 360px);
  gap: 18px;
  align-items: end;
  min-height: clamp(260px, 42dvh, 420px);
  padding: 28px 0 18px;
}

.lobby-kicker {
  margin: 0 0 8px;
  color: #ffd36b;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.lobby-hero h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 0.95;
}

.brand-byline {
  margin: 8px 0 0;
  color: #ffcf63;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 1000;
}

.lobby-subtitle {
  max-width: 520px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.55;
}

.lobby-subtitle:empty {
  display: none;
}

.lobby-mascot {
  position: relative;
  align-self: end;
  min-height: 188px;
  pointer-events: none;
}

.lobby-mascot::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 80%;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  filter: blur(8px);
  transform: translateX(-50%);
}

.lobby-mascot img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 176px);
  max-height: 220px;
  margin: 0 auto;
  object-fit: contain;
  transform-origin: 50% 100%;
  animation: mascot-breathe 3.6s ease-in-out infinite;
}

@keyframes mascot-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.025);
  }
}

.language-picker {
  display: grid;
  gap: 8px;
  align-self: end;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.language-picker span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 900;
}

.language-picker select {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(15, 20, 28, 0.96);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
}

.language-picker option {
  color: #111821;
}

.lobby-wallet {
  display: grid;
  align-self: end;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(129, 221, 255, 0.36);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(95, 214, 255, 0.18), rgba(255, 255, 255, 0.08));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.lobby-wallet span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
}

.lobby-wallet strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9eeaff;
  font-size: 30px;
  line-height: 1;
}

.lobby-wallet i {
  color: #6bdcff;
  font-style: normal;
  text-shadow: 0 0 14px rgba(107, 220, 255, 0.58);
}

.lobby-feature {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 118px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.lobby-feature img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.lobby-feature span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.lobby-feature strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.1;
}

.lobby-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.lobby-stats div {
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.lobby-stats strong {
  display: block;
  color: #ffcf63;
  font-size: 28px;
  line-height: 1;
}

.lobby-stats span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 900;
}

.daily-reward {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.6fr);
  gap: 10px;
  align-items: center;
  min-height: 98px;
  margin: 0 0 10px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 107, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 207, 99, 0.22), rgba(126, 202, 255, 0.13)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.daily-reward-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-reward-copy span {
  color: #ffcf63;
  font-size: 12px;
  font-weight: 1000;
}

.daily-reward-copy strong {
  overflow-wrap: anywhere;
  font-size: clamp(19px, 3vw, 28px);
  line-height: 1.05;
}

.daily-reward-copy small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.daily-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.daily-day {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 62px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 15, 23, 0.48);
  color: inherit;
  font: inherit;
  text-align: center;
}

.daily-day:not(:disabled) {
  cursor: pointer;
}

.daily-day span,
.daily-day small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}

.daily-day b {
  color: #9eeaff;
  font-size: 16px;
  line-height: 1;
}

.daily-day.current {
  border-color: rgba(129, 221, 255, 0.94);
  background: linear-gradient(180deg, rgba(95, 214, 255, 0.3), rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 0 2px rgba(95, 214, 255, 0.12) inset;
}

.daily-day.claimable {
  border-color: rgba(255, 207, 99, 0.96);
  background: linear-gradient(180deg, rgba(255, 207, 99, 0.36), rgba(95, 214, 255, 0.16));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 207, 99, 0.14) inset;
}

.daily-day.claimable:active {
  transform: translateY(2px);
}

.daily-day.claimed:not(.current) {
  opacity: 0.72;
}

.daily-day.claimed small {
  color: #7dff8a;
}

.age-filter {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 8px;
  margin: 4px 0 10px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  backdrop-filter: blur(10px);
}

.topic-filter {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin: 0 0 10px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  backdrop-filter: blur(10px);
}

.library-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 14px;
}

.topic-filter button {
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.topic-filter button.active {
  transform: translateY(-1px);
}

.age-filter button,
.topic-filter button,
.library-tabs button {
  min-width: 64px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.1);
}

.topic-filter button {
  min-width: max-content;
  padding: 0 14px;
}

.age-filter button.active,
.topic-filter button.active,
.library-tabs button.active {
  border-color: rgba(255, 220, 122, 0.86);
  background: linear-gradient(180deg, #ffeaa0, #ffbf42);
  color: #241a08;
  box-shadow: 0 8px 18px rgba(255, 191, 66, 0.18), inset 0 -3px rgba(128, 80, 11, 0.14);
}

.hero-games-section {
  display: grid;
  gap: 10px;
  padding: 8px 0 14px;
}

.filter-status {
  min-height: 24px;
  padding: 0 2px 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 900;
}

.filter-status.empty {
  color: #ffcf63;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.section-heading span {
  color: #ffcf63;
  font-size: 13px;
  font-weight: 1000;
}

.section-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

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

.hero-game-card {
  display: grid;
  grid-template-rows: 120px minmax(0, auto);
  gap: 0;
  min-height: 204px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.hero-game-art {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #202938;
}

.hero-game-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-game-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.02), rgba(10, 14, 20, 0.26));
  pointer-events: none;
}

.hero-game-art span {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(15, 20, 28, 0.82);
  color: #ffcf63;
  font-size: 14px;
  font-weight: 1000;
}

.hero-game-copy {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 12px;
}

.hero-game-card strong {
  overflow: hidden;
  font-size: 22px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-game-card small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-game-card em,
.game-card-plays {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(129, 221, 255, 0.28);
  border-radius: 8px;
  background: rgba(129, 221, 255, 0.12);
  color: #9eeaff;
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 8px;
}

.site-footer {
  display: grid;
  gap: 12px;
  margin-top: 34px;
  padding: 22px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.66);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.site-footer a {
  color: #ffcf63;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.legal-page {
  min-height: 100dvh;
  overflow: auto;
  touch-action: pan-y;
}

.legal-shell {
  width: min(100%, 880px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px calc(42px + env(safe-area-inset-bottom));
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 28px;
}

.legal-nav a {
  color: #ffcf63;
  font-weight: 900;
  text-decoration: none;
}

.legal-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.legal-card h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1;
}

.legal-card h2 {
  margin: 12px 0 0;
  color: #ffcf63;
  font-size: 22px;
}

.legal-card p,
.legal-card li {
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.65;
}

.legal-card p {
  margin: 0;
}

.legal-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.legal-card strong {
  color: #fff;
}

.game-card {
  position: relative;
  display: flex;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  text-decoration: none;
  flex-direction: column;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.favorite-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(9, 13, 19, 0.72);
  color: #ffffff;
  font-size: 26px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.favorite-toggle.active {
  border-color: rgba(255, 212, 106, 0.95);
  background: #ffcf63;
  color: #4b2606;
}

.favorite-toggle:active {
  transform: scale(0.94);
}

.game-card.playable {
  background: rgba(255, 255, 255, 0.11);
}

.game-card-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 196px;
  overflow: hidden;
  background: #243242;
}

.game-card-art.image-art {
  height: auto;
  max-height: 360px;
  aspect-ratio: 1 / 1;
}

.game-card-art > span {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 4px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: rgba(19, 24, 32, 0.42);
  color: #fff;
  font-size: 28px;
  font-weight: 1000;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.game-card-bg-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  filter: blur(16px) brightness(0.42) saturate(1.12);
  transform: scale(1.16);
  z-index: 0;
}

.game-card-fg {
  position: relative;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  max-width: 220px;
  max-height: 168px;
  object-fit: contain;
  z-index: 1;
}

.game-card-art.image-art .game-card-fg {
  width: 84%;
  height: 84%;
  max-width: none;
  max-height: none;
}

.game-card-art.image-art .game-card-bg-blur {
  padding: 0;
  object-fit: cover;
  transform: scale(1.06);
}

.game-card-art .game-card-hero {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 104px;
  height: 104px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
}

.game-card-art.image-art .game-card-hero {
  width: 76px;
  height: 76px;
}

.game-card-art.color-match {
  background:
    linear-gradient(135deg, rgba(255, 99, 104, 0.9), transparent 48%),
    linear-gradient(225deg, rgba(85, 196, 255, 0.9), transparent 48%),
    #f5c65e;
}

.game-card-art.memory-flip {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 18px, transparent 18px 36px),
    #6858b7;
}

.game-card-art.reflex-run {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, #38a777 0%, #2c6fb0 100%);
  background-size: 38px 100%, auto;
}

.game-card-art.snack-blocks {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(135deg, #e5526f 0%, #f5be55 55%, #65bf82 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

.game-card-art.animal-quiz {
  background:
    radial-gradient(circle at 26% 28%, rgba(255, 255, 255, 0.24), transparent 16%),
    radial-gradient(circle at 72% 64%, rgba(255, 255, 255, 0.18), transparent 18%),
    linear-gradient(135deg, #4aa0df 0%, #6abf6a 100%);
}

.game-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  flex: 1;
}

.game-card-topline,
.game-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.age-pill {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #ffffff;
  color: #18202b;
  font-weight: 1000;
}

.game-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.game-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  line-height: 1.45;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.game-card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-card-categories span {
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 207, 99, 0.16);
  color: #ffdf8a;
  font-size: 12px;
  font-weight: 900;
}

.game-card-skills span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(132, 211, 255, 0.16);
  color: #a9dcff;
  font-size: 12px;
  font-weight: 900;
}

.game-card-meta span {
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.game-card-plays {
  margin-top: 2px;
}

.game-card-actions {
  align-self: end;
  color: #ffd36b;
}

.lobby-feature,
.hero-game-card,
.game-card {
  transform: translateZ(0);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.lobby-feature img,
.hero-game-art img,
.game-card-bg-blur,
.game-card-fg,
.game-card-art .game-card-hero {
  transition: transform 0.24s ease, filter 0.24s ease;
}

.game-card-art::after {
  content: "▶";
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 207, 99, 0.94);
  color: #241a08;
  font-size: 18px;
  font-weight: 1000;
  opacity: 0;
  transform: scale(0.72);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lobby-feature:hover,
.lobby-feature:focus-visible,
.hero-game-card:hover,
.hero-game-card:focus-visible,
.game-card.playable:hover,
.game-card.playable:focus-visible {
  border-color: rgba(255, 211, 107, 0.58);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.34);
  transform: translateY(-4px);
}

.lobby-feature:hover img,
.lobby-feature:focus-visible img {
  filter: drop-shadow(0 12px 18px rgba(255, 207, 99, 0.22));
  transform: scale(1.1) rotate(-2deg);
}

.hero-game-card:hover .hero-game-art img,
.hero-game-card:focus-visible .hero-game-art img {
  filter: saturate(1.1) brightness(1.08);
  transform: scale(1.06);
}

.game-card.playable:hover .game-card-art::after,
.game-card.playable:focus-visible .game-card-art::after {
  opacity: 1;
  transform: scale(1);
}

.game-card.playable:hover .game-card-bg-blur,
.game-card.playable:focus-visible .game-card-bg-blur {
  filter: blur(14px) brightness(0.5) saturate(1.22);
  transform: scale(1.12);
}

.game-card.playable:hover .game-card-fg,
.game-card.playable:focus-visible .game-card-fg {
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.36));
  transform: scale(1.06);
}

.game-card.playable:hover .game-card-hero,
.game-card.playable:focus-visible .game-card-hero {
  filter: drop-shadow(0 16px 22px rgba(255, 207, 99, 0.28));
  transform: translateX(-50%) scale(1.16);
}

.game-card:active,
.hero-game-card:active,
.lobby-feature:active {
  transform: translateY(-1px) scale(0.99);
}

.coming-soon {
  opacity: 0.72;
}

.lobby-toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  min-width: 210px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.88);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: lobby-toast-up 1.5s ease-out forwards;
  pointer-events: none;
}

.sound-toggle {
  position: fixed;
  z-index: 60;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(12, 15, 20, 0.72);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.sound-toggle.muted {
  opacity: 0.72;
}

@keyframes lobby-toast-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -125%);
  }
}

@media (max-width: 920px) {
  .lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .lobby-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .lobby-hero {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 132px);
    min-height: 0;
    padding-top: 22px;
  }

  .lobby-hero-copy {
    grid-column: 1 / -1;
  }

  .lobby-mascot {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: end;
    min-height: 150px;
  }

  .lobby-mascot img {
    width: 132px;
    max-height: 168px;
  }

  .language-picker {
    min-height: 0;
  }

  .lobby-wallet {
    min-height: 0;
  }

  .lobby-feature {
    grid-column: 1 / -1;
    grid-template-columns: 76px 1fr;
    min-height: 96px;
  }

  .lobby-feature img {
    width: 76px;
    height: 76px;
  }

  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .lobby-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .lobby-stats div {
    min-height: 68px;
    padding: 10px 9px;
  }

  .lobby-stats strong {
    font-size: 24px;
  }

  .lobby-stats span {
    font-size: 12px;
  }

  .daily-reward {
    grid-template-columns: 1fr;
  }

  .daily-track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .daily-day {
    min-height: 58px;
  }

  .game-card {
    min-height: 332px;
  }

  .game-card-art.image-art {
    max-height: 420px;
  }

  .hero-games {
    grid-auto-columns: minmax(210px, 72vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
  }

  .hero-game-card {
    min-height: 190px;
    scroll-snap-align: start;
  }
}

.game-shell {
  position: relative;
  width: min(100vw, 56.28dvh);
  height: min(100dvh, 177.68vw);
  max-width: 950px;
  max-height: 1688px;
  overflow: hidden;
  background: #202938;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.hud {
  position: absolute;
  z-index: 3;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.68);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.top-right {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  min-width: 118px;
  line-height: 1.5;
  text-align: right;
}

.coin-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.coin-line img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.menu-coin-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.62);
  font-size: 20px;
  font-weight: 900;
}

.menu-wallet-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diamond-wallet,
.cost-diamond {
  color: #9eeaff;
}

.diamond-wallet i,
.cost-diamond {
  font-style: normal;
  text-shadow: 0 0 12px rgba(107, 220, 255, 0.55);
}

.menu-coin-line img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.settings-btn {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.68);
  color: #fff;
  font-size: 24px;
  backdrop-filter: blur(8px);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 24px calc(96px + env(safe-area-inset-bottom));
  text-align: center;
  background: rgba(8, 11, 18, 0.58);
  animation: wonder-fade-in 0.22s ease;
}

.overlay.equipment-screen {
  align-content: start;
  gap: 4px;
  padding: max(10px, env(safe-area-inset-top)) 24px calc(100px + env(safe-area-inset-bottom));
}

.overlay.equipment-screen #overlayText {
  display: none;
}

.overlay.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.overlay h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1;
}

.overlay p {
  max-width: 300px;
  margin: 0 auto 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.45;
}

.overlay button {
  justify-self: center;
  align-self: center;
  min-width: 128px;
  min-height: 46px;
  max-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #ffcb3f;
  color: #202020;
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(105, 68, 10, 0.72);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.overlay button:active,
.settlement-actions button:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 1px 0 rgba(105, 68, 10, 0.72);
  filter: brightness(1.06);
}

.menu-content {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  width: min(380px, calc(100vw - 48px));
  max-height: min(760px, calc(100dvh - 245px));
  overflow-y: auto;
  padding: 2px;
  animation: wonder-panel-pop 0.34s cubic-bezier(0.17, 0.9, 0.28, 1.2);
}

.menu-content.equipment-mode {
  align-self: stretch;
  align-content: start;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

.menu-tabs {
  position: absolute;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.74);
  backdrop-filter: blur(8px);
}

.menu-tabs button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  min-height: 82px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1.05;
  overflow: hidden;
}

.menu-tabs button.active {
  background: #ffcb3f;
  color: #202020;
}

.menu-tabs img,
.tab-gear {
  width: 58px;
  height: 58px;
  object-fit: contain;
  font-size: 26px;
  line-height: 28px;
}

.menu-tabs span {
  display: block;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-panel,
.character-panel {
  display: grid;
  gap: 10px;
  width: 100%;
}

.equipment-panel {
  gap: 8px;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.equipment-slots,
.backpack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 64px;
  gap: 8px;
}

.equipment-slots {
  flex: none;
}

.backpack-grid {
  align-content: start;
  height: min(352px, 42dvh);
  min-height: 210px;
  max-height: 352px;
  overflow-y: auto;
  padding-right: 4px;
  touch-action: pan-y;
}

.equip-slot,
.backpack-item,
.backpack-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 64px;
  max-height: none;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.62);
  position: relative;
}

.equipment-slots .equip-slot,
.backpack-grid .backpack-item {
  min-width: 0;
  padding: 0;
}

.equip-slot img,
.backpack-item img {
  display: block;
  width: auto;
  height: auto;
  max-width: 54px;
  max-height: 54px;
  aspect-ratio: auto;
  object-fit: contain;
}

.equip-slot.empty::after {
  content: "+";
  color: rgba(255, 255, 255, 0.45);
  font-size: 28px;
  font-weight: 900;
}

.equipment-slots .equip-slot.empty {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(12, 15, 20, 0.62);
}

.equip-slot.selected,
.backpack-item.selected {
  outline: 3px solid rgba(255, 255, 255, 0.82);
  outline-offset: -3px;
}

.equip-slot.drag-over {
  border-color: #ffcb3f;
  background: rgba(255, 203, 63, 0.18);
}

.backpack-item.drag-over {
  outline: 3px solid rgba(255, 203, 63, 0.85);
  outline-offset: -3px;
}

.backpack-item,
.backpack-empty {
  height: 64px;
  min-height: 0;
}

.backpack-item {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.equip-slot {
  touch-action: none;
  user-select: none;
}

.equipment-slots .equip-slot.tier-1,
.backpack-grid .backpack-item.tier-1 {
  border-color: rgba(188, 195, 207, 0.72);
  background: rgba(105, 111, 124, 0.32);
}

.equipment-slots .equip-slot.tier-2,
.backpack-grid .backpack-item.tier-2 {
  border-color: rgba(102, 230, 137, 0.82);
  background: rgba(71, 171, 99, 0.34);
}

.equipment-slots .equip-slot.tier-3,
.backpack-grid .backpack-item.tier-3 {
  border-color: rgba(95, 170, 255, 0.84);
  background: rgba(59, 126, 218, 0.34);
}

.equipment-slots .equip-slot.tier-4,
.backpack-grid .backpack-item.tier-4 {
  border-color: rgba(205, 139, 255, 0.86);
  background: rgba(155, 91, 220, 0.36);
}

.equipment-slots .equip-slot.tier-5,
.backpack-grid .backpack-item.tier-5 {
  border-color: rgba(255, 222, 91, 0.92);
  background: rgba(234, 177, 45, 0.38);
}

.equipment-slots .equip-slot.tier-6,
.backpack-grid .backpack-item.tier-6 {
  border-color: rgba(255, 103, 103, 0.9);
  background: rgba(222, 62, 62, 0.38);
}

.backpack-empty {
  cursor: default;
  opacity: 0.65;
}

.backpack-empty::after {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
}

.equip-level {
  position: absolute;
  right: 6px;
  bottom: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 203, 63, 0.95);
  color: #202020;
  font-size: 12px;
  font-weight: 900;
}

.weapon-info-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.68);
}

.weapon-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.52);
}

.weapon-modal.hidden {
  display: none;
}

.weapon-modal-card {
  position: relative;
  width: min(360px, calc(100vw - 48px));
}

.weapon-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  min-width: 0;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #202020;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.weapon-info-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
}

.weapon-info-icon {
  width: auto;
  height: auto;
  max-width: 58px;
  max-height: 58px;
  padding: 4px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(105, 111, 124, 0.32);
  border: 1px solid rgba(188, 195, 207, 0.72);
}

.weapon-info-icon.tier-2 {
  background: rgba(71, 171, 99, 0.34);
  border-color: rgba(102, 230, 137, 0.82);
}

.weapon-info-icon.tier-3 {
  background: rgba(59, 126, 218, 0.34);
  border-color: rgba(95, 170, 255, 0.84);
}

.weapon-info-icon.tier-4 {
  background: rgba(155, 91, 220, 0.36);
  border-color: rgba(205, 139, 255, 0.86);
}

.weapon-info-icon.tier-5 {
  background: rgba(234, 177, 45, 0.38);
  border-color: rgba(255, 222, 91, 0.92);
}

.weapon-info-icon.tier-6 {
  background: rgba(222, 62, 62, 0.38);
  border-color: rgba(255, 103, 103, 0.9);
}

.weapon-info-head strong {
  display: block;
  font-size: 15px;
}

.weapon-info-head span,
.weapon-info-next,
.weapon-info-empty {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
}

.weapon-info-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.weapon-info-stats span {
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.weapon-info-empty {
  display: grid;
  min-height: 72px;
  place-items: center;
  text-align: center;
}

.section-title {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.settlement-panel {
  display: grid;
  gap: 12px;
  width: 100%;
}

.settlement-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.66);
  text-align: left;
  animation: wonder-row-slide 0.28s ease both;
}

.settlement-row strong {
  font-size: 18px;
}

.settlement-row span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.reward-item,
.reward-empty {
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 6px;
  border: 1px solid rgba(188, 195, 207, 0.72);
  border-radius: 8px;
  background: rgba(105, 111, 124, 0.32);
  text-align: center;
  animation: wonder-reward-pop 0.36s cubic-bezier(0.17, 0.9, 0.28, 1.2) both;
}

.reward-item img {
  display: block;
  width: auto;
  height: auto;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
}

.reward-item span,
.reward-empty {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.reward-empty {
  grid-column: 1 / -1;
  min-height: 58px;
  color: rgba(255, 255, 255, 0.74);
}

.reward-item.tier-2 {
  border-color: rgba(102, 230, 137, 0.82);
  background: rgba(71, 171, 99, 0.34);
}

.reward-item.tier-3 {
  border-color: rgba(95, 170, 255, 0.84);
  background: rgba(59, 126, 218, 0.34);
}

.reward-item.tier-4 {
  border-color: rgba(205, 139, 255, 0.86);
  background: rgba(155, 91, 220, 0.36);
}

.reward-item.tier-5,
.reward-item.coin-reward {
  border-color: rgba(255, 222, 91, 0.92);
  background: rgba(234, 177, 45, 0.38);
}

.reward-item.tier-6 {
  border-color: rgba(255, 103, 103, 0.9);
  background: rgba(222, 62, 62, 0.38);
}

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

.settlement-actions button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  max-height: none;
  border: 0;
  border-radius: 8px;
  background: #ffcb3f;
  color: #202020;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(105, 68, 10, 0.72);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.settlement-actions button:only-child {
  grid-column: 1 / -1;
}

.settlement-actions button:last-child {
  background: rgba(255, 255, 255, 0.88);
}

@keyframes wonder-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes wonder-panel-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wonder-row-slide {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes wonder-reward-pop {
  0% {
    opacity: 0;
    transform: scale(0.76);
    filter: brightness(1.35);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .menu-content,
  .settlement-row,
  .reward-item,
  .reward-empty {
    animation: none;
  }
}

.character-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.62);
  text-align: left;
}

.character-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.character-card strong {
  display: block;
  font-size: 18px;
}

.character-card span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 54px);
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.profile-panel {
  display: grid;
  gap: 8px;
  width: 100%;
}

.profile-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.62);
  text-align: left;
}

.profile-row.full {
  grid-template-columns: 1fr;
}

.profile-row.setting-row {
  grid-template-columns: 64px minmax(0, 1fr);
}

.setting-control {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  width: 100%;
}

.profile-row-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.settings-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.settings-actions button {
  width: 100%;
}

.profile-row strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.profile-row span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.profile-row button,
.pause-panel button {
  min-width: 104px;
  min-height: 42px;
  font-size: 15px;
}

.profile-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.cost-coin {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.profile-row button:disabled {
  background: rgba(255, 255, 255, 0.28);
  color: rgba(0, 0, 0, 0.45);
}

.pause-panel {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.level-grid button {
  width: 54px;
  min-width: 0;
  height: 54px;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 203, 63, 0.95);
  color: #202020;
  font-size: 20px;
}

.level-grid button.locked {
  background: rgba(26, 29, 36, 0.88);
  color: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.12);
}

.level-grid button.completed {
  background: #45d483;
  color: #102217;
}

.level-grid button.challenge {
  background: #ffcb3f;
  color: #202020;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.floating-message {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.82);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.72);
  pointer-events: none;
  animation: float-message-up 1.5s ease-out forwards;
}

@keyframes float-message-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -135%);
  }
}

.upgrade-grid {
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 56px));
}

.upgrade-grid button {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 88px;
  max-height: none;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 203, 63, 0.95);
  color: #202020;
  text-align: left;
}

.upgrade-grid img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.upgrade-copy {
  display: grid;
  gap: 4px;
}

.upgrade-grid strong {
  font-size: 18px;
}

.upgrade-grid span {
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 480px) {
  .hud {
    font-size: 14px;
    padding: 8px 10px;
  }

  .overlay {
    gap: 8px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .overlay button {
    min-height: 42px;
    font-size: 16px;
  }

  .menu-tabs button {
    min-height: 72px;
    padding: 3px 2px;
  }

  .menu-tabs img,
  .tab-gear {
    width: 46px;
    height: 46px;
  }

  .menu-tabs span {
    font-size: 10px;
  }
}

@supports not (height: 100dvh) {
  html,
  body {
    height: 100vh;
  }

  .game-shell {
    width: min(100vw, 56.28vh);
    height: min(100vh, 177.68vw);
  }

  .menu-content {
    max-height: min(760px, calc(100vh - 245px));
  }

  .backpack-grid {
    height: min(322px, 40vh);
  }
}

.drag-ghost {
  position: fixed;
  z-index: 20;
  width: 58px;
  height: 58px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.settings-select {
  display: block;
  width: 100%;
  min-height: 46px;
  background: #1e293b;
  border: 2px solid #475569;
  color: #f8fafc;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.settings-select option {
  background-color: #1e293b;
  color: #f8fafc;
}
html,
body,
button,
a,
canvas,
[role="button"] {
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
