:root {
    /* how visible the logo art itself is on the intermission screen: 1 = solid, 0 = only the running lights */
    --logo-art-opacity: 0.7;
    /* soft glow around the whole logo shape on the intermission screen: 0 = off, around .25 = subtle */
    --logo-glow: 0.25;
    --black: #070707;
    --ink: #121008;
    --gold: #d4af37;
    --gold-light: #f6e27a;
    --gold-dark: #8a6d1d;
    --cream: #f3e9c8;
    --gold-grad: linear-gradient(180deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
    --display: "Cinzel", "Trajan Pro", Georgia, serif;
    --body: "Josefin Sans", "Century Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: var(--body);
    color: var(--cream);
    background-color: var(--black);
    /* art-deco sunburst fanning out from the top, over a soft golden glow */
    background-image:
        radial-gradient(ellipse 70% 45% at 50% 0%, rgba(212, 175, 55, .28), transparent 70%),
        repeating-conic-gradient(from 0deg at 50% -10%, rgba(212, 175, 55, .07) 0deg 4deg, transparent 4deg 12deg),
        radial-gradient(ellipse at 50% 120%, rgba(212, 175, 55, .10), transparent 60%);
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
}

h1:focus { outline: none; }

/* ---------- page frame ---------- */

.stage {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
    padding: 1.2rem 1rem 2rem;
    text-align: center;
}

.brand {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: .3em;
    text-wrap: balance;
    text-transform: uppercase;
    font-size: clamp(.75rem, 2.4vw, 1.1rem);
    color: var(--gold);
}
.orn {
    display: inline-block;
    width: 3.4em; height: 1.45em;
    margin: 0 1em;
    vertical-align: middle;
    background: var(--gold-grad);
    -webkit-mask: url("/img/xxx.svg") center / contain no-repeat;
    mask: url("/img/xxx.svg") center / contain no-repeat;
}

.kicker {
    font-family: var(--display);
    letter-spacing: .3em;
    text-transform: uppercase;
    font-size: clamp(.7rem, 2vw, 1rem);
    color: var(--gold);
}

.vote-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.6rem, 6vw, 3.4rem);
    line-height: 1.1;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
}

.hint { margin: 0; font-weight: 300; letter-spacing: .12em; color: rgba(243, 233, 200, .7); max-width: 34rem; }

/* ---------- timer ---------- */

.timer {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2rem, 9vw, 3.6rem);
    letter-spacing: .12em;
    color: var(--gold-light);
    text-shadow: 0 0 22px rgba(212, 175, 55, .55);
    font-variant-numeric: tabular-nums;
}
.timer.huge { font-size: clamp(3rem, 9vw, 6.5rem); line-height: 1; }

.timebar {
    width: min(90vw, 30rem);
    height: 4px;
    background: rgba(212, 175, 55, .18);
}
.timebar span { display: block; height: 100%; background: var(--gold-grad); transition: width .3s linear; }

/* ---------- idle / intermission ---------- */

.idle {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    max-width: 52rem;
}
.idle .vote-title { font-size: clamp(1.8rem, 6vw, 4rem); }

.emblem {
    width: clamp(7rem, 22vw, 11rem);
    aspect-ratio: 126.7 / 123.3;
    background: var(--gold-grad);
    -webkit-mask: url("/img/vyrostci.svg") center / contain no-repeat;
    mask: url("/img/vyrostci.svg") center / contain no-repeat;
}
/* the mask clips shadows, so the glow lives on a wrapper filter */
.idle .emblem { filter: drop-shadow(0 0 18px rgba(212, 175, 55, .5)); animation: breathe 3.5s ease-in-out infinite; }

@keyframes breathe {
    50% { filter: drop-shadow(0 0 34px rgba(246, 226, 122, .85)); }
}


/* ---------- voting pad ---------- */

.vote { display: flex; flex-direction: column; align-items: center; gap: .8rem; width: 100%; }

.pad {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(.6rem, 2.4vw, 1.2rem);
    width: min(94vw, max(20rem, calc(100dvh - 19rem)), 44rem);
    margin-top: .4rem;
}

