/* 10 묶기 — lib/mini.css 위에 이 게임에만 필요한 것 */
/* 무대 어디서든 끌기 시작할 수 있어야 해서 화면 넘김을 막아요 */
.app[data-game="sum"] .stage--play { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.app[data-game="sum"] .mini-body { inset: 60px 8px 8px; gap: 0; }
.app[data-game="sum"] .qbar.is-low i { background: var(--p1); }

.sumb { position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); gap: var(--gap, 3px); outline: none; }
/* 더해서 10이 되는 짝(1·9, 2·8, 3·7, 4·6)은 같은 색, 5는 혼자 다른 색 */
.tok { --h: #8C6BFF; display: grid; place-items: center; min-width: 0; border-radius: 30%; pointer-events: none;
  background: var(--stage-raised); background: color-mix(in srgb, var(--h) 20%, var(--stage));
  box-shadow: inset 0 0 0 1.5px rgba(var(--stage-ink), 0.08); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--h) 38%, var(--stage));
  color: var(--on-stage); font: 700 calc(var(--cell) * 0.56)/1 var(--font-sans); font-variant-numeric: tabular-nums;
  transition: transform 90ms var(--ease-out); }
.tok[data-v="1"], .tok[data-v="9"] { --h: #3D8BFF; }
.tok[data-v="2"], .tok[data-v="8"] { --h: #2FA84F; }
.tok[data-v="3"], .tok[data-v="7"] { --h: #E39B00; }
.tok[data-v="4"], .tok[data-v="6"] { --h: #E0558A; }
.tok.is-sel { background: var(--grain); box-shadow: none; color: var(--stage); transform: scale(1.07); }
.sumb.is-ten .tok.is-sel { background: var(--sprout); }
.tok.is-no { animation: mini-shake 240ms var(--ease-out); }
.tok.is-out { animation: sum-out 200ms var(--ease-out) forwards; }
.tok.is-gone { visibility: hidden; animation: none; }
@keyframes sum-out { from { background: var(--sprout); color: var(--stage); transform: scale(1.12); } to { background: var(--sprout); transform: scale(0.2); opacity: 0; } }

.sumrect { position: absolute; z-index: 1; box-sizing: border-box; border: 2px dashed var(--grain); border-radius: 10px; background: rgba(168, 106, 0, 0.1); pointer-events: none; }
.sumrect.is-ten { border-style: solid; border-color: var(--sprout); background: rgba(47, 168, 79, 0.14); }
.sumcur { position: absolute; z-index: 2; border-radius: 30%; box-shadow: 0 0 0 3px var(--focus); pointer-events: none; }
.sumpop { position: absolute; z-index: 3; translate: -50% -50%; font: 400 26px/1 var(--font-pixel); color: var(--sprout); text-shadow: 0 0 0 var(--stage), 0 1px 0 var(--stage), 0 -1px 0 var(--stage), 1px 0 0 var(--stage), -1px 0 0 var(--stage); pointer-events: none; animation: sum-pop 600ms var(--ease-out) forwards; }
@keyframes sum-pop { from { transform: translateY(6px) scale(0.7); opacity: 0; } 25% { transform: none; opacity: 1; } to { transform: translateY(-26px); opacity: 0; } }

.sumb--intro { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.sumb--intro .sumrect { left: 0; top: 0; }

@media (min-width: 960px) and (min-height: 620px) {
  .app[data-game="sum"] .mini-body { inset: 76px 24px 20px; }
  .sumpop { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .tok { transition: none; }
  .tok.is-out { animation-duration: 1ms; }
  .tok.is-no { animation: none; }
}
