/* Dual player: mode select, match (tablet flat between two kids) and winner view. */

/* ---------- Mode select ---------- */
.dual-title {
  position: absolute; left: 0; right: 0; top: 62px; margin: 0;
  text-align: center; font-size: 40px; font-weight: 700; color: var(--maroon);
}
.dual-cards {
  position: absolute; left: 50%; top: 168px; transform: translateX(-50%);
  display: flex; gap: 64px;
}
.dual-card {
  width: 430px; height: 500px; border-radius: 40px; overflow: hidden;
  display: flex; flex-direction: column;
  background: #FFFDF7; border: 3px solid var(--ink);
  box-shadow: 6px 8px 0 rgba(0,0,0,.5);
  transition: transform .08s ease, box-shadow .08s ease;
}
.dual-card:active { transform: translate(4px, 5px); box-shadow: 2px 3px 0 rgba(0,0,0,.5); }
.dual-band {
  height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--yellow);
  box-shadow: inset 0 0 18px rgba(255,255,255,.5), inset 0 -6px 10px rgba(0,0,0,.12);
}
.dual-card.turns .dual-band { background: var(--green); }
.dual-icon {
  width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.7);
}
.dual-icon svg { width: 78px; height: 78px; fill: #fff; stroke: #fff; }
.dual-name {
  font-size: 58px; font-weight: 900; color: var(--btn-text);
  text-shadow: 0 0 1px #000, 1px 1px 0 #6d6d6d, 0 2px 3px rgba(0,0,0,.35);
}
.dual-lines {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 26px; line-height: 1.25; color: var(--ink); padding: 0 24px;
}
.dual-lines span:last-child { font-weight: 700; color: var(--maroon); }

/* ---------- Match ---------- */
.dm-pause { position: absolute; left: 36px; top: 36px; width: 80px; height: 80px; z-index: 3; }
.dm-pause svg { width: 34px; height: 34px; fill: #8a8a8a; stroke: none; }

/* Player panels: P1 along the bottom; P2 is the same panel turned 180° along the top. */
.dm-panel {
  --pc: var(--green);
  position: absolute; left: 197px; bottom: 0; width: 800px; height: 186px;
  border-radius: 48px 48px 0 0; background: var(--pc); color: #fff;
  display: grid; grid-template-columns: 170px 1fr; align-items: center;
  padding: 12px 30px 8px 24px;
  opacity: .72;
  transition: opacity .25s, box-shadow .25s;
}
.dm-panel.p2 { --pc: var(--navy); top: 0; bottom: auto; transform: rotate(180deg); }
.dm-panel.active { opacity: 1; box-shadow: 0 0 0 6px var(--yellow), 0 -6px 28px rgba(233,171,46,.55); }

.dm-who { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dm-name { font-size: 28px; font-weight: 700; white-space: nowrap; }
.dm-score {
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--pc); font-size: 42px; font-weight: 900;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), 2px 3px 0 rgba(0,0,0,.3);
}
.dm-score.bump { animation: dm-bump .6s ease; }
@keyframes dm-bump { 40% { transform: scale(1.35); } }
.dm-pts { font-size: 16px; font-weight: 500; opacity: .9; letter-spacing: .5px; }

.dm-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; min-width: 0; }
.dm-msg { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; }
.dm-note { margin: 0; font-size: 20px; opacity: .92; }
.dm-msg:empty, .dm-note:empty { display: none; }
.dm-actions { display: flex; gap: 18px; margin-top: 8px; }
.dm-actions:empty { display: none; }
.dm-actions .pill { width: auto; min-width: 200px; height: 68px; padding: 0 30px; font-size: 32px; }
.dm-actions .pill.big { min-width: 300px; height: 78px; font-size: 42px; }
.pill.soft { background: var(--cream); color: var(--ink); text-shadow: none; }