.candidate {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid var(--gold);
    background: #000;
    overflow: hidden;
    cursor: pointer;
    color: inherit;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: inset 0 0 0 5px #000, inset 0 0 0 6px var(--gold-dark), 0 6px 24px rgba(0, 0, 0, .6);
    transition: transform .08s ease, filter .08s ease, box-shadow .2s ease;
}
.candidate img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.candidate:hover { box-shadow: inset 0 0 0 5px #000, inset 0 0 0 6px var(--gold), 0 0 30px rgba(212, 175, 55, .55); }
.candidate:active { transform: scale(.95); filter: brightness(1.35); }

.candidate .name {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.6rem .4rem .8rem;
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: clamp(.8rem, 2.8vw, 1.15rem);
    color: var(--gold-light);
    background: linear-gradient(transparent, rgba(0, 0, 0, .9));
}

.candidate .mine {
    position: absolute; top: .55rem; right: .55rem;
    min-width: 2.1rem; padding: .1rem .5rem;
    font-family: var(--display);
    font-weight: 800;
    color: #000;
    background: var(--gold-grad);
}

/* ---------- results chart ---------- */

.results .vote-title { font-size: clamp(1.8rem, 5vw, 4rem); }

.chart {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(.6rem, 3vw, 3rem);
    width: min(96vw, 90rem);
    flex: 1;
    margin-top: .6rem;
}

.col { display: flex; flex-direction: column; align-items: center; gap: .7rem; min-width: 0; }

.track {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 12rem;
    border-bottom: 2px solid var(--gold);
}

.bar {
    position: absolute; left: 12%; right: 12%; bottom: 0;
    height: calc(var(--h) * 1%);
    min-height: 3px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold) 35%, var(--gold-light) 50%, var(--gold) 65%, var(--gold-dark));
    box-shadow: 0 0 18px rgba(212, 175, 55, .25);
    transition: height .35s cubic-bezier(.2, .8, .2, 1);
}

.count {
    position: absolute; left: 0; right: 0;
    bottom: calc(var(--h) * 1% + .5rem);
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.4rem, 4.5vw, 3.2rem);
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
    transition: bottom .35s cubic-bezier(.2, .8, .2, 1);
}

.avatar {
    width: min(100%, 9rem);
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid var(--gold);
    box-shadow: inset 0 0 0 3px #000, 0 0 0 3px #000, 0 0 0 4px var(--gold-dark);
}

.cname {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-size: clamp(.7rem, 1.8vw, 1.3rem);
    color: var(--cream);
}

.col.leader .bar { box-shadow: 0 0 40px rgba(246, 226, 122, .75); filter: brightness(1.15); }
.col.leader .cname { color: var(--gold-light); }

/* ---------- control ---------- */

.control { gap: 1.2rem; }

.panel {
    width: min(94vw, 40rem);
    padding: 1.4rem 1.2rem;
    display: flex; flex-direction: column; align-items: center; gap: .9rem;
    background: rgba(0, 0, 0, .65);
    border: 1px solid var(--gold);
    box-shadow: inset 0 0 0 5px #000, inset 0 0 0 6px var(--gold-dark);
}
.panel .vote-title { font-size: clamp(1.4rem, 5vw, 2.4rem); }

