/* Dice and coin flipper */
.dz-coin-ico { width: 16px; height: 16px; border-radius: 50%; background: #f2a516; box-shadow: inset 0 0 0 2px #c98a1b; display: inline-block; }
.dz-tray { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(14px, 3vw, 34px); max-width: 100%; cursor: pointer; perspective: 900px; --sz: clamp(96px, 14vw, 170px); }
.dz-tray.dz-n4, .dz-tray.dz-n5, .dz-tray.dz-n6 { --sz: clamp(84px, 11vw, 140px); }
.dz-tray.is-coins.dz-n5, .dz-tray.is-coins.dz-n6, .dz-tray.is-coins.dz-n7, .dz-tray.is-coins.dz-n8, .dz-tray.is-coins.dz-n9, .dz-tray.is-coins.dz-n10 { --sz: clamp(70px, 8.5vw, 120px); }
body.presenting .dz-tray { --sz: min(24vh, 17vw); }
body.presenting .dz-tray.dz-n4, body.presenting .dz-tray.dz-n5, body.presenting .dz-tray.dz-n6 { --sz: min(22vh, 13vw); }
body.presenting .dz-tray.is-coins.dz-n5, body.presenting .dz-tray.is-coins.dz-n6, body.presenting .dz-tray.is-coins.dz-n7, body.presenting .dz-tray.is-coins.dz-n8, body.presenting .dz-tray.is-coins.dz-n9, body.presenting .dz-tray.is-coins.dz-n10 { --sz: min(19vh, 10vw); }
.dz-tray.idle > * { opacity: 0.35; }
.dz-die { --c: #e5484d; width: var(--sz); height: var(--sz); border-radius: 22%; background: linear-gradient(145deg, #fff, #eef0f4); border: 3px solid color-mix(in srgb, var(--c) 70%, #000); box-shadow: inset -6px -8px 0 color-mix(in srgb, var(--c) 18%, #dfe3ea), 0 14px 22px -10px rgba(14, 21, 37, 0.45); display: grid; place-items: center; position: relative; }
.dz-pips { width: 72%; height: 72%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; }
.dz-pips i { width: 62%; aspect-ratio: 1; border-radius: 50%; }
.dz-pips i.on { background: var(--c); box-shadow: inset 2px 3px 0 rgba(0, 0, 0, 0.25); }
.dz-poly { background: none; border: 0; box-shadow: none; border-radius: 0; filter: drop-shadow(0 14px 12px rgba(14, 21, 37, 0.35)); }
.dz-poly svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--c); stroke: color-mix(in srgb, var(--c) 60%, #000); stroke-width: 3; stroke-linejoin: round; }
.dz-poly b { position: relative; color: #fff; font-size: calc(var(--sz) * 0.36); font-weight: 800; letter-spacing: -0.04em; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); margin-top: 6%; }
.dz-poly small { position: absolute; bottom: 9%; color: rgba(255, 255, 255, 0.85); font-weight: 700; font-size: calc(var(--sz) * 0.1); }
.dz-die.rolling { animation: dz-tumble 0.18s linear infinite; animation-delay: calc(var(--i) * -40ms); }
.landed .dz-die { animation: dz-land 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) backwards; animation-delay: calc(var(--i) * 50ms); }
@keyframes dz-tumble { 0% { transform: rotate(-14deg) translateY(-6px) scale(0.96); } 50% { transform: rotate(12deg) translateY(4px) scale(1.03); } 100% { transform: rotate(-14deg) translateY(-6px) scale(0.96); } }
@keyframes dz-land { from { transform: scale(1.25) rotate(-10deg); } }
.dz-coin { width: var(--sz); height: var(--sz); position: relative; transform-style: preserve-3d; transition: transform 0.3s; }
.dz-coin.tails { transform: rotateY(180deg); }
.dz-coin.flipping { animation: dz-flip 1.1s cubic-bezier(0.25, 0.6, 0.3, 1) forwards; animation-delay: calc(var(--i) * 40ms); }
.dz-coin.flipping.tails { animation-name: dz-flip-t; }
@keyframes dz-flip { 0% { transform: translateY(0) rotateY(0); } 45% { transform: translateY(-40%) rotateY(1080deg); } 100% { transform: translateY(0) rotateY(1800deg); } }
@keyframes dz-flip-t { 0% { transform: translateY(0) rotateY(0); } 45% { transform: translateY(-40%) rotateY(1080deg); } 100% { transform: translateY(0) rotateY(1980deg); } }
.dz-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; align-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; color: #5a3a00; box-shadow: inset 0 0 0 calc(var(--sz) * 0.05) #d18f12, inset 0 0 0 calc(var(--sz) * 0.08) #ffd76a, 0 12px 20px -10px rgba(14, 21, 37, 0.5); }
.dz-heads { background: radial-gradient(circle at 35% 30%, #fff1b8, #f6c043 55%, #e0a01c); }
.dz-tails { background: radial-gradient(circle at 35% 30%, #f3f5f9, #c9d0dc 55%, #a4adbd); color: #2d3446; transform: rotateY(180deg); box-shadow: inset 0 0 0 calc(var(--sz) * 0.05) #8d97aa, inset 0 0 0 calc(var(--sz) * 0.08) #e6eaf1, 0 12px 20px -10px rgba(14, 21, 37, 0.5); }
.dz-face span { font-size: calc(var(--sz) * 0.36); line-height: 1; }
.dz-face b { font-size: calc(var(--sz) * 0.14); text-transform: uppercase; letter-spacing: 0.08em; }
.dz-total { font-size: clamp(1.6rem, 3.6vw, 2.8rem); font-weight: 750; letter-spacing: -0.03em; color: var(--accent-text); min-height: 1.2em; }
body.presenting .dz-total { font-size: min(7vh, 5vw); }
.dz-tally { display: grid; gap: 6px; }
.dz-bar { display: grid; grid-template-columns: 3.6em 1fr 2.4em; align-items: center; gap: 8px; font-size: 0.88rem; }
.dz-bar span { height: 10px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.dz-bar i { display: block; height: 100%; border-radius: 9px; background: var(--accent); transition: width 0.4s var(--ease); }
.dz-bar em { font-style: normal; text-align: right; font-weight: 650; }
@media (prefers-reduced-motion: reduce) { .dz-die.rolling, .landed .dz-die, .dz-coin.flipping { animation: none; } }

/* Raffle picker */
.rf-stage .stage-body { position: relative; overflow: hidden; }
.rf-prize { display: grid; gap: 2px; text-align: center; min-height: 3.2em; }
.rf-prize small { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rf-prize b { font-size: clamp(1.2rem, 2.6vw, 2rem); letter-spacing: -0.02em; }
.rf-ticket { --tk: var(--amber); position: relative; min-width: min(560px, 86%); padding: clamp(18px, 3vw, 34px) clamp(40px, 7vw, 90px); border-radius: 18px; color: #14110a; text-align: center;
  background: radial-gradient(circle at 0 50%, var(--surface) 0 22px, transparent 23px), radial-gradient(circle at 100% 50%, var(--surface) 0 22px, transparent 23px), linear-gradient(135deg, color-mix(in srgb, var(--tk) 85%, #fff), var(--tk));
  box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--tk) 70%, #000), inset 0 0 0 3px rgba(255, 255, 255, 0.4); }
.rf-ticket::before, .rf-ticket::after { content: ''; position: absolute; top: 14%; bottom: 14%; border-left: 3px dashed rgba(20, 17, 10, 0.3); }
.rf-ticket::before { left: 40px; } .rf-ticket::after { right: 40px; }
.rf-ticket-in { display: grid; gap: 2px; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 700; }
.rf-ticket-in small { font-size: clamp(0.9rem, 1.6vw, 1.3rem); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; opacity: 0.75; }
.rf-ticket-in b { font-size: clamp(3.6rem, 11vw, 8rem); line-height: 1; letter-spacing: -0.05em; font-weight: 800; }
.rf-ticket-in b.rf-name { font-size: clamp(2.4rem, 7vw, 5.5rem); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.rf-ticket.spinning { animation: rf-shake 0.12s linear infinite; }
.rf-ticket.spinning b { filter: blur(1px); opacity: 0.85; }
.rf-ticket.won { animation: rf-win 0.7s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes rf-shake { 50% { transform: rotate(-1.2deg) translateY(2px); } }
@keyframes rf-win { 0% { transform: scale(0.7) rotate(-4deg); } 100% { transform: none; } }
body.presenting .rf-ticket-in b { font-size: min(26vh, 18vw); }
body.presenting .rf-ticket-in b.rf-name { font-size: min(16vh, 10vw); }
body.presenting .rf-prize b { font-size: min(5vh, 3.4vw); }
.rf-winners { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 100%; }
.rf-winners li { --tk: var(--amber); display: grid; padding: 6px 14px; border-radius: 10px; background: color-mix(in srgb, var(--tk) 16%, var(--surface)); border: 2px solid var(--tk); text-align: left; animation: land 0.4s var(--ease); }
.rf-winners li span { font-size: 0.72rem; color: var(--muted); font-weight: 650; }
.rf-winners li b { font-size: 1.05rem; }
.rf-col::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--k); margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.rf-confetti { position: absolute; inset: 0; pointer-events: none; }
.rf-confetti i { position: absolute; top: 40%; width: 10px; height: 16px; background: var(--c); border-radius: 2px; animation: rf-fall var(--d) cubic-bezier(0.2, 0.6, 0.4, 1) forwards; }
@keyframes rf-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 30% { transform: translate(calc(var(--x) * 2px), -180px) rotate(calc(var(--r) / 2)); } 100% { transform: translate(calc(var(--x) * 4px), 360px) rotate(var(--r)); opacity: 0; } }

/* Fixture generator */
.fx-now { gap: 18px; width: 100%; }
.fx-when { display: grid; gap: 2px; }
.fx-when b { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.fx-when span { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.fx-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; width: 100%; max-width: 980px; }
.fx-game { border-radius: 16px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--border); border-top: 6px solid #2fa66a; box-shadow: var(--shadow); display: grid; gap: 10px; }
.fx-game small { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #1f7a4c; }
.fx-vs { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.fx-vs em { font-style: normal; font-weight: 800; color: var(--muted); }
.fx-vs .fx-team { font-size: clamp(1.1rem, 2vw, 1.5rem); padding: 6px 14px; }
.fx-team { --tc: var(--accent); display: inline-flex; align-items: center; gap: 8px; font-weight: 700; border-radius: 99px; padding: 3px 10px; background: color-mix(in srgb, var(--tc) 13%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--tc) 55%, var(--border)); white-space: nowrap; }
.fx-team i { width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--tc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.fx-rest, .fx-rest-sm { color: var(--muted); margin: 0; }
.fx-rest { font-size: 1.05rem; }
.fx-empty { color: var(--muted); font-size: 1.2rem; }
body.presenting .fx-when b { font-size: min(11vh, 7vw); }
body.presenting .fx-games { max-width: 94vw; gap: 2vh 1.6vw; }
body.presenting .fx-game { padding: 2vh 1.6vw; }
body.presenting .fx-game small { font-size: min(2.6vh, 1.6vw); }
body.presenting .fx-vs .fx-team { font-size: min(4.6vh, 2.6vw); }
body.presenting .fx-rest { font-size: min(3.2vh, 2vw); }
.fx-quick { align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.fx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fx-grid .field, .panel > label.field { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.fx-all { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; margin-top: 28px; align-items: start; }
.fx-list-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fx-all h2 { font-size: 1.3rem; margin: 0 0 12px; }
.fx-slot { display: grid; grid-template-columns: 92px 1fr; gap: 6px 14px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 10px; }
.fx-slot.current { border-color: #2fa66a; box-shadow: 0 0 0 3px color-mix(in srgb, #2fa66a 25%, transparent); }
.fx-slot-time { display: grid; align-content: start; text-align: left; border: 0; background: none; cursor: pointer; font: inherit; color: var(--text); padding: 2px; }
.fx-slot-time b { font-size: 1.3rem; }
.fx-slot-time span { font-size: 0.75rem; color: var(--muted); font-weight: 650; }
.fx-slot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fx-slot li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 46px auto 46px minmax(0, 1fr); align-items: center; gap: 6px; }
.fx-slot li small { color: var(--muted); font-size: 0.75rem; font-weight: 650; }
.fx-slot li .fx-team { overflow: hidden; text-overflow: ellipsis; justify-self: start; max-width: 100%; }
.fx-slot li .fx-team:last-child { justify-self: start; }
.fx-slot li input { width: 46px; text-align: center; padding: 6px 2px; font-weight: 700; }
.fx-rest-sm { grid-column: 2; font-size: 0.8rem; }
.fx-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.fx-table th, .fx-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.fx-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); }
.fx-table td:nth-child(2), .fx-table th:nth-child(2) { text-align: left; }
.fx-table tbody tr:first-child td { background: color-mix(in srgb, #f2a516 12%, var(--surface)); }
@media (max-width: 900px) { .fx-all { grid-template-columns: 1fr; } .fx-slot { grid-template-columns: 1fr; } .fx-rest-sm { grid-column: 1; } .fx-slot li { grid-template-columns: minmax(0, 1fr) 40px auto 40px minmax(0, 1fr); } .fx-slot li small { display: none; } }
@media print {
  body:has(.fx-all) * { visibility: hidden; }
  body:has(.fx-all) .fx-all, body:has(.fx-all) .fx-all * { visibility: visible; }
  .fx-all { position: absolute; left: 0; top: 0; width: 100%; grid-template-columns: 1fr; }
  .fx-slot { break-inside: avoid; }
  .fx-slot li input { border: 1px solid #999; }
}
.stage-bar .segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.stage-bar .segmented svg { width: 18px; height: 18px; }
.stage-bar .status { white-space: nowrap; }
