/* 鷹雄棒球紀錄簿｜平板專用介面層
   Tablet: width 700–1440 CSS px AND height ≥600px; portrait/landscape layouts are independent.
   IMPORTANT: this file intentionally contains no mobile (<768px) rules.
   Base scorer/SQL/game logic stays in existing JS/PHP. */
@media (min-width:700px) and (min-height:600px) and (max-width:1440px){
 :root{--yx-tablet-gold:#f1ce8f;--yx-tablet-ink:#102336}
 html{scroll-padding-top:132px}
 body{font-size:15px}
 body[data-yx-tablet="true"]{--yx-tablet-hit:48px}
 .yx-tablet-nav{position:sticky;top:0;z-index:90;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:62px;padding:7px max(14px,env(safe-area-inset-left)) 7px max(14px,env(safe-area-inset-right));border-block:1px solid rgba(231,193,122,.35);background:rgba(7,19,33,.98);color:#eaf1fa;box-shadow:0 8px 19px #0006;isolation:isolate}
 .yx-tablet-nav .yx-tablet-caption{flex:0 0 auto;display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;letter-spacing:.02em;color:var(--yx-tablet-gold);white-space:nowrap}
 .yx-tablet-nav .yx-tablet-caption::before{content:'▰';color:var(--yx-tablet-gold)}
 .yx-tablet-nav .yx-tablet-links{display:flex;align-items:stretch;justify-content:flex-end;gap:5px;flex:1;min-width:0}
 .yx-tablet-nav .yx-tablet-links a{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:48px;padding:7px 12px;border:1px solid transparent;border-radius:12px;color:#d6e5f5;text-decoration:none;font-size:14px;font-weight:750;white-space:nowrap;background:#142a41}
 .yx-tablet-nav .yx-tablet-links a[aria-current="page"]{color:#0e2131;background:linear-gradient(135deg,#f7dfae,#d4a45c);border-color:#fbe1b1}
 .yx-tablet-nav a:focus-visible,.yx-tablet-stage-nav a:focus-visible{outline:3px solid #ffdd8e;outline-offset:2px}
 .yx-tablet-stage-nav{position:sticky;top:62px;z-index:81;display:flex;gap:7px;align-items:center;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:8px 13px;background:#101f31;border-bottom:1px solid #3c566a;max-width:none}
 .yx-tablet-stage-nav a{font-size:13px;min-height:44px;flex:0 0 auto;display:flex;align-items:center;padding:7px 12px;border:1px solid #385166;border-radius:10px;color:#dce8f5;text-decoration:none;background:#182d43;font-weight:730}
 .yx-tablet-stage-nav a[data-active="true"]{background:#e4bf7f;color:#132234;border-color:#ebcd99}
 .yx-tablet-stage-label{flex:0 0 auto;font-size:11px;font-weight:800;color:#eac78c;margin-right:6px}
 .yx-tablet-nav a,.yx-tablet-stage-nav a,.field-quick-nav button,.workflow-nav a{touch-action:manipulation}
 .yx-tablet-stage-anchor{scroll-margin-top:134px}
 :where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #ffdd8e;outline-offset:3px}
 :where(button,input,select,textarea){font-size:max(15px,1em)}
 /* Real tablet scorer: paired field/score controls; secondary ledger below the main desk */
 body.ui4-scoring .workspace{max-width:1440px;grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr);gap:12px;padding:10px 14px 30px}
 body.ui4-scoring .workspace>.scoreboard,body.ui4-scoring .workspace>.live-checkstrip,body.ui4-scoring .workspace>.stale-ledger-notice,body.ui4-scoring .workspace>.half-alert,body.ui4-scoring .workspace>.field-quick-nav{grid-column:1/-1}
 body.ui4-scoring .workspace>.left-column{grid-column:1;grid-row:auto}
 body.ui4-scoring .workspace>.middle-column{grid-column:2;grid-row:auto}
 body.ui4-scoring .workspace>.right-column{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 body.ui4-scoring .left-column>.panel,body.ui4-scoring .middle-column>.panel,body.ui4-scoring .right-column>.panel{padding:15px}
 body.ui4-scoring .topbar{gap:10px;padding:12px 16px}
 body.ui4-scoring .top-actions{gap:7px}
 body.ui4-scoring .top-actions .btn{min-height:48px;padding:9px 12px;font-size:13px}
 body.ui4-scoring .scoreboard{padding:15px 20px}
 body.ui4-scoring .score{font-size:clamp(48px,5vw,74px)}
 body.ui4-scoring .field-quick-nav{position:relative;top:auto;z-index:1;scroll-margin-top:138px}
 body.ui4-scoring .field-nav-actions button{min-height:50px;font-size:14px}
 body.ui4-scoring .action{min-height:72px}
 body.ui4-scoring .action b,body.ui4-scoring .smart-action b{font-size:15px}
 body.ui4-scoring .smart-action{min-height:94px;gap:5px}
 body.ui4-scoring .smart-action small{font-size:11px}
 body.ui4-scoring .hint{font-size:12px;max-width:220px}
 body.ui4-scoring .field{height:244px}
 body.ui4-scoring .field .base{min-width:80px;min-height:56px}
 body.ui4-scoring dialog{max-width:calc(100vw - 42px);max-height:calc(100dvh - 50px);overflow:auto}
 body.ui4-scoring .dialog-actions button{min-height:48px}
 /* SQL-backed dashboard is a separate tablet workflow, never the scorer's local cache. */
 body:has(#teamPanel)>.workflow-nav{display:none}
 body:has(#teamPanel) .workspace{max-width:1370px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;padding:16px 14px 40px}
 body:has(#teamPanel) .workspace .stack{min-width:0}
 body:has(#teamPanel) .flow-panel{scroll-margin-top:139px;min-width:0}
 body:has(#teamPanel) .field-group{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 body:has(#teamPanel) header{gap:12px;padding:12px 18px}
 body:has(#teamPanel) .header-right{gap:8px}
 body:has(#teamPanel) .header-right a,body:has(#teamPanel) .header-right button{min-height:48px}
 body:has(#teamPanel) .flow-intro{margin:12px 14px}
 body:has(#teamPanel) .panel{padding:16px}
 body:has(#teamPanel) input,body:has(#teamPanel) select{min-height:48px}
 /* Friend/challenge cards: side by side on landscape, comfortable form touch. */
 body:has(#challengeForm) main{max-width:1380px}
 body:has(#challengeForm) .cols{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 body:has(#challengeForm) .card{padding:18px}
 body:has(#challengeForm) button,body:has(#challengeForm) select,body:has(#challengeForm) input,body:has(#challengeForm) textarea{min-height:48px}
 body:has(#challengeForm) .fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 /* Historical results / scorebooks keep full tables scrollable, not truncated. */
 .report-shortcuts{position:relative;top:auto}
 .report-shortcuts a{min-height:48px;display:inline-flex;align-items:center}
 :where(.table-scroll,.history-table-wrap,.scorecard-sheets){max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
 :where(.table-scroll,.history-table-wrap){-webkit-overflow-scrolling:touch}
 :where(.report-header a,.report-header button,.head a,.head button){min-height:48px}
 /* Authentication tablet: a real split introduction + login panel. */
 body:has(.premium-auth) .premium-auth{max-width:1150px;margin:auto;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:22px;align-items:center}
 body:has(.premium-auth) .auth-card{width:100%;max-width:unset}
 body:has(.premium-auth) button,body:has(.premium-auth) input{min-height:50px}
}
/* Portrait tablets keep action surface full width and stage navigator persistent. */
@media (min-width:700px) and (min-height:600px) and (max-width:959px) and (orientation:portrait){
 .yx-tablet-nav{flex-wrap:wrap;min-height:108px;justify-content:center;padding:8px}
 .yx-tablet-nav .yx-tablet-caption{font-size:11px}
 .yx-tablet-nav .yx-tablet-links{flex:1 0 100%;justify-content:space-evenly}
 .yx-tablet-nav .yx-tablet-links a{padding:7px 8px;font-size:13px;flex:1}
 .yx-tablet-stage-nav{top:108px}
 .yx-tablet-stage-anchor{scroll-margin-top:188px}
 body.ui4-scoring .workspace{grid-template-columns:minmax(0,1fr)}
 body.ui4-scoring .workspace>.left-column,body.ui4-scoring .workspace>.middle-column,body.ui4-scoring .workspace>.right-column{grid-column:1/-1}
 body.ui4-scoring .workspace>.right-column{grid-template-columns:minmax(0,1fr)}
 /* Portrait tablet is not the phone layout: choose one full-size work area. */
 body.ui4-scoring[data-yx-tablet-section="scoring"] .workspace>.left-column,
 body.ui4-scoring[data-yx-tablet-section="scoring"] .workspace>.right-column{display:none}
 body.ui4-scoring[data-yx-tablet-section="field"] .workspace>.middle-column,
 body.ui4-scoring[data-yx-tablet-section="field"] .workspace>.right-column{display:none}
 body.ui4-scoring[data-yx-tablet-section="history"] .workspace>.left-column,
 body.ui4-scoring[data-yx-tablet-section="history"] .workspace>.middle-column{display:none}
 body.ui4-scoring[data-yx-tablet-section="scoring"] [data-ui4-target="scoring"],
 body.ui4-scoring[data-yx-tablet-section="field"] [data-ui4-target="field"],
 body.ui4-scoring[data-yx-tablet-section="history"] [data-ui4-target="history"]{border-color:#f7d79f;background:#dfb775;color:#132335;box-shadow:inset 0 0 0 1px #f7dcac}
 body.ui4-scoring .field{height:275px}
 body.ui4-scoring .scoreboard{padding:12px 17px}
 body.ui4-scoring .field-nav-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
 body.ui4-scoring .field-nav-actions button{min-width:0;white-space:normal}
 body:has(#teamPanel) .workspace{grid-template-columns:minmax(0,1fr)}
 body:has(#teamPanel) .field-group{grid-template-columns:repeat(2,minmax(0,1fr))}
 body:has(#challengeForm) .cols{grid-template-columns:minmax(0,1fr)}
 body:has(.premium-auth) .premium-auth{grid-template-columns:minmax(0,1fr)}
}
@media (min-width:700px) and (min-height:600px) and (max-width:1440px) and (prefers-reduced-motion:reduce){
 .yx-tablet-nav *, .yx-tablet-stage-nav *{transition:none!important}
}
