/* ============================================================
   14-playtest.css — the deck playtest (js/playtest.js): a full-screen
   table over the app, the opening hand, land odds, the goldfish board
   and the sheets that hold card menus and zone lists.
   ============================================================ */

body.pt-open{overflow:hidden;}

.pt-back{
  position:fixed; inset:0; z-index:70; background:var(--bg);
  display:flex; justify-content:center;
}
.pt{
  width:min(1180px,100%); height:100%; height:100dvh;
  display:flex; flex-direction:column; min-height:0;
}

/* ---- header ---- */
.pt-head{
  display:flex; align-items:center; gap:8px; flex:0 0 auto;
  padding:12px 16px; padding-top:calc(12px + env(safe-area-inset-top));
  border-bottom:1px solid var(--line);
}
.pt-title{display:flex; flex-direction:column; min-width:0; flex:1; line-height:1.15;}
.pt-kicker{font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--accent);}
.pt-name{
  font-family:'Barlow Condensed',sans-serif; font-weight:700; font-size:20px;
  text-transform:uppercase; letter-spacing:.04em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pt-head .modal-x{position:static; flex:0 0 auto;}

.pt-body{flex:1 1 auto; min-height:0; overflow-y:auto; padding:16px; overscroll-behavior:contain;}

.pt-sec-head{display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:12px;}
.pt-sec-head h3{font-size:17px; text-transform:uppercase; letter-spacing:.05em;}
.pt-sub, .pt-note, .pt-hint{font-size:12.5px; color:var(--text-faint);}
.pt-note{margin-top:10px; line-height:1.5;}
.pt-hint{margin-top:6px;}
.pt-empty{font-size:13px; color:var(--text-faint); padding:14px 2px;}

/* ---- cards ----
   --cw is the card width; the height follows the real 63 × 88 ratio. The
   box turns with a tapped card, so the row makes room for it. */
.pt-card{
  --cw:92px;
  position:relative; flex:0 0 auto; padding:0; border:0; background:none; color:inherit;
  width:var(--cw); height:calc(var(--cw) * 1.397);
  transition:width .16s ease, height .16s ease;
  -webkit-touch-callout:none; user-select:none; -webkit-user-select:none;
  touch-action:manipulation; cursor:pointer;
}
.pt-card .face{
  position:absolute; left:50%; top:50%;
  width:var(--cw); height:calc(var(--cw) * 1.397);
  transform:translate(-50%,-50%);
  border-radius:calc(var(--cw) * .05); overflow:hidden;
  background:var(--surface-2); box-shadow:0 2px 8px rgba(0,0,0,.35);
  transition:transform .16s ease, box-shadow .16s ease;
}
.pt-card .face img{width:100%; height:100%; object-fit:cover; display:block; pointer-events:none;}
.pt-card.tapped{width:calc(var(--cw) * 1.397); height:var(--cw);}
.pt-card.tapped .face{transform:translate(-50%,-50%) rotate(90deg); opacity:.82;}
.pt-card:focus-visible{outline:none;}
.pt-card:focus-visible .face{box-shadow:0 0 0 2px var(--accent);}
.pt-card.selected .face{box-shadow:0 0 0 3px var(--accent); transform:translate(-50%,-50%) translateY(-6px);}

.pt-card.token .face{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  padding:6px; text-align:center;
  background:linear-gradient(160deg, var(--surface-3), var(--surface));
  border:1px solid var(--line-3);
}
.pt-tname{font-size:max(10px, calc(var(--cw) * .13)); font-weight:600; line-height:1.15; word-break:break-word;}
.pt-tkind{font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--accent);}

.pt-ctr, .pt-tax{
  position:absolute; top:-6px; right:-6px; z-index:2;
  min-width:24px; height:24px; padding:0 6px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; line-height:1;
  background:var(--accent); color:var(--on-accent); box-shadow:0 1px 4px rgba(0,0,0,.4);
}
.pt-tax{background:var(--surface-3); color:var(--text); border:1px solid var(--line-3);}

/* ---- opening hand ---- */
.pt-open-hand{max-width:900px; margin:0 auto 22px;}
.pt-hand-grid{display:flex; flex-wrap:wrap; gap:10px; container-type:inline-size;}
.pt-hand-grid .pt-card{--cw:118px;}
.pt-hand-sum{margin-top:14px; font-size:14px; color:var(--text-dim);}
.pt-acts{display:flex; gap:9px; margin-top:14px; flex-wrap:wrap;}
.pt-acts .btn{min-width:130px;}

/* ---- land odds ---- */
.pt-odds{
  max-width:900px; margin:0 auto;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r3); padding:16px 18px;
}
.pt-bars{display:flex; align-items:flex-end; gap:6px; height:112px;}
.pt-bar{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:4px; min-width:0;}
.pt-bar .fill{width:100%; max-width:44px; border-radius:4px 4px 0 0; background:var(--surface-3);}
.pt-bar.good .fill{background:rgba(var(--accent-rgb),.75);}
.pt-bar .pct{font-size:11px; color:var(--text-faint); white-space:nowrap;}
.pt-bar .k{font-size:12px; color:var(--text-dim); font-weight:600;}
.pt-odds-line{margin-top:10px; font-size:13.5px; color:var(--text-dim);}
.pt-drops{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:14px;}
.pt-drop{background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r2); padding:10px 12px;}
.pt-drop .n{display:block; font-size:20px; font-weight:700; font-family:'Barlow Condensed',sans-serif;}
.pt-drop .l{display:block; font-size:12px; color:var(--text-faint);}

