/* ============================================================
   Guess the Painter — Phase 5: Duo mode
   redesign-duo.css — scoped under .gtp
   2026-05 redesign branch.
   ============================================================ */

/* ============================================================
   DUO SETUP SCREEN
   ============================================================ */
#screen-duo-setup {
  background: var(--paper);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#screen-duo-setup.active {
  display: flex;
}

/* Duo setup is now a modal over an ink-black backdrop */
#screen-duo-setup {
  background: rgba(10, 9, 8, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#screen-duo-setup.active {
  display: flex;
}

.gtp-duo-setup {
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  background: var(--paper);
  padding: 40px 44px 32px;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  position: relative;
  margin: auto;
}

.gtp-duo-setup-spacer {
  height: 0;
  flex-shrink: 0;
}

.gtp-duo-setup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  font-family: var(--mono);
  transition: color 160ms;
}
.gtp-duo-setup-close:hover {
  color: var(--ink);
}

.gtp-duo-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ochre-deep);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.gtp-duo-h1 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex-shrink: 0;
}

.gtp-duo-lede {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.4;
  margin: 12px 0 28px;
  flex-shrink: 0;
}

/* Player input rows */
.gtp-duo-player-row {
  margin-bottom: 18px;
  flex-shrink: 0;
}

.gtp-duo-player-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.gtp-duo-player-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gtp-duo-player-dot--p1 { background: var(--player-1); }
.gtp-duo-player-dot--p2 { background: var(--player-2); }

.gtp-duo-player-mono {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gtp-duo-input {
  width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms;
  box-sizing: border-box;
}
.gtp-duo-input:focus {
  border-color: var(--rule); /* overridden per-player by JS */
}
.gtp-duo-input--p1:focus { border-color: var(--player-1); }
.gtp-duo-input--p2:focus { border-color: var(--player-2); }

/* CTA */
.gtp-duo-cta {
  margin-top: auto;
  width: 100%;
  padding: 18px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms, opacity 160ms;
  flex-shrink: 0;
}
.gtp-duo-cta:hover:not(:disabled) { background: var(--ink-2); }
.gtp-duo-cta:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ============================================================
   DUO GAME SCREEN
   ============================================================ */
#screen-duo-game {
  background: var(--paper);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#screen-duo-game.active {
  display: flex;
}

.gtp-duo-game {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--paper);
  overflow: hidden;
}

/* -------- Active player band -------- */
.gtp-duo-band {
  flex-shrink: 0;
  padding: 8px 20px 0;
  position: relative;
  transition: background 360ms ease-out;
}

.gtp-duo-band--p1 { background: var(--ochre-bg-soft); }
.gtp-duo-band--p2 { background: var(--indigo-bg-soft); }

.gtp-duo-band-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

/* Player badge */
.gtp-duo-badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 36%;
}
.gtp-duo-badge--right {
  align-items: flex-end;
}

.gtp-duo-badge-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gtp-duo-badge--right .gtp-duo-badge-name-row {
  flex-direction: row-reverse;
}

.gtp-duo-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 240ms;
}
.gtp-duo-badge-dot--p1 { background: var(--player-1); }
.gtp-duo-badge-dot--p2 { background: var(--player-2); }

/* Halo glow when active */
.gtp-duo-badge--active .gtp-duo-badge-dot--p1 {
  box-shadow: 0 0 0 4px var(--player-1-tint);
}
.gtp-duo-badge--active .gtp-duo-badge-dot--p2 {
  box-shadow: 0 0 0 4px var(--player-2-tint);
}

.gtp-duo-badge-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 360ms, font-style 360ms;
}

/* Active vs inactive name styling */
.gtp-duo-badge--active   .gtp-duo-badge-name--p1 { color: var(--player-1-deep); font-style: normal; }
.gtp-duo-badge--active   .gtp-duo-badge-name--p2 { color: var(--player-2-deep); font-style: normal; }
.gtp-duo-badge--inactive .gtp-duo-badge-name {     color: var(--ink-4); font-style: italic; }

/* Lives in the badge */
.gtp-duo-badge-lives {
  display: flex;
  align-items: center;
  gap: 5px;
}
.gtp-duo-badge--right .gtp-duo-badge-lives {
  justify-content: flex-end;
}

