:root {
    --bg-deep: #050816;
    --bg-mid: #0c122b;
    --card-bg: rgba(13, 20, 46, 0.72);
    --card-border: rgba(112, 224, 255, 0.22);
    --text-main: #f3f6ff;
    --text-muted: #9aa8cc;
    --cyan: #38e8ff;
    --gold: #ffd166;
    --rose: #ff5c8a;
    --emerald: #34d399;
    --danger: #fb7185;
    --radius-lg: 22px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at 20% 20%, #191342 0%, #090e24 48%, #040611 100%);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.55;
}

#cosmic-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.nebula-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(95px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.nebula-1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #5b21b6, transparent 70%);
    top: -120px;
    right: -80px;
}

.nebula-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #0284c7, transparent 70%);
    bottom: -100px;
    left: -90px;
}

.page-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    gap: 22px;
}

.admin-wrapper {
    justify-content: flex-start;
    max-width: 1180px;
    margin: 0 auto;
    padding-top: 32px;
    padding-bottom: 48px;
}

.hero-header {
    text-align: center;
    max-width: 640px;
}

.team-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(56, 232, 255, 0.1);
    border: 1px solid rgba(56, 232, 255, 0.32);
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.65; }
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.55rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(120deg, #ffffff 10%, #7dd3fc 52%, #ffd166 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 0.96rem;
}

.glass-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 28px;
}

.main-card {
    max-width: 640px;
}

.view-panel {
    display: none;
    animation: fadeSlide 0.28s ease-out;
}

.view-panel.active {
    display: block;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.28rem;
    text-align: center;
    margin-bottom: 8px;
}

.panel-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.93rem;
    margin-bottom: 18px;
}

.muted-text {
    color: var(--text-muted);
    text-align: center;
}

.highlight-cyan {
    color: var(--cyan);
}

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}

.step-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-pill.active {
    background: rgba(56, 232, 255, 0.14);
    color: var(--cyan);
    border-color: rgba(56, 232, 255, 0.45);
}

.step-pill.done {
    background: rgba(52, 211, 153, 0.14);
    color: var(--emerald);
    border-color: rgba(52, 211, 153, 0.4);
}

.step-line {
    width: 28px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
}

.step-line.active {
    background: linear-gradient(90deg, var(--emerald), var(--cyan));
}

/* Inputs & Member Grid */
.search-box-wrap {
    margin-bottom: 14px;
}

.cosmic-input,
.cosmic-textarea {
    width: 100%;
    background: rgba(5, 8, 22, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cosmic-input:focus,
.cosmic-textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(56, 232, 255, 0.15);
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 10px;
    max-height: 310px;
    overflow-y: auto;
    padding: 4px 2px 6px;
    margin-bottom: 18px;
}

.member-grid::-webkit-scrollbar {
    width: 6px;
}
.member-grid::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 999px;
}

.member-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.member-item:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(56, 232, 255, 0.55);
    background: rgba(56, 232, 255, 0.08);
}

.member-item.selected {
    border-color: var(--cyan);
    background: rgba(56, 232, 255, 0.16);
    box-shadow: 0 0 18px rgba(56, 232, 255, 0.22);
}

.member-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

.member-item-name {
    font-weight: 600;
    font-size: 0.94rem;
    word-break: break-word;
}

.member-item-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.member-item.selected .member-item-tag {
    color: var(--cyan);
}

.member-item:disabled .member-item-tag {
    color: var(--gold);
}

/* Buttons */
.action-row {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.split-actions {
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s, background 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 0.82rem;
    border-radius: 9px;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    box-shadow: 0 8px 22px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(6, 182, 212, 0.45);
}

.btn-gold {
    background: linear-gradient(135deg, #ffd166, #f59e0b);
    color: #151004;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.btn-gold:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.35);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.42);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.3);
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.42);
}

.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.32);
}

/* Visuals & Banners */
.state-icon {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 10px;
}

