/* Phone feel shared by both demos: long-press card sheet, lifted drag card, drag hint. */

/* A long press shows our sheet, not the browser's copy/save callout. */
[data-card-id],.hand-card{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}

/* Dragging with a finger: the card grows to 1.3× and rides above the thumb.
   :not(#_) outranks each demo's own .dragging-card rule. */
.hand-card.dragging-card.drag-touch:not(#_){top:var(--drag-y)!important;transform-origin:50% 0!important;transform:translate(-50%,calc(-1 * var(--drag-lift,300px))) rotate(-2deg) scale(1.3)!important;filter:drop-shadow(0 18px 22px #000c) drop-shadow(0 0 14px #f1d38366)!important;opacity:1!important}
.hand-card.dragging-card.drag-touch:not(#_) .card-face{transform:none!important}

.drag-hint{position:fixed;z-index:2100;transform:translateX(-50%);pointer-events:none;padding:8px 14px;border:1px solid #f1d38399;border-radius:999px;background:#0d151bee;box-shadow:0 6px 18px #000a;color:#f4e3b6;font:700 14px/1.2 system-ui,-apple-system,'PingFang SC','Microsoft YaHei',sans-serif;letter-spacing:.5px;white-space:nowrap;transition:background .12s,color .12s,border-color .12s}
.drag-hint.is-ready{border-color:#a8e59a;background:#1d3a24f2;color:#e3ffd8;box-shadow:0 0 0 3px #a8e59a33,0 6px 18px #000a}
.drag-hint::before{content:'↑ ';opacity:.8}.drag-hint.is-ready::before{content:'✓ '}

/* Long-press detail sheet (a modal <dialog>, above every other layer). */
dialog.card-sheet{position:fixed;inset:auto 0 0;margin:0 auto;width:min(760px,100%);max-width:100%;max-height:min(92dvh,760px);padding:0;border:0;background:transparent;color:#e9e3d2;overflow:visible}
dialog.card-sheet::backdrop{background:#050a0dcc;backdrop-filter:blur(2px)}
/* Panel = fixed close bar + scrolling body, so 关闭 never scrolls out of reach. */
.card-sheet-panel{position:relative;box-sizing:border-box;display:flex;flex-direction:column;max-height:min(92dvh,760px);overflow:hidden;border:1px solid #6c6a58;border-bottom:0;border-radius:16px 16px 0 0;background:linear-gradient(#18242b,#0f171d);box-shadow:0 -10px 40px #000b;font:15px/1.6 system-ui,-apple-system,'PingFang SC','Microsoft YaHei',sans-serif;animation:card-sheet-in .18s ease-out}
.card-sheet-bar{flex:none;display:flex;justify-content:flex-end;padding:8px 10px 0}
.card-sheet-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:14px 18px calc(14px + env(safe-area-inset-bottom))}
@keyframes card-sheet-in{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
.card-sheet-close{min-width:88px;min-height:44px;padding:8px 14px;border:1px solid #9a9c86;border-radius:8px;background:#2c3c42;color:#f7eed4;font:700 15px system-ui,-apple-system,'PingFang SC','Microsoft YaHei',sans-serif;cursor:pointer;touch-action:manipulation}
.card-sheet-close:focus-visible{outline:2px solid #f1d383;outline-offset:2px}
.card-sheet-body{display:grid;grid-template-columns:auto minmax(0,1fr);gap:20px;align-items:start}
.card-sheet-art{display:flex;justify-content:center;padding-top:14px}
.card-sheet-art>*{pointer-events:none}
.card-sheet-info{min-width:0;padding-top:4px}
.card-sheet-info h3{margin:0 0 2px;font-size:22px;line-height:1.3;color:#f4dea5}
.card-sheet-meta{margin:0 0 10px;color:#9fb0ab;font-size:13px}
.card-sheet-text{margin:0 0 12px;padding:10px 12px;border-left:3px solid #d8b86a;border-radius:4px;background:#ffffff0d;font-size:16px;line-height:1.65;color:#fff6e0}
.card-sheet-text .kw{font-weight:700}
.card-sheet-keywords{display:grid;gap:6px;margin:0 0 12px}
.card-sheet-keywords>div{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:baseline}
.card-sheet-keywords dt{padding:1px 8px;border-radius:4px;background:#2e3d3f;color:#f3d98f;font-weight:700;font-size:13px;white-space:nowrap}
.card-sheet-keywords dd{margin:0;color:#cad6d0;font-size:14px}
.card-sheet-upgrade{margin:0 0 12px;padding:9px 12px;border:1px dashed #8fcf8a88;border-radius:6px;background:#8fcf8a14;color:#dff5d6;font-size:14px}
.card-sheet-upgrade b{margin-right:8px;color:#a8e59a}
.card-sheet-scene{margin:0 0 8px;color:#93a39e;font-size:13px}
.card-sheet-foot{margin:10px 0 0;text-align:center;color:#6f7f7c;font-size:12px}
/* Wa card face at a readable size. */
.wa-sheet-art .card{width:200px;margin:0}.wa-sheet-art .card>.card-face{height:290px}.wa-sheet-art .card .card-effect{font-size:13px}.wa-sheet-art .card .card-title{font-size:16px}
/* New-demo tactical card at a readable size. */
.new-sheet-art .tc{width:210px;height:300px;font-size:14px}
@media(max-width:600px){
 .card-sheet-body{grid-template-columns:1fr;gap:10px}
 .card-sheet-art{padding-top:0}
 .card-sheet-info h3{margin-right:0;text-align:center}
 .card-sheet-meta{text-align:center}
}
@media(orientation:landscape) and (max-height:500px){
 dialog.card-sheet{max-height:100dvh}.card-sheet-panel{max-height:100dvh}
 .card-sheet-bar{padding-top:4px}
 .card-sheet-body{grid-template-columns:auto minmax(0,1fr)}
 .card-sheet-art{padding-top:0}
 .wa-sheet-art .card{width:170px}.wa-sheet-art .card>.card-face{height:246px}
 .new-sheet-art .tc{width:180px;height:258px}
}
@media(prefers-reduced-motion:reduce){.card-sheet-panel{animation:none}}

/* Tap-play (phones, html.tap-play from shared/tap-play.js): no hover tooltips,
   upgrade peeks or drag hints floating over the battlefield. */
html.tap-play #card-tooltip,html.tap-play .rm-peek,html.tap-play .drag-hint{display:none!important}
html.tap-play .hand-card{touch-action:pan-x;-webkit-tap-highlight-color:transparent}
