/* ---------- tablet (iPad / Android): touch sizes and the on-screen buttons. Loaded after app.css ---------- */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }
html, body { overflow: hidden; overscroll-behavior: none; }
#app { height: 100vh; height: 100dvh; }
#stage, #cv { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }

/* bigger touch targets */
button, .btn { min-height: 36px; padding: 6px 12px; }
button.mini { min-height: 30px; padding: 3px 10px; }
input:not([type=checkbox]):not([type=radio]), select { min-height: 36px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
.tabnav button { min-height: 42px; }
.sbrail { width: 46px; }
.sbrail .sbopen { width: 40px; height: 44px; font-size: 18px; }
.sbhead button { min-width: 40px; min-height: 40px; }
#helpBtn { width: 40px; height: 40px; font-size: 18px; }
#scorehead button { min-height: 34px; }
.ctxmenu button { min-height: 46px; font-size: 15px; }
#rpBar button { min-height: 40px; min-width: 44px; }
#chat input, #chat button, #chatTab { min-height: 38px; }
.objpal button, .tokpal button { min-height: 44px; }

/* − / + beside number boxes */
.stp { display: inline-flex; align-items: stretch; gap: 0; }
.stp input { border-radius: 0 !important; text-align: center; min-width: 0; }
.stpb { min-width: 38px; min-height: 36px; padding: 0 8px; font-size: 18px; line-height: 1; border-radius: 0; }
.stpb:first-child { border-radius: 6px 0 0 6px; }
.stpb:last-child { border-radius: 0 6px 6px 0; }

/* ---------- button dock: beside the table (landscape) or below it (portrait), never over it ---------- */
#tDock { flex: none; display: flex; gap: 8px; padding: 6px; background: var(--panel); z-index: 30; overflow: auto; }
#tDock.side { flex-direction: column; width: 140px; border-left: 1px solid var(--line); }
#tDock.bottom { flex-direction: column; border-top: 1px solid var(--line); }
#tDock.folded #tActs, #tDock.folded #tRail > .tb:not(.fold) { display: none !important; }
#tDock.side.folded { width: 52px; }
/* 3 columns when 2 would not fit the screen height (set by touch.js) */
#tDock.side.c3:not(.folded) { width: 188px; }
#tDock.side.c3 #tRail, #tDock.side.c3 #tActs { grid-template-columns: repeat(3, 54px); }
#tDock.side.c3 .tb:not(.fold) { width: 54px; }
#tRail, #tActs { display: grid; grid-template-columns: repeat(2, 60px); gap: 6px; align-content: start; }
#tDock.bottom #tRail, #tDock.bottom #tActs { display: flex; flex-wrap: wrap; }
#tDock.bottom #tActs { min-height: 116px; align-content: flex-start; }
#tDock.side #tActs { border-top: 1px solid var(--line); padding-top: 8px; }
#tActs .tgrp { display: contents; }
#tDock.bottom #tActs .tgrp { display: flex; gap: 4px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); }
#tActs:not(.show) > * { display: none !important; }
#tActs .tinfo { grid-column: 1 / -1; background: rgba(15, 16, 20, .9); border: 1px solid var(--accent); color: var(--accent2); border-radius: 8px; padding: 7px 9px; font-weight: 600; font-size: 12.5px; text-align: center; }
#tDock.bottom #tActs .tinfo { align-self: center; }
.tb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 60px; min-height: 52px; padding: 4px 2px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.tb .ti { font-size: 20px; line-height: 1.1; font-weight: 700; }
.tb .tl { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tb.on, .tb.tg.on { background: var(--accent); border-color: var(--accent2); color: #1a1406; }
.tb.on .tl { color: #2a2208; }
.tb.warn { border-color: var(--danger); }
.tb.fold { grid-column: 1 / -1; width: auto; min-height: 32px; background: transparent; border-color: var(--line); }
.tb.fold .ti { font-size: 16px; color: var(--muted); }
#tDock.bottom .tb.fold { width: 44px; min-height: 52px; }
.tb:active { filter: brightness(1.35); }
body.replay #tActs { display: none !important; }
@media (max-width: 900px) { #chat { width: 280px; } }

/* a sidebar opened over the table must lie above the score / phase bars too */
.sb.open:not(.pinned) { z-index: 45; }

/* keyboard hints that mean nothing on a tablet */
#scorehead .note { display: none; }
