:root {
  --ink: #101820;
  --cream: #fff4d6;
  --milk: #f9fafb;
  --mint: #64d9bd;
  --coral: #ff6b6b;
  --gold: #f7c948;
  --coffee: #6b4f3f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: 'Outfit', 'M PLUS Rounded 1c', sans-serif;
  color: var(--milk);
  background:
    radial-gradient(circle at 14% 10%, rgba(100, 217, 189, 0.24), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(247, 201, 72, 0.2), transparent 30%),
    linear-gradient(145deg, #101820, #17212e 52%, #26313d);
}

#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.back-link {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 20;
  padding: 8px 14px;
  border: 1px solid rgba(255, 244, 214, 0.28);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(16, 24, 32, 0.72);
  text-decoration: none;
  font-weight: 900;
  font-size: 0.78rem;
  backdrop-filter: blur(12px);
}

.game-shell {
  width: min(440px, 100%);
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding-top: 38px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

h1 {
  font-size: 2.55rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

h1 span {
  color: var(--mint);
}

.wallet {
  min-width: 118px;
  padding: 10px 12px;
  border: 1px solid rgba(100, 217, 189, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  text-align: right;
}

.wallet span,
.stats span,
.order-board span {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.wallet b {
  font-size: 1.05rem;
}

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

.stats div {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.stats b {
  display: block;
  margin-top: 3px;
  font-size: 1.15rem;
}

.counter {
  position: relative;
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 12px;
  align-items: stretch;
  min-height: 190px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(0, 0, 0, 0.16);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.24);
}

.customer {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--cream), #f0c98b);
  color: var(--ink);
  font-size: 5rem;
  font-weight: 900;
  box-shadow: inset 0 -16px 28px rgba(107, 79, 63, 0.18);
}

.order-board {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.order-board strong {
  margin: 6px 0 8px;
  color: var(--cream);
  font-size: 1.62rem;
  line-height: 1.05;
}

.order-board p {
  min-height: 42px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.45;
}

.patience {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.patience i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--mint));
  transform-origin: left center;
}

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

.menu button,
.actions button {
  border: 0;
  border-radius: 8px;
  min-height: 58px;
  padding: 10px;
  color: var(--ink);
  background: var(--cream);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
}

.menu button span {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.menu button:active,
.actions button:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}

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

#start-btn {
  background: linear-gradient(135deg, var(--mint), var(--gold));
}

#claim-btn {
  background: linear-gradient(135deg, var(--gold), var(--coral));
}

#claim-btn:disabled {
  opacity: 0.48;
  cursor: default;
}

@media (max-height: 720px) {
  .game-shell {
    justify-content: flex-start;
    gap: 10px;
    padding-top: 42px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .counter {
    min-height: 162px;
  }

  .menu button,
  .actions button {
    min-height: 48px;
  }
}

@media (max-width: 380px) {
  #app {
    padding: 12px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .counter {
    grid-template-columns: 104px 1fr;
  }

  .customer {
    font-size: 4.1rem;
  }

  .order-board strong {
    font-size: 1.34rem;
  }
}