.btn {
    font-family: var(--display);
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-size: 1rem;
    padding: .8rem 1.6rem;
    color: #000;
    background: var(--gold-grad);
    border: 0;
    cursor: pointer;
    touch-action: manipulation;
    transition: filter .15s, transform .08s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.big { font-size: 1.5rem; padding: 1.1rem 2.6rem; }
.btn.big { max-width: 100%; }
@media (max-width: 480px) { .btn.big { font-size: 1.1rem; letter-spacing: .12em; padding: 1.1rem 1rem; } }
.btn.small { font-size: .75rem; padding: .5rem .9rem; }
.btn.danger { background: none; color: #e8836f; border: 1px solid #e8836f; }

.list { align-items: stretch; gap: 0; padding: .6rem 1.2rem; }

.row {
    display: grid;
    grid-template-columns: 1.6rem 1fr auto auto;
    align-items: center;
    gap: .8rem;
    padding: .7rem 0;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 55, .2);
}
.row:last-child { border-bottom: 0; }
.row .num { font-family: var(--display); color: var(--gold); font-weight: 800; }
.row .state { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(243, 233, 200, .55); }
.row.running .state { color: var(--gold-light); }
.row.running .rtitle { color: var(--gold-light); }
.row.done .rtitle { opacity: .6; }
.row.current { background: rgba(212, 175, 55, .14); box-shadow: inset 3px 0 0 var(--gold); }
.row .num { text-align: center; }
.row .sub { display: block; font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(243, 233, 200, .45); }
.row .actions { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; width: 11.5rem; }
.btn.danger.confirm { background: #e8836f; color: #000; }
.panel-tools { align-self: stretch; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }

/* the "own vote" dialog on the control page */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; padding: 1rem; overflow: auto; background: rgba(0, 0, 0, .8); }
.dialog { margin: auto; background: #070707; }
.dialog label {
    align-self: stretch;
    display: flex; flex-direction: column; gap: .3rem;
    text-align: left;
    font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.dialog input {
    font-family: var(--body);
    font-size: 1.1rem;
    padding: .6rem .7rem;
    color: var(--cream);
    background: #121008;
    border: 1px solid var(--gold-dark);
}
.dialog input:focus { outline: 2px solid var(--gold-light); }

@media (max-width: 560px) {
    .row { grid-template-columns: 1.6rem 1fr auto; }
    .row .actions { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; width: auto; }
}

/* ---------- error / reconnect bits ---------- */

#blazor-error-ui { background: #2b0d0d; color: var(--cream); }
#blazor-error-ui a { color: var(--gold); }

@media (max-width: 560px) {
    .chart { gap: .4rem; }
    .bar { left: 8%; right: 8%; }
    .avatar { border-width: 1px; }
}

/* ---------- results: note shown only while the browser blocks sound (created by sound.js) ---------- */

.sound-hint {
    position: fixed;
    right: .8rem; bottom: .8rem;
    z-index: 10;
    font-family: var(--body);
    font-size: .7rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(0, 0, 0, .6);
    border: 1px solid var(--gold-dark);
    padding: .4rem .8rem;
    opacity: .7;
    pointer-events: none;
}

/* ---------- finale: winner on show ---------- */

.finale {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    overflow: hidden;
}

/* slowly turning rays behind the winner */
.spotlight {
    position: absolute;
    left: 50%; top: 40%;
    width: 160vmax; height: 160vmax;
    margin: -80vmax 0 0 -80vmax;
    background: repeating-conic-gradient(rgba(246, 226, 122, .15) 0 6deg, transparent 6deg 18deg);
    -webkit-mask-image: radial-gradient(circle, #000, transparent 32%);
    mask-image: radial-gradient(circle, #000, transparent 32%);
    animation: spin 50s linear infinite;
    pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.confetti span {
    position: absolute;
    top: -6%;
    height: 1rem;
    opacity: 0;
    animation: confetti var(--t) linear calc(1.8s + var(--delay)) infinite backwards;
}
@keyframes confetti {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    6%   { opacity: 1; }
    100% { transform: translateY(115vh) rotate(720deg); opacity: 1; }
}

.winners {
    position: relative; z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 4vw, 4rem);
}

.winner-card {
    position: relative;
    margin: 0;
    display: flex; flex-direction: column; align-items: center; gap: .3rem;
    animation: reveal 1.1s cubic-bezier(.2, 1.3, .3, 1) 1.4s backwards;
}
@keyframes reveal {
    from { transform: scale(.15) rotate(-8deg); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.winner-card img {
    display: block;
    width: clamp(9rem, min(calc(100dvh - 33rem), 80vw), 36rem);
    aspect-ratio: 1;
    object-fit: cover;
    border: 3px solid var(--gold);
    box-shadow: inset 0 0 0 6px #000, inset 0 0 0 7px var(--gold-dark), 0 0 70px rgba(246, 226, 122, .6);
}
.winners.n2 .winner-card img { width: clamp(8rem, min(calc(100dvh - 36rem), 38vw), 26rem); }
.winners.n3 .winner-card img,
.winners.n4 .winner-card img { width: clamp(6rem, min(calc(100dvh - 38rem), 24vw), 20rem); }

.crown {
    position: absolute;
    top: -1.9rem;
    z-index: 3;
    font-size: 3.2rem;
    line-height: 1;
    color: var(--gold-light);
    text-shadow: 0 0 24px rgba(246, 226, 122, .9);
    animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-.4rem); } }

.wname {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.3rem, 3.5vw, 2.4rem);
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.wcount { font-family: var(--display); font-size: clamp(1rem, 2.5vw, 1.6rem); color: var(--gold-light); letter-spacing: .15em; text-transform: uppercase; }

.runners {
    position: relative; z-index: 1;
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 4vw, 4rem);
    padding-bottom: .5rem;
    animation: fade-up .8s ease 2.3s backwards;
}
@keyframes fade-up { from { transform: translateY(1.5rem); opacity: 0; } }

.runner { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.runner img {
    width: clamp(4rem, 10vh, 7rem);
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid var(--gold-dark);
    box-shadow: inset 0 0 0 3px #000;
}
.rname { font-family: var(--display); font-weight: 600; font-size: clamp(.7rem, 1.8vw, 1.2rem); letter-spacing: .1em; text-transform: uppercase; color: var(--cream); }
.rcount { font-size: clamp(.8rem, 1.8vw, 1.1rem); letter-spacing: .12em; color: var(--gold); }

/* ---------- category intro: the nominees ---------- */

.nominees {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(.8rem, 3vw, 2.5rem);
    width: min(94vw, 80rem);
    margin-top: .6rem;
}
@media (min-width: 760px) { .nominees { grid-template-columns: repeat(4, 1fr); } }

.nominee {
    margin: 0;
    display: flex; flex-direction: column; align-items: center; gap: .7rem;
}
.nominees.none { display: none; }
.nominee img, .nominee .slot {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid var(--gold);
    box-shadow: inset 0 0 0 5px #000, inset 0 0 0 6px var(--gold-dark), 0 6px 24px rgba(0, 0, 0, .6);
}
@media (min-width: 760px) { .nominee img, .nominee .slot { width: min(100%, calc(100dvh - 22rem)); } }
/* not introduced yet: an empty frame, so that nothing shifts when the photo arrives */
.nominee .slot {
    display: grid; place-items: center;
    border-color: var(--gold-dark);
    font-family: var(--display);
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--gold-dark);
    opacity: .5;
}
/* the moment of introduction: the photo turns in with a flare of light, the name follows */
.nominee.enter img { animation: nominee-in .8s cubic-bezier(.2, .8, .2, 1) backwards, nominee-flare 1.8s ease-out; }
.nominee.enter figcaption { animation: fade-up .6s ease .55s backwards; }
@keyframes nominee-in { from { transform: perspective(60rem) rotateY(90deg) scale(1.18); opacity: 0; } }
@keyframes nominee-flare {
    0%, 100% { box-shadow: inset 0 0 0 5px #000, inset 0 0 0 6px var(--gold-dark), 0 6px 24px rgba(0, 0, 0, .6); filter: brightness(1); }
    35% { box-shadow: inset 0 0 0 5px #000, inset 0 0 0 6px var(--gold-dark), 0 0 70px 18px rgba(255, 222, 120, .85); filter: brightness(1.45); }
}
/* the category name on its own, before the first nominee */
.results .category-card .kicker { font-size: clamp(1rem, 3vmin, 2.2rem); }
.results .category-card .vote-title { font-size: clamp(2.6rem, 11vmin, 11rem); max-width: 90vw; animation: award-in 1.2s ease backwards; }
.category-card.idle { max-width: none; }
.nominee figcaption {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-size: clamp(.85rem, 2vw, 1.5rem);
    color: var(--gold-light);
}

/* ---------- summary: all winners ---------- */

.all-winners {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: clamp(.8rem, 2vw, 2rem);
    width: min(96vw, 92rem);
    margin-top: .6rem;
}

.slot {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    animation: fade-up .7s ease calc(.2s + var(--i) * .25s) backwards;
}
.slot-title {
    min-height: 2.4em;
    display: flex; align-items: center;
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: clamp(.7rem, 1.3vw, 1rem);
    color: var(--gold);
    text-wrap: balance;
}
.mosaic {
    width: 100%;
    max-width: calc(100dvh - 20rem);
    min-width: 8rem;
    aspect-ratio: 1;
    display: grid;
    gap: 3px;
    border: 2px solid var(--gold);
    box-shadow: inset 0 0 0 4px #000, 0 0 30px rgba(246, 226, 122, .3);
    background: #000;
    overflow: hidden;
}
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.mosaic.n2 { grid-template-columns: 1fr 1fr; }
.mosaic.n3, .mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.empty { place-items: center; opacity: .35; }
.mosaic.empty .emblem { width: 50%; }
.slot-name {
    font-family: var(--display);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: clamp(.85rem, 1.6vw, 1.3rem);
    color: var(--gold-light);
}
.slot-count { font-size: clamp(.75rem, 1.2vw, 1rem); letter-spacing: .12em; color: var(--gold); text-transform: uppercase; }

/* ---------- control: extra row ---------- */


/* ---------- intermission: just the logo, big and glowing ---------- */

.stage.intermission {
    height: 100dvh;
    min-height: 0;
    padding: 0;
    justify-content: center;
    overflow: hidden;
}

.hero { display: grid; place-items: center; }

.logo {
    position: relative;
    width: min(80vmin, 62rem);
    aspect-ratio: 126.73549 / 123.29593;
}
.logo .emblem { position: relative; z-index: 1; width: 100%; opacity: var(--logo-art-opacity); }   /* the logo sits above the light */

/* soft halo of the whole logo shape (a blurred copy behind everything; the blur sits on the wrapper because
   a mask would clip a blur applied to the masked element itself) */
.logo .halo {
    position: absolute;
    inset: 0;
    filter: blur(1.5vmin);
    opacity: var(--logo-glow);
    pointer-events: none;
}
.logo .halo .emblem { position: static; opacity: 1; }

/* light running along the outlines, BEHIND the logo (animated SVG, see tools/make_sparkle.py);
   it extends 15% past the logo on every side so the glow is not clipped */
.logo .sparkle {
    position: absolute;
    inset: -15%;
    width: 130%;
    height: 130%;
    pointer-events: none;
}

/* before show time: the plain emblem with one line under it, together in the middle of the screen */
.stage.welcome { gap: 4vmin; }
.stage.welcome .emblem { width: 26vmin; }
.welcome-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.8rem, 7vmin, 7rem);
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--gold-light);
}

/* ---------- fade through black when switching to / from the intermission ---------- */

.curtain {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2.4s ease-in-out;   /* lifting: slow */
}
.curtain.on {
    opacity: 1;
    transition-duration: 1.6s;              /* dropping (keep a little under CurtainDropMs in LivePage.cs) */
}

/* ---------- opening of the evening: golden photos flying out of the dark, then the logo ---------- */

.opening-scene {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.open-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(242, 185, 51, .22), rgba(242, 185, 51, .06) 40%, transparent 70%);
    animation: open-glow 30s ease-in-out both;
}
@keyframes open-glow { 0% { opacity: 0; } 12% { opacity: 1; } 80% { opacity: .8; } 100% { opacity: 1; } }

.fly { position: absolute; inset: 0; perspective: 1200px; perspective-origin: 50% 50%; }
.fly-stage { position: absolute; inset: 0; transform-style: preserve-3d; }

.fly-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: fit-content;   /* the photo decides the shape */
    opacity: 0;
    border: .25vmin solid rgba(255, 224, 138, .8);
    box-shadow: 0 0 4vmin rgba(242, 185, 51, .55), inset 0 0 3vmin rgba(242, 185, 51, .35);
    animation: fly var(--dur) cubic-bezier(.3, .15, .65, 1) var(--delay) both;
    will-change: transform, opacity;
}
.fly-card img {
    display: block;
    width: auto;
    height: auto;
    max-height: var(--box);
    max-width: calc(var(--box) * 1.3);
    filter: sepia(1) saturate(1.8) hue-rotate(-12deg) contrast(1.1) brightness(.95);   /* everything turns gold */
}
.fly-card::after {   /* golden sheen over the photo */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 226, 140, .38), rgba(150, 90, 10, .32));
    mix-blend-mode: overlay;
}