.dm-badge {
  position: absolute; top: -26px; right: 44px;
  background: var(--yellow); color: var(--maroon); font-size: 26px; font-weight: 900;
  padding: 6px 22px; border-radius: 24px; border: 3px solid #fff;
  transform: rotate(-6deg); box-shadow: 2px 3px 0 rgba(0,0,0,.35);
  animation: dm-pop .5s ease both;
}
@keyframes dm-pop {
  from { transform: rotate(-6deg) scale(.3); opacity: 0; }
  60% { transform: rotate(-6deg) scale(1.15); opacity: 1; }
  to { transform: rotate(-6deg); }
}
.dm-badge[hidden] { display: none; }

/* Round + timer, once facing each player. */
.dm-side {
  position: absolute; top: 186px; width: 377px; height: 462px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.dm-side.left { left: 0; }
.dm-side.right { right: 0; transform: rotate(180deg); }
.dm-round {
  background: #fff; color: var(--maroon); font-size: 24px; font-weight: 700;
  padding: 8px 22px; border-radius: 24px; box-shadow: 2px 3px 0 rgba(0,0,0,.25);
}
.dm-mode { font-size: 18px; font-weight: 500; color: #8b7a55; letter-spacing: .5px; }
.dm-glass { display: block; width: 52px; height: 78px; margin-top: 6px; }
.dm-glass svg { width: 100%; height: 100%; display: block; }
.dm.running .dm-glass { animation: dm-flip 3s ease-in-out infinite; }
@keyframes dm-flip { 0%, 80% { transform: rotate(0); } 100% { transform: rotate(180deg); } }
.dm-time { font-size: 54px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.dm-time.low { color: var(--maroon); animation: pulse 1s ease-in-out infinite; }

/* Puzzle card in the middle. */
.dm-center { position: absolute; left: 377px; top: 205px; width: 440px; height: 424px; }
.dm-card {
  width: 100%; height: 100%; padding: 14px;
  background: #fff; border: 6px solid var(--yellow-dark); border-radius: 24px;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 5px 6px 0 rgba(0,0,0,.25);
}
.dm-card.answer { border-color: var(--green); }
.dm-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.dm-wait { display: flex; flex-direction: column; align-items: center; gap: 22px; font-size: 32px; font-weight: 700; color: #9b8a66; }
.dm-ribbon {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%); z-index: 2;
  background: var(--maroon); color: #fff; font-size: 26px; font-weight: 700; white-space: nowrap;
  padding: 8px 26px; border-radius: 24px; box-shadow: 2px 3px 0 rgba(0,0,0,.3);
}
.dm-ribbon:empty { display: none; }

/* Winner view (and "no puzzles" message) replaces the middle. */
.dm-win {
  position: absolute; left: 0; right: 0; top: 186px; height: 462px;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center;
}
.dm.is-over .dm-win, .dm.is-empty .dm-win { display: flex; }
.dm.is-over .dm-center, .dm.is-over .dm-side, .dm.is-over .dm-pause,
.dm.is-empty .dm-center, .dm.is-empty .dm-side, .dm.is-empty .dm-pause, .dm.is-empty .dm-panel { display: none; }
.dm.is-empty .dm-win { top: 0; height: 100%; gap: 22px; }

.dm-trophies { display: flex; gap: 10px; animation: pop .6s ease both; }
.dm-trophies svg { width: 104px; height: 104px; }
.dm-win-title { margin: 0; font-size: 56px; font-weight: 900; color: var(--maroon); }
.dm-final { display: flex; gap: 18px; }
.dm-chip { color: #fff; font-size: 26px; font-weight: 700; padding: 8px 24px; border-radius: 26px; background: var(--green); }
.dm-chip.p2 { background: var(--navy); }
.dm-warm { margin: 0; font-size: 26px; }
.dm-win-actions { display: flex; gap: 20px; margin-top: 6px; }
.dm-win-actions .pill.small { height: 68px; font-size: 30px; min-width: 190px; }