.loader-orbit {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 12px auto 16px;
}

.orbit-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(56, 232, 255, 0.45);
    animation: spinOrbit 3s linear infinite;
}

.orbit-planet {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gold), #f97316);
    box-shadow: 0 0 18px var(--gold);
}

@keyframes spinOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.capsule-visual {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 6px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capsule-core {
    font-size: 2.5rem;
    z-index: 2;
    animation: floatGift 2.6s ease-in-out infinite;
}

.capsule-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 209, 102, 0.45);
    box-shadow: 0 0 24px rgba(255, 209, 102, 0.25);
    animation: spinOrbit 8s linear infinite;
}

@keyframes floatGift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.warp-rocket {
    font-size: 3.4rem;
    text-align: center;
    margin: 10px auto 14px;
    animation: rocketShake 0.4s infinite alternate;
}

@keyframes rocketShake {
    from { transform: translateY(2px) rotate(-3deg); }
    to { transform: translateY(-4px) rotate(3deg); }
}

.warning-banner {
    background: rgba(255, 209, 102, 0.1);
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: var(--radius-md);
    padding: 13px 15px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    color: #fde68a;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.warning-banner.critical {
    background: rgba(255, 92, 138, 0.12);
    border-color: rgba(255, 92, 138, 0.42);
    color: #fecdd3;
    margin-top: 18px;
    margin-bottom: 0;
}

.error-banner {
    background: rgba(244, 63, 94, 0.16);
    border: 1px solid rgba(244, 63, 94, 0.48);
    color: #fecdd3;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.success-banner {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #a7f3d0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.info-pill {
    text-align: center;
    font-size: 0.86rem;
    color: var(--cyan);
    background: rgba(56, 232, 255, 0.08);
    border: 1px solid rgba(56, 232, 255, 0.25);
    border-radius: 12px;
    padding: 12px;
}

.hidden {
    display: none !important;
}

/* Result reveal */
.result-badge {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 10px;
}

.result-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.result-intro strong {
    color: var(--text-main);
}

.target-reveal-box {
    background: radial-gradient(circle at top, rgba(56, 232, 255, 0.18), rgba(255, 209, 102, 0.08));
    border: 1px solid rgba(255, 209, 102, 0.5);
    border-radius: 18px;
    padding: 26px 18px;
    text-align: center;
    box-shadow: 0 0 36px rgba(255, 209, 102, 0.18);
}

.target-stars {
    font-size: 1.45rem;
    margin-bottom: 8px;
}

.target-name {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 4.5vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 18px rgba(56, 232, 255, 0.55);
    word-break: break-word;
}

/* Footer */
.cosmic-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-admin-link {
    color: rgba(154, 168, 204, 0.65);
    text-decoration: none;
    border-bottom: 1px dotted rgba(154, 168, 204, 0.4);
}

.footer-admin-link:hover {
    color: var(--cyan);
}

/* Admin Panel Styles */
.admin-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.stat-card {
    padding: 18px 20px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cyan);
}

.stat-value.gold { color: var(--gold); }
.stat-value.emerald { color: var(--emerald); }
.stat-value.rose { color: var(--rose); }

.admin-two-col {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.section-heading {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.cosmic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.cosmic-table th,
.cosmic-table td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
}

.cosmic-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.chip-ok {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.chip-wait {
    background: rgba(255, 209, 102, 0.12);
    color: #fde68a;
    border: 1px solid rgba(255, 209, 102, 0.32);
}

.chip-warn {
    background: rgba(244, 63, 94, 0.16);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.4);
}

.chip-ip {
    background: rgba(56, 232, 255, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 232, 255, 0.3);
    font-size: 0.72rem;
    margin-left: 4px;
}

.inline-form {
    display: inline-block;
}

@media (max-width: 540px) {
    .glass-card {
        padding: 20px 16px;
    }
    .member-grid {
        grid-template-columns: 1fr 1fr;
    }
}
