/* Dama. Layout on the app's stage (1024x768 landscape, 390x844 portrait, scaled to fit); colors only from /app.css tokens. */
.bar .helpb{--ctl:54px;height:var(--ctl);min-height:0;font-size:20px;padding:0 18px 0 14px;gap:10px;border-radius:18px}
.bar .helpb svg{width:26px;height:26px}
.bar .lv.single{font-size:18px;padding:9px 16px}

/* first screen */
.menu{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:34px;padding:10px 28px 40px}
.hero{display:flex;gap:4px}
.hero img{width:96px;height:96px}
.modes{display:flex;gap:28px;align-items:stretch}
.mcard{background:var(--surface);border:2px solid var(--line);border-radius:var(--r-big);box-shadow:0 8px 0 var(--line);padding:26px 30px 30px;display:flex;flex-direction:column;align-items:center;gap:18px;width:430px}
.mcard h2{font:500 32px/1.1 var(--font)}
.mcard p{font:400 21px/1.3 var(--font);color:var(--ink-2);flex:1;display:flex;align-items:center}
.lvls{display:flex;flex-direction:column;gap:16px;width:100%}
.lvls .btn,.mcard .duo{width:100%;justify-content:space-between}
.mcard .duo{justify-content:center}
.lvb.btn{--fg:#fff;text-shadow:0 1px 1px rgba(0,0,0,.25)}
.wins{display:inline-flex;align-items:center;gap:6px;font:500 22px/1 var(--font);background:var(--surface);color:var(--ink);border-radius:999px;padding:5px 12px 5px 6px;text-shadow:none}
.wins img{width:30px;height:30px}
.phone .menu{gap:24px;padding:8px 22px 40px}
.phone .hero img{width:56px;height:56px}
.phone .modes{flex-direction:column;gap:22px;width:100%}
.phone .mcard{width:100%;padding:18px 20px 22px;gap:14px}
.phone .mcard h2{font-size:26px}
.phone .mcard p{font-size:18px}
.phone .lvls{gap:14px}
.phone .bar .helpb{--ctl:46px;font-size:16px;padding:0 12px 0 10px;border-radius:15px}
.phone .bar .helpb svg{width:22px;height:22px}

/* game: board on the left, turn and buttons on the right; on phones the board on top */
.play{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:30px;padding:18px 28px 28px;container-type:size}
.board{--bs:min(100cqh,100cqw - 330px);width:var(--bs);height:var(--bs);flex:none;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);
  border-radius:14px;overflow:hidden;position:relative;box-shadow:0 0 0 6px var(--t-verde-lip),0 12px 0 var(--t-verde-lip);touch-action:none;user-select:none;-webkit-user-select:none}
.sq{border:0;padding:0;margin:0;position:relative;cursor:pointer;display:block;width:100%;height:100%;min-width:0;min-height:0;font:inherit;transition:background-color 120ms ease}
.sq.lt{background:var(--surface);cursor:default}
.sq.dk{background:var(--t-verde)}
.sq img{position:absolute;inset:2%;width:96%;height:96%;pointer-events:none;z-index:1;transition:opacity 160ms ease}
.sq.gone img{opacity:.3}
/* pieces that must take: a ring that says "this one" */
.sq.must{box-shadow:inset 0 0 0 5px var(--t-rosa),inset 0 0 0 8px var(--surface)}
.sq.sel{background:var(--t-azzurro)}
.sq.last{box-shadow:inset 0 0 0 5px var(--t-giallo)}
/* where the piece can go: a dot on an empty square, a ring around a piece it can take */
.sq.tgt::after{content:"";position:absolute;inset:33%;border-radius:50%;background:var(--t-blu);box-shadow:0 0 0 4px var(--surface);z-index:2;pointer-events:none}
.sq:focus-visible{outline:4px solid var(--sole);outline-offset:-4px;box-shadow:inset 0 0 0 7px var(--ink);z-index:3}
.ghost{position:absolute;left:0;top:0;z-index:5;pointer-events:none;filter:drop-shadow(0 10px 8px rgba(0,0,0,.3))}

