/* Coinflip – dodatki do style.css */

.arena-panel { display: flex; flex-direction: column; }
.arena-panel[data-state="flip"] .timer-value { color: var(--gold); }
.arena-panel[data-state="idle"] .timer-value { color: var(--dim); }
.arena-panel[data-state="result"] .timer-value { color: var(--gold); }
.arena-panel[data-state="flip"] #progress-bar,
.arena-panel[data-state="result"] #progress-bar { background: var(--gold); }

.arena { flex: 1; display: grid; grid-template-columns: 1fr 220px 1fr; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 12px 10px; }

/* gracze po bokach */
.fighter { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: opacity .4s, transform .4s; }
.fighter .head { box-shadow: 0 0 0 3px var(--c); }
.fighter-name { font-family: var(--display); font-size: 28px; line-height: 1.05; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fighter-amt { font-size: 14px; color: var(--muted); }
.fighter-tag { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.fighter.empty .head-ph { width: 84px; height: 84px; border: 2px dashed var(--line-2); border-radius: 3px; display: grid; place-items: center;
  font-family: var(--display); font-size: 40px; color: var(--dim); }
.fighter.empty .fighter-name { color: var(--dim); font-size: 22px; }
.fighter.won .head { box-shadow: 0 0 0 4px var(--gold); }
.fighter.won .fighter-name { color: var(--gold); }
.fighter.won .fighter-tag { color: var(--gold); }
.fighter.lost { opacity: .35; transform: scale(.94); }

/* moneta */
.coin-zone { position: relative; display: grid; place-items: center; height: 160px; }
.coin-toss { width: 128px; height: 128px; perspective: 900px; }
.coin-toss.tossing { animation: toss var(--toss, 6s) cubic-bezier(.3,.6,.3,1) forwards; }
@keyframes toss { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-34px) scale(1.12); } 100% { transform: translateY(0) scale(1); } }
.coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #2b332d 0 58%, #1b211d 59% 100%);
  box-shadow: inset 0 0 0 7px var(--c, var(--line-2)), inset 0 0 0 11px #0e110f, 0 0 0 3px #b8912f; }
.face.back { transform: rotateY(180deg); }
.face .head { border-radius: 4px; }
.face .q { font-family: var(--display); font-size: 54px; color: var(--dim); }
.coin-shadow { position: absolute; bottom: 4px; left: 50%; width: 110px; height: 12px; margin-left: -55px; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(4px); }
.vs { font-family: var(--display); font-size: 22px; color: var(--dim); }

.arena-note { margin-top: 10px; min-height: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.arena-note b { color: var(--text); }
.arena-note .gold { color: var(--gold); font-weight: 700; }

/* otwarte pojedynki */
.duel-list { flex: 1; min-height: 0; max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.duel { display: grid; grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 7px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.duel:last-child { border-bottom: 0; }
.duel-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-hint { font-size: 12px; color: var(--muted); }
.duel-hint b { color: var(--green); font-weight: 600; }
.duel-amt { font-weight: 700; font-size: 16px; text-align: right; }
.duel-left { display: block; font-size: 11px; font-weight: 400; color: var(--dim); }
.duel-bar { grid-column: 1 / -1; height: 3px; background: var(--s3); border-radius: 2px; overflow: hidden; }
.duel-bar::before { content: ""; display: block; height: 100%; width: var(--w, 100%); background: var(--c); transition: width .25s linear; }
.duel.live .duel-hint { color: var(--gold); }
.duel.live .duel-bar::before { background: var(--gold); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .4; } to { opacity: 1; } }

.history .vs-cell { color: var(--muted); }
.history .vs-cell .who { font-weight: 400; }

@media (max-width: 980px) {
  .arena { grid-template-columns: 1fr 140px 1fr; }
  .coin-toss { width: 110px; height: 110px; }
  .fighter-name { font-size: 20px; }
}
