:root{--bg:#16141f;--panel:#221f30;--ink:#f3f0ff;--mut:#9a94b8;--gold:#ffc828;--red:#e2453c;--blue:#3d7be0}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.35 system-ui,Segoe UI,Roboto,sans-serif}
header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;background:#0e0c15;border-bottom:3px solid var(--gold);flex-wrap:wrap;gap:8px}
h1{margin:0;font:900 22px/1 Impact,system-ui;letter-spacing:1px;color:var(--gold)}h1 span{color:#fff}
nav button,button,.btn{background:#2f2a45;color:var(--ink);border:1px solid #4a4466;border-radius:8px;padding:6px 10px;cursor:pointer;font-weight:600}
nav button.on{background:var(--gold);color:#111}button:hover,.btn:hover{border-color:var(--gold)}button:disabled{opacity:.4;cursor:not-allowed}
button.big{background:var(--gold);color:#111;font-size:15px}.wide{width:100%;margin:10px 0}
.tab{display:none}.tab.on{display:grid}.hidden{display:none!important}.muted{color:var(--mut)}
#builder{grid-template-columns:220px 1fr 300px;gap:10px;padding:10px;height:calc(100vh - 56px)}
.filters,.deck{background:var(--panel);border-radius:10px;padding:10px;overflow:auto;display:flex;flex-direction:column;gap:8px}
input,select{background:#14121c;color:var(--ink);border:1px solid #4a4466;border-radius:6px;padding:6px;width:100%}
label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--mut)}label.tog{flex-direction:row;align-items:center;gap:6px}label.tog input{width:auto}
.chips{display:flex;flex-wrap:wrap;gap:4px}.chip{padding:4px 8px;border-radius:12px;border:2px solid;cursor:pointer;font-size:12px;font-weight:700;opacity:.45}.chip.on{opacity:1}
.browser{overflow:auto}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--cw,130px),1fr));gap:8px}
.card{position:relative;border-radius:8px;overflow:hidden;cursor:pointer;background:#000;aspect-ratio:220/308}
.card img{width:100%;height:100%;display:block}.card .cnt{position:absolute;right:4px;top:4px;background:var(--gold);color:#111;border-radius:10px;padding:0 7px;font-weight:800}
.card:hover{outline:2px solid var(--gold)}
.row{display:flex;gap:6px}.row input,.row select{flex:1}
#deckList{list-style:none;padding:0;margin:0;font-size:13px}#deckList li{display:flex;justify-content:space-between;padding:3px 6px;border-radius:5px;cursor:pointer;border-left:4px solid}
#deckList li:hover{background:#2f2a45}.errs{color:#ff8a80;font-size:12px}.ok{color:#8eea8a}
.curve{display:flex;align-items:flex-end;gap:3px;height:60px}.curve div{flex:1;background:var(--blue);text-align:center;font-size:10px;color:#fff;border-radius:3px 3px 0 0;min-height:12px}
#play{padding:10px}.setup{max-width:420px;margin:30px auto;background:var(--panel);padding:20px;border-radius:12px;display:flex;flex-direction:column;gap:10px}
.table{display:grid;grid-template-columns:1fr 280px;grid-template-rows:auto auto auto;gap:8px;height:calc(100vh - 76px)}
.side{background:#1d1a2a;border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:6px;grid-column:1}.opp{background:#241a22}
.mid{grid-column:1;display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}.actions{display:flex;gap:6px;flex-wrap:wrap}
#status{font-weight:700;color:var(--gold)}.log{grid-column:2;grid-row:1/4;background:#0e0c15;border-radius:10px;padding:8px;overflow:auto;font-size:12px}
.log div{padding:2px 0;border-bottom:1px solid #221f30}.log .turn{color:var(--gold);font-weight:700}
.info{display:flex;gap:12px;flex-wrap:wrap;font-weight:700}.info span{background:#2f2a45;border-radius:6px;padding:3px 8px}.info .score{background:var(--gold);color:#111}
.field{display:flex;gap:8px;min-height:150px;align-items:flex-start;flex-wrap:wrap}.hand{display:flex;gap:6px;flex-wrap:wrap;min-height:120px}
.hand .card{width:96px}.field .card{width:108px}.backs .back{width:40px;height:56px;border-radius:5px;background:repeating-linear-gradient(45deg,#ffc828,#ffc828 6px,#c99a10 6px,#c99a10 12px);border:2px solid #111}
.bear{position:relative}.bear .tags{position:absolute;left:0;right:0;bottom:0;display:flex;flex-wrap:wrap;gap:2px;padding:2px;background:rgba(0,0,0,.65);font-size:10px;font-weight:800}
.tag{padding:1px 4px;border-radius:4px}.t-rest{background:#666}.t-def{background:var(--blue)}.t-dmg{background:var(--red)}.t-frz{background:#5bc0eb;color:#111}.t-act{background:#444}
.bear .stat{position:absolute;top:2px;left:2px;background:rgba(0,0,0,.75);border-radius:5px;padding:0 4px;font-weight:800;font-size:11px}
.sel{outline:3px solid var(--gold)!important}.tgt{outline:3px dashed var(--red)!important}.dim{opacity:.5}
.zoom{position:fixed;right:12px;bottom:12px;width:300px;background:#0e0c15;border:2px solid var(--gold);border-radius:12px;padding:8px;z-index:20;pointer-events:none}
.zoom img{width:100%;border-radius:8px}.zoom .t{font-size:12px;margin-top:4px}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:30}.modal>div{background:var(--panel);padding:16px;border-radius:12px;max-width:640px}
.modal .opts{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}.modal .card{width:150px}
.menu{position:fixed;z-index:25;background:#0e0c15;border:1px solid var(--gold);border-radius:8px;display:flex;flex-direction:column}.menu button{border:0;border-radius:0;text-align:left}
.toast{position:fixed;left:50%;top:70px;transform:translateX(-50%);background:var(--red);padding:8px 14px;border-radius:8px;opacity:0;transition:.3s;z-index:40;font-weight:700}.toast.show{opacity:1}
.rules{max-width:820px;margin:0 auto;padding:16px;white-space:pre-wrap;background:var(--panel);border-radius:10px}
@media (max-width:900px), (max-height:520px) and (hover: none){#builder{grid-template-columns:1fr;height:auto}.table{grid-template-columns:1fr;height:auto}.log{grid-column:1;grid-row:auto;max-height:200px}.zoom{display:none}}

#autoBox{background:#2a2540;border-radius:8px;padding:8px}#autoBox summary{cursor:pointer}.small{font-size:12px}#abSummary p{margin:4px 0}
.ico{display:inline-flex;width:16px;height:16px;border-radius:50%;align-items:center;justify-content:center;color:#111;font-size:10px;font-weight:900;margin-right:4px}

.bear.ex{transform:rotate(90deg) scale(.86);margin:0 26px;transition:transform .25s}.bear{transition:transform .25s}
.dmgc{position:absolute;top:30%;right:4px;width:30px;height:30px;border-radius:50%;background:var(--red);color:#fff;font-weight:900;display:flex;align-items:center;justify-content:center;border:2px solid #fff;font-size:15px;box-shadow:0 2px 6px #000}
.t-dry{background:#6b4fa3}.t-awake{background:#2e7d32}.t-ex{background:#555}
.pips{display:inline-flex;flex-wrap:wrap;max-width:190px;gap:2px;vertical-align:middle;margin-left:6px}.pip{width:9px;height:9px;border-radius:50%;border:2px solid var(--gold)}.pip.on{background:var(--gold)}
.modal .card.mull{outline:3px solid var(--red);opacity:.55}

.cbar{gap:8px;margin:10px 0}.cbar input{flex:1}.clist{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}.citem{background:#1e1c2c;border:1px solid #333;border-radius:10px;padding:10px}.citem h4{margin:0 0 4px}.citem .meta{opacity:.75;font-size:13px;margin-bottom:8px}.citem button{margin-right:6px}

/* ---------- mobile / touch ---------- */
.mobonly{display:none}.fbody{display:flex;flex-direction:column;gap:8px}
.zbtn{position:absolute;right:0;top:0;width:44px;height:44px;padding:0;border:0;background:transparent;font-size:15px;display:flex;align-items:flex-start;justify-content:flex-end;padding:4px 5px;z-index:2;cursor:pointer}
.zbtn:hover{border:0}
body.touch .card .cnt{right:auto;left:4px}
body.touch .bear .stat{top:2px;left:2px}
body.touch .card:hover{outline:none}
body.touch .zoom{display:block;pointer-events:auto;left:50%;right:auto;top:50%;bottom:auto;transform:translate(-50%,-50%);width:min(340px,88vw);max-height:90vh;overflow:auto;z-index:45;box-shadow:0 0 0 100vmax rgba(0,0,0,.6)}
body.touch .zoom::after{content:'Tap to close';display:block;text-align:center;color:var(--mut);font-size:12px;margin-top:6px}
body.touch .zoom.hidden{display:none!important}
.modal>div{max-height:92vh;overflow:auto;max-width:min(640px,96vw)}
@media (pointer:coarse){button,.btn,nav button,select,input:not([type=checkbox]){min-height:44px}.chip{padding:10px 12px;font-size:13px}label.tog{min-height:44px}label.tog input{width:22px;height:22px}.menu button{min-height:48px;font-size:15px;padding:10px 16px}#deckList li{padding:10px 8px}}
@media (max-width:900px), (max-height:520px) and (hover: none){
  html,body{overflow-x:clip}
  body{font-size:15px}
  .mobonly{display:inline-flex;align-items:center;justify-content:center}
  header{padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top));position:sticky;top:0;z-index:15}
  h1{font-size:19px}
  nav{display:flex;gap:6px;overflow-x:auto;width:100%;scrollbar-width:none;-webkit-overflow-scrolling:touch}nav::-webkit-scrollbar{display:none}
  nav button{flex:0 0 auto;white-space:nowrap}
  #builder{padding:8px;gap:8px}
  .filters .fbody{display:none;flex-direction:column;gap:8px}.filters.open .fbody{display:flex}
  .filters #filtBtn{width:100%}
  .filters{order:0}.browser{order:1}.deck{order:2;scroll-margin-top:110px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(min(var(--cw,104px),calc(100vw - 32px)),1fr));gap:6px}
  .row{flex-wrap:wrap}.row button,.row .btn{flex:1 1 auto}
  .deckbar{position:fixed;left:0;right:0;bottom:0;z-index:12;display:flex;justify-content:space-between;align-items:center;gap:8px;background:#0e0c15;border-top:2px solid var(--gold);padding:6px 10px;padding-bottom:max(6px,env(safe-area-inset-bottom));}
  #builder.on{padding-bottom:70px}
  #deckBarTxt{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  /* game */
  #play{padding:6px 6px 84px}
  .setup{margin:10px auto;padding:14px}
  .table{gap:6px;grid-template-columns:minmax(0,1fr)!important}.side,.mid,.info{min-width:0}
  .side{padding:6px;gap:4px}
  .info{gap:5px;font-size:12px}.info span{padding:3px 6px}.pips{max-width:150px}.pip{width:7px;height:7px;border-width:1.5px}
  .info .score{width:100%}
  .backs{min-height:0!important;flex-wrap:nowrap!important;overflow-x:auto}.backs .back{width:22px;height:30px;flex:0 0 auto}
  .field{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;min-height:126px;padding:4px 2px;-webkit-overflow-scrolling:touch}
  .field .card{width:84px;flex:0 0 auto}
  .bear.ex{transform:rotate(90deg) scale(.8);margin:0 20px}
  .hand{flex-wrap:nowrap;overflow-x:auto;min-height:0;padding:4px 2px 6px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
  .hand .card{width:86px;flex:0 0 auto;scroll-snap-align:start}
  .bear .tags{font-size:9px}
  #status{font-size:13px;width:100%}
  .mid .actions{position:fixed;left:0;right:0;bottom:0;z-index:14;background:#0e0c15;border-top:2px solid var(--gold);padding:6px;padding-bottom:max(6px,env(safe-area-inset-bottom));display:flex;gap:6px;flex-wrap:nowrap}
  .mid .actions button{flex:1 1 0;min-height:48px;padding:6px 4px}
  .log{display:none;max-height:40vh}.log.open{display:block;position:fixed;left:6px;right:6px;bottom:70px;z-index:13;border:2px solid var(--gold);box-shadow:0 -4px 20px #000}
  .modal .card{width:min(28vw,120px)}.modal .opts{gap:6px;justify-content:center}
  #mullOk{position:sticky;bottom:0;width:100%}
  .clist{grid-template-columns:1fr}.citem button{min-width:30%;margin:3px 3px 0 0}
  .cbar{flex-wrap:wrap}.cbar input{flex:1 1 100%}
  .rules{padding:12px;font-size:15px;margin:6px}
  .toast{top:auto;bottom:90px;max-width:92vw;text-align:center}
}
@media (orientation:landscape) and (max-height:520px) and (hover: none){
  header{position:static}
  .field{min-height:100px}.field .card{width:66px}.hand .card{width:70px}
  .mid .actions{left:auto;width:auto;top:auto;flex-direction:row}
}

/* HD preview + viewer + size */
.zoom{width:360px}.zoom img{aspect-ratio:600/840;background:#000}
@media (max-height:760px){.zoom{width:300px}}
.zbtn{opacity:.85}
body:not(.touch) .card .zbtn{opacity:0;transition:opacity .15s}body:not(.touch) .card:hover .zbtn{opacity:1}
body:not(.touch) .card .zbtn{width:34px;height:34px;right:4px;top:4px;background:rgba(0,0,0,.6);border-radius:50%;align-items:center;justify-content:center;padding:0}
.csz{display:flex;align-items:center;gap:6px;margin:0 0 8px;flex-wrap:wrap}.csz button{min-width:44px}.csz button.on{background:var(--gold);color:#111}
.viewer{position:fixed;inset:0;z-index:60;background:rgba(5,4,10,.94);display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;user-select:none}
.viewer.hidden{display:none}
.vimg{max-width:min(94vw,680px);max-height:86vh;border-radius:14px;box-shadow:0 10px 40px #000;transform-origin:center center;cursor:grab;will-change:transform;touch-action:none}
.vcap{position:absolute;top:max(10px,env(safe-area-inset-top));left:60px;right:60px;text-align:center;font-weight:700;color:var(--gold);font-size:15px}
.vhint{position:absolute;bottom:max(10px,env(safe-area-inset-bottom));left:0;right:0;text-align:center;color:var(--mut);font-size:12px}
.vnav,.vclose{position:absolute;width:52px;height:52px;border-radius:50%;background:rgba(40,36,60,.85);border:1px solid #4a4466;color:#fff;font-size:30px;line-height:1;display:flex;align-items:center;justify-content:center;padding:0}
.vnav{top:50%;transform:translateY(-50%)}.vprev{left:10px}.vnext{right:10px}.vclose{top:max(8px,env(safe-area-inset-top));right:8px;font-size:22px}
.vnav[hidden]{display:none}
body.noscroll{overflow:hidden}

/* ---------- readable cards: strips, badges, detail panel ---------- */
.cwrap{display:flex;flex-direction:column;gap:3px;flex:0 0 auto;position:relative}
.cwrap.hand{width:150px}.cwrap.hand .card{width:100%!important}
.cwrap.board{width:118px}.cwrap.board .card{width:100%!important}
.cwrap.mull{width:170px}.cwrap.mull .card{width:100%!important}
.cwrap.picked .strip{border-color:var(--red);opacity:.6}
.strip{background:#0e0c15;border:1px solid #3a3456;border-radius:8px;padding:5px 6px;font-size:13px;line-height:1.25;cursor:pointer}
.sname{font-weight:800;font-size:14px;display:flex;gap:5px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scost{flex:0 0 auto;background:var(--blue);color:#fff;border-radius:50%;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;font-size:13px}
.sstats{display:flex;gap:6px;margin:3px 0;font-weight:900;font-size:17px}
.satk,.batk{color:#ff8f86}.sdef,.bdef{color:#8fc0ff}.sdmg{color:#fff;background:var(--red);border-radius:6px;padding:0 5px;font-size:14px}
.skw{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin-top:2px}.sab{font-weight:800;color:var(--gold);font-size:14px}
.stext{font-size:16px;line-height:1.3;margin-top:3px;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.strip.board .sname{font-size:13px}.strip.board .sab{font-size:12px}
.kw{display:inline-block;background:#2f2a45;border:1px solid #6a5fa0;color:#e6dcff;border-radius:6px;padding:1px 6px;font-size:12px;font-weight:800;cursor:help;text-decoration:underline dotted}
.kwtip{position:fixed;z-index:70;background:#0e0c15;border:2px solid var(--gold);border-radius:10px;padding:10px 12px;font-size:16px;line-height:1.35;box-shadow:0 6px 24px #000}.kwtip.hidden{display:none}
.badges{position:absolute;left:3px;right:3px;top:28%;display:flex;justify-content:space-between;pointer-events:none}
.badges span{background:rgba(0,0,0,.85);border-radius:8px;padding:1px 6px;font-weight:900;font-size:17px;border:2px solid currentColor}
.sicons{position:absolute;left:3px;bottom:3px;display:flex;gap:3px;pointer-events:none}.si{background:rgba(0,0,0,.85);border-radius:6px;padding:0 4px;font-size:16px;font-weight:900;line-height:22px;min-width:22px;text-align:center}.si-frz{background:#5bc0eb;color:#111}.si-buff{background:var(--blue)}
.bear .tags,.bear .stat{display:none}
.dmgc{width:auto;min-width:30px;padding:0 4px;border-radius:12px;top:52%}
.detail{position:fixed;z-index:22;right:10px;top:70px;bottom:10px;width:380px;background:#14121c;border:2px solid var(--gold);border-radius:12px;overflow:auto;padding:10px;box-shadow:0 8px 30px #000}
.detail.hidden{display:none}.dimg{width:100%;border-radius:10px;aspect-ratio:600/840;background:#000}
.detail h3{margin:6px 0 2px;font-size:22px}.dmeta{color:var(--mut);font-size:15px}.dstats{display:flex;gap:12px;flex-wrap:wrap;font-size:22px;font-weight:900;margin:6px 0}
.dsmall{font-size:15px;color:#cfc8ea;margin:4px 0}.dstatus{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}.dstatus .kw{font-size:15px;padding:4px 8px}
.dab{font-size:17px;line-height:1.4;margin:8px 0}.dclose{position:sticky;top:0;float:right;width:44px;height:44px;font-size:20px;z-index:2}
.sheetacts{position:static!important;display:flex;flex-direction:column;gap:6px;border:0;background:none}.sheetacts button{min-height:50px;font-size:17px;border-radius:10px!important;border:1px solid #4a4466!important;text-align:center!important}.dwhy{font-size:13px;color:#ff8a80;margin:-3px 0 2px}
#modal .opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.modal>div{max-width:min(1100px,96vw)}
.field{min-height:220px}
@media (max-width:900px), (max-height:520px) and (hover: none){
  .detail{left:0;right:0;top:auto;bottom:0;width:auto;max-height:78vh;border-radius:16px 16px 0 0;border-width:2px 0 0;padding:10px 12px calc(12px + env(safe-area-inset-bottom));z-index:50;display:grid;grid-template-columns:38% 1fr;gap:10px;align-items:start}
  /* Keep End turn / Attack base tappable while the card info sheet is open */
  body.sheet-open .mid .actions{z-index:55}
  body.sheet-open .detail{bottom:calc(62px + env(safe-area-inset-bottom,0px));max-height:calc(78vh - 62px);padding-bottom:12px}
  .detail.hidden{display:none}.detail .dclose{position:absolute;right:8px;top:8px;float:none}
  .detail .dbody{grid-column:2}.detail .dimg{grid-column:1;grid-row:1}
  .detail .sheetacts{grid-column:1/-1}
  .detail h3{font-size:19px;padding-right:44px}.dab{font-size:16px}
  .cwrap.hand{width:128px}.cwrap.board{width:96px}
  .strip.board .skw .kw{display:none}
  .badges span{font-size:15px;padding:0 4px}
  #modal .opts{grid-template-columns:repeat(2,1fr)}.cwrap.mull{width:auto}
  .field{min-height:190px}
}
@media (orientation:landscape) and (max-height:520px) and (hover: none){.cwrap.hand{width:110px}.cwrap.board{width:80px}.detail{max-height:92vh}}
#modal>div{width:min(1100px,96vw)}
/* PvP */
.pvp{max-width:640px;margin:0 auto;padding:12px}
.pvp label{display:block;margin:8px 0}.pvp input,.pvp select{font-size:16px;padding:8px;max-width:100%}
.pvp-row{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0;align-items:center}.pvp-row input{flex:1;min-width:0}
.pvp-list{display:flex;flex-direction:column;gap:6px}.pvp-item{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;border:1px solid #3a3350;border-radius:8px;background:#1a1626}
.pvp-code{font-size:1.6em;letter-spacing:.15em;color:#ffd75e}
.pvp-players{display:flex;flex-direction:column;gap:6px;margin:10px 0}.pvp-p{padding:8px 10px;border-radius:8px;background:#1a1626;border:1px solid #3a3350}.pvp-p.rdy{border-color:#4caf50}
.pvp button{min-height:40px}button.small{min-height:0;font-size:.75em;padding:2px 8px}
.card.drowsy img{filter:saturate(.55) brightness(.85)}
.card.ex{transform:rotate(8deg)}
.strip .skw .sab.muted{opacity:.7;font-style:italic}
.navlink{color:#ffc93c;text-decoration:none;padding:6px 10px;font-weight:700}
.homelink{display:inline-flex;align-items:center;gap:7px;color:#ffc93c;text-decoration:none;font-weight:800;font-size:13px;padding:4px 10px 4px 5px;border:1px solid #ffc93c66;border-radius:999px;background:#ffc93c14;white-space:nowrap;min-height:34px}.homelink img{width:24px;height:24px;border-radius:50%}.homelink:hover{background:#ffc93c2b;border-color:#ffc93c}
@media (pointer:coarse){.homelink{min-height:44px}}

/* ========== graphics-table-cards: play mat + card feel ========== */
:root{
  --mat:#1a3a2a;--mat2:#14281f;--mat-ink:#0c1812;--zone:#ffc82855;--zone-line:#ffc82888;
  --rar-common:#9aa0a6;--rar-uncommon:#7ee08a;--rar-rare:#5ab8ff;--rar-mythic:#ff6bd6;
}
.playmat{
  position:relative;
  isolation:isolate;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 2l26 15v18L30 50 4 35V17z' fill='none' stroke='%23ffc828' stroke-opacity='.07' stroke-width='1.2'/%3E%3C/svg%3E"),
    radial-gradient(120% 80% at 50% -10%,rgba(255,210,90,.22),transparent 55%),
    radial-gradient(90% 70% at 50% 110%,rgba(120,50,160,.28),transparent 52%),
    linear-gradient(165deg,rgba(255,255,255,.07),transparent 42%),
    repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,.06) 2px,rgba(0,0,0,.06) 3px),
    repeating-linear-gradient(90deg,transparent,transparent 2px,rgba(0,0,0,.05) 2px,rgba(0,0,0,.05) 3px),
    radial-gradient(ellipse at 28% 18%,#356b45 0%,transparent 52%),
    radial-gradient(ellipse at 72% 82%,#274968 0%,transparent 48%),
    linear-gradient(155deg,#24553a 0%,#173024 38%,#1a2838 100%);
  background-size:60px 52px,auto,auto,auto,auto,auto,auto,auto,auto;
  border:2px solid #e0b52e99;
  border-radius:16px;
  box-shadow:inset 0 0 100px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,220,120,.15),0 18px 50px rgba(0,0,0,.55);
  transform:perspective(1400px) rotateX(5deg);
  transform-origin:center 55%;
  padding:12px;
  overflow:hidden;
}
.playmat .mat-vignette{
  pointer-events:none;position:absolute;inset:0;z-index:0;border-radius:inherit;
  background:
    radial-gradient(ellipse at 50% 45%,transparent 30%,rgba(0,0,0,.35) 70%,rgba(0,0,0,.72) 100%),
    linear-gradient(90deg,rgba(0,0,0,.35),transparent 12%,transparent 88%,rgba(0,0,0,.35));
}
.playmat > .side,.playmat > .mid,.playmat > .log{position:relative;z-index:1}
.playmat .side{
  background:linear-gradient(180deg,rgba(10,18,14,.35),rgba(8,12,18,.25));
  border:1px solid rgba(255,200,80,.14);
  box-shadow:inset 0 0 30px rgba(0,0,0,.25);
  backdrop-filter:blur(0);
}
.playmat .opp{background:linear-gradient(180deg,rgba(40,18,28,.4),rgba(10,14,18,.28))}
.playmat .me{background:linear-gradient(180deg,rgba(12,28,22,.35),rgba(10,16,22,.3))}
.playmat .mid{
  background:linear-gradient(90deg,transparent,rgba(255,200,80,.08),transparent);
  border-radius:10px;padding:6px 10px;
  border:1px dashed rgba(255,200,80,.25);
}
.playmat .log{border:1px solid rgba(255,200,80,.18);box-shadow:inset 0 0 20px rgba(0,0,0,.35)}
.playmat .info span{
  background:rgba(14,18,24,.72);border:1px solid rgba(255,200,80,.22);
  box-shadow:0 2px 8px rgba(0,0,0,.25)
}
.playmat .info .score{box-shadow:0 0 14px rgba(255,200,40,.35)}

.zone-row{display:grid;grid-template-columns:64px 1fr 64px;gap:8px;align-items:stretch}
.zone{position:relative;border:1.5px dashed var(--zone-line);border-radius:12px;padding:10px 8px 8px;min-height:0;
  background:rgba(0,0,0,.18);box-shadow:inset 0 0 18px rgba(0,0,0,.25)}
.zone::before{
  content:attr(data-zone);position:absolute;top:-9px;left:10px;padding:0 7px;
  font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  color:var(--gold);background:linear-gradient(180deg,#1a281c,#142018);border:1px solid var(--zone-line);border-radius:999px;line-height:16px
}
.zone-field{min-height:220px;padding-top:14px}
.zone-hand{padding-top:14px}
.zone-pile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:110px}
.zone-count{font-weight:800;font-size:12px;color:var(--gold);text-shadow:0 1px 2px #000}
.pile-stack{position:relative;width:42px;height:58px}
.pile-stack::before,.pile-stack::after,.pile-stack{background:
  repeating-linear-gradient(45deg,#ffc828,#ffc828 5px,#c99a10 5px,#c99a10 10px);
  border:2px solid #1a1200;border-radius:5px;box-shadow:0 3px 8px rgba(0,0,0,.45)}
.pile-stack::before,.pile-stack::after{content:"";position:absolute;inset:0}
.pile-stack::before{transform:translate(3px,-3px);opacity:.85;z-index:-1}
.pile-stack::after{transform:translate(6px,-6px);opacity:.55;z-index:-2}
.pile-stack.disc{background:linear-gradient(145deg,#3a3148,#1a1624);box-shadow:inset 0 0 0 2px #6a5fa0,0 3px 8px rgba(0,0,0,.45)}
.pile-stack.disc::before,.pile-stack.disc::after{background:linear-gradient(145deg,#2a2438,#15121c)}
.playmat .hand,.playmat .field{min-height:0}
.playmat .field{min-height:200px}

/* card feel: rarity edge, hover glow, lift, tilt, holo foil */
.card{
  --rx:0deg;--ry:0deg;--sx:50%;--sy:40%;--rar:var(--rar-common);--tint:#ffc828;--lift:0px;
  outline:none!important;
  border:2px solid color-mix(in srgb,var(--rar) 80%,#000);
  box-shadow:0 2px 6px rgba(0,0,0,.4),0 0 0 1px rgba(0,0,0,.4),inset 0 0 0 1px color-mix(in srgb,var(--rar) 35%,transparent);
  transform:translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style:preserve-3d;
  transition:transform .12s ease-out,box-shadow .15s ease,border-color .15s ease,filter .15s ease;
  will-change:transform;
}
.card.rarity-Common{--rar:var(--rar-common)}
.card.rarity-Uncommon{--rar:var(--rar-uncommon)}
.card.rarity-Rare{--rar:var(--rar-rare)}
.card.rarity-Mythic{
  --rar:var(--rar-mythic);
  border-width:3px;
  box-shadow:0 2px 8px rgba(0,0,0,.45),0 0 14px rgba(255,107,214,.45),0 0 0 1px rgba(255,200,80,.35),inset 0 0 0 1px rgba(255,107,214,.4);
}
.card:hover,.card.sel{
  --lift:-8px;
  filter:brightness(1.05);
  box-shadow:0 14px 28px rgba(0,0,0,.55),0 0 18px color-mix(in srgb,var(--rar) 55%,transparent),0 0 0 1px var(--rar);
  z-index:3;
}
.card:active,.card.lifting{
  --lift:-14px;
  box-shadow:0 22px 36px rgba(0,0,0,.6),0 0 22px color-mix(in srgb,var(--rar) 65%,transparent);
}
.card.rarity-Mythic:hover,.card.rarity-Mythic.sel{
  box-shadow:0 16px 32px rgba(0,0,0,.55),0 0 28px rgba(255,107,214,.7),0 0 0 2px #ffc828;
}
.card .foil{
  position:absolute;inset:0;pointer-events:none;border-radius:inherit;z-index:1;
  mix-blend-mode:color-dodge;opacity:.5;
  background:
    radial-gradient(circle at var(--sx) var(--sy),#fffc 0%,var(--tint) 16%,transparent 42%),
    linear-gradient(115deg,transparent 20%,var(--tint) 40%,#fff8 50%,var(--tint) 60%,transparent 80%);
  background-size:100% 100%,220% 220%;
  background-position:0 0,calc(var(--sx) * 1.2) calc(var(--sy) * .8);
}
.card.holo{box-shadow:0 2px 8px rgba(0,0,0,.45),0 0 12px color-mix(in srgb,var(--tint) 40%,transparent),inset 0 0 0 1px color-mix(in srgb,var(--rar) 40%,transparent)}
.card.holo:hover{box-shadow:0 14px 28px rgba(0,0,0,.55),0 0 22px color-mix(in srgb,var(--tint) 60%,transparent),0 0 0 1px var(--rar)}
.card img{position:relative;z-index:0}
.card .zbtn,.card .cnt,.card .badges,.card .sicons,.card .dmgc{z-index:2}
/* sticky / drowsy still override tilt so board state stays readable */
.bear.ex{
  --rx:0deg!important;--ry:0deg!important;--lift:0px!important;
  transform:rotate(90deg) scale(.86);margin:0 26px;transition:transform .25s;
}
body.touch .card:hover{--lift:0px;filter:none}
body.touch .card:active{--lift:-6px}

#grid .card:hover{--lift:-6px}
#grid{perspective:900px}

@media (max-width:900px), (max-height:520px) and (hover: none){
  .playmat{transform:none;padding:6px}
  .zone-row{grid-template-columns:48px 1fr 48px;gap:6px}
  .zone-pile{min-height:90px}.pile-stack{width:32px;height:44px}
  .zone::before{font-size:9px;left:6px}
  .zone-field{min-height:190px}
}
@media (prefers-reduced-motion:reduce){
  .playmat{transform:none}
  .card{transition:none!important;--rx:0deg!important;--ry:0deg!important;--lift:0px!important}
  .card .foil{opacity:.35;background-position:0 0,50% 50%}
  .bear.ex,.card.ex{transition:none!important}
}


/* ========== graphics-mobile: touch / phone polish ========== */
/* Flatten play mat whenever touch/coarse (incl. wide phone landscape) */
body.touch .playmat{transform:none!important}
@media (pointer: coarse){
  .playmat{transform:none!important}
}
@media (max-height:520px){
  .playmat{transform:none!important}
}

/* Keep table content clear of fixed End-turn bar + deck bar */
@media (max-width:900px), (max-height:520px) and (hover: none){
  #play{padding:6px 6px calc(88px + env(safe-area-inset-bottom,0px))}
  .table.playmat{padding-bottom:8px;overflow:visible}
  .playmat{overflow:visible}
  /* Leave room under hand for fixed End-turn bar */
  .playmat .side.me{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
  .zone-field{min-height:120px}
  .playmat .field{min-height:110px}
  .zone-row{grid-template-columns:52px minmax(0,1fr) 52px;gap:4px;min-width:0}
  .zone{min-width:0}
  .zone-hand{overflow:hidden}
  .zone-pile{min-height:72px;overflow:visible}
  .pile-stack{width:28px;height:40px}
  .cwrap.hand{width:104px}
  .cwrap.board{width:88px}
  .cwrap.mull{width:auto}
  /* Mulligan: Confirm stays usable without covering card text */
  #modal>div{display:flex;flex-direction:column;max-height:min(92vh,920px);padding-bottom:10px}
  #modal .opts{overflow:auto;flex:1 1 auto;padding-bottom:8px;-webkit-overflow-scrolling:touch}
  #mullOk{position:sticky;bottom:0;z-index:2;margin-top:8px;box-shadow:0 -8px 16px #0e0c15;min-height:48px}
  #modal .opts .cwrap{min-width:0;max-width:100%}
  #modal .opts .strip{overflow:hidden;word-break:break-word}
}


/* Cheap holo / no tilt work on phones — foil stays but static & lighter */
body.touch .card{
  will-change:auto;
  transition:box-shadow .15s ease,border-color .15s ease,filter .15s ease;
  --rx:0deg!important;--ry:0deg!important;
}
body.touch .card .foil{
  opacity:.28;
  mix-blend-mode:soft-light;
  background-size:100% 100%,100% 100%;
  background-position:0 0,50% 40%;
}
body.touch .card:hover,
body.touch .card.sel{--lift:-4px}
body.touch .card:active,
body.touch .card.lifting{--lift:-8px}
body.touch #grid{perspective:none}
body.touch #grid .card:hover{--lift:-2px}

/* Short landscape: tighter zones so hand + actions fit */
@media (orientation:landscape) and (max-height:520px) and (hover: none){
  .zone-field{min-height:72px}
  .playmat .field{min-height:66px}
  .cwrap.hand{width:88px}
  .cwrap.board{width:68px}
  .hand .card{width:66px}
  .field .card{width:62px}
  #play{padding:4px 6px calc(64px + env(safe-area-inset-bottom,0px))}
  .playmat .side.me{padding-bottom:calc(56px + env(safe-area-inset-bottom,0px))}
  .playmat .side.opp{padding-top:2px;padding-bottom:2px}
  .mid .actions{padding:4px 6px;padding-bottom:max(4px,env(safe-area-inset-bottom))}
  .mid .actions button{min-height:44px}
}


/* ========== graphics-mobile-v2: bigger readable phone UI ========== */
/* Soften mat texture/vignette so cards pop; collapse piles to badges;
   larger hand/field cards; stronger status + zone labels. Desktop untouched. */
@media (max-width:900px), (max-height:520px) and (hover: none){
  .playmat{
    box-shadow:inset 0 0 48px rgba(0,0,0,.32),inset 0 1px 0 rgba(255,220,120,.12),0 12px 32px rgba(0,0,0,.45);
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 2l26 15v18L30 50 4 35V17z' fill='none' stroke='%23ffc828' stroke-opacity='.035' stroke-width='1.2'/%3E%3C/svg%3E"),
      radial-gradient(120% 80% at 50% -10%,rgba(255,210,90,.14),transparent 55%),
      radial-gradient(90% 70% at 50% 110%,rgba(120,50,160,.16),transparent 52%),
      linear-gradient(165deg,rgba(255,255,255,.05),transparent 42%),
      linear-gradient(155deg,#2a5a40 0%,#1c3828 42%,#1e3040 100%);
    background-size:60px 52px,auto,auto,auto,auto;
  }
  .playmat .mat-vignette{opacity:.22}

  /* Deck / Discard → compact count badges; hand gets full width */
  .zone-row{
    display:grid;grid-template-columns:1fr;grid-template-areas:"hand";
    gap:0;min-width:0;position:relative;padding-top:28px;
  }
  .zone-hand{grid-area:hand;min-width:0}
  .zone-pile{
    position:absolute;top:2px;z-index:3;
    min-height:0!important;width:auto;max-width:46%;
    flex-direction:row;align-items:center;justify-content:center;gap:5px;
    padding:4px 10px;border-style:solid;border-width:1.5px;
    background:rgba(8,14,12,.92);box-shadow:0 2px 10px rgba(0,0,0,.45);
  }
  .zone-row>.zone-pile:first-child{left:4px}
  .zone-row>.zone-pile:last-child{right:4px}
  .zone-pile .pile-stack{display:none}
  .zone-count{font-size:15px;font-weight:900;color:#ffe27a;text-shadow:0 1px 2px #000;line-height:1}
  .zone-pile::before{
    position:static;top:auto;left:auto;padding:0;border:0;background:none;
    font-size:11px;letter-spacing:.05em;line-height:1.1;color:#ffe27a;
  }

  /* High-contrast zone labels on field / hand */
  .zone-field::before,.zone-hand::before{
    font-size:12px;font-weight:900;letter-spacing:.05em;line-height:18px;
    color:#111;background:linear-gradient(180deg,#ffe27a,#e0b52e);
    border:1px solid #fff3;box-shadow:0 1px 4px rgba(0,0,0,.35);
    padding:0 10px;left:8px;
  }

  /* Bigger hand (horizontal scroll) + readable strip — never shrink */
  .hand{gap:8px}
  .cwrap.hand{width:168px;flex:0 0 168px;min-width:168px;max-width:168px}
  .hand .card{width:168px;flex:0 0 auto}
  .cwrap.hand .card{width:100%!important}
  .cwrap.hand .strip{padding:6px 7px}
  .cwrap.hand .sname{
    font-size:15px;white-space:normal;overflow:hidden;text-overflow:clip;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.2;
  }
  .cwrap.hand .scost{width:24px;height:24px;font-size:14px}
  .cwrap.hand .sstats{font-size:18px;margin:2px 0}
  .cwrap.hand .stext{display:none}
  .cwrap.hand .skw{max-height:22px;overflow:hidden}
  .cwrap.hand .sab,.cwrap.hand .kw{font-size:12px}

  /* Bigger field cards; slightly shorter zones so hand+field fit together */
  .cwrap.board{width:120px;flex:0 0 120px;min-width:120px}
  .field{gap:8px}
  .field .card{width:120px;flex:0 0 auto}
  .cwrap.board .card{width:100%!important}
  .zone-field{min-height:120px}
  .playmat .field{min-height:112px}
  .strip.board .sname{font-size:14px}
  .strip.board .sstats{font-size:16px}
  .badges span{font-size:16px;padding:1px 6px}

  /* Honey / drops / turn status — min ~16px, bold, high contrast */
  .info{gap:6px;font-size:16px;font-weight:800}
  .info span{
    padding:6px 10px;font-size:15px;font-weight:800;
    background:rgba(10,14,20,.88)!important;border:1px solid rgba(255,210,90,.45)!important;
    color:#fff8e6;
  }
  .info .score{
    font-size:17px;font-weight:900;color:#111!important;
    background:var(--gold)!important;border-color:#ffe27a!important;
  }
  .pips{max-width:180px}.pip{width:9px;height:9px;border-width:2px}
  #status{
    font-size:16px;font-weight:800;line-height:1.35;color:#ffe9a8;
    text-shadow:0 1px 2px #000;width:100%;
  }
  .mid{border-color:rgba(255,200,80,.4)!important}

  /* Obvious zoom control on every card */
  .zbtn,body.touch .zbtn{
    width:42px;height:42px;right:4px;top:4px;padding:0;
    display:flex;align-items:center;justify-content:center;
    background:rgba(14,12,21,.9);border:2px solid var(--gold)!important;
    border-radius:50%;font-size:18px;opacity:1;
    box-shadow:0 2px 10px rgba(0,0,0,.55);
  }
  .viewer .vclose{
    width:56px;height:56px;font-size:24px;font-weight:900;
    background:rgba(14,12,21,.95);border:2px solid var(--gold);
    color:#ffe27a;
  }
  .viewer .vhint{font-size:14px;color:#ffe9a8;font-weight:700}
  .vcap{font-size:16px}

  /* Deck builder: force 2 columns, readable chrome */
  .grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px;
  }
  #csz{font-size:14px}
  #deckList li{font-size:15px;font-weight:700}
  #deckBarTxt{font-size:15px;font-weight:800}
  #count{font-size:14px}
}

/* Short landscape: still larger than v1, but fit height */
@media (orientation:landscape) and (max-height:520px) and (hover: none){
  .zone-row{padding-top:24px}
  .cwrap.hand{width:132px;flex:0 0 132px;min-width:132px;max-width:132px}
  .hand .card{width:132px;flex:0 0 auto}
  .cwrap.board{width:100px;flex:0 0 100px;min-width:100px}
  .field .card{width:100px;flex:0 0 auto}
  .zone-field{min-height:88px}
  .playmat .field{min-height:82px}
  .info{font-size:14px}.info span{font-size:14px;padding:4px 8px}
  .info .score{font-size:15px}
  #status{font-size:14px}
  .cwrap.hand .sname{font-size:13px}
  .cwrap.hand .sstats{font-size:15px}
  .zbtn,body.touch .zbtn{width:38px;height:38px;font-size:16px}
}


/* ========== graphics-mobile-v3: fit whole table on screen (no scrolling) ==========
   body.ingame is set by fitTable() on phones while a game is showing.
   Card widths come from JS vars: --fw (field) and --hw (hand). */
.pmini{display:none}
body.ingame{overflow:hidden}
body.ingame #play{padding:0}
body.ingame #table.playmat{
  position:fixed;inset:0;z-index:16;margin:0;border-radius:0;width:100vw;height:100vh;height:100dvh;
  box-sizing:border-box;overflow:hidden;display:grid;gap:3px;
  padding:max(3px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto;
  grid-template-areas:"oinfo" "ohand" "ofield" "status" "mfield" "minfo" "mhand" "actions";
}
body.ingame #table .side,body.ingame #table .mid{display:contents}
body.ingame #oppInfo{grid-area:oinfo}
body.ingame #myInfo{grid-area:minfo}
body.ingame .side.opp>.zone-row{grid-area:ohand}
body.ingame .side.opp>.zone-field{grid-area:ofield}
body.ingame .side.me>.zone-field{grid-area:mfield}
body.ingame .side.me>.zone-row{grid-area:mhand}
body.ingame #status{grid-area:status}
body.ingame #table .mid .actions{grid-area:actions;position:static;padding:0;border:0;background:none;gap:6px}
body.ingame #table .mid .actions button{min-height:42px;font-weight:800}
body.ingame .log.open{bottom:60px;max-height:50dvh}
body.ingame .pmini{display:inline-block}
body.ingame .zone-pile{display:none!important}
body.ingame .zone,body.ingame .zone-row{min-height:0!important;min-width:0;padding:0;margin:0}
body.ingame .zone-row{display:block;position:relative}
body.ingame .zone-hand{overflow:visible;padding:0;border:0;background:none;height:100%}
body.ingame .zone-hand::before{display:none}
/* info lines */
body.ingame .info{display:flex;flex-wrap:wrap;gap:3px;font-size:13px;line-height:1.1;margin:0;padding:0}
body.ingame .info span{padding:3px 7px;font-size:13px}
body.ingame .info .score{width:auto;font-size:14px}
body.ingame .info .pips{display:none}
/* opponent hand: thin row of overlapping backs */
body.ingame .backs{display:flex;flex-wrap:nowrap!important;overflow:hidden!important;min-height:0!important;padding:0 2px;height:24px;align-items:center}
body.ingame .backs .back{width:18px;height:24px;flex:0 0 18px}
/* fields */
body.ingame .zone-field{position:relative;overflow:hidden;padding-top:16px!important;border-radius:10px}
body.ingame .zone-field::before{font-size:10px!important;line-height:14px!important;top:1px!important;left:6px!important;padding:0 7px!important}
body.ingame .playmat .field,body.ingame .field{
  height:100%;min-height:0!important;box-sizing:border-box;overflow:hidden!important;
  display:flex;flex-wrap:nowrap;gap:6px;align-items:center;justify-content:center;align-content:center;padding:2px
}
body.ingame .field.rows2{flex-wrap:wrap}
body.ingame .field .cwrap.board{width:var(--fw,80px)!important;flex:0 0 var(--fw,80px)!important;min-width:0!important;max-width:none}
body.ingame .field .card{width:100%!important}
body.ingame .cwrap.board .strip{display:none}
body.ingame .bear.ex{transform:rotate(90deg) scale(.7);margin:0}
body.ingame .badges span{font-size:clamp(10px,calc(var(--fw,80px)*.15),15px);padding:0 4px}
body.ingame .sicons{font-size:11px;transform:scale(.75);transform-origin:left bottom}
body.ingame .field .zbtn{display:none!important}
body.ingame .field .badges{transform:scale(.8);transform-origin:left top}
/* my hand: fits width, overlaps when needed */
body.ingame .hand,body.ingame #myHand{
  display:flex;flex-wrap:nowrap;overflow:visible!important;height:100%;box-sizing:border-box;
  gap:0;padding:2px;align-items:flex-end;justify-content:center;scroll-snap-type:none
}
body.ingame #myHand.spread{gap:6px}
body.ingame #myHand .cwrap.hand{width:var(--hw,80px)!important;flex:0 0 var(--hw,80px)!important;min-width:0!important;max-width:none!important;position:relative}
body.ingame #myHand .card{width:100%!important}
body.ingame #myHand.overlap .strip,body.ingame #myHand.nostrip .strip{display:none}
body.ingame #myHand.overlap .cwrap.hand{background:none;border:0;padding:0}
body.ingame #myHand.overlap .card{box-shadow:-4px 0 10px rgba(0,0,0,.55)}
body.ingame #myHand.overlap .cwrap.hand:not(:last-child) .zbtn{display:none}
body.ingame #myHand .cwrap.hand:has(.sel),body.ingame #myHand .cwrap.hand:active{z-index:5}
body.ingame #myHand.spread .sname{font-size:13px}
body.ingame .zbtn,body.ingame .card .zbtn{width:30px!important;height:30px!important;font-size:14px!important;top:3px!important;right:3px!important;border-width:1.5px!important}
/* status: short, never pushes the board */
body.ingame #status{font-size:13px;line-height:1.25;max-height:2.6em;overflow:hidden;padding:0 4px;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
body.ingame #status button{min-height:30px;padding:2px 10px}

/* Landscape phone: board on the left, info + buttons in a side column */
@media (orientation:landscape){
  body.ingame #table.playmat{
    grid-template-columns:minmax(0,1fr) 190px!important;
    grid-template-rows:auto minmax(0,1fr) minmax(0,1fr) minmax(0,.35fr) auto;
    grid-template-areas:"ohand oinfo" "ofield oinfo" "mfield status" "mhand minfo" "mhand actions";
    column-gap:6px;
  }
  body.ingame .info{align-content:flex-start;flex-direction:column;flex-wrap:nowrap;overflow:hidden}
  body.ingame .info span{font-size:12px;padding:2px 6px}
  body.ingame .info .score{font-size:13px}
  body.ingame #oppInfo{align-self:start}
  body.ingame #myInfo{align-self:end}
  body.ingame #status{max-height:none;-webkit-line-clamp:5;font-size:12px;align-self:stretch;min-height:0;overflow:hidden}
  body.ingame #table .mid .actions{flex-wrap:wrap}
  body.ingame #table .mid .actions button{min-height:40px;flex:1 1 40%}
  body.ingame #table .mid .actions #endTurn{flex:1 1 100%}
}
@media (orientation:landscape){
  body.ingame #modal>div{max-width:96vw;width:96vw;box-sizing:border-box;padding:8px 12px}
  body.ingame #modal .opts{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  body.ingame #modal h3,body.ingame #modal h2{font-size:15px;margin:2px 0 4px}
}
