/* ═══════════════════════════════════════════════════════
   PixelHaven Drop Queue — Frontend Styles v0.9.0
   Pixel-art arcade lobby aesthetic
   Font: Press Start 2P (pixel) + Nunito (body)
   Palette: #7401B8 → #7FFFDA
═══════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────── */
[data-phdq-app] {
    --ph-purple:    #7401B8;
    --ph-indigo:    #6A30C3;
    --ph-slate:     #5E60CD;
    --ph-blue:      #5490D9;
    --ph-sky:       #4EA8DD;
    --ph-cyan:      #49BFE3;
    --ph-strong:    #56CFE0;
    --ph-pearl:     #63DFDF;
    --ph-turquoise: #72EFDD;
    --ph-aqua:      #7FFFDA;
    --bg-dark:      #0d0d14;
    --bg-card:      #13131f;
    --bg-panel:     #1a1a2e;
    --border-dim:   #2a2a45;
    --text-primary: #e8e8ff;
    --text-muted:   #7a7aaa;
}

[data-phdq-app] *, [data-phdq-app] *::before, [data-phdq-app] *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

/* ── Container ──────────────────────────────────────── */
[data-phdq-app] {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    font-family: 'Nunito', sans-serif;
    color: var(--text-primary);
    background: var(--bg-dark);
    box-shadow:
        0 0 0 4px var(--ph-cyan),
        0 0 0 8px var(--bg-dark),
        0 0 0 12px var(--ph-purple),
        0 0 40px rgba(73,191,227,.25),
        0 0 80px rgba(116,1,184,.15);
    animation: phdq-boot .35s steps(4) both;
}

/* scanlines */
[data-phdq-app]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.07) 2px, rgba(0,0,0,.07) 4px);
    pointer-events: none;
    z-index: 10;
}

/* ── Header ─────────────────────────────────────────── */
.phdq-header {
    background: linear-gradient(135deg, var(--ph-purple) 0%, var(--ph-indigo) 50%, var(--ph-slate) 100%);
    padding: 24px 28px 20px;
    border-bottom: 4px solid var(--ph-cyan);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.phdq-header::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
    animation: phdq-shine 5s linear infinite;
}

.phdq-drop-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--ph-aqua);
    letter-spacing: .08em;
    text-shadow: 0 0 8px var(--ph-cyan);
    text-transform: uppercase;
    margin-bottom: 8px;
}

[data-phdq-title] {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(11px, 2.5vw, 15px);
    color: #fff;
    text-shadow: 3px 3px 0 var(--ph-purple), 0 0 20px rgba(127,255,218,.35);
    line-height: 1.7;
    letter-spacing: .02em;
}

.phdq-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,.8);
    line-height: 1.6;
    margin-top: 10px;
    font-weight: 600;
}

.phdq-ttl-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(0,0,0,.4);
    border: 2px solid var(--ph-turquoise);
    font-size: 11px;
    color: var(--ph-turquoise);
    font-weight: 800;
    box-shadow: 0 0 10px rgba(114,239,221,.2);
    max-width: 100%;
}
.phdq-ttl-chip::before { content: '⏱'; font-size: 13px; }

/* ── Body ───────────────────────────────────────────── */
.phdq-body { padding: 28px; background: var(--bg-card); }

/* ── Form ───────────────────────────────────────────── */
[data-phdq-join] form { display: flex; flex-direction: column; gap: 16px; }

.phdq-field { display: flex; flex-direction: column; gap: 6px; }

.phdq-field label {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--ph-cyan);
    text-transform: uppercase;
    letter-spacing: .08em;
}

[data-phdq-app] input[type="text"],
[data-phdq-app] input[type="email"] {
    width: 100%;
    padding: 13px 14px;
    background: var(--bg-panel);
    border: 2px solid var(--border-dim);
    border-radius: 0;
    color: var(--text-primary);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
}
[data-phdq-app] input:focus {
    border-color: var(--ph-cyan);
    box-shadow: 0 0 0 2px rgba(73,191,227,.2);
}
[data-phdq-app] input::placeholder { color: #404060; }

/* ── Submit button ──────────────────────────────────── */
[data-phdq-app] button[type="submit"] {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    margin-top: 4px;
    background: linear-gradient(135deg, var(--ph-purple), var(--ph-indigo));
    border: none;
    border-bottom: 4px solid rgba(0,0,0,.4);
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    letter-spacing: .05em;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(116,1,184,.4);
    transition: transform .12s ease, box-shadow .15s ease;
    overflow: hidden;
    border-radius: 0;
}
[data-phdq-app] button[type="submit"]:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--ph-indigo), var(--ph-slate));
    box-shadow: 0 0 30px rgba(73,191,227,.35);
    transform: translateY(-2px);
}
[data-phdq-app] button[type="submit"]:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom-width: 1px;
}
[data-phdq-app] button[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }
[data-phdq-app] button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
    transition: left .4s;
}
[data-phdq-app] button[type="submit"]:hover::after { left: 150%; }

