/**
 * Server Runner v3.0 — UI styling for quest toasts, lobby modal, star HUD.
 * Loaded after server-runner-pro.css.
 *
 * Design language: stays consistent with the existing neon/glass aesthetic
 * already used by the runner. All sizes use rem so they scale on mobile
 * without separate media queries.
 */

/* ─────── Quest completion toast ─────── */
.sr-v3-quest-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    min-width: 240px;
    max-width: 320px;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 27, 75, 0.96));
    border: 1px solid rgba(250, 204, 21, 0.6);
    border-left: 4px solid #facc15;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 18px rgba(250, 204, 21, 0.25);
    color: #fef3c7;
    font-family: monospace;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sr-v3-quest-toast.sr-v3-show { transform: translateX(0); }
.sr-v3-quest-toast-title {
    font-size: 0.95rem; font-weight: 700; color: #facc15;
    margin-bottom: 0.25rem; letter-spacing: 0.04em;
}
.sr-v3-quest-toast-body {
    font-size: 0.8rem; color: #e2e8f0; margin-bottom: 0.4rem;
}
.sr-v3-quest-toast-reward {
    font-size: 0.78rem; color: #4ade80; font-weight: 600;
}

/* ─────── Star HUD badge (in-run + lobby) ─────── */
.sr-v3-star-hud {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: 999px;
    color: #fde047;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
}
.sr-v3-star-hud-icon { font-size: 0.95rem; line-height: 1; }

/* ─────── Lobby modal — character + planet picker before run ─────── */
.sr-v3-lobby-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99998;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.sr-v3-lobby-overlay.sr-v3-open { opacity: 1; pointer-events: auto; }
.sr-v3-lobby-modal {
    width: min(900px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #0f172a, #1e1b4b);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    color: #e2e8f0;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
    font-family: system-ui, -apple-system, sans-serif;
}
.sr-v3-lobby-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.sr-v3-lobby-title {
    font-size: 1.25rem; font-weight: 700;
    background: linear-gradient(90deg, #f472b6, #a78bfa, #22d3ee);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.04em;
}
.sr-v3-lobby-close {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fca5a5; cursor: pointer;
    padding: 0.4rem 0.8rem; border-radius: 6px;
    font-family: monospace; font-size: 0.8rem;
}
.sr-v3-lobby-close:hover { background: rgba(248, 113, 113, 0.25); }
.sr-v3-lobby-section { margin-bottom: 1.5rem; }
.sr-v3-lobby-section-title {
    font-size: 0.8rem; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-bottom: 0.6rem; font-weight: 600;
}
.sr-v3-lobby-grid {
    display: grid; gap: 0.6rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.sr-v3-char-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
}
.sr-v3-char-card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.6);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.18);
}
.sr-v3-char-card.sr-v3-active {
    border-color: #fde047; box-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.08);
}
.sr-v3-char-card.sr-v3-locked { opacity: 0.55; cursor: not-allowed; }
.sr-v3-char-card-name { font-size: 0.95rem; font-weight: 700; color: #fef3c7; margin-bottom: 0.15rem; }
.sr-v3-char-card-tag  { font-size: 0.72rem; color: #94a3b8; margin-bottom: 0.4rem; }
.sr-v3-char-card-stats {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.7rem; color: #cbd5e1;
}
.sr-v3-char-card-stat {
    padding: 0.1rem 0.35rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 999px;
}
.sr-v3-char-card-power {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.2);
    font-size: 0.72rem;
    color: #fde68a;
}
.sr-v3-char-card-cost {
    position: absolute; top: 0.5rem; right: 0.5rem;
    font-size: 0.7rem; color: #fde047;
    background: rgba(250, 204, 21, 0.12);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.sr-v3-lobby-actions {
    display: flex; gap: 0.6rem; justify-content: flex-end;
    margin-top: 0.5rem;
}
.sr-v3-lobby-play {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: #052e16; border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    font-family: monospace;
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: transform 0.1s, box-shadow 0.15s;
}
.sr-v3-lobby-play:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45); }

/* Mobile tap target for power activation (Q key on desktop) */
.sr-v3-power-btn {
    position: absolute;
    bottom: 0.5rem; right: 0.5rem;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(250, 204, 21, 0.15);
    border: 2px solid rgba(250, 204, 21, 0.5);
    color: #fde047;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.1s;
}
.sr-v3-power-btn:active { transform: scale(0.92); }
.sr-v3-power-btn.sr-v3-cooling {
    opacity: 0.45; border-color: rgba(148, 163, 184, 0.3); color: #94a3b8;
}
@media (max-width: 575.98px) {
    .sr-v3-quest-toast { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; max-width: none; }
    .sr-v3-lobby-modal { width: 95vw; padding: 1rem; }
    .sr-v3-power-btn { bottom: 1rem; right: 1rem; }
}
