/* ============================================================
   pages.css - page-specific: raffle detail, lightbox, modal, draw
   ============================================================ */

/* ---------- Public raffle detail ---------- */
.detail-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.5rem, 0.8rem + 2.5vw, 2.75rem); align-items: start; }
.detail-img {
    border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
    background: radial-gradient(circle at 50% 40%, var(--paper) 0%, var(--paper-deep) 100%);
    box-shadow: var(--shadow-sm);
}
.detail-img img { width: 100%; display: block; cursor: zoom-in; transition: transform var(--dur-3) var(--ease-out); }
.detail-img:hover img { transform: scale(1.02); }
.detail-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.detail-thumbs img { width: 76px; height: 60px; object-fit: cover; border-radius: var(--r-sm); cursor: pointer; border: 2px solid transparent; transition: border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.detail-thumbs img:hover { transform: translateY(-2px); }
.detail-thumbs img.sel { border-color: var(--red); }

.detail-img.is-placeholder img { cursor: default; }
.detail-img.is-placeholder:hover img { transform: none; }

@media (max-width: 900px) {
    .detail-hero { grid-template-columns: 1fr; }
}

/* ---------- Image zoom lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; background: rgba(8, 9, 13, 0.95);
    z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center;
    overflow: auto; padding: 24px; animation: pv-fade-in var(--dur-2) var(--ease-out);
}
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; cursor: zoom-in; transition: transform var(--dur-2) var(--ease-out); }
.lightbox.zoomed { align-items: flex-start; justify-content: flex-start; }
.lightbox.zoomed img { max-width: none; max-height: none; width: 180%; cursor: zoom-out; }
.lightbox-close {
    position: fixed; top: 18px; right: 22px; background: rgba(0, 0, 0, 0.45); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4); border-radius: var(--r-sm);
    font-size: 1.4rem; line-height: 1; padding: 8px 14px; cursor: pointer;
    transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.lightbox-close:hover { background: var(--red); border-color: var(--red); }
.lightbox-hint { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #c3c7d2; font-size: var(--step--1); }

/* ---------- Modal (admin image crop) ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(8, 9, 13, 0.64);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center; padding: 24px;
    animation: pv-fade-in var(--dur-2) var(--ease-out);
}
.modal-card {
    background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 720px; max-height: 90vh; overflow: auto; padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
    animation: pv-rise var(--dur-3) var(--ease-out);
}
.crop-stage { background: var(--paper-deep); border-radius: var(--r-sm); max-height: 60vh; overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: var(--sp-5); }

/* ---------- Drawing screen (admin, video friendly) ---------- */
.draw-shell {
    min-height: 100svh;
    background:
        radial-gradient(circle at 20% 0%, rgba(224, 35, 47, 0.12), transparent 50%),
        radial-gradient(circle at 85% 100%, rgba(36, 86, 230, 0.12), transparent 55%),
        linear-gradient(180deg, #141a2e 0%, #06070b 100%);
    color: #eef0f4; font-family: var(--font-body); display: flex; flex-direction: column;
}
.draw-top { display: flex; justify-content: space-between; align-items: center; padding: 22px clamp(16px, 3vw, 32px); border-bottom: 1px solid rgba(224, 35, 47, 0.22); }
.draw-brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.15rem; color: #dfe2ea; letter-spacing: 0.02em; }
.draw-brand img { height: 34px; width: 34px; }
.draw-exit { color: #c3c7d2; font-size: 0.88rem; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.18); padding: 8px 14px; border-radius: var(--r-sm); transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.draw-exit:hover { color: #fff; border-color: var(--red); text-decoration: none; }
.draw-main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 80px; text-align: center; }
.draw-eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.82rem; color: var(--red); font-weight: 700; margin-bottom: 14px; }
.draw-title { font-family: var(--font-display); font-size: clamp(2rem, 1.3rem + 3vw, 3rem); line-height: 1.1; color: #fff; margin: 0; }
.draw-sub { color: #b9bdc9; margin-top: 8px; margin-bottom: 36px; font-size: 1rem; }

.reel-window {
    position: relative; width: min(620px, 92vw); height: 400px; overflow: hidden;
    background: linear-gradient(180deg, #1a2236 0%, #0a0d16 100%);
    border: 1px solid rgba(224, 35, 47, 0.38); border-radius: 14px;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6), 0 18px 40px rgba(0, 0, 0, 0.45);
}
.reel-track { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.reel-row { height: 80px; display: flex; align-items: center; justify-content: center; padding: 0 28px; color: #e6e8ef; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.reel-indicator { position: absolute; left: 0; right: 0; top: 160px; height: 80px; pointer-events: none; border-top: 2px solid var(--red); border-bottom: 2px solid var(--red); background: rgba(224, 35, 47, 0.12); z-index: 2; transition: background 0.25s ease, box-shadow 0.25s ease; }
.reel-window.revealed .reel-indicator { background: rgba(224, 35, 47, 0.24); box-shadow: inset 0 0 36px rgba(224, 35, 47, 0.48); animation: pv-glow 1.6s ease-in-out infinite alternate; }
.reel-fade { position: absolute; left: 0; right: 0; height: 120px; pointer-events: none; z-index: 3; }
.reel-fade-top { top: 0; background: linear-gradient(180deg, rgba(8, 9, 14, 0.95) 0%, rgba(8, 9, 14, 0) 100%); }
.reel-fade-bottom { bottom: 0; background: linear-gradient(0deg, rgba(8, 9, 14, 0.95) 0%, rgba(8, 9, 14, 0) 100%); }
.reel-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #aab0bd; font-size: 1.05rem; z-index: 1; }

/* Idle preview: names drift slowly on a seamless loop before the draw starts. */
.reel-idle { animation: pv-reel-idle linear infinite; will-change: transform; }
@keyframes pv-reel-idle {
    from { transform: translateY(0); }
    to { transform: translateY(var(--pv-idle-shift, -640px)); }
}
@media (prefers-reduced-motion: reduce) {
    .reel-idle { animation: none; }
}

.draw-actions { margin-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.draw-status { color: #b9bdc9; font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.btn-draw {
    background: var(--grad-red); color: #fff; border: none; border-radius: var(--r-md); padding: 16px 36px;
    font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase;
    cursor: pointer; box-shadow: var(--shadow-red); transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2) var(--ease-out); text-decoration: none; display: inline-block;
}
.btn-draw:hover { filter: brightness(1.08); color: #fff; text-decoration: none; transform: translateY(-2px); }
.btn-draw:active { transform: translateY(0); }
.btn-draw:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-draw.secondary { background: transparent; color: #dfe2ea; border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: none; }
.btn-draw.secondary:hover { border-color: var(--red); color: #fff; filter: none; }
.draw-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.winner-card { margin-top: 8px; padding: 28px 36px; border: 1px solid rgba(224, 35, 47, 0.48); border-radius: 14px; background: linear-gradient(180deg, rgba(224, 35, 47, 0.12), rgba(224, 35, 47, 0.02)); box-shadow: 0 0 40px rgba(224, 35, 47, 0.20); min-width: min(620px, 92vw); animation: pv-rise 0.45s ease; }
.winner-card.recorded { border-color: rgba(80, 150, 255, 0.55); }
.winner-eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.78rem; color: var(--red); font-weight: 700; }
.winner-name { font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); color: #fff; margin-top: 6px; }
.winner-meta { color: #c8ccd6; margin-top: 8px; font-size: 1rem; }
.winner-contact { color: #aab0bd; margin-top: 4px; font-size: 0.95rem; }
.winner-sep { display: inline-block; width: 6px; height: 6px; background: var(--red); border-radius: 50%; margin: 0 10px; vertical-align: middle; }
