/* Shared scratch coating: touch input stays inside the card. */
.scratch-coating-wrap { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: 2; transition: opacity .4s ease, filter .4s ease; }
.scratch-coating-wrap[hidden] { display: none !important; }
canvas.scratch-coating { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='14' fill='%23f1ce7b' stroke='%23795726' stroke-width='2'/%3E%3Ccircle cx='18' cy='18' r='10' fill='none' stroke='%23b58a40' stroke-dasharray='2 2'/%3E%3Cpath d='M14 22l8-8m-10 5l7-7m-2 12l7-7' stroke='%23795726' stroke-width='1.5'/%3E%3C/svg%3E") 18 18, crosshair; }
canvas.scratch-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scratch-coating-wrap.is-complete { opacity: 0; pointer-events: none; filter: brightness(1.15); }
.scratch-sensory { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.scratch-sensory [data-scratch-progress] { flex: 1 1 180px; margin: 0; color: #735a60; font-size: .76rem; line-height: 1.5; }
[data-scratch-sound] { min-height: 44px; padding: 8px 12px; border: 1px solid #d4b99b; border-radius: 30px; color: #6b2940; background: #fff9ed; font: 600 .75rem/1.3 system-ui, sans-serif; cursor: pointer; }
[data-scratch-sound][aria-pressed="true"] { background: #f5e3b3; border-color: #9f7833; }
[data-scratch-sound]:focus-visible { outline: 3px solid #a23759; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .scratch-coating-wrap { transition: none; } .scratch-dust { display: none; } }

/* A stable, shared result face stays underneath the coating. */
.scratch-outcome-core { position:relative; isolation:isolate; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:310px; padding:18px 16px; overflow:hidden; border:1px solid #ead3a5; border-radius:17px; text-align:center; color:#4c2331; background:radial-gradient(ellipse at 50% 32%,#fffdf5 0%,#fff7e8 48%,#f9ebd2 100%); }
.scratch-outcome-core::before,.scratch-outcome-core::after { content:""; position:absolute; z-index:-1; width:120px; height:120px; border:1px solid #bd8d3450; border-radius:50%; pointer-events:none; }
.scratch-outcome-core::before { top:-62px; left:-49px; box-shadow:0 0 0 12px #cfaa6b12,0 0 0 24px #cfaa6b0a; }
.scratch-outcome-core::after { bottom:-68px; right:-44px; box-shadow:0 0 0 12px #cfaa6b12,0 0 0 24px #cfaa6b0a; }
.scratch-outcome-badge { display:inline-flex; align-items:center; justify-content:center; min-height:25px; padding:5px 12px; border:1px solid #d7af66; border-radius:99px; color:#805519; background:#fff2ce; font:750 .65rem/1.2 system-ui,sans-serif; letter-spacing:.09em; text-transform:uppercase; }
.scratch-outcome-art { display:grid; place-items:center; flex-shrink:0; width:68px; min-height:56px; margin:1px 0; color:#a57525; }
.scratch-outcome-signature { margin:6px 0 0!important; color:#937756; font:500 .62rem/1.5 system-ui,sans-serif; letter-spacing:.03em; }
:where(#scratch-result,[data-demo-result]) .scratch-outcome-lost { display:none; }
:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-won { display:none; }
:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-lost { display:inline; }
:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-core { border-color:#dfcbd2; background:radial-gradient(ellipse at 50% 32%,#fffdfb,#fcf0f1 65%,#f7e5e9); }
:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-badge { color:#85435b; border-color:#dfbdc9; background:#fff4f6; }
:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-art { color:#aa5c75; }
:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-core::before,:where(#scratch-result,[data-demo-result])[data-outcome="lost"] .scratch-outcome-core::after { border-color:#bf8b9d55; box-shadow:0 0 0 12px #bf8b9d0c,0 0 0 24px #bf8b9d08; }
@media(max-width:360px) { .scratch-outcome-core { padding-inline:12px; gap:8px; } .scratch-outcome-badge { font-size:.6rem; } }
