.game-body {
  background: #f2f2f4;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.g-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.g-brand { flex: 0 0 auto; font-size: 15px; }
.g-stats { flex: 1; display: flex; justify-content: center; gap: 32px; }
.g-stats div, .g-win-stats div { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.g-stats .k, .g-win-stats .k { font-size: 11px; color: #86868b; text-transform: uppercase; letter-spacing: 0.06em; }
.g-stats .v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-actions { display: flex; gap: 8px; }
.g-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: #e8e8ed; color: #1d1d1f; font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.g-btn:hover { background: #dcdce1; }
.g-btn:active { transform: scale(0.97); }
.g-btn:disabled { opacity: 0.4; cursor: default; }
.g-sub { display: flex; justify-content: center; gap: 16px; font-size: 13px; color: #6e6e73; padding: 10px 16px 0; }
.g-practice { color: #15803d; font-weight: 500; }
.g-main { flex: 1; display: flex; justify-content: center; padding: 12px 12px 24px; }
.board { position: relative; width: 100%; max-width: 760px; touch-action: none; }

.slot {
  position: absolute; border-radius: var(--cr, 8px);
  background: rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.slot.stock { cursor: pointer; display: flex; align-items: center; justify-content: center; color: rgba(0,0,0,0.25); }
.slot .glyph { font-size: calc(var(--cw) * 0.38); line-height: 1; }

.card {
  position: absolute; border-radius: var(--cr, 8px);
  background: #fff;
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer; will-change: transform;
}
.card.red { color: #d12b20; }
.card.black { color: #1d1d1f; }
.card .tl { position: absolute; top: 6%; left: 9%; display: flex; flex-direction: column; align-items: center; line-height: 1; font-weight: 600; }
.card .tl .r { font-size: calc(var(--cw) * 0.26); letter-spacing: -0.04em; }
.card .tl .s { font-size: calc(var(--cw) * 0.2); margin-top: 1px; }
.card .ctr { position: absolute; right: 10%; bottom: 8%; font-size: calc(var(--cw) * 0.46); line-height: 1; }
.card.down {
  background: #15803d;
  background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1.2px);
  background-size: 7px 7px;
  box-shadow: inset 0 0 0 3px #15803d, inset 0 0 0 4px rgba(255,255,255,0.35), 0 0.5px 1px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.08);
  cursor: default;
}
.card.down .tl, .card.down .ctr { display: none; }
.card.dragging { transition: none; box-shadow: 0 2px 4px rgba(0,0,0,0.12), 0 14px 32px rgba(0,0,0,0.18); z-index: 1000 !important; pointer-events: none; }
.card.nope { animation: nope 0.32s var(--ease); }
@keyframes nope { 25% { margin-left: -4px; } 50% { margin-left: 4px; } 75% { margin-left: -2px; } }
.card.hint { box-shadow: 0 0 0 2px #15803d, 0 2px 6px rgba(0,0,0,0.08); }

.g-finish { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); box-shadow: 0 8px 30px rgba(21,128,61,0.35); z-index: 1100; }

.g-win { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 2000; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.g-win[hidden], .g-finish[hidden] { display: none; }
.g-win-card { background: #fff; border-radius: 22px; padding: 32px 28px 28px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 24px 60px rgba(0,0,0,0.25); animation: pop 0.35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.g-win-card h2 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 20px; font-weight: 600; }
.g-win-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 20px; }
.g-win-stats .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-win-note { font-size: 14px; color: #6e6e73; margin: 0 0 20px; }
.g-win-actions { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 640px) {
  .g-bar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .g-brand span { display: none; }
  .g-stats { gap: 20px; order: 3; flex-basis: 100%; padding-top: 4px; }
  .g-actions { margin-left: auto; }
  .g-btn { padding: 0 12px; }
  .g-btn span { display: none; }
  .g-btn { width: 40px; justify-content: center; padding: 0; }
  .g-main { padding: 8px 6px 16px; }
  .card .tl { left: 7%; top: 4%; }
  .card .tl .r { font-size: calc(var(--cw) * 0.32); }
  .card .tl .s { font-size: calc(var(--cw) * 0.24); }
  .card .ctr { font-size: calc(var(--cw) * 0.5); }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
