/* SportsBadger: Sunday Hand (play/hand.html). Loaded after sb.css and sb-play.css. Phone first. */

:root {
  --hand-win: #24543A; --hand-loss: #9B2C2C; --hand-push: #8A6A12;
  --hand-win-tag: #DDEBE2; --hand-loss-tag: #F3E1E1; --hand-push-tag: #F4ECD6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hand-win: #1F5C3B; --hand-loss: #7A2626; --hand-push: #6E5510;
    --hand-win-tag: #1D3A29; --hand-loss-tag: #3A1C1C; --hand-push-tag: #3A3118;
  }
}
:root[data-theme="dark"] {
  --hand-win: #1F5C3B; --hand-loss: #7A2626; --hand-push: #6E5510;
  --hand-win-tag: #1D3A29; --hand-loss-tag: #3A1C1C; --hand-push-tag: #3A3118;
}

#hand { padding-bottom: 8px; }

/* ---------- deal bars ---------- */
.hand-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.hand-status b { font-size: .95rem; }
.hand-bars { display: flex; gap: 6px; }
.hand-bars span { width: 34px; height: 8px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--surface); }
.hand-bars span.now { background: var(--ink); border-color: var(--ink); }
.hand-bars span.win { background: var(--win); border-color: var(--win); }
.hand-bars span.loss { background: var(--loss); border-color: var(--loss); }
.hand-bars span.push { background: var(--hand-push); border-color: var(--hand-push); }
.hand-bars.big { margin-top: 10px; }
.hand-bars.big span { flex: 1; max-width: 60px; height: 10px; border-radius: 5px; }