/* ── Spinner ─────────────────────────────────────────── */
.phdq-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: var(--ph-aqua);
    animation: phdq-spin .5s steps(8) infinite;
    flex-shrink: 0;
}

/* ── Queue waiting card ─────────────────────────────── */
[data-phdq-queue-box] { animation: phdq-boot .3s steps(4) both; }

.phdq-in-line { display: flex; flex-direction: column; gap: 20px; }

.phdq-position-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 22px;
    background: var(--bg-panel);
    border: 2px solid var(--border-dim);
    position: relative;
    overflow: hidden;
}
.phdq-position-wrap::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--ph-cyan), var(--ph-purple));
    animation: phdq-bar-pulse 2s steps(4) infinite;
}

.phdq-position-number {
    font-family: 'Press Start 2P', monospace;
    font-size: 3rem;
    line-height: 1;
    color: var(--ph-cyan);
    text-shadow: 0 0 20px rgba(73,191,227,.6), 3px 3px 0 var(--ph-purple);
    min-width: 68px;
    text-align: center;
}
.phdq-position-number.phdq-bump {
    animation: phdq-number-bump .35s cubic-bezier(.175,.885,.32,1.275);
}
.phdq-position-label strong {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.6;
}
.phdq-position-label span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

/* ── Pixel loading bar ──────────────────────────────── */
.phdq-pixel-bar-wrap { display: flex; flex-direction: column; gap: 8px; }

.phdq-pixel-bar-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: var(--ph-cyan);
    letter-spacing: .1em;
    display: flex;
    justify-content: space-between;
}

.phdq-pixel-bar { display: flex; gap: 3px; align-items: center; }

.phdq-pixel-block {
    width: 16px; height: 16px;
    background: var(--border-dim);
    flex-shrink: 0;
    transition: background .05s steps(1), box-shadow .05s steps(1);
}
.phdq-pixel-block.lit {
    background: var(--ph-cyan);
    box-shadow: 0 0 6px rgba(73,191,227,.8);
}
.phdq-pixel-block.head {
    background: var(--ph-aqua);
    box-shadow: 0 0 10px rgba(127,255,218,1);
}

/* ── Message ticker ─────────────────────────────────── */
.phdq-message-ticker {
    padding: 14px 16px;
    background: var(--bg-panel);
    border-left: 4px solid var(--ph-purple);
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,.85);
    min-height: 50px;
    display: flex;
    align-items: center;
    line-height: 1.5;
}
.phdq-message-ticker.phdq-msg-change { animation: phdq-msg-fade .35s ease both; }

/* ── Live dot ───────────────────────────────────────── */
.phdq-live {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--text-muted); font-weight: 700;
}
.phdq-live-dot {
    width: 8px; height: 8px;
    background: var(--ph-aqua);
    box-shadow: 0 0 8px var(--ph-aqua);
    animation: phdq-blink 1s steps(1) infinite;
    flex-shrink: 0;
}

/* ── Status bar ─────────────────────────────────────── */
[data-phdq-status] {
    padding: 12px 18px;
    font-size: 9px;
    font-weight: 400;
    color: var(--text-muted);
    border-top: 2px solid var(--border-dim);
    background: var(--bg-card);
    font-family: 'Press Start 2P', monospace;
    line-height: 1.9;
    letter-spacing: .03em;
    min-height: 50px;
    display: flex;
    align-items: center;
}
[data-phdq-status].phdq-status-admitted {
    background: rgba(127,255,218,.07);
    border-top-color: var(--ph-aqua);
    color: var(--ph-aqua);
    animation: phdq-glow-pulse .8s ease-in-out infinite alternate;
}
[data-phdq-status].phdq-status-expired {
    background: rgba(239,68,68,.08);
    border-top-color: #ef4444;
    color: #f87171;
}
[data-phdq-status].phdq-status-error {
    background: rgba(245,158,11,.08);
    border-top-color: #f59e0b;
    color: #fbbf24;
}

/* ── Removed card ───────────────────────────────────── */
.phdq-removed-notice {
    padding: 28px 24px;
    background: var(--bg-panel);
    border-top: 4px solid #ef4444;
    text-align: center;
    animation: phdq-boot .3s steps(4) both;
}
.phdq-removed-icon { font-size: 2.5rem; margin-bottom: 14px; filter: drop-shadow(0 0 8px rgba(239,68,68,.6)); }
.phdq-removed-notice p { color: rgba(255,255,255,.75); font-size: 13px; line-height: 1.7; font-weight: 600; margin-bottom: 8px; }
.phdq-removed-notice p strong {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px; color: #f87171; margin-bottom: 10px; line-height: 1.8;
}
.phdq-rejoin-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ph-purple), var(--ph-indigo));
    border: none;
    border-bottom: 4px solid rgba(0,0,0,.4);
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    letter-spacing: .05em;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 16px rgba(116,1,184,.35);
    border-radius: 0;
}
.phdq-rejoin-btn:hover { transform: translateY(-2px); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    .phdq-header { padding: 18px 16px 14px; }
    .phdq-body   { padding: 20px 16px; }
    .phdq-position-number { font-size: 2.2rem; min-width: 54px; }
    [data-phdq-title] { font-size: 10px; }
    .phdq-pixel-block { width: 12px; height: 12px; }
}

