/* LEARN TO PLAY (PLD-25, docs/TEACH_BUILD_PLAN.md §7): the coach, the pointer and the cards around the lessons, over
   the play page's own felt (play.css). THE COACH IS ACHROMATIC: every colour on the felt already means a game state
   (gold = your turn and the standing bid, amber = a clock or a rule change, red = armed, green/red rings = held or
   over-bid), so the coach speaks in bone on a dark scrim and borrows none of them. No new tokens. */

/* The tournament felt without a tournament: its Rankings tab and its My Table / Other Tables bar read one. */
body.teach .ltabs, body.teach #tabbar { display: none !important; }

#teachLayer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
/* over the phone's standings drawer (z 1500) while lesson 7 has it open, so the coach can talk about it */
body.sdopen #teachLayer { z-index: 1520; }
/* a card is a full stop: nothing of the table's chrome pokes through it (the edge tabs sit at z 1510 in play.css) */
body.tcard-on .sdtab, body.tcard-on .actab { visibility: hidden; }
#teachLayer > * { pointer-events: auto; }

/* ---- the coach ---- */
.tcoach {
  position: fixed; box-sizing: border-box; max-width: calc(100vw - 16px);
  padding: 12px 14px 12px; border-radius: var(--ld-radius-md);
  background: rgba(8, 10, 16, .95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(244, 236, 224, .38);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55); color: var(--ld-bone);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  animation: tc-in .18s ease-out; /* it arrives once the felt has stopped moving (web/teach.ts feltMoving) */
}
@keyframes tc-in { from { opacity: 0; } to { opacity: 1; } }
.tcoach.min, .tcoach.solo { padding: 8px 10px; }
.tc-head { position: relative; display: flex; align-items: center; gap: 6px; }
.tc-eb { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: var(--ld-fs-7); letter-spacing: .14em; text-transform: uppercase; color: rgba(244, 236, 224, .72); }
.tc-sp { flex: 1; }
.tc-min, .tc-more {
  min-width: 44px; min-height: 44px; margin: -10px -6px -10px 0; border: 0; background: transparent;
  color: var(--ld-bone); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 50%;
}
.tc-min:focus-visible, .tc-more:focus-visible { outline: 2px solid var(--ld-bone); outline-offset: -6px; }
.tc-menu { position: absolute; right: 0; top: 34px; z-index: 2; min-width: 200px; }
.tc-h { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: var(--ld-fs-3); line-height: 1.2; margin: 6px 0 4px; color: var(--ld-bone); }
.tc-p { font-size: 15px; line-height: 1.45; margin: 0; color: var(--ld-bone); }
.tc-solo { margin: 2px 0 0; font-size: 14px; color: var(--ld-bone); }
.tc-nudge { margin: 8px 0 0; padding: 6px 9px; border-radius: var(--ld-radius-sm); border: 1px dashed rgba(244, 236, 224, .55); font-size: 14px; }
.tc-found { margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.tc-rule { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: rgba(244, 236, 224, .9); }
.tc-rule summary { cursor: pointer; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: var(--ld-fs-7); letter-spacing: .12em; text-transform: uppercase; color: rgba(244, 236, 224, .72); min-height: 28px; display: flex; align-items: center; }
.tc-rule q { quotes: '\201C' '\201D'; font-style: italic; }
.tc-rule a { color: var(--ld-bone); }
.tc-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tc-btns .btn { flex: 0 0 auto; width: auto; min-height: 44px; }
/* Next beside the words when it is the coach's only button: a whole row shorter on a phone */
.tc-row { display: flex; align-items: flex-end; gap: 12px; }
.tc-txt { flex: 1; min-width: 0; }
.tc-row .tc-btns { margin-top: 0; }
.tc-h:focus { outline: none; }
/* the coach's one exception to the .btn intents: bone, the white die, with navy pips (the canon's die pairing). Gold
   would read as a game state on the felt. */
.tc-next { background: var(--ld-bone); color: var(--ld-navy-deep); border: 0; font-family: 'Oswald', sans-serif; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 10px 20px; border-radius: var(--ld-radius-sm); cursor: pointer; }
/* (.btn.ghost's own gold would outrank one class: gold on the felt means "your turn") */
.tcoach .btn.tc-jump { color: var(--ld-bone); border-color: rgba(244, 236, 224, .55); }

.tcoach.shake { animation: tc-shake .4s ease; }
@keyframes tc-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---- the pointer: a ring around what the coach is talking about ---- */
.tpoint {
  position: fixed; box-sizing: border-box; pointer-events: none !important; border-radius: 12px;
  border: 2px solid var(--ld-bone); box-shadow: 0 0 0 3px rgba(8, 10, 16, .55), 0 0 10px rgba(244, 236, 224, .3);
  animation: tp-pulse 1.6s ease-in-out infinite;
}
.tpoint.hint { border-style: dashed; }
.tpoint.found { animation: none; border-color: var(--ld-bone); }
.tpoint.found::after { content: '\2713'; position: absolute; right: -10px; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--ld-bone); color: var(--ld-navy-deep); font-weight: 700; font-size: 14px; line-height: 22px; text-align: center; }
/* the glow breathes; the line stays solid, so the ring never fades out over a bright control */
@keyframes tp-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(8, 10, 16, .55), 0 0 10px rgba(244, 236, 224, .3); }
  50% { box-shadow: 0 0 0 3px rgba(8, 10, 16, .55), 0 0 22px 4px rgba(244, 236, 224, .6); }
}