/* ---------- game letter tiles ---------- */
.hand-tile {
  width: 36px; height: 36px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font: 700 1.15rem/1 var(--font-display); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.hand-tile.sm { width: 28px; height: 28px; border-radius: 7px; font-size: .95rem; }

/* ---------- the deck ---------- */
.hand-deck { margin-top: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.hand-deck-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hand-deck h2 { margin: 0; font: 700 .75rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.hand-deck-top small { font-size: .82rem; color: var(--muted); }
.hand-games { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.hand-game { display: flex; gap: 8px; align-items: center; min-width: 0; }
.hand-game > div { min-width: 0; line-height: 1.15; }
.hand-game b { display: block; font-size: .88rem; }
.hand-game small { display: block; font-size: .76rem; color: var(--muted); }
.hand-deck p { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------- your hand ---------- */
.hand-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.hand-h h2 { margin: 0; font: 700 1.5rem/1.1 var(--font-display); text-transform: uppercase; }
.hand-h span { font-size: .88rem; color: var(--muted); }
.hand-cards { display: grid; gap: 8px; margin-top: 8px; }
.hand-card {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 8px 12px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left;
  font: inherit; box-sizing: border-box;
}
button.hand-card { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .08s, border-color .08s; }
button.hand-card:active { transform: scale(.985); }
button.hand-card:focus-visible { outline: 3px solid var(--turf); outline-offset: 2px; }
.hand-card.held { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 3px 0 var(--ink); }
.hand-card .who { flex: 1; min-width: 0; }
.hand-card .nm { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hand-card .nm b { font: 700 1.38rem/1.05 var(--font-display); }
.hand-card .nm small { font-size: .75rem; font-weight: 700; color: var(--muted); }
.hand-card .who > small { display: block; font-size: .82rem; color: var(--muted); margin-top: 1px; }
.hand-card .hold {
  flex: none; font: 700 .75rem/1 var(--font-body); letter-spacing: .05em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.hand-card.held .hold { background: var(--ink); border-color: var(--ink); color: var(--surface); }
@media (hover: hover) { button.hand-card:not(.held):hover { border-color: var(--muted); } }

.hand-dealt { margin: 10px 0 0; font-size: .94rem; }
.hand-draw { width: 100%; justify-content: center; margin-top: 14px; min-height: 52px; font-size: 1.05rem; }
.hand-note { margin: 8px 0 0; text-align: center; font-size: .82rem; color: var(--muted); }

.hand-guide { margin-top: 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.hand-guide summary { cursor: pointer; font: 700 .75rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.hand-guide ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.hand-guide li { display: grid; grid-template-columns: 6.6rem 1fr; gap: 8px; font-size: .88rem; }
.hand-guide li span { color: var(--muted); }
.hand-guide p { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------- the showdown ---------- */
.hand-result { margin-top: 12px; padding: 18px 16px 16px; border-radius: 16px; color: #FFFFFF; animation: hand-in .35s ease-out; }
.hand-result.win { background: var(--hand-win); }
.hand-result.loss { background: var(--hand-loss); }
.hand-result.push { background: var(--hand-push); }
.hand-result p { margin: 0; }
.hand-result > p:first-child { font: 600 .75rem/1.3 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.hand-result h2 { margin: 4px 0 0; font: 700 clamp(2.4rem, 12vw, 3.1rem)/.95 var(--font-display); text-transform: uppercase; color: #FFFFFF; }
.hand-result .vs { margin-top: 10px; font-size: 1rem; }
.hand-result .sub { margin-top: 2px; font-size: .94rem; color: rgba(255, 255, 255, .82); }
@keyframes hand-in { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.hand-side { margin-top: 14px; }
.hand-side-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hand-side-h h3 { margin: 0; font: 700 1.38rem/1.1 var(--font-display); }
.hand-side-h > b { font: 700 1.38rem/1 var(--font-display); white-space: nowrap; }
.hand-badger { display: flex; align-items: center; gap: 8px; }
.hand-badger img { flex: none; border-radius: 50%; }
.hand-held { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.hand-card.open { min-height: 0; padding: 8px 12px; gap: 10px; border-radius: 12px; }
.hand-card.open .nm b { font: 600 .98rem/1.2 var(--font-body); }
.hand-card.open .who > small { font-size: .8rem; }
.hand-card.open .who > small.when { font-size: .74rem; }
.hand-card.open .drew { font-weight: 600; color: var(--muted); }
.hand-card.open .hand-pts { font: 700 1.38rem/1 var(--font-display); }
.hand-card.made { border-color: var(--win); }
.hand-next { width: 100%; justify-content: center; margin-top: 16px; min-height: 52px; font-size: 1.05rem; }

/* ---------- the day ---------- */
.hand-final { padding-top: 6px; }
.hand-big { margin: 4px 0 0; font: 700 3.3rem/.95 var(--font-display); text-transform: uppercase; }
.hand-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.hand-kpis > div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.hand-kpis small { display: block; font: 600 .7rem/1.3 var(--font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hand-kpis b { font: 700 2.1rem/1 var(--font-display); }
.hand-kpis p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.hand-final .pl-compare { margin-top: 12px; }
.hand-h3 { margin: 16px 0 2px; font: 700 1.25rem/1.1 var(--font-display); }
.hand-calls { list-style: none; margin: 0 0 14px; padding: 0; }
.hand-calls li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.hand-crow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hand-crow b { font-size: .94rem; }
.hand-crow span { flex: none; font: 700 .8rem/1 var(--font-body); padding: 5px 9px; border-radius: 999px; }
.hand-crow span.td { background: var(--hand-win-tag); color: var(--win); }
.hand-crow span.no { background: var(--hand-loss-tag); color: var(--loss); }
.hand-crow span.push { background: var(--hand-push-tag); color: var(--ink); }
.hand-calls p { margin: 3px 0 0; font-size: .9rem; }
.hand-calls small { display: block; margin-top: 2px; font-size: .82rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .hand-result { animation: none; }
  button.hand-card { transition: none; }
  .hand-card.held { transform: none; }
}
@media (max-width: 360px) {
  .hand-games { grid-template-columns: 1fr; }
  .hand-card .nm b { font-size: 1.22rem; }
}
@media (max-width: 400px) {
  .hand-bars span { width: 26px; }
  .hand-status b { white-space: nowrap; font-size: .9rem; }
}
