/* ============================================================
   Premier Entertainment — gold on black theme
   ============================================================ */

:root {
    --pe-bg:          #0a0a0b;
    --pe-bg-raised:   #141416;
    --pe-bg-card:     #17171a;
    --pe-border:      #2a2a2f;
    --pe-gold:        #d4af37;
    --pe-gold-hi:     #f4d56e;
    --pe-gold-dim:    #8e7426;
    --pe-text:        #f2efe4;
    --pe-muted:       #9a968a;
    --pe-danger:      #ef4444;
    --pe-ok:          #21c07a;
    --pe-font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
                 Arial, sans-serif;
    color: var(--pe-text);
    background: var(--pe-bg);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pe-gold); text-decoration: none; }
a:hover { color: var(--pe-gold-hi); text-decoration: underline; }
.muted { color: var(--pe-muted); font-size: .92rem; }
.center { text-align: center; }

/* ---------- topbar / container ---------- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: .9rem 1.25rem;
    background: linear-gradient(180deg, #121214 0%, #0b0b0d 100%);
    border-bottom: 1px solid var(--pe-border);
}
.topbar h1 { font-size: 1.1rem; margin: 0; color: var(--pe-gold); font-family: var(--pe-font-display); letter-spacing: .02em; }
.topbar .brand { display: flex; align-items: center; gap: .75rem; }
.topbar .brand img { width: 40px; height: 40px; object-fit: contain; }
.topbar .brand small { color: var(--pe-muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.topbar nav a { margin-left: 1rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---------- cards / buttons ---------- */
.card {
    background: var(--pe-bg-card);
    border: 1px solid var(--pe-border);
    border-radius: 14px;
    padding: 1.3rem 1.3rem 1.2rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.02);
}
.card h1, .card h2 { margin-top: 0; color: var(--pe-gold); font-family: var(--pe-font-display); }

