* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #7cc576;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
#game, #ui { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#game { pointer-events: none; }
#vig {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(20, 30, 60, .28) 100%);
}

#hud {
  position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; pointer-events: none;
}
#hud > * { pointer-events: auto; }
.spacer { flex: 1; pointer-events: none !important; }
.pill {
  background: #fff; border-radius: 999px; padding: 6px 16px 6px 6px; font-weight: 800; font-size: 20px;
  color: #2b2b3a; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 0 rgba(0,0,0,.2), 0 8px 18px rgba(0,0,0,.18);
  background: linear-gradient(#fff, #f1f1f6);
}
.pill.small { font-size: 14px; padding: 9px 14px; }
.pill.bump { animation: bump .18s; }
@keyframes bump { 50% { transform: scale(1.12); } }
.coin {
  width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #7be08a, #2c9b3f); color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
  display: grid; place-items: center; font-size: 18px;
}
.btn {
  border: 0; background: #fff; border-radius: 12px; width: 40px; height: 40px; font-size: 18px;
  cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.18); color: #2b2b3a;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }

#hint {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(30,30,45,.82); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 700;
  font-size: 15px; pointer-events: none; white-space: nowrap; max-width: 94vw; overflow: hidden;
  text-overflow: ellipsis; transition: opacity .2s;
}
#hint:empty { opacity: 0; }
#toast {
  position: fixed; left: 50%; top: 72px; transform: translate(-50%, -20px); opacity: 0;
  background: #ffcf3f; color: #3a2a00; padding: 10px 20px; border-radius: 14px; font-weight: 800;
  box-shadow: 0 4px 0 rgba(0,0,0,.2); pointer-events: none; transition: all .25s; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#panel {
  position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25);
  padding: 16px;
}
#panel[hidden] { display: none; }
.card {
  background: #fff7e8; border-radius: 20px; width: min(420px, 100%); padding: 14px;
  box-shadow: 0 8px 0 rgba(0,0,0,.2); max-height: 90vh; overflow: auto;
}
.head { display: flex; justify-content: space-between; align-items: center; font-size: 20px; margin-bottom: 8px; color: #2b2b3a; }
.group { font-size: 12px; font-weight: 800; color: #a0875e; text-transform: uppercase; margin: 10px 4px 4px; }
.row {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px;
  padding: 8px 10px; margin-bottom: 6px;
}
.row .ico { font-size: 24px; width: 32px; text-align: center; }
.row .info { flex: 1; min-width: 0; }
.row .name { font-weight: 800; color: #2b2b3a; font-size: 15px; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: #e7dcc6; }
.pips i.on { background: #ff8a3d; }
.buy {
  border: 0; border-radius: 12px; background: #39b54a; color: #fff; font-weight: 800; font-size: 15px;
  padding: 10px 12px; min-width: 84px; cursor: pointer; box-shadow: 0 3px 0 #23803280;
}
.buy:disabled { background: #c9c9c9; box-shadow: none; cursor: default; }
