/* ============================================================
   DIGITAL BAM (digital.html) — on top of bam-cards.css
   The table: umpire clicker + field up top, the computer's card
   (face down, then flipped) beside your card.
   ============================================================ */
.dg-app { background:
  radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.06), transparent 60%),
  repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 7px),
  #3A3226; }                                     /* a dark wood tabletop */
.dg-setup .bam-wrap { max-width: 760px; }
.dg-h2 { font-family: var(--font-display); color: var(--tan); font-size: 1.3rem; margin: 18px 0 2px; }
.dg-muted { color: rgba(255,255,255,.7); margin-bottom: 10px; }
.dg-sp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.bam-h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.05; margin: 6px 0 8px; }

.dg-table { max-width: 1060px; margin: 0 auto; padding: 10px 14px 40px; }
.dg-table.is-active { display: block; }

/* top: clicker + field */
.dg-top { display: grid; grid-template-columns: minmax(150px, 330px) minmax(0, 470px); justify-content: center; gap: 22px; align-items: center; }
.bam-clock[hidden] { display: none; }
.dg-clicker svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
/* umpire clicker: engraved labels, rolling number drums with tan digits */
.ck-label { font: 700 9px var(--font-body); letter-spacing: .16em; fill: #DCCFA7; opacity: .85; }
.ck-label--lamp { font-size: 10px; opacity: .55; }
.ck-label--lamp.is-on { opacity: 1; fill: #F2DC9A; }
.ck-label--tiny { font-size: 6.5px; letter-spacing: .2em; opacity: .6; }
.ck-brand { font-family: var(--font-display); font-size: 15px; letter-spacing: .12em; fill: #4D5438; paint-order: stroke; stroke: #7F8A62; stroke-width: .6px; }
.ck-digit { font: 700 31px var(--font-body); fill: #E8DBB7; font-variant-numeric: tabular-nums; }
.ck-digit--ghost { opacity: .35; }
.ck-drum.is-roll { animation: ckRoll .55s cubic-bezier(.3,.7,.3,1.15); }
@keyframes ckRoll { from { transform: translateY(33px); } to { transform: translateY(0); } }
.dg-fieldwrap { background: #E9E4D8; border-radius: 10px; padding: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.35); }
.dg-field { width: 100%; height: auto; display: block; max-height: 300px; }
.dg-tok image { pointer-events: none; }
.dg-burst text { font-family: var(--font-display); font-size: 16px; stroke: #fff; stroke-width: 3px; paint-order: stroke; animation: dgRise 1.1s ease-out forwards; }
@keyframes dgRise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-22px); opacity: 0; } }

.dg-notice { margin: 10px 0 2px; color: var(--tan); font-weight: 600; text-align: center; min-height: 1.2em; }
.dg-notice b { font-family: var(--font-display); font-weight: 400; }

/* the two cards on the table */
.dg-opp__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 10px 0 8px; font-size: .85rem; }
.dg-who { font-family: var(--font-display); color: #EDEAE0; }
.dg-status { color: var(--tan); font-weight: 700; }
.dg-flip { perspective: 1100px; }
.dg-flip__inner { position: relative; aspect-ratio: 900 / 1350; transition: transform .7s cubic-bezier(.3,.7,.2,1); transform-style: preserve-3d; transform: rotate(-3deg); }
.dg-flip.is-flipped .dg-flip__inner { transform: rotateY(180deg) rotate(3deg); }
.dg-flip__back, .dg-flip__front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.dg-flip__front { transform: rotateY(180deg); }
.dg-flip .bam-card { min-width: 0; max-width: none; width: 100%; box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.dg-cardback {
  position: absolute; inset: 0; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: repeating-linear-gradient(45deg, #4D5438 0 12px, #454C32 12px 24px); border: 8px solid #F4F1EA; box-shadow: 0 8px 20px rgba(0,0,0,.45);
}
.dg-cardback span { font-family: var(--font-display); color: var(--tan); font-size: clamp(1.1rem, 3vw, 1.8rem); line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.dg-cardback small { color: rgba(244,241,234,.8); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .66rem; }
.dg-mine .bam-card { box-shadow: 0 10px 24px rgba(0,0,0,.45); transform: rotate(1deg); }
.dg-mine .bam-rolebar { margin-top: 4px; }

.dg-controls, .dg-result { max-width: 560px; margin: 0 auto; }
.dg-result[hidden], .dg-controls[hidden] { display: none; }
.dg-result .bam-result { margin-top: 16px; }
.dg-moves h2 { font-size: 1.1rem; }
.dg-sp-row { max-width: 760px; margin: 14px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dg-sp-row .bam-sp-mine { margin-top: 0; }
.dg-secret { width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; background: #4D5438; color: var(--tan); font-family: var(--font-display); font-size: 1.6rem; flex: none; }

/* setup: Quick Game + Daily Challenge */
.dg-start { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
.dg-start__btn { display: flex; gap: 12px; align-items: center; text-align: left; padding: 16px; border-radius: 12px; cursor: pointer; font: inherit; color: #fff; border: 0;
  box-shadow: 0 6px 14px rgba(0,0,0,.35); transition: transform .12s; }
.dg-start__btn:hover { transform: translateY(-2px); }
.dg-start__btn--quick { background: #BB3D43; }
.dg-start__btn--daily { background: #4D5438; border: 2px solid var(--tan); }
.dg-start__icon { font-size: 2rem; flex: none; }
.dg-start__btn b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; display: block; }
.dg-start__btn small { display: block; opacity: .9; font-size: .88rem; margin-top: 2px; }
.dg-daily { display: flex; flex-direction: column; gap: 2px; }
.dg-daily span { font-weight: 700; font-size: .92rem; }
.dg-daily small { opacity: .8; }
.dg-daily em { font-style: normal; font-size: .82rem; color: #F2DC9A; margin-top: 3px; }
@media (max-width: 640px) { .dg-start { grid-template-columns: 1fr; } }

/* online: Play Online button, Quick Match waiting room */
.dg-start__btn--online { grid-column: 1 / -1; background: #5E6B45; border: 2px solid #8D9670; }
.dg-start__btn:disabled { opacity: .6; cursor: wait; transform: none; }
.dg-online-count { display: block; font-style: normal; font-size: .85rem; color: #F2DC9A; margin-top: 4px; }
.dg-online-count:empty { display: none; }
.dg-online .bam-panel h2 { margin-top: 0; }
.dg-online .bam-btn--ghost { margin-top: 8px; }
.dg-wait { text-align: center; }
.dg-radar { width: 96px; height: 96px; margin: 6px auto 12px; border-radius: 50%; position: relative;
  background: radial-gradient(circle, #5E6B45 0 6px, transparent 7px), repeating-radial-gradient(circle, transparent 0 15px, rgba(94,107,69,.35) 16px 17px); border: 2px solid #5E6B45; }
.dg-radar::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(94,107,69,.55), transparent 25%); animation: dg-sweep 2s linear infinite; }
@keyframes dg-sweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dg-radar::after { animation: none; } }
.dg-rematch-note:empty { display: none; }

/* final screen: share + the real game */
.bam-btn--red { background: #BB3D43; color: #fff; }
a.bam-btn--red { text-decoration: none; }
.dg-over { max-width: 640px; }
.dg-daily-sit { font-weight: 700; margin: 0 0 6px; }
.dg-emoji { font-size: 1.8rem; letter-spacing: .1em; margin: 6px 0; word-break: break-all; }
.dg-score-line { font-family: var(--font-display); font-size: 1.3rem; margin: 4px 0 8px; }
.dg-share { width: 100%; margin-top: 12px; }
.dg-again { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.dg-again .bam-btn { margin: 0; }
.dg-cta { margin-top: 22px; background: #F4F1EA; color: #222; border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: 42% 1fr; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.dg-cta__img { background: #E9E4D8; display: grid; align-content: center; gap: 4px; padding: 10px; }
.dg-cta__img img { width: 100%; height: auto; display: block; }
.dg-cta__body { padding: 16px 18px; }
.dg-cta__eyebrow { color: #BB3D43; font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin: 0; }
.dg-cta h2 { font-family: var(--font-display); color: #4D5438; font-size: 1.35rem; margin: 4px 0 6px; line-height: 1.1; }
.dg-cta p { font-size: .92rem; margin: 0 0 10px; }
.dg-cta .bam-btn { margin: 0 0 8px; display: block; text-align: center; }
.dg-cta__alt, .dg-cta p a { color: #4D5438; font-weight: 700; font-size: .9rem; }
.dg-back { display: block; text-align: center; margin-top: 16px; color: var(--tan); }
@media (max-width: 640px) { .dg-cta { grid-template-columns: 1fr; } .dg-cta__img { grid-template-columns: 1fr 1fr; } }

/* setup: Advanced Rules, pitch mix, opponents */
.bam-field[hidden] { display: none; }               /* the pitch mix only shows with Advanced Rules on */
.dg-mixcount { margin: 4px 0 0; font-size: .85rem; }
/* a picked Special Ops player / opponent: baseball-red outline + check */
.dg-sp-grid .bam-sp { position: relative; }
.dg-sp-grid .bam-sp[aria-pressed="true"] { border-color: #BB3D43; box-shadow: 0 0 0 3px #BB3D43, 0 0 0 7px rgba(212,190,132,.55); background: #FFF6EC; transform: translateY(-2px); }
.dg-sp-grid .bam-sp[aria-pressed="true"]::after, .dg-persona[aria-pressed="true"]::after { content: '✓ PICKED'; position: absolute; top: 6px; right: 6px; background: #BB3D43; color: #fff;
  font: 700 .66rem var(--font-body); letter-spacing: .08em; padding: 3px 7px; border-radius: 99px; }
.dg-persona { position: relative; }
.dg-adv-note { margin: 6px 0 0; font-size: .85rem; }
.dg-mix { flex-wrap: wrap; }
.dg-mixchip img, .dg-chip img { width: 18px; height: 18px; vertical-align: -4px; margin-right: 5px; }
.dg-persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.dg-persona { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(244,241,234,.06); border: 2px solid rgba(244,241,234,.18); color: #EDEAE0; font: inherit; }
.dg-persona:hover { border-color: rgba(212,190,132,.6); }
.dg-persona[aria-pressed="true"] { border-color: #BB3D43; box-shadow: 0 0 0 2px #BB3D43; background: rgba(187,61,67,.18); }
.dg-persona b { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--tan); }
.dg-persona small { opacity: .75; font-size: .78rem; }
.dg-persona em { font-style: normal; font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.dg-persona span { font-size: .85rem; opacity: .85; line-height: 1.35; }
.dg-reads { font-style: normal; font-size: .75rem; opacity: .8; letter-spacing: .05em; margin-top: 2px; }

/* scouting report: a small heat map under the computer's card */
.dg-scout { margin-top: 12px; padding: 8px 10px 10px; border-radius: 10px; background: rgba(0,0,0,.22); color: #EDEAE0; }
.dg-scout__head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: .78rem; margin-bottom: 6px; }
.dg-scout__head b { font-family: var(--font-display); font-weight: 400; color: var(--tan); font-size: .9rem; }
.dg-scout__head small { opacity: .7; }
.dg-heat { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; max-width: 150px; margin: 0 auto; }
.dg-heat__cell { aspect-ratio: 1.5; border-radius: 4px; display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: color-mix(in srgb, #BB3D43 calc(var(--k) * 100%), rgba(244,241,234,.12)); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.dg-scout__mix { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 7px; font-size: .78rem; font-weight: 700; }
.dg-scout__note { opacity: .8; font-weight: 500; text-align: center; }

/* big-situation callout */
.dg-callout { text-align: center; font-family: var(--font-display); color: #F2DC9A; font-size: 1.15rem; letter-spacing: .04em;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .3s, opacity .3s; }
.dg-callout.is-on { max-height: 3em; opacity: 1; animation: dgCall .6s ease-out; }
.dg-callout.is-big { color: #fff; font-size: 1.45rem; text-shadow: 0 0 12px rgba(187,61,67,.9), 0 2px 0 #7A2226; }
@keyframes dgCall { from { transform: scale(.7); } 60% { transform: scale(1.08); } to { transform: scale(1); } }

.dg-sound { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: #4D5438; color: #fff; font-size: 1.2rem; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.dg-setup ~ .dg-sound { display: none; }

@media (max-width: 760px) {
  .dg-table { padding: 8px 10px 32px; }
  .dg-scout { padding: 6px; }
  .dg-scout__head { flex-direction: column; gap: 0; }
  .dg-callout.is-big { font-size: 1.15rem; }
  .dg-top { grid-template-columns: 50% 1fr; gap: 8px; }
  .dg-opp__head { flex-direction: column; gap: 0; margin: 4px 0 6px; font-size: .74rem; }
  .dg-mine .bam-card { min-width: 0; }
  .dg-mine .bam-role { font-size: 1.05rem; }
  .dg-mine .bam-clock { width: 44px; height: 44px; font-size: 1.1rem; }
  .dg-sp-row { grid-template-columns: 1fr; }
  .dg-cardback { border-width: 5px; }
}

/* ============================================================
   ONE-SCREEN LAYOUT (owner, Nov 19: "I have to scroll down and up over and over")
   ============================================================ */
.dg-sp-row { grid-template-columns: 1fr; }
.dg-result { scroll-margin-top: 76px; }
.dg-mine .bam-rolebar { scroll-margin-top: 76px; }

/* wide screens: field | your card | their card + tray / result — everything visible at once */
@media (min-width: 1000px) {
  .dg-table { max-width: 1260px; padding: 10px 16px 0; }
  .dg-layout { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 440px) minmax(280px, 340px); gap: 20px; justify-content: center; align-items: start; }
  .dg-col { max-height: calc(100vh - 76px); max-height: calc(100svh - 76px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding-bottom: 8px; }
  .dg-top { grid-template-columns: 1fr; gap: 10px; }
  .dg-clicker { max-width: 230px; margin: 0 auto; width: 100%; }
  .dg-field { max-height: none; }
  .dg-notice { margin-top: 8px; font-size: .92rem; }
  .dg-sp-row { margin-top: 10px; }
  .dg-sp-row .bam-sp-mine { font-size: .8rem; }
  .dg-mine .bam-card { min-width: 0; max-width: min(100%, calc((100vh - 150px) * .6667)); max-width: min(100%, calc((100svh - 150px) * .6667)); }
  .dg-opp .dg-flip { max-width: 190px; margin: 0 auto; }
  .dg-opp__head { margin-top: 4px; }
  .dg-controls .bam-tray { margin-top: 10px; }
  .dg-controls .bam-token { min-height: 40px; font-size: .84rem; }
  .dg-result .bam-result { margin-top: 10px; }
  .dg-col--right .bam-sublinks { margin-top: 10px; }
}

/* phones / narrow (owner: cards + pitch/bat tray first, scroll down for the clicker and field);
   the Lock In / Next Pitch button is pinned at the bottom */
@media (max-width: 999px) {
  .dg-table { padding-bottom: 96px; }
  .dg-layout { display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: 10px;
    grid-template-areas: "call call" "note note" "opp mine" "ctl ctl" "res res" "top top" "scout scout" "sp sp" "links links"; }
  .dg-heat { max-width: 200px; }
  .dg-col--left, .dg-col--right { display: contents; }
  .dg-col--mid { grid-area: mine; }
  .dg-top { grid-area: top; margin-top: 14px; }
  .dg-callout { grid-area: call; }
  .dg-notice { grid-area: note; }
  .dg-opp { grid-area: opp; }
  .dg-scout { grid-area: scout; align-self: start; }
  .dg-controls { grid-area: ctl; width: 100%; }
  .dg-result { grid-area: res; width: 100%; }
  .dg-sp-row { grid-area: sp; }
  .dg-col--right .bam-sublinks { grid-area: links; }
  .dg-action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(36,30,22,.96); box-shadow: 0 -6px 14px rgba(0,0,0,.4); }
  .dg-action .bam-btn { margin: 0 auto; width: 100%; max-width: 560px; display: block; }
  .dg-sound { bottom: 84px; }
  .dg-app ~ .bam-toast { bottom: 92px; }
}
@media (max-width: 999px) and (min-width: 600px) {
  .dg-top { grid-template-columns: 240px minmax(0, 360px); justify-content: center; }
  .dg-layout { grid-template-columns: minmax(0, 260px) minmax(0, 420px); justify-content: center; }
}