/* 清台模式 and the online duel: the HUD changes, the mode tabs on the difficulty page, the duel button and the results panels. */

/* no timer, combo or goal bar while clearing the table; the duel bar replaces the score box */
#hud.pool #hud-timer, #hud.pool #hud-combo, #hud.pool #goal-bar { display: none !important; }
#hud.duel #hud-score { display: none !important; }

/* ---------------------------------------------------------------- duel bar (top, left of the pause button) */
#duel-bar { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); left: calc(8px + env(safe-area-inset-left, 0px)); right: 64px;
  display: flex; align-items: center; gap: 6px; pointer-events: none; }
#duel-bar.hidden { display: none; }
.duel-side { --c1: #ffb3d1; --c2: #ff6fa8; --cd: #c2457a; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 6px; border-radius: 18px; border: 3px solid #fff; color: #fff; font-weight: 900;
  background: radial-gradient(120% 70% at 50% 15%, rgba(255,255,255,.5), rgba(255,255,255,0) 60%), linear-gradient(var(--c1), var(--c2));
  box-shadow: 0 4px 0 var(--cd); opacity: .62; transform: scale(.93); filter: saturate(.55);
  transition: transform .25s cubic-bezier(.3,1.6,.5,1), opacity .2s, filter .2s; }
.duel-side.b { --c1: #b8dcff; --c2: #5aa2f5; --cd: #2f6fb8; }
.duel-side.on { opacity: 1; transform: scale(1); filter: none; animation: duelGlow 1.2s ease-in-out infinite; }
@keyframes duelGlow { 0%, 100% { box-shadow: 0 4px 0 var(--cd), 0 0 0 0 rgba(255,255,255,.0); } 50% { box-shadow: 0 4px 0 var(--cd), 0 0 0 4px rgba(255,255,255,.75); } }
.duel-side .dn { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: -1.5px -1.5px 0 var(--cd), 1.5px -1.5px 0 var(--cd), -1.5px 1.5px 0 var(--cd), 1.5px 1.5px 0 var(--cd); }
.duel-side .dn small { font-size: 11px; opacity: .95; }
.duel-side .dc { flex: 0 0 auto; font-size: 24px; line-height: 1;
  text-shadow: -2px -2px 0 var(--cd), 2px -2px 0 var(--cd), -2px 2px 0 var(--cd), 2px 2px 0 var(--cd), 0 3px 0 rgba(0,0,0,.2); }
.duel-side .dc.bump { animation: bump .35s cubic-bezier(.3,1.8,.5,1); }
.duel-side .turn { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: 0; }
.duel-side.on .turn { opacity: 1; animation: turnDot .8s ease-in-out infinite; }
@keyframes turnDot { 50% { transform: scale(1.5); } }
.duel-mid { flex: 0 0 auto; font-size: 13px; font-weight: 900; color: #fff; padding: 4px 8px; border-radius: 12px; background: rgba(194, 69, 122, .88);
  border: 2px solid #fff; white-space: nowrap; }

/* ---------------------------------------------------------------- difficulty page: mode tabs and the duel button */
.mode-tabs { display: flex; gap: 8px; }
.mode-tab { flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 8px;
  border-radius: 18px; border: 3px solid #ffd2e4; background: rgba(255,255,255,.75); color: #c2457a; cursor: pointer; outline: none;
  font-family: inherit; font-weight: 900; font-size: 16px; line-height: 1.1; transition: transform .12s cubic-bezier(.3,1.6,.5,1), filter .12s; }
.mode-tab img { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }
.mode-tab span { white-space: normal; text-align: center; font-size: 15px; line-height: 1.1; }
.mode-tab.on { border-color: #fff; color: #fff; background: linear-gradient(#ffb3d1, #ff6fa8); box-shadow: 0 4px 0 #c2457a;
  text-shadow: -1.5px -1.5px 0 #c2457a, 1.5px -1.5px 0 #c2457a, -1.5px 1.5px 0 #c2457a, 1.5px 1.5px 0 #c2457a; }
.mode-tab:hover, .mode-tab.focus { transform: scale(1.05); filter: brightness(1.05) drop-shadow(0 0 6px rgba(255,255,255,.95)); }
.mode-tab.pressed { animation: btnSquash 0.22s cubic-bezier(.3,1.6,.5,1); }
.pool-mode .diff-btn { min-height: 62px; padding: 6px 14px 8px; }
.pool-mode .diff-btn .dn { font-size: 21px; }

.diff-duel { --cd: #2f6fb8; position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 6px 14px; margin: 0;
  border: 4px solid #fff; border-radius: 26px; cursor: pointer; outline: none; color: #fff; text-align: left; font-family: inherit; font-weight: 900;
  background: radial-gradient(120% 60% at 50% 18%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%), linear-gradient(#b8dcff, #5aa2f5);
  box-shadow: 0 5px 0 var(--cd), inset 0 -6px 10px rgba(0,0,0,.08); transition: transform .12s cubic-bezier(.3,1.6,.5,1), filter .12s; }
.diff-duel img { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; }
.diff-duel .tx { display: flex; flex-direction: column; min-width: 0; }
.diff-duel .dt { font-size: 20px; line-height: 1.1;
  text-shadow: -2px -2px 0 var(--cd), 2px -2px 0 var(--cd), -2px 2px 0 var(--cd), 2px 2px 0 var(--cd), 0 3px 0 rgba(0,0,0,.2); }
.diff-duel .ds { font-size: 13px; line-height: 1.25; font-weight: 800;
  text-shadow: -1.5px -1.5px 0 var(--cd), 1.5px -1.5px 0 var(--cd), -1.5px 1.5px 0 var(--cd), 1.5px 1.5px 0 var(--cd); }
.diff-duel:hover, .diff-duel.focus { transform: scale(1.04); filter: brightness(1.06) drop-shadow(0 0 8px rgba(255,255,255,.95)); }
.diff-duel.pressed { animation: btnSquash 0.22s cubic-bezier(.3,1.6,.5,1); }

/* ---------------------------------------------------------------- results */
.pool-shots { font-size: 52px; line-height: 1; color: #fff; }
.pool-sub { font-size: 15px; font-weight: 800; color: var(--ink); }
.duel-res { font-size: 34px; line-height: 1.1; color: #fff; }
.duel-res.win { color: #fff4a8; }
.duel-vs { display: flex; align-items: stretch; gap: 8px; }
.duel-vs .side { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 20px;
  border: 3px solid #fff; color: #fff; font-weight: 900; background: linear-gradient(#ffb3d1, #ff6fa8); box-shadow: 0 4px 0 #c2457a; --cd: #c2457a; }
.duel-vs .side.b { background: linear-gradient(#b8dcff, #5aa2f5); box-shadow: 0 4px 0 #2f6fb8; --cd: #2f6fb8; }
.duel-vs .side.win { outline: 3px solid #ffe066; outline-offset: 2px; }
.duel-vs .nm { max-width: 100%; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: -1.5px -1.5px 0 var(--cd), 1.5px -1.5px 0 var(--cd), -1.5px 1.5px 0 var(--cd), 1.5px 1.5px 0 var(--cd); }
.duel-vs .n { font-size: 34px; line-height: 1;
  text-shadow: -2px -2px 0 var(--cd), 2px -2px 0 var(--cd), -2px 2px 0 var(--cd), 2px 2px 0 var(--cd), 0 3px 0 rgba(0,0,0,.2); }
.duel-vs .vs { align-self: center; font-size: 18px; font-weight: 900; color: #c2457a; }
.duel-reason { font-size: 14px; font-weight: 800; color: var(--ink); }
/* 「再來一次」 on the duel results */
.rematch-row { margin-bottom: 2px; }
.rematch-row .rematch-btn.off { filter: grayscale(.6) brightness(.95); opacity: .6; }
.rematch-row .rematch-btn.ask { animation: rematchAsk .9s ease-in-out infinite; }
@keyframes rematchAsk { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.rematch-line { min-height: 18px; font-size: 14px; font-weight: 800; color: var(--ink); text-align: center; margin: -2px 0 6px; }
.rematch-line.asked, .rematch-line.starting { color: #e0477f; }