/* ── Keyframes ──────────────────────────────────────── */
@keyframes phdq-boot {
    0%   { opacity: 0; clip-path: inset(50% 0); }
    60%  { opacity: 1; clip-path: inset(8% 0); }
    100% { opacity: 1; clip-path: inset(0% 0); }
}
@keyframes phdq-spin   { to { transform: rotate(360deg); } }
@keyframes phdq-blink  { 0%,49% { opacity:1; } 50%,100% { opacity:0; } }
@keyframes phdq-bar-pulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }
@keyframes phdq-number-bump {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.4) translateY(-6px); color: var(--ph-aqua); }
    65%  { transform: scale(1.1) translateY(-2px); }
    100% { transform: scale(1) translateY(0); }
}
@keyframes phdq-shine  { 0% { left:-100%; } 100% { left:200%; } }
@keyframes phdq-glow-pulse {
    from { text-shadow: 0 0 8px rgba(127,255,218,.3); }
    to   { text-shadow: 0 0 18px rgba(127,255,218,.9); }
}
@keyframes phdq-msg-fade {
    from { opacity:0; transform:translateY(6px); }
    to   { opacity:1; transform:translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    [data-phdq-app], [data-phdq-queue-box], .phdq-spinner,
    .phdq-live-dot, .phdq-pixel-block, .phdq-header::after {
        animation: none !important; transition: none !important;
    }
}

/* ═══════════════════════════════════════════════
   COUNTDOWN — v1.0.0 additions
═══════════════════════════════════════════════ */

.phdq-countdown-wrap {
    text-align: center;
    padding: 32px 20px 24px;
    animation: phdq-boot .35s steps(4) both;
}

.phdq-cd-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: var(--ph-cyan);
    letter-spacing: .12em;
    text-shadow: 0 0 10px var(--ph-cyan);
    margin-bottom: 20px;
}

.phdq-cd-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.phdq-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-panel);
    border: 2px solid var(--ph-purple);
    padding: 14px 16px;
    min-width: 80px;
    box-shadow:
        0 0 0 1px var(--bg-dark),
        0 0 12px rgba(116,1,184,.3);
}

.phdq-cd-unit span {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    line-height: 1;
    color: var(--ph-aqua);
    text-shadow:
        2px 2px 0 var(--ph-purple),
        0 0 20px rgba(127,255,218,.5);
    display: block;
    min-width: 2ch;
    text-align: center;
    /* smooth digit changes */
    transition: color .2s ease;
}

.phdq-cd-unit small {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: var(--text-muted);
    letter-spacing: .08em;
}

.phdq-cd-sep {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.8rem;
    color: var(--ph-purple);
    line-height: 1;
    padding-bottom: 18px; /* align with digits */
    animation: phdq-blink 1s steps(1) infinite;
}

.phdq-cd-sub {
    font-size: 13px;
    color: rgba(255,255,255,.65);
    font-weight: 700;
    line-height: 1.5;
}

@media (max-width: 420px) {
    .phdq-cd-unit { min-width: 60px; padding: 10px 10px; }
    .phdq-cd-unit span { font-size: 1.4rem; }
    .phdq-cd-sep { font-size: 1.4rem; }
}

/* ═══════════════════════════════════════════════
   SOLD OUT — v1.0.0 additions
═══════════════════════════════════════════════ */

.phdq-sold-out-notice {
    padding: 36px 24px;
    background: linear-gradient(160deg, #1a0505, #0d0d14);
    border-top: 4px solid #dc2626;
    text-align: center;
    animation: phdq-boot .3s steps(4) both;
    position: relative;
    overflow: hidden;
}

/* subtle pulse border for sold out */
.phdq-sold-out-notice::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(220,38,38,.3);
    animation: phdq-sold-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.phdq-sold-out-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(220,38,38,.7));
    animation: phdq-sold-wobble 2s ease-in-out infinite;
}

.phdq-sold-out-notice p {
    color: rgba(255,255,255,.8);
    font-size: 13px;
    line-height: 1.7;
    font-weight: 600;
    margin-bottom: 10px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.phdq-sold-out-notice p strong {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #f87171;
    margin-bottom: 14px;
    line-height: 1.8;
    text-shadow: 0 0 12px rgba(239,68,68,.6);
}

@keyframes phdq-sold-pulse {
    0%,100% { opacity: .3; }
    50%      { opacity: .8; }
}

@keyframes phdq-sold-wobble {
    0%,100% { transform: scale(1); }
    25%     { transform: scale(1.08) rotate(-3deg); }
    75%     { transform: scale(1.08) rotate(3deg); }
}