/* ---- the skip-ahead banner ---- */
.tskip {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 2;
  padding: 14px 26px; border-radius: var(--ld-radius-md); background: rgba(8, 10, 16, .9); border: 1px solid rgba(244, 236, 224, .38);
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 22px; letter-spacing: .08em; text-transform: uppercase; color: var(--ld-bone);
}

/* ---- the cards around the lessons ---- */
.tcard-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(10, 16, 32, .6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); overflow-y: auto;
}
.tcard {
  box-sizing: border-box; width: 100%; max-width: 480px; margin: auto; padding: 24px 22px;
  background: var(--ld-card-navy); border: 1px solid var(--ld-line-gold); border-radius: var(--ld-radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55); color: var(--ld-ink); text-align: center;
}
.tcard-crest { display: block; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 14px; }
.tcard h1 { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: var(--ld-fs-1); margin: 0 0 6px; color: var(--ld-ink); }
.tcard-lede { font-size: 15.5px; line-height: 1.5; color: var(--ld-muted); margin: 0 0 14px; }
.tcard-pad { text-align: left; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--ld-radius-sm); background: rgba(255, 255, 255, .05); }
.tcard-pad h2 { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: var(--ld-fs-6); letter-spacing: .14em; text-transform: uppercase; color: var(--ld-gold-bright); margin: 0 0 4px; }
.tcard-pad p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ld-ink); }
.tcard-pad p + p { margin-top: 8px; }
.tcard-q { font-style: italic; color: var(--ld-muted) !important; }
.tcard .btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin: 0 0 10px; text-decoration: none; box-sizing: border-box; }
.tcard-fine { font-size: 13.5px; color: var(--ld-faint); margin: 6px 0 0; }
.tcard-note { margin: 0 0 14px; }
.tcard h1:focus { outline: none; }
.tcard-fine a { color: var(--ld-gold-bright); }
.tcard-steps { text-align: left; margin: 0 0 16px; padding: 0 0 0 22px; }
.tcard-steps li { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--ld-ink); }
.tl-list { list-style: none; margin: 4px 0 14px; padding: 0; text-align: left; }
.tl-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 0 0 6px; padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--ld-radius-sm); background: rgba(255, 255, 255, .04);
  color: var(--ld-ink); font: inherit; text-align: left; cursor: pointer;
}
.tl-row.here { border-color: var(--ld-line-gold); }
.tl-n { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); font-family: 'Oswald', sans-serif; font-weight: 600; }
.tl-t { flex: 1; display: flex; flex-direction: column; font-size: 15px; }
.tl-act { font-size: var(--ld-fs-6); color: var(--ld-faint); }
.tl-s { font-size: 12.5px; color: var(--ld-muted); white-space: nowrap; }
body.tcard-on #tcoach { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tpoint { animation: none; }
  .tcoach, .tcoach.shake { animation: none; }
}
