/* Palpedia TCG — match tracker styles (tcg/match-tracker.html).
   Mobile first: stacked layout, big buttons (≥56px), portrait and landscape. */

body.tcg-hub-page .mt-main {
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

body.tcg-hub-page .mt-intro header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

body.tcg-hub-page .mt-board {
  display: grid;
  gap: 1rem;
  padding: 0 clamp(.75rem, 2vw, 2rem);
}

/* ---------- status bar ---------- */

body.tcg-hub-page .mt-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

body.tcg-hub-page .mt-night {
  min-height: 56px;
  padding: .6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

body.tcg-hub-page .mt-night[aria-pressed="true"] {
  border-color: #8f7bff;
  color: #cabdff;
  background: rgba(80, 60, 160, .25);
}

body.tcg-hub-page .mt-timer {
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--cyan-soft);
}

body.tcg-hub-page .mt-timer.is-warning { color: var(--amber); }

body.tcg-hub-page .mt-timer.is-finished {
  color: var(--danger);
  animation: mt-blink 1s steps(2) infinite;
}

@keyframes mt-blink {
  50% { opacity: .35; }
}

body.tcg-hub-page .mt-timer-actions {
  display: flex;
  gap: .5rem;
}

body.tcg-hub-page .mt-timeup {
  flex-basis: 100%;
  margin: 0;
  padding: .5rem .8rem;
  border: 1px solid var(--danger);
  border-radius: 10px;
  background: rgba(242, 92, 92, .12);
  color: var(--danger);
  font-weight: 700;
  text-align: center;
}

/* ---------- buttons ---------- */

body.tcg-hub-page .mt-btn {
  min-width: 56px;
  min-height: 56px;
  padding: .6rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s var(--ease-out), filter .12s var(--ease-out);
  touch-action: manipulation;
  user-select: none;
}

body.tcg-hub-page .mt-btn:active { transform: scale(.95); }
body.tcg-hub-page .mt-btn:hover { filter: brightness(1.12); }

body.tcg-hub-page .mt-btn--small {
  min-height: 44px;
  font-size: .9rem;
  font-weight: 700;
}

body.tcg-hub-page .mt-btn--big {
  min-width: 72px;
  min-height: 72px;
  font-size: 2rem;
  border-color: var(--cyan);
}

body.tcg-hub-page .mt-btn--ghost {
  background: transparent;
  color: var(--muted);
}

/* ---------- players ---------- */

body.tcg-hub-page .mt-players {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

body.tcg-hub-page .mt-player {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}

body.tcg-hub-page .mt-player.is-turn {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(98, 231, 237, .35);
}

body.tcg-hub-page .mt-player__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

body.tcg-hub-page .mt-player__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

body.tcg-hub-page .mt-player__name {
  padding: .15rem .35rem;
  border-radius: 8px;
  border-bottom: 1px dashed var(--muted);
  cursor: text;
  outline: none;
}

body.tcg-hub-page .mt-player__name:focus {
  border-bottom-color: var(--cyan);
  background: rgba(98, 231, 237, .07);
}

body.tcg-hub-page .mt-turn-btn[aria-pressed="true"] {
  border-color: var(--cyan);
  color: var(--cyan);
}

body.tcg-hub-page .mt-life {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
}

body.tcg-hub-page .mt-life__value {
  min-width: 3ch;
  text-align: center;
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 800;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

body.tcg-hub-page .mt-counters {
  display: grid;
  gap: .6rem;
}

body.tcg-hub-page .mt-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

body.tcg-hub-page .mt-counter__label {
  font-size: .9rem;
  color: var(--amber);
  font-weight: 700;
}

body.tcg-hub-page .mt-counter__controls {
  display: flex;
  align-items: center;
  gap: .45rem;
}

body.tcg-hub-page .mt-counter__controls output {
  min-width: 2ch;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.tcg-hub-page .mt-actions {
  display: flex;
  justify-content: center;
}

/* ---------- night ---------- */

body.tcg-hub-page.mt-is-night .mt-board {
  background: radial-gradient(900px 260px at 50% 0%, rgba(80, 60, 160, .16), transparent);
}

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  body.tcg-hub-page .mt-players { grid-template-columns: 1fr; }
}

@media (max-width: 900px) and (orientation: landscape) {
  body.tcg-hub-page .mt-life__value { font-size: 2.4rem; }
  body.tcg-hub-page .mt-btn--big { min-height: 56px; min-width: 60px; font-size: 1.5rem; }
  body.tcg-hub-page .mt-intro p { display: none; }
}

/* Short mobile viewports (≤844px tall): compact everything so Player B
   stays above the fold without scrolling. */
@media (max-height: 844px) and (max-width: 720px) {
  body.tcg-hub-page .mt-intro { padding-top: .6rem; padding-bottom: .6rem; }
  body.tcg-hub-page .mt-intro h1 { font-size: 1.3rem; margin: 0; }
  body.tcg-hub-page .mt-intro .tcg-eyebrow { margin-bottom: .15rem; }
  body.tcg-hub-page .mt-intro p { display: none; }
  body.tcg-hub-page .mt-board { gap: .6rem; }
  body.tcg-hub-page .mt-statusbar { padding: .4rem .6rem; gap: .5rem; }
  body.tcg-hub-page .mt-night { min-height: 44px; padding: .4rem .8rem; }
  body.tcg-hub-page .mt-timer { font-size: 1.8rem; }
  body.tcg-hub-page .mt-player { gap: .45rem; padding: .6rem .8rem; }
  body.tcg-hub-page .mt-player__head h2 { font-size: 1rem; }
  body.tcg-hub-page .mt-life__value { font-size: 2.2rem; }
  body.tcg-hub-page .mt-btn { min-height: 44px; min-width: 48px; padding: .4rem .7rem; font-size: 1rem; }
  body.tcg-hub-page .mt-btn--small { min-height: 38px; font-size: .8rem; }
  body.tcg-hub-page .mt-btn--big { min-height: 52px; min-width: 56px; font-size: 1.4rem; }
  body.tcg-hub-page .mt-counters { gap: .35rem; }
  body.tcg-hub-page .mt-counter__controls output { font-size: 1.15rem; }
  body.tcg-hub-page .mt-actions .mt-btn { min-height: 40px; }
}