.gtp-duo-life-pip {
  font-size: 12px;
  line-height: 1;
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 280ms ease, transform 280ms ease;
}
.gtp-duo-life-pip::before { content: attr(data-glyph); }
.gtp-duo-life-pip.filled--p1 { color: var(--player-1); }
.gtp-duo-life-pip.filled--p2 { color: var(--player-2); }
.gtp-duo-life-pip.empty {
  color: var(--ink-4);
  opacity: 0.55;
}
.gtp-duo-life-pip.draining {
  animation: gtp-heart-drain 280ms cubic-bezier(.4, 0, .2, 1) forwards;
}

/* VS + whose turn */
.gtp-duo-band-center {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* Wildcards sit just under the turn indicator, centred in the band */
.gtp-duo-band-center .gtp-duo-wildcards {
  margin-top: 6px;
}
.gtp-duo-band-vs {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1;
  display: block;
}
.gtp-duo-band-turn {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
  transition: color 360ms;
}
.gtp-duo-band-turn--p1 { color: var(--player-1-deep); }
.gtp-duo-band-turn--p2 { color: var(--player-2-deep); }

/* Accent rule at bottom of band — slides between halves on turn change */
.gtp-duo-accent-rule {
  position: absolute;
  bottom: 0;
  height: 3px;
  transition: left 420ms cubic-bezier(.4,0,.2,1), right 420ms cubic-bezier(.4,0,.2,1), background 360ms ease;
}
/* When applied directly on a single element with class --p1 / --p2, animate the position. */
.gtp-duo-band--p1 .gtp-duo-accent-rule,
.gtp-duo-accent-rule--p1 {
  left: 0;
  right: 50%;
  background: var(--player-1);
}
.gtp-duo-band--p2 .gtp-duo-accent-rule,
.gtp-duo-accent-rule--p2 {
  left: 50%;
  right: 0;
  background: var(--player-2);
}

/* -------- Wildcards row (Duo) -------- */
.gtp-duo-wildcards {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px 0;
  flex-shrink: 0;
}

/* -------- Hint banner -------- */
.gtp-duo-hint-banner {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ochre-deep);
  text-transform: uppercase;
  padding: 6px 20px 0;
  min-height: 24px;
  flex-shrink: 0;
  transition: opacity 200ms;
}
.gtp-duo-hint-banner:empty { opacity: 0; }

/* -------- Game body (painting + question + options) -------- */
.gtp-duo-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px 20px 12px;
  overflow: hidden;
  min-height: 0;
}
/* Centre + size the Duo content column to match Solo (children stretch) */
.gtp-duo-body .gtp-slide-wrap {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
}
/* Duo's player band is taller than Solo's HUD, so the painting needs to be
   a touch shorter for the whole screen to fit without scrolling. */
.gtp-duo-body .gtp-painting-frame {
  height: min(33vh, 300px);
  margin-bottom: 6px;
}
.gtp-duo-body .gtp-painting-img {
  max-height: 300px;
}

/* -------- Game over screen for Duo -------- */
#screen-duo-gameover {
  background: var(--paper);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#screen-duo-gameover.active {
  display: flex;
}

.gtp-duo-gameover {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  gap: 16px;
  width: 100%;
}

.gtp-duo-gameover-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.gtp-duo-gameover-winner {
  font-family: var(--serif);
  font-style: italic;
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.gtp-duo-gameover-winner strong {
  font-style: normal;
  font-weight: 500;
}

.gtp-duo-gameover-summary {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0;
}

.gtp-duo-gameover-stat {
  text-align: center;
  min-width: 64px;
}
.gtp-duo-gameover-stat-value {
  font-family: var(--mono);
  font-size: 28px;
  line-height: 1;
}
.gtp-duo-gameover-stat-value--p1 { color: var(--player-1-deep); }
.gtp-duo-gameover-stat-value--p2 { color: var(--player-2-deep); }
.gtp-duo-gameover-stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Winner's correct count */
.gtp-duo-gameover-sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  margin: 0 0 8px;
}
.gtp-duo-gameover-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}
/* `.gtp` prefix so these beat the `.gtp button` reset (background/padding). */
.gtp .gtp-duo-gameover-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  margin: 0;
  padding: 15px 28px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms, color 160ms;
}
.gtp .gtp-duo-gameover-cta:hover { background: var(--ink-2); border-color: var(--ink-2); }

.gtp .gtp-duo-gameover-home {
  background: transparent;
  border: 0;
  padding: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 160ms;
}
.gtp .gtp-duo-gameover-home:hover { color: var(--ink); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 375px) {
  .gtp-duo-badge-name {
    font-size: 19px;
    max-width: 120px;
  }
  .gtp-duo-band-vs {
    font-size: 18px;
  }
}