@keyframes fly {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translate3d(var(--x0), var(--y0), var(--z0)) rotateX(var(--rx0)) rotateY(var(--ry0)) rotateZ(var(--rz0));
    }
    18% { opacity: var(--peak); }
    78% { opacity: var(--peak); }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate3d(var(--x1), var(--y1), var(--z1)) rotateX(var(--rx1)) rotateY(var(--ry1)) rotateZ(var(--rz1));
    }
}

/* finale (~25 s): a flash, then the logo drops out of the light and the title appears under it.
   Behind the flash the black background is swapped for a wall of all the photos. */
.open-tiles { opacity: 0; animation: open-tiles .2s linear 25.2s both; }   /* switches while the flash is at its brightest */
@keyframes open-tiles { from { opacity: 0; } to { opacity: 1; } }

.open-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, #fffdf2, #fff0b8 35%, rgba(242, 185, 51, .88) 100%);   /* fills the whole screen */
    opacity: 0;
    animation: open-flash 2.2s ease-out 25s both;
}
@keyframes open-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

.open-finale {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    animation: open-finale 3.4s cubic-bezier(.2, .7, .2, 1) 25.1s both;
}
@keyframes open-finale {
    0% { opacity: 0; transform: scale(1.7); filter: blur(2.5vmin) brightness(3); }
    100% { opacity: 1; transform: scale(1); filter: none; }
}

