/* Tournament sign-up dialog on the front page (public/js/tournament-dialog.js fills it; proposal F
   on /proposals/tournament-dialog). Left: the game (its icon box from the game bars, title font and
   background pattern) with the countdown ring. Right: the tournament in the intermission's colours. */

.td-dialog { border: 0; padding: 46px 30px 24px; margin: auto; background: none; overflow: auto; width: 880px; max-width: 100vw; max-height: 100dvh; box-sizing: border-box;
    opacity: 0; transition: opacity .2s ease, display .2s allow-discrete, overlay .2s allow-discrete; }
.td-dialog[open] { opacity: 1; display: flex; justify-content: center; }
.td-dialog::backdrop { background-color: transparent; transition: background-color .2s ease, display .2s allow-discrete, overlay .2s allow-discrete; }
.td-dialog[open]::backdrop { background-color: rgba(0, 0, 0, .35); }
/* Unfolds in ~200 ms (and folds away the same way); the icon pops in just after. */
.td-dialog .td-frame { scale: .92; transition: scale .2s cubic-bezier(.2, .9, .3, 1.2); }
.td-dialog[open] .td-frame { scale: 1; }
.td-dialog .td-badge { transition: scale .22s cubic-bezier(.2, .9, .3, 1.5) .06s, rotate .22s ease .06s; }
@starting-style {
    .td-dialog[open] { opacity: 0; }
    .td-dialog[open] .td-frame { scale: .92; }
    .td-dialog[open] .td-badge { scale: .5; rotate: -12deg; }
    .td-dialog[open]::backdrop { background-color: transparent; }
}
@media (max-width: 600px) { .td-dialog { padding: 46px 8px 16px; } }