.btn {
    display: inline-block; padding: .5rem .95rem;
    border: 1px solid var(--pe-border); background: #1b1b1f; color: var(--pe-text);
    border-radius: 8px; font-size: .95rem; cursor: pointer; text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #242429; border-color: var(--pe-gold-dim); color: var(--pe-gold-hi); text-decoration: none; }
.btn.primary {
    background: linear-gradient(180deg, var(--pe-gold-hi), var(--pe-gold));
    border-color: var(--pe-gold);
    color: #1a1405;
    font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); color: #1a1405; }
.btn.danger { color: #ffb3ac; border-color: #5d2a26; background: #2a1513; }
.btn.danger:hover { background: #3a1d1a; color: #ffd3cf; }

input[type=text], input[type=password], input[type=email], input[type=url] {
    padding: .55rem .7rem;
    border: 1px solid var(--pe-border);
    background: #0f0f11;
    color: var(--pe-text);
    border-radius: 8px;
    font-size: 1rem; width: 100%;
}
input[readonly] { background: #0a0a0c; color: var(--pe-muted); }
input:focus { outline: none; border-color: var(--pe-gold-dim); box-shadow: 0 0 0 3px rgba(212,175,55,.14); }

label { display: block; font-size: .85rem; color: var(--pe-muted); margin-bottom: .75rem; letter-spacing: .03em; }
label input { margin-top: .3rem; }

.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

.flash {
    padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem;
    border: 1px solid transparent;
}
.flash-ok  { background: rgba(33,192,122,.08); border-color: rgba(33,192,122,.35); color: #7de4b1; }
.flash-err { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.35); color: #ff9c94; }
.error { color: #ff9c94; }

/* ---------- auth page ---------- */
body.auth {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(ellipse at top, rgba(212,175,55,.09), transparent 55%),
        radial-gradient(ellipse at bottom, rgba(212,175,55,.04), transparent 60%),
        var(--pe-bg);
}
body.auth .card.auth-card { width: 100%; max-width: 380px; text-align: center; }
body.auth .card.auth-card h1 { margin: .35rem 0 .15rem; font-size: 1.5rem; }
body.auth .card.auth-card .muted { margin-bottom: 1.1rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
body.auth .auth-logo { width: 90px; height: 90px; object-fit: contain; }
body.auth .btn { width: 100%; }
body.auth label { text-align: left; }

/* ---------- admin event list ---------- */
.event-list { display: grid; gap: 1rem; }
.event-card {
    background: var(--pe-bg-card);
    border: 1px solid var(--pe-border);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.event-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.event-card header h3 { margin: 0 0 .15rem; color: var(--pe-gold); font-family: var(--pe-font-display); font-size: 1.3rem; }

.event-body { display: flex; gap: 1.25rem; margin-top: 1rem; flex-wrap: wrap; align-items: flex-start; }
.qr-group { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.qr-mini {
    background: #fff;
    padding: 6px;
    border: 1px solid var(--pe-gold-dim);
    border-radius: 8px;
    width: 132px; height: 132px;
    display: flex; align-items: center; justify-content: center;
}
.qr-mini.empty { color: #888; font-size: .75rem; text-align: center; letter-spacing: .1em; }
.qr-caption { font-size: .75rem; color: var(--pe-muted); text-transform: uppercase; letter-spacing: .1em; }
.event-body .links { flex: 1 1 280px; }
.inline-song { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; margin-bottom: .75rem; }

/* ---------- guest upload page ---------- */
body.guest { background: var(--pe-bg); color: var(--pe-text); }
.guest-shell {
    max-width: 560px; margin: 0 auto; padding: 1.5rem 1rem 5rem;
    min-height: 100vh; display: flex; flex-direction: column;
}
.guest-head { text-align: center; margin-bottom: 1rem; }
.guest-logo { width: 72px; height: 72px; object-fit: contain; margin-bottom: .5rem; }
body.guest h1 {
    margin: 0 0 .2rem; font-size: 1.6rem;
    font-family: var(--pe-font-display);
    color: var(--pe-gold);
}
body.guest .muted { color: var(--pe-muted); }

.rotate-tip {
    display: flex; align-items: center; gap: .7rem;
    margin: 1rem 0 0;
    padding: .7rem .85rem;
    background: rgba(212, 175, 55, .08);
    border: 1px solid rgba(212, 175, 55, .35);
    border-left-width: 4px;
    border-radius: 8px;
    color: var(--pe-gold-hi);
    font-size: .9rem;
    line-height: 1.3;
}
.rotate-tip strong { color: #fff; }
.rotate-tip .rotate-icon {
    font-size: 1.3rem; line-height: 1; flex-shrink: 0;
    animation: rotate-wiggle 2.5s ease-in-out infinite;
    display: inline-block;
}
@keyframes rotate-wiggle {
    0%, 60%, 100% { transform: rotate(0deg); }
    70%           { transform: rotate(-18deg); }
    85%           { transform: rotate(-90deg); }
}
/* Hide once they've actually rotated the device */
@media (orientation: landscape) and (max-width: 960px) {
    .rotate-tip { display: none; }
}

.drop-zone {
    display: block; margin: 1.5rem 0 1rem;
    border: 2px dashed var(--pe-gold-dim);
    border-radius: 16px;
    background: var(--pe-bg-raised);
    padding: 2rem 1rem; text-align: center;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--pe-gold); background: #1b1a15; }
.drop-zone input { display: none; }
.drop-inner .plus {
    font-size: 3rem; line-height: 1; color: var(--pe-gold); margin-bottom: .5rem;
    font-weight: 300;
}
.drop-text { font-size: 1.05rem; }
.drop-text small { color: var(--pe-muted); display: block; margin-top: .25rem; }

.queue { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.queue li {
    display: grid; grid-template-columns: 44px 1fr auto; gap: .7rem; align-items: center;
    background: var(--pe-bg-raised); border: 1px solid var(--pe-border); border-radius: 10px; padding: .55rem .75rem;
}
.queue li .thumb {
    width: 44px; height: 44px; border-radius: 6px; background: #262625;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.queue li .thumb img, .queue li .thumb video { width: 100%; height: 100%; object-fit: cover; }
.queue li .meta { min-width: 0; }
.queue li .name {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .92rem;
}
.queue li .bar {
    height: 4px; background: #2a2a2a; border-radius: 2px; margin-top: .25rem; overflow: hidden;
}
.queue li .bar > span {
    display: block; height: 100%; background: var(--pe-gold); width: 0; transition: width .15s;
}
.queue li.ok .bar > span { background: var(--pe-ok); }
.queue li.err .bar > span { background: var(--pe-danger); }
.queue li .state { font-size: .82rem; color: var(--pe-muted); }
.queue li.err .state { color: var(--pe-danger); }

.guest-footer { margin-top: auto; text-align: center; padding-top: 2rem; }
.guest-footer a { color: var(--pe-muted); }

/* ---------- live photo wall (formerly slideshow.js target) ---------- */
body.slideshow {
    margin: 0; background: #000; color: #fff; overflow: hidden;
    height: 100vh; width: 100vw;
}
#stage { position: fixed; inset: 0; overflow: hidden; }
#stage .slide {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 1.2s ease;
    display: flex; align-items: center; justify-content: center;
}
#stage .slide.show { opacity: 1; }
#stage .slide img, #stage .slide video {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    animation: kenburns 9s ease-in-out forwards;
}
@keyframes kenburns {
    0%   { transform: scale(1);    }
    100% { transform: scale(1.08); }
}
.intro {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2rem;
}
.intro .intro-logo { width: 140px; height: 140px; object-fit: contain; margin-bottom: 1rem; filter: drop-shadow(0 0 18px rgba(212,175,55,.35)); }
.intro h1 { font-size: clamp(2rem, 6vw, 4.5rem); margin: 0 0 .75rem; font-family: var(--pe-font-display); color: var(--pe-gold); }
.intro p { color: #c7ccd4; margin: .25rem 0; }
.intro .small { color: #888; font-size: .95rem; margin-top: 1rem; }
.fab {
    position: fixed; right: 1rem; bottom: 1rem;
    padding: .45rem .8rem; border-radius: 999px;
    background: rgba(0,0,0,.55); color: var(--pe-gold); font-size: .85rem;
    backdrop-filter: blur(4px); border: 1px solid var(--pe-gold-dim);
}

/* ============================================================
   DISPLAY BOARD — the QR screen shown at the DJ booth
   ============================================================ */
body.display-board {
    margin: 0; height: 100vh; width: 100vw; overflow: hidden;
    color: var(--pe-text);
    background:
        radial-gradient(ellipse at top left, rgba(212,175,55,.14), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(212,175,55,.10), transparent 55%),
        radial-gradient(ellipse at center, rgba(212,175,55,.05), transparent 70%),
        #050506;
    position: relative;
    font-family: var(--pe-font-display);
}

/* subtle gold dust — a few radial specks via box-shadow on a single element */
body.display-board .dust {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(244,213,110,.7) 1px, transparent 1.5px),
        radial-gradient(circle, rgba(244,213,110,.4) 1px, transparent 1.5px);
    background-size: 240px 240px, 360px 360px;
    background-position: 0 0, 120px 180px;
    opacity: .45;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    transition: opacity .8s ease;
}

/* Full-screen photo background that appears while a guest photo is on stage */
.photo-layer {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
    background: #000;
    opacity: 0; transition: opacity .9s ease;
}
body.display-board.has-photo .photo-layer { opacity: 1; }
body.display-board.has-photo .dust         { opacity: 0; }
.photo-bg-item {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0; transition: opacity 1s ease, transform 300s linear;
    transform: scale(1);
}
.photo-bg-item.show {
    opacity: 1;
    transform: scale(1.08);           /* slow Ken Burns during its 5-minute run */
}
/* Countdown pill showing time until current photo expires */
.photo-timer {
    position: fixed;
    top: 2vh; right: 2vw;
    z-index: 5;
    display: inline-flex;
    align-items: baseline;
    gap: .5rem;
    padding: .5rem .9rem;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 999px;
    color: var(--pe-gold, #d4af37);
    font-family: 'Playfair Display', serif;
    box-shadow: 0 2px 10px rgba(0,0,0,.4);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .4s ease, transform .4s ease;
}
.photo-timer:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
}
.photo-timer[hidden] { display: none; }
.photo-timer-label {
    font-size: .75rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
}
.photo-timer-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Dark vignette so gold text + QR labels stay readable over any photo */
body.display-board.has-photo .photo-layer::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 25%,
                                 rgba(0,0,0,.15) 70%, rgba(0,0,0,.7) 100%);
    pointer-events: none;
}

.board {
    position: relative; z-index: 2;
    height: 100vh; display: flex; flex-direction: column;
    padding: 2.5vh 4vw; gap: 2vh;
    transition: padding .6s ease;
}
.board-head {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 1vh;
    flex: 0 0 auto;
    transition: gap .6s ease, transform .6s ease;
}
.board-banner {
    max-width: min(760px, 78%);
    max-height: 38vh;
    width: auto; height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 32px rgba(212,175,55,.35));
    transition: max-height .6s ease, max-width .6s ease, filter .6s ease;
}
.board-text-fallback h1 {
    font-size: clamp(2.4rem, 6vw, 5rem);
    color: var(--pe-gold); margin: 0; letter-spacing: .02em;
}
.board-text-fallback p {
    color: var(--pe-gold-hi); margin: .2rem 0 0; font-size: 1.2rem; letter-spacing: .25em; text-transform: uppercase;
}
.event-title {
    margin: .4rem 0 0;
    font-size: clamp(1.8rem, 4.2vw, 3.4rem);
    color: var(--pe-gold-hi);
    letter-spacing: .04em;
    font-weight: 500;
    font-style: italic;
    text-shadow: 0 0 24px rgba(212,175,55,.35);
}

.qr-row {
    flex: 1 1 auto;
    display: flex; justify-content: space-around; align-items: center;
    gap: 4vw; padding: 1vh 2vw;
    transition: justify-content .6s ease, padding .6s ease, gap .6s ease;
}
.qr-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 1.2rem;
    transition: transform .6s ease, gap .6s ease;
}
.qr-card .scan-tag {
    background: var(--pe-gold);
    color: #0a0a0b;
    padding: .35rem 1.2rem;
    font-family: sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .2em;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(212,175,55,.45);
}
.qr-card .qr-box {
    background: #fff;
    padding: 14px;
    border: 3px solid var(--pe-gold);
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(212,175,55,.35), 0 12px 40px rgba(0,0,0,.6);
}
.qr-card .qr-box > div {
    width: 260px; height: 260px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.qr-card .qr-box > div img,
.qr-card .qr-box > div canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.qr-card .qr-box > div table {
    width: 100%; height: 100%;
}
.qr-card .qr-label {
    font-family: var(--pe-font-display);
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    color: var(--pe-gold-hi);
    letter-spacing: .12em;
    text-align: center;
    line-height: 1.15;
    text-shadow: 0 0 18px rgba(212,175,55,.35);
}
.qr-card.disabled { opacity: .45; }

/* ---- has-photo mode: banner shrinks to top, QRs tuck into corners ---- */
body.display-board.has-photo .board {
    justify-content: space-between;
    padding: 2vh 3vw;
}
body.display-board.has-photo .board-head {
    gap: .4vh;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,.85));
}
body.display-board.has-photo .board-banner {
    max-height: 14vh;
    max-width: min(520px, 55%);
    filter: drop-shadow(0 0 14px rgba(212,175,55,.55)) drop-shadow(0 2px 8px rgba(0,0,0,.8));
}
body.display-board.has-photo .board-text-fallback h1 {
    font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}
body.display-board.has-photo .board-text-fallback p {
    font-size: .9rem;
}
body.display-board.has-photo .event-title {
    font-size: clamp(1.2rem, 2.6vw, 2rem);
    text-shadow: 0 2px 8px rgba(0,0,0,.85), 0 0 20px rgba(212,175,55,.35);
}
body.display-board.has-photo .qr-row {
    flex: 0 0 auto;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 2.5vw 3vh;
    gap: 2rem;
}
body.display-board.has-photo .qr-card {
    gap: .7rem;
    padding: 1rem 1.1rem 1.1rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
body.display-board.has-photo .qr-card .qr-box {
    padding: 10px;
    border-width: 2px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
}
body.display-board.has-photo .qr-card .qr-box > div {
    width: 170px; height: 170px;
}
body.display-board.has-photo .qr-card .scan-tag {
    font-size: .8rem; padding: .25rem .9rem;
    letter-spacing: .22em;
}
body.display-board.has-photo .qr-card .qr-label {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0,0,0,.9), 0 0 18px rgba(212,175,55,.35);
}
.qr-card .qr-placeholder {
    width: 260px; height: 260px;
    display: flex; align-items: center; justify-content: center;
    color: #666; font-family: sans-serif; letter-spacing: .1em;
    text-transform: uppercase;
}

/* On shorter screens stack the QRs */
@media (max-height: 640px), (max-width: 680px) {
    .qr-row { flex-direction: column; gap: 1.5rem; padding-bottom: 2vh; }
    .qr-card .qr-box > div { width: 200px; height: 200px; }
    .board-banner { max-height: 28vh; }
}

/* ---------- gallery ---------- */
body.gallery { background: var(--pe-bg); }
.gallery-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-top: .25rem;
}
.grid {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    margin-top: 1rem;
}
.tile-wrap { position: relative; }
.tile-delete {
    position: absolute; top: 6px; left: 6px; margin: 0; z-index: 2;
    opacity: 0; transition: opacity .15s;
}
.tile-wrap:hover .tile-delete,
.tile-delete:focus-within { opacity: 1; }
.tile-delete button {
    width: 28px; height: 28px; line-height: 1;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.2);
    background: rgba(0,0,0,.75); color: #fff;
    font-size: 1.1rem; cursor: pointer; padding: 0;
}
.tile-delete button:hover {
    background: var(--pe-danger); border-color: var(--pe-danger);
}
.tile {
    position: relative; aspect-ratio: 1/1; overflow: hidden;
    background: #1a1a1d; border-radius: 8px; display: block;
    border: 1px solid var(--pe-border);
}
.tile img, .tile video {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .25s;
}
.tile:hover img, .tile:hover video { transform: scale(1.04); }
.tile .badge {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,.55); color: var(--pe-gold);
    border-radius: 4px; padding: 0 .35rem; font-size: .75rem;
}
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,.94);
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.lightbox[hidden] { display: none; }
.lightbox img, .lightbox video { max-width: 95vw; max-height: 92vh; }
.lightbox #lb-close {
    position: absolute; top: 12px; right: 16px; background: none;
    color: var(--pe-gold); border: 0; font-size: 2.2rem; cursor: pointer;
}