.open-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4vh;
    opacity: 0;
    animation: open-title 2.4s ease-out 28.2s both;
}
@keyframes open-title { from { opacity: 0; transform: translateY(2vh); } to { opacity: 1; transform: none; } }
.open-title .brand { margin: 0; padding: 0 2vw; font-size: clamp(1.4rem, 4.8vmin, 6rem); letter-spacing: .16em; }
.open-title .orn { display: none; }   /* just the words here, no ornaments at the sides */
.open-finale .logo { width: min(68vmin, 62rem); margin-bottom: 9vmin; }   /* leaves room for the large title below */

/* ---------- photo wall: the evening's photos as a background (PhotoWall.razor) ---------- */

.photo-wall {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);
    gap: .4vmin;
    background: #070707;
    pointer-events: none;
}
.photo-tile { position: relative; overflow: hidden; min-width: 0; min-height: 0; perspective: 90vmin; }
.photo-wall img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    backface-visibility: hidden;   /* only the side of the card facing us is drawn */
    object-position: 50% 30%;   /* faces tend to be in the upper part */
    filter: sepia(1) saturate(2.1) hue-rotate(-12deg) brightness(.47);   /* golden and dim, so the content stands out */
}
.photo-wall img.in { animation: photo-in 1.2s ease-in-out both; }     /* a tile flips around its vertical axis: */
.photo-wall img.out { animation: photo-out 1.2s ease-in-out both; }   /* old photo turns away, new one comes round */
@keyframes photo-in { from { transform: rotateY(180deg); } to { transform: rotateY(0deg); } }
@keyframes photo-out { from { transform: rotateY(0deg); } to { transform: rotateY(-180deg); } }
.photo-wall::after {   /* darker in the middle, behind the content */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, .82) 25vmin, rgba(0, 0, 0, .2) 75vmin);
}
.open-tiles::after {   /* the opening: behind the logo and the title */
    background:
        radial-gradient(circle at 50% 44%, rgba(0, 0, 0, .78) 22vmin, rgba(0, 0, 0, .2) 55vmin),
        linear-gradient(to top, rgba(0, 0, 0, .92) 6%, transparent 28%);
}
.award, .photo-wall ~ .hero { position: relative; z-index: 1; }   /* above the wall */
@media (orientation: portrait) {   /* phones held upright: turn the grid so the tiles do not become thin strips */
    .photo-wall { grid-template-columns: repeat(var(--rows), 1fr); grid-template-rows: repeat(var(--cols), 1fr); }
}