/* ---- the game ---- */
.pt-bar-top{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px;}
.pt-turn{
  font-family:'Barlow Condensed',sans-serif; font-weight:700; font-size:22px;
  text-transform:uppercase; letter-spacing:.04em;
}
.pt-life{
  display:flex; align-items:center; gap:2px;
  background:var(--surface); border:1px solid var(--line-2); border-radius:22px; padding:3px;
}
.pt-lbtn{
  width:34px; height:34px; border-radius:50%; border:0; background:var(--surface-3);
  color:var(--text); font-size:18px; line-height:1; touch-action:manipulation;
}
.pt-lbtn:hover{background:var(--line-3);}
.pt-lval{min-width:44px; text-align:center; font-weight:700; font-size:18px; font-variant-numeric:tabular-nums;}
.pt-next{margin-left:auto;}

.pt-zones{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px;}
.pt-chip{
  display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r2);
  padding:8px 12px; color:var(--text-dim); font-size:13px;
}
.pt-chip:hover{border-color:var(--line-3); color:var(--text);}
.pt-chip .n{font-weight:700; color:var(--text); font-variant-numeric:tabular-nums;}

.pt-row-block{margin-bottom:16px;}
.pt-row-label{
  display:flex; align-items:center; gap:10px; margin-bottom:8px;
  font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim);
}
.pt-row-hint{color:var(--text-faint); text-transform:none; letter-spacing:0;}
.pt-row-label .btn{margin-left:auto; text-transform:none; letter-spacing:0;}
.pt-row{display:flex; flex-wrap:wrap; gap:10px; align-items:center;}
.pt-field{
  min-height:calc(92px * 1.397 + 20px); padding:10px;
  background:var(--bg-2); border:1px dashed var(--line-2); border-radius:var(--r2);
}
.pt-command .pt-card{--cw:72px;}

/* the hand stays at the bottom of the screen, scrolling sideways */
.pt-handbar{
  flex:0 0 auto; border-top:1px solid var(--line-2); background:var(--surface);
  padding:10px 16px calc(12px + env(safe-area-inset-bottom));
}
.pt-hand-row{
  display:flex; gap:8px; overflow-x:auto; padding:8px 2px 4px;
  scroll-snap-type:x proximity; overscroll-behavior-x:contain;
}
.pt-hand-row .pt-card{--cw:104px; scroll-snap-align:start;}

/* ---- sheets ---- */
.pt-sheet-back{
  position:absolute; inset:0; z-index:5; background:rgba(4,5,7,.72);
  display:flex; align-items:center; justify-content:center; padding:24px;
}
.pt-sheet{
  position:relative; width:min(560px,100%); max-height:88vh; overflow-y:auto;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r3);
  padding:22px; display:flex; flex-direction:column; gap:12px;
}
.pt-sheet > h3{font-size:18px; text-transform:uppercase; letter-spacing:.05em; padding-right:44px;}
.pt-sheet .search-input{min-width:0; width:100%;}
.pt-sheet-card{width:min(420px,100%); align-items:stretch;}
.pt-prev{
  width:min(260px,70%); align-self:center; aspect-ratio:63/88; object-fit:cover;
  border-radius:4.75% / 3.4%; box-shadow:var(--shadow); background:var(--surface-2);
}
.pt-meta{display:flex; flex-direction:column; gap:2px; text-align:center;}
.pt-meta span{font-size:12.5px; color:var(--text-faint);}
.pt-menu{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.pt-menu .btn{width:100%; justify-content:center; text-align:center;}
.pt-menu .btn.primary:first-child{grid-column:1 / -1;}
.pt-quick{display:flex; flex-wrap:wrap; gap:6px;}
.pt-list-grid{display:flex; flex-wrap:wrap; gap:10px; container-type:inline-size;}
.pt-list-grid .pt-card{--cw:96px;}

/* ---- phones ---- */
@media(max-width:960px){
  .pt-head{padding-left:12px; padding-right:12px;}
  .pt-head .btn.sm{padding:6px 9px;}
  .pt-body{padding:12px;}
  .pt-hand-grid{gap:6px;}
  /* four to a row, measured on the row itself (a scrollbar would break 100vw) */
  .pt-hand-grid .pt-card{--cw:calc((100cqw - 18px) / 4 - .5px);}
  .pt-acts .btn{flex:1; min-width:0;}
  .pt-odds{padding:14px;}
  .pt-drops{grid-template-columns:1fr 1fr;}
  .pt-turn{font-size:19px;}
  .pt-lbtn{width:36px; height:36px;}
  .pt-field{min-height:calc(62px * 1.397 + 16px); padding:8px; gap:8px;}
  .pt-field .pt-card{--cw:62px;}
  .pt-command .pt-card{--cw:56px;}
  .pt-ctr, .pt-tax{min-width:20px; height:20px; font-size:11px; top:-5px; right:-5px;}
  .pt-handbar{padding:8px 12px calc(10px + env(safe-area-inset-bottom));}
  .pt-hand-row .pt-card{--cw:84px;}
  .pt-sheet-back{padding:0; align-items:flex-end;}
  .pt-sheet{
    width:100%; max-width:none; max-height:88vh; border-radius:var(--r3) var(--r3) 0 0;
    padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .pt-prev{width:min(230px,62vw);}
  .pt-list-grid{gap:8px;}
  .pt-list-grid .pt-card{--cw:calc((100cqw - 24px) / 4 - .5px);}
  .pt-sheet .search-input{font-size:16px;}   /* iOS zooms into anything smaller */
}

/* a finger scrolls the hand; the bar only takes room */
@media(pointer:coarse){
  .pt-hand-row{scrollbar-width:none;}
  .pt-hand-row::-webkit-scrollbar{display:none;}
}

@media(prefers-reduced-motion:reduce){
  .pt-card, .pt-card .face{transition:none;}
}
body.reduce-motion .pt-card, body.reduce-motion .pt-card .face{transition:none;}