.td-frame { position: relative; width: min(820px, 100%); container-type: inline-size; text-align: left; font-family: Poppins, sans-serif; color: #fff;
    interpolate-size: allow-keywords; --gd: #3f5f00; }
.td-frame[data-game="block-champ"] { --gd: #6d3c1b; }
.td-frame[data-game="lollipop"] { --gd: #7a0f47; }
/* No overflow clipping: the rules box may float out over the card's edge. The two halves round their own corners. */
.td-card { position: relative; display: grid; grid-template-columns: 1fr; border-radius: 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, .32), 0 2px 6px rgba(0, 0, 0, .18); }
@container (min-width: 640px) { .td-card { grid-template-columns: 1fr 1.1fr; } .td-left { border-radius: 18px 0 0 18px; } .td-right { border-radius: 0 18px 18px 0; } }

/* The icon box of the game bars at about 3/4 size, over the top-left corner. */
.td-badge { position: absolute; top: -24px; left: -18px; width: 104px; height: 104px; z-index: 3; pointer-events: none; scale: .76; transform-origin: 0 0; }
/* Block Champ's bar is the second one, laid out right to left: the lion sits to the right in its box there. */
.td-frame[data-game="block-champ"] .td-badge .game-icon-borderbox { direction: rtl; }
.td-frame[data-game="block-champ"] .td-badge img { translate: 13px -1px; } /* the mane inside the box, as on the game bar */
.td-x { position: absolute; top: 10px; right: 10px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; background: rgba(0, 0, 0, .28); color: #fff;
    cursor: pointer; display: grid; place-items: center; }
.td-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.td-frame svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.td-shadow { text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }

/* ---- left: the game ---- */
.td-left { position: relative; border-radius: 18px 18px 0 0; padding: 26px 22px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.td-left::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .32)); pointer-events: none; }
.td-left > * { position: relative; }
.td-head { width: 100%; box-sizing: border-box; padding: 0 34px; }
.td-frame .td-game { margin: 0; line-height: 1.15; text-align: center; }
.td-pill { display: inline-block; margin-top: 10px; padding: 5px 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; font: 800 11px Poppins, sans-serif;
    letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.td-name { font: 800 1.3rem/1.2 Poppins, sans-serif; margin: 14px 0 0; overflow-wrap: anywhere; color: #fff; }
.td-ring { position: relative; width: 176px; height: 176px; margin: 16px auto 14px; }
.td-ring svg { width: 100%; height: 100%; rotate: -90deg; overflow: visible; }
.td-ring .trk { fill: rgba(0, 0, 0, .22); stroke: rgba(255, 255, 255, .25); stroke-width: 9; }
.td-ring .prg { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)); transition: stroke-dasharray 1s linear; }
.td-ring.soon .prg { stroke: #ffd700; filter: drop-shadow(0 0 8px rgba(255, 215, 0, .8)); } /* the last five minutes */
.td-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.td-ring-in small { font: 600 11.5px Poppins, sans-serif; opacity: .92; }
.td-ring-in b { font: 800 1.5rem/1.1 Poppins, sans-serif; font-variant-numeric: tabular-nums; }
.td-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; justify-items: center; font: 600 13.5px Poppins, sans-serif; }
.td-facts li { display: flex; align-items: center; justify-content: center; gap: 9px; }
.td-facts img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff; }
.td-cta-wrap { width: 100%; padding-top: 18px; } /* right under the facts, not at the bottom */
.td-cta { display: block; width: 100%; border: 0; border-radius: 999px; padding: 14px 20px; font: 800 16px Poppins, sans-serif; cursor: pointer; text-align: center; text-decoration: none;
    background: #fff; color: var(--gd); box-shadow: 0 6px 16px rgba(0, 0, 0, .28); transition: transform .15s ease, box-shadow .15s ease; box-sizing: border-box; }
.td-cta:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(0, 0, 0, .32); }
.td-cta:disabled { opacity: .7; cursor: default; transform: none; }
.td-joined { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px; border-radius: 999px; font: 700 15px Poppins, sans-serif;
    background: rgba(255, 255, 255, .92); color: #1d7a3a; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.td-joined button { border: 0; background: none; color: inherit; text-decoration: underline; font: 600 12.5px Poppins, sans-serif; opacity: .8; cursor: pointer; padding: 0; }
.td-joined + .td-cta { margin-top: 10px; }
.td-note { margin: 8px 0 0; font: 600 12.5px Poppins, sans-serif; }
.td-follow { display: inline-block; margin-top: 10px; color: #fff; font: 700 13px Poppins, sans-serif; text-decoration: none; opacity: .9; }
.td-follow:hover { text-decoration: underline; }
.td-full + .td-cta { margin-top: 10px; }
.td-full { margin: 0; font: 700 14px Poppins, sans-serif; opacity: .9; }

/* ---- right: the tournament ---- */
.td-right { background: linear-gradient(180deg, #2d1233, #1a0a1f); padding: 22px; min-width: 0; border-radius: 0 0 18px 18px; }
.td-label { font: 700 11px Poppins, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin: 20px 0 8px; }
.td-right > .td-label:first-child { margin-top: 0; }
.td-box { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: 12px 14px; }
/* The rules fold out over what is below them, with the game bars' elastic spring (style.css .gamebar-unfolded), and fold
   back without a bounce, with the game bars' own easing (.gamebar: cubic-bezier(.075, .82, .165, 1));
   a few pixels wider than the column, floating on a shadow. Like the bars: a CSS transition of the height between
   --closed and --open (measured in tournament-dialog.js); the details element is always open, .is-open folds it. */
.td-fold-slot { position: relative; z-index: 4; }
.td-fold.td-box { position: absolute; top: 0; left: 0; right: 0; box-sizing: border-box; height: var(--closed, auto); overflow: hidden; background: #3a203f; border-color: rgba(255, 255, 255, .1);
    --spring: linear(0, 0.009 0.7%, 0.041 1.5%, 0.157 3.1%, 0.807 8.9%, 1.039 11.4%, 1.182 13.8%, 1.223 15%, 1.247 16.3%, 1.251 17.8%, 1.231 19.5%, 1 28.2%, 0.957 30.8%, 0.938 33.5%, 0.942 36.8%, 1 45.4%, 1.015 50.5%, 0.996 67.4%, 1);
    --ease: cubic-bezier(.075, .82, .165, 1);
    transition: height .3s var(--ease), left .3s var(--ease), right .3s var(--ease), padding .3s var(--ease), box-shadow .3s ease, border-color .3s ease; }
/* Wider by 7 px each side, and padded by as much more: the text keeps its width and does not move. */
.td-fold.td-box.is-open { height: var(--open, auto); left: -7px; right: -7px; padding-left: 21px; padding-right: 21px; border-color: rgba(255, 255, 255, .2);
    transition: height .7s var(--spring), left .7s var(--spring), right .7s var(--spring), padding .7s var(--spring), box-shadow .3s ease, border-color .3s ease;
    box-shadow: 0 22px 44px rgba(0, 0, 0, .65), 0 6px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 45, 120, .25), 0 0 24px rgba(255, 45, 120, .18); }
.td-fold > summary { list-style: none; cursor: pointer; }
.td-fold > summary::-webkit-details-marker { display: none; }
.td-format { display: flex; gap: 14px; align-items: center; }
.td-format svg { width: 104px; height: 56px; flex: none; }
.td-format p { margin: 0; font-size: 13px; opacity: .9; }
.td-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font: 700 12.5px Poppins, sans-serif; color: #ff8fb8; }
.td-more::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate .2s ease, translate .2s ease; }
.td-fold.is-open .td-more::after { rotate: 225deg; translate: 0 2px; }
.td-fold.is-open .td-more .closed, .td-fold:not(.is-open) .td-more .open { display: none; }
.td-dg path { stroke: rgba(255, 255, 255, .45); stroke-width: 2; fill: none; }
.td-dg circle { fill: #ff5a9d; }
.td-dg .win { fill: #ffd700; }
.td-rules { margin: 10px 0 0; padding: 0 0 0 18px; font-size: 13px; line-height: 1.5; }
.td-rules li { margin: 3px 0; opacity: .9; }
.td-rules li.sched { list-style: none; margin: 8px 0 0 -18px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 215, 0, .08); border: 1px solid rgba(255, 215, 0, .18); opacity: 1; }
.td-rules b { color: #ffd700; }
.td-host { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; width: fit-content; }
.td-host:hover b { text-decoration: underline; }
.td-who { color: inherit; text-decoration: none; }
.td-who:hover { text-decoration: underline; }
.td-host + .td-msg { margin-top: 8px; }
.td-host img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.td-host b { font-size: 13px; color: #ff8fb8; }
.td-host span { font-size: 12px; opacity: .6; }
.td-msg { margin: 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.td-seathead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 10px; font: 700 13px Poppins, sans-serif; }
.td-seathead span { font-weight: 600; font-size: 12px; opacity: .65; }
.td-seathead span.few { opacity: 1; color: #ffd700; }
.td-seats { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 7px; }
.td-seat { display: block; width: 34px; height: 34px; border-radius: 50%; outline: none; }
.td-seat img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #3d1a45; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.td-seat.you img { box-shadow: 0 0 0 2px #ff2d78, 0 0 12px rgba(255, 45, 120, .7); }
.td-seat:hover img, .td-seat:focus-visible img { box-shadow: 0 0 0 2px #ffd700; }
.td-seat.free { box-sizing: border-box; border: 2px dashed rgba(255, 255, 255, .25); }
.td-seat-more { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .12); font: 700 11px Poppins, sans-serif; }
.td-names { margin: 10px 0 0; font-size: 12px; opacity: .7; overflow-wrap: anywhere; }
.td-names b { font-weight: 600; }
/* A name over a picture (hover, or a tap on a phone). Outside the card, so it is never cut off. */
.td-tip { position: absolute; z-index: 6; translate: -50% calc(-100% - 8px); padding: 4px 10px; border-radius: 8px; background: #fff; color: #1a0a1f; font: 700 12px Poppins, sans-serif;
    white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.td-tip.show { opacity: 1; }
.td-tip::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; translate: -50% 0; rotate: 45deg; border-radius: 2px; }

/* A phone: the icon stays on screen and the headings move right of it. */
@container (max-width: 520px) {
    .td-badge { top: -30px; left: -2px; }
    .td-head { padding-left: 70px; padding-right: 40px; }
    .td-format svg { width: 76px; height: 42px; }
    .td-seats { gap: 6px; }
}