/* ---------- programme of the evening ---------- */

.program {
    list-style: none;
    margin: 2vh auto 0;
    padding: 0;
    width: min(92%, 52rem);
}
.program li {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: baseline;
    gap: 1.2rem;
    padding: 1.1vh 0;
    border-bottom: 1px solid rgba(242, 185, 51, .3);
    font-size: clamp(1.1rem, 3vh, 2rem);
}
.program li:last-child { border-bottom: 0; }
.program .time { color: var(--gold, #f2b933); font-family: 'Cinzel', serif; text-align: right; letter-spacing: .08em; }
.program .what { text-align: left; }

/* ---------- award name and "join the voting" (QR code) ---------- */

.award, .join { display: grid; justify-items: center; align-content: center; gap: 2.5vh; width: 100%; padding: 0 4vw; text-align: center; }

.award-title {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 13vmin, 14rem);
    line-height: 1.05;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: linear-gradient(100deg, #b8892a 0%, #fff3c4 30%, #f2b933 50%, #fff3c4 70%, #b8892a 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 2.5vmin rgba(242, 185, 51, .35));
    animation: award-in 2.4s ease-out both, award-shine 9s ease-in-out 2.4s infinite;
}
.award-title.small { font-size: clamp(1.8rem, 7vmin, 7rem); animation: award-in 1.6s ease-out both; }
@keyframes award-in { from { opacity: 0; transform: scale(.94); letter-spacing: .14em; } to { opacity: 1; transform: none; } }
@keyframes award-shine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.qr-frame {
    padding: 1.6vmin;
    background: #050403;
    border: .3vmin solid rgba(242, 185, 51, .7);
    box-shadow: 0 0 5vmin rgba(242, 185, 51, .35);
}
.qr { display: block; width: min(52vh, 70vw); height: min(52vh, 70vw); filter: drop-shadow(0 0 .8vmin rgba(242, 185, 51, .5)); }

.join-url {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.3rem, 4.2vmin, 3.4rem);
    letter-spacing: .08em;
    color: var(--gold-light);
    word-break: break-all;
}

/* ---------- volume slider on the control page ---------- */

.panel.volume { display: grid; gap: .8rem; }
.panel.volume input[type=range] { width: 100%; accent-color: var(--gold); height: 2rem; }