.side{width:300px;flex:none;align-self:stretch;display:flex;flex-direction:column;justify-content:center;gap:18px}
.turn{display:flex;align-items:center;gap:12px;font:500 32px/1.1 var(--font)}
.turn img{width:64px;height:64px;flex:none}
.info{min-height:150px;display:flex;flex-direction:column;gap:10px}
.info p{font:500 22px/1.25 var(--font);margin:0}
.info .note{color:var(--ink)}
.info .chk{align-self:flex-start;color:#fff;background:var(--t-rosa);border-radius:14px;padding:8px 16px;font-size:28px;box-shadow:0 4px 0 var(--t-rosa-lip)}
.info .think{color:var(--ink-2)}
.info .msg{display:flex;gap:8px;align-items:flex-start;color:var(--ink)}
.info .msg svg{width:26px;height:26px;stroke-width:3;color:var(--rosso);flex:none;margin-top:1px}
.acts{display:flex;flex-direction:column;gap:16px}
.acts .btn{font-size:22px;min-height:60px;justify-content:flex-start;padding:12px 20px}
.acts .btn svg{width:26px;height:26px}
.phone .play{flex-direction:column;gap:14px;padding:12px 3px 24px}
.phone .board{--bs:min(100cqw - 6px,100cqh - 200px);border-radius:8px;box-shadow:0 7px 0 var(--t-verde-lip)}
.phone .side{width:100%;padding:6px 19px 0;gap:12px;align-self:auto;justify-content:flex-start}
.phone .turn{font-size:24px;order:-1}
.phone .turn img{width:44px;height:44px}
.phone .info{min-height:56px}
.phone .info p{font-size:17px}
.phone .info .note{color:var(--ink)}
.info .chk{font-size:20px;padding:5px 12px}
.phone .acts{flex-direction:row;gap:12px}
.phone .acts .btn{flex:1;font-size:16px;min-height:52px;padding:8px 10px;justify-content:center;gap:8px}
.phone .acts .btn svg{width:22px;height:22px}

/* dialogs: end of game, promotion, help */
.end .panel{position:relative}
.end .panel>img{width:120px;height:120px}
.end .pair{display:flex}.end .pair img{width:110px;height:110px}
.end .sub{font:400 24px/1.35 var(--font);color:var(--ink-2);text-align:center;max-width:24em;margin-top:-6px}
.end .x{position:absolute;right:16px;top:16px}
.help .panel{width:min(820px,calc(100% - 40px));gap:12px;padding:28px 34px 30px}
.help h2{padding:0 60px;font-size:36px}
.how{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:1fr;gap:6px 26px;width:100%}
.how li{display:flex;align-items:center;gap:12px;padding:6px 0;border-top:1px solid var(--line)}
.how img{width:72px;height:72px;flex:none}
.how b{font:500 24px/1.1 var(--font);display:block}
.how span{font:400 18px/1.3 var(--font);color:var(--ink-2);display:block}
.rule{font:400 19px/1.35 var(--font);color:var(--ink-2);align-self:stretch;margin:0}
.rule b{font-weight:500;color:var(--ink)}
.phone .end .panel>img{width:96px;height:96px}
.phone .end .pair img{width:84px;height:84px}
.phone .end .sub{font-size:19px}
.phone .help .panel{padding:18px 16px 18px;gap:6px;max-width:calc(100% - 20px)}
.phone .help h2{font-size:24px;padding:0 56px 0 0;align-self:flex-start;min-height:52px;display:flex;align-items:center}
.phone .help .x{right:12px;top:12px}
.phone .how{grid-template-columns:1fr;gap:0}
.phone .how li{padding:3px 0;gap:10px}
.phone .how img{width:46px;height:46px}
.phone .how b{font-size:18px}
.phone .how span{font-size:15px}
.phone .rule{font-size:15px}

@media (prefers-reduced-motion:reduce){.sq{transition:none}}
