/* Scratch cards: the catalogue and the card on the table (the card scales as one piece) */
#game:has(.sk){background:radial-gradient(ellipse at 50% 0,rgba(240,120,200,.16),transparent 55%),linear-gradient(#180b16,#08040a)}
.sk{display:flex;flex-direction:column;gap:10px;width:100%;max-width:980px;margin:0 auto;height:calc(100dvh - 190px);min-height:440px;user-select:none}
.sk-head{flex:none;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.sk-head h2{margin:0;font-family:var(--display);font-size:26px;color:#ffe9a8}
.sk-filter{display:flex;gap:6px}.sk-filter button{height:32px;padding:0 14px;font-size:13px;direction:ltr}.sk-filter button.on{background:linear-gradient(#f6d36a,#c9931c);color:#241400}
.sk-resume{flex:none;height:40px;animation:skpulse 1.5s ease-in-out infinite}
@keyframes skpulse{50%{box-shadow:0 0 24px #f6d36a}}
.sk-grid{flex:1;min-height:0;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;align-content:start;padding:4px}
.sk-item{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:16px;background:linear-gradient(160deg,var(--a),var(--b));border:2px solid #ffffff33;box-shadow:0 8px 20px #000a;color:var(--ink);transition:transform .2s,box-shadow .2s}
.sk-item:hover{transform:translateY(-4px) rotate(-.4deg);box-shadow:0 14px 28px #000c,0 0 22px #f6d36a55}
.sk-face{display:block;width:100%;aspect-ratio:320/112;padding:0;border:0;border-radius:10px;overflow:hidden;background:#0006;position:relative}
.sk-face svg{display:block;width:100%;height:100%}
.sk-face::after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 38%,#ffffff66 50%,transparent 62%);transform:translateX(-100%);animation:mcshine 4.5s ease-in-out infinite}
.sk-line{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:13px;text-shadow:0 1px 3px #000c}
.sk-small{font-size:11.5px;opacity:.95;flex-wrap:wrap;row-gap:0}.sk-small b{color:#ffe27a}
.sk-info{width:24px;height:24px;min-width:0;padding:0;border-radius:50%;font-weight:800;background:#0007;color:#fff;border:1px solid #ffffff77}
.sk-buy{height:36px;padding:0;font-family:var(--display);font-size:16px}
.sk-recent{flex:none;display:flex;gap:6px;height:22px;overflow:hidden;white-space:nowrap}
.sk-recent i{flex:none;font-style:normal;font-size:11px;padding:2px 9px;border-radius:9px;background:#0007;opacity:.75}.sk-recent i.w{background:#1e7a3acc;opacity:1}
/* the card on the table: one fixed shape (100 wide, 166 high), everything inside measured against its width */
.sk-stage{flex:1;min-height:0;container-type:size;display:flex;align-items:center;justify-content:center}
.st{container-type:inline-size;position:relative;width:min(100cqw - 8px,(100cqh - 6px) / 1.66,440px);aspect-ratio:100/166;animation:stin .5s cubic-bezier(.2,1.3,.4,1)}
@keyframes stin{from{transform:translateY(30px) scale(.9) rotate(-2deg);opacity:0}}
.st::before{content:"";position:absolute;inset:0;border-radius:5cqw;background:linear-gradient(165deg,var(--a),var(--b) 70%);border:.9cqw solid #f0c35a;box-shadow:0 3cqw 7cqw #000c,inset 0 0 0 .8cqw #00000066,inset 0 0 9cqw #00000088}
.st>*{position:absolute;left:4cqw;right:4cqw}
.st-head{top:3.5cqw;height:32cqw;border-radius:3cqw;overflow:hidden;border:.5cqw solid #f0c35acc}
.st-head>svg{display:block;width:100%;height:100%}
.st-price{position:absolute;top:1.4cqw;left:1.4cqw;padding:.2cqw 2.4cqw;border-radius:5cqw;background:#000c;color:#ffe27a;font-weight:800;font-size:4.4cqw;border:.3cqw solid #f0c35a}
.st-goal{top:36.5cqw;height:7cqw;display:flex;align-items:center;justify-content:center;gap:1cqw;color:var(--ink);font-size:3.9cqw;white-space:nowrap;text-shadow:0 1px 3px #000}
.st-goal b{color:#ffe27a;margin:0 1cqw}
.st-play{top:44.5cqw;height:85cqw;display:flex;flex-direction:column;justify-content:center;gap:2cqw;padding:0 6cqw}
.st:not(.has-bonus) .st-play{padding:0 3.5cqw}
.st-cells{display:grid;grid-template-columns:repeat(3,1fr);gap:2.2cqw}
.st-cell{position:relative;aspect-ratio:1/.9;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:3.4cqw;background:radial-gradient(circle at 50% 38%,#fff,var(--cell) 55%,#c9bb98);box-shadow:inset 0 0 0 .5cqw #00000033,inset 0 1cqw 2cqw #00000040;overflow:hidden}
.st:not(.has-bonus) .st-cell{aspect-ratio:1/.93}
.st-cell .sa-sym{width:66%;height:70%;filter:drop-shadow(0 .6cqw .6cqw #0006)}
.st-cell small{font-size:3.1cqw;font-weight:800;color:#2a1a08;line-height:1;white-space:nowrap}
.st-cell.open .sa-sym{animation:stpop .45s cubic-bezier(.2,1.7,.4,1)}
@keyframes stpop{from{transform:scale(.6)}}
.st-cell.hit{background:radial-gradient(circle,#fffbe0,#ffd54f 60%,#e09a00);box-shadow:0 0 0 .8cqw #fff3b0,0 0 5cqw #ffd54f;animation:stglow .8s ease-in-out infinite alternate;z-index:1}
@keyframes stglow{to{box-shadow:0 0 0 .8cqw #fff,0 0 8cqw #ffd54f}}
.st-cell.dim:not(.hit){opacity:.45;filter:saturate(.4)}
.st-bonusrow{display:flex;align-items:center;justify-content:space-between;gap:3cqw;height:12.5cqw;padding:0 3cqw;border-radius:3.4cqw;background:#0008;border:.5cqw dashed #f0c35a;color:#ffe27a;font-family:var(--display);font-size:5.4cqw}
.st-bonusrow span small{font-family:var(--body);font-size:3.3cqw;opacity:.85;margin-inline-start:2cqw;color:var(--ink)}
.st-cell.st-bonus{width:26cqw;height:10cqw;aspect-ratio:auto;flex:none}
.st:not(.has-bonus) .st-cell.st-bonus{aspect-ratio:auto}
.st-bonus b{font-size:6.6cqw;color:#7a1230}
.st-foil{position:absolute;inset:0;width:100%;height:100%;touch-action:none;opacity:0;cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='13' fill='%23f4c430' stroke='%237a4d00' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='8' fill='none' stroke='%23fff3b0' stroke-width='2'/%3E%3C/svg%3E") 16 16,crosshair;z-index:2}
.st-foil.ready{opacity:1}.st-foil.gone{pointer-events:none}
/* until the silver layer is painted, nothing of the result may show */
.st-foil:not(.ready){background:#777;opacity:1;border-radius:3cqw}
.st-pays{top:131.5cqw;height:28cqw;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(3,1fr);grid-auto-flow:column;gap:1cqw 2cqw}
.st-pays div{display:flex;align-items:center;justify-content:space-between;gap:1.5cqw;padding:0 2cqw;border-radius:2.2cqw;background:#0008;color:#fff}
.st-pays span{display:flex;align-items:center;gap:1cqw;direction:ltr}.st-pays .sa-sym{width:7.6cqw;height:7.6cqw}.st-pays em{font-style:normal;font-size:3.3cqw;opacity:.75}
.st-pays b{font-size:4.5cqw;color:#ffe27a}
.st-pays div.hit{background:linear-gradient(90deg,#ffe27a,#e0a812);color:#241400}.st-pays div.hit b,.st-pays div.hit em{color:#241400;opacity:1}
.st-serial{top:160.4cqw;text-align:center;font-size:2.7cqw;letter-spacing:.6cqw;color:var(--ink);opacity:.6;direction:ltr}
.st-flake{position:absolute!important;right:auto!important;border-radius:1px;pointer-events:none;z-index:4;animation:stfall .8s ease-in forwards}
@keyframes stfall{to{transform:translate(var(--dx),70px) rotate(var(--r));opacity:0}}
.st>.st-banner{left:6cqw;right:6cqw;top:130cqw;z-index:5;text-align:center;padding:3cqw 2cqw;border-radius:5cqw;background:#14050af2;border:1cqw solid var(--gold);box-shadow:0 0 12cqw #000;animation:stban .6s cubic-bezier(.2,1.6,.4,1) .35s backwards;color:#fff}
.st-banner[hidden]{display:none}
.st-banner small{display:block;font-family:var(--display);font-size:5cqw;line-height:1.1;color:#8dffa4}.st-banner b{display:block;font-family:var(--display);font-size:10cqw;line-height:1.1;color:#ffd54f}.st-banner span{display:block;font-size:4cqw;opacity:.85}
.st-banner.lose{border-color:#8a8a8a}.st-banner.lose b{font-size:9cqw;color:#ddd}
@keyframes stban{from{transform:scale(.3);opacity:0}}
.sk-dock{flex:none;display:flex;align-items:center;justify-content:center;gap:14px;padding:6px 4px}
body.phone .sk-dock{justify-content:space-between;gap:8px}
.sk-dock button{height:40px;padding:0 18px;white-space:nowrap}.sk-hint{font-size:13px;opacity:.75;text-align:center}.sk-hint[hidden]{display:none}
@media(max-height:730px){body:not(.phone) main:has(.sk) #game{min-height:0}body:not(.phone) main:has(.sk) #chat{min-height:0;height:calc(100dvh - 130px)}body:not(.phone) .sk{min-height:0;height:calc(100dvh - 184px)}}
/* phone */
body.phone.ingame #game:has(.sk){padding:0}
body.phone .sk{flex:1;min-height:0;height:auto;max-width:100%;gap:6px}
body.phone .sk.list{padding:6px 8px 0}
body.phone .sk-head h2{font-size:19px}.sk-filter button{min-width:0}
body.phone .sk-filter button{height:30px;padding:0 10px;font-size:12px}
body.phone .sk-grid{grid-template-columns:1fr 1fr;gap:8px;padding:2px 0 8px}
body.phone .sk-item{padding:5px;gap:4px;border-radius:12px;min-width:0}
body.phone .sk-item:hover{transform:none}
body.phone .sk-face{aspect-ratio:320/124}
body.phone .sk-line{font-size:11px;gap:4px}body.phone .sk-small{font-size:10px;flex-direction:column;align-items:flex-start}
body.phone .sk-buy{height:34px;font-size:13px}
body.phone .sk-recent{display:none}
body.phone .sk-dock{padding:6px 10px calc(env(safe-area-inset-bottom) + 8px);border-top:2px solid var(--gold2);background:linear-gradient(#1a0a10,#0b0408)}
body.phone .sk-dock button{padding:0 12px;font-size:13px}body.phone .sk-hint{font-size:11px}
/* the strip of recent results must never widen the page */
.sk{min-width:0}.sk-recent{contain:inline-size;min-width:0}
/* a low computer window: the buttons move beside the card, so the card keeps its size */
@media(max-height:730px) and (min-width:601px){
  body:not(.phone) .sk.play{flex-direction:row;align-items:stretch;gap:12px;height:calc(100dvh - 176px)}
  body:not(.phone) .sk.play .sk-stage{height:auto}
  body:not(.phone) .sk.play .sk-dock{flex:none;width:170px;flex-direction:column;justify-content:center;gap:12px}
  body:not(.phone) .sk.play .sk-dock button{width:100%;padding:0 8px}
}
