@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-deep: #030306;
    --bg-elevated: rgba(12, 12, 18, 0.72);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(139, 92, 246, 0.35);
    --text-primary: #f4f4f5;
    --text-muted: #71717a;
    --accent: #8b5cf6;
    --accent-bright: #a78bfa;
    --cyan: #22d3ee;
    --glow: rgba(139, 92, 246, 0.15);
}

* {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
}

.ark-bg {
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(34, 211, 238, 0.06), transparent),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.glass {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.glass:hover {
    border-color: var(--border-accent);
    box-shadow: 0 8px 32px var(--glow);
}

.project-card:hover {
    transform: translateY(-3px);
}

.ark-input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.35);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ark-input:focus {
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.ark-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.8125rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
    border: 1px solid rgba(167, 139, 250, 0.25);
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.25);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.ark-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.35);
}

.ark-btn-ghost {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.ark-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* App shell + sidebar */
:root {
    --sidebar-width: 4.25rem;
    --sidebar-width-expanded: 14.5rem;
    --sidebar-current: var(--sidebar-width);
}

html.sidebar-expanded {
    --sidebar-current: var(--sidebar-width-expanded);
}

.app-shell {
    min-height: 100dvh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-current);
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(8, 8, 12, 0.92);
    border-right: 1px solid var(--border-subtle);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.app-sidebar-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.25rem;
    padding: 0.875rem 0.625rem;
    border-bottom: 1px solid var(--border-subtle);
    overflow: visible;
}

html.sidebar-expanded .app-sidebar-head {
    justify-content: flex-start;
    padding: 0.875rem 0.75rem 0.875rem 0.875rem;
}

.app-sidebar-head::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(139, 92, 246, 0.14), transparent 55%),
        radial-gradient(circle at 85% 100%, rgba(34, 211, 238, 0.08), transparent 50%);
    pointer-events: none;
}

.app-sidebar-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    text-decoration: none;
    color: var(--text-primary);
}

html.sidebar-expanded .app-sidebar-brand {
    justify-content: flex-start;
}

.app-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.app-sidebar-toggle-icon {
    transition: transform 0.28s ease;
}

html.sidebar-expanded .app-sidebar-toggle-icon {
    transform: rotate(180deg);
}

.app-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 0.625rem;
    overflow-y: auto;
}

.app-sidebar-link,
.app-sidebar-action {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.625rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.app-sidebar-link:hover,
.app-sidebar-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.app-sidebar-link.is-active {
    background: rgba(34, 211, 238, 0.1);
    color: var(--cyan);
}

.app-sidebar-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-sidebar-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.app-sidebar-label {
    white-space: nowrap;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.28s ease;
}

html.sidebar-expanded .app-sidebar-label {
    opacity: 1;
    width: auto;
}

.app-sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 0.625rem 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.app-sidebar-foot .app-sidebar-link,
.app-sidebar-foot .app-sidebar-action {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
}

.app-sidebar-foot-sep {
    height: 1px;
    margin: 0.3rem -0.625rem;
    background: var(--border-subtle);
}

.app-sidebar-link--foot {
    width: 100%;
}

.app-sidebar-logout-form {
    width: 100%;
}

.app-sidebar-action--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.app-content {
    min-height: 100dvh;
    margin-left: var(--sidebar-current);
    transition: margin-left 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

@media (min-width: 640px) {
    .app-main {
        padding: 2rem 1.5rem 2.5rem;
    }
}

.app-footer {
    padding: 1rem 1.5rem 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: #52525b;
    letter-spacing: 0.04em;
    border-top: 1px solid var(--border-subtle);
}

html.light .app-sidebar-inner {
    background: rgba(255, 255, 255, 0.94);
}

/* Нижняя панель с пупыркой-замком */
.auth-dock {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
    pointer-events: none;
}

.auth-dock-sheet {
    pointer-events: auto;
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    background: rgba(10, 10, 14, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
    transform: translateY(calc(100% - 3rem));
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    min-height: 3rem;
}

.auth-dock.is-open .auth-dock-sheet {
    transform: translateY(0);
}

.auth-dock-bubble {
    position: absolute;
    top: -1.85rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 3.5rem;
    height: 3.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.35rem;
    border: 1px solid var(--border-subtle);
    border-bottom: none;
    border-radius: 1.1rem 1.1rem 0.65rem 0.65rem;
    background: linear-gradient(180deg, rgba(18, 18, 26, 0.98) 0%, rgba(10, 10, 14, 0.94) 100%);
    color: var(--accent-bright);
    cursor: pointer;
    box-shadow:
        0 -6px 24px rgba(139, 92, 246, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: color 0.2s, border-color 0.2s, box-shadow 0.25s;
}

.auth-dock-bubble:hover {
    color: var(--cyan);
    border-color: var(--border-accent);
    box-shadow:
        0 -8px 28px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-dock.is-open .auth-dock-bubble {
    color: var(--cyan);
    border-color: rgba(34, 211, 238, 0.35);
}

.auth-dock-bubble svg {
    width: 1.25rem;
    height: 1.25rem;
}

.auth-dock-peek {
    display: block;
    width: 100%;
    height: 3rem;
    border: none;
    border-radius: 1rem 1rem 0 0;
    background: transparent;
    cursor: pointer;
}

.auth-dock.is-open .auth-dock-peek {
    display: none;
    height: 0;
}

.auth-dock-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease;
}

.auth-dock.is-open .auth-dock-body {
    max-height: 10rem;
    opacity: 1;
}

.auth-dock-body-inner {
    padding: 0.75rem 1rem 1rem;
    width: 100%;
}

@media (min-width: 640px) {
    .auth-dock-body-inner {
        padding: 0.75rem 1.5rem 1.25rem;
    }
}

.auth-form-error {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.auth-form-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 640px) {
    .auth-form-row {
        gap: 0.75rem;
    }
}

.auth-form-field {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
}

.auth-form-remember {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.auth-form-remember input {
    width: 0.875rem;
    height: 0.875rem;
    accent-color: var(--accent);
}

@media (max-width: 480px) {
    .auth-form-remember-text {
        display: none;
    }
}

.auth-form-submit {
    flex-shrink: 0;
    padding: 0.625rem 1.125rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border: 1px solid rgba(167, 139, 250, 0.25);
    white-space: nowrap;
    transition: filter 0.2s, transform 0.15s;
}

.auth-form-submit:hover {
    filter: brightness(1.08);
}

.auth-form-submit:active {
    transform: scale(0.98);
}

.auth-form-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.auth-form-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.auth-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.auth-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

html.light .auth-dock-sheet,
html.light .auth-dock-bubble {
    background: rgba(255, 255, 255, 0.96);
}

html.light .auth-dock-bubble {
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.96) 100%);
}

.ark-header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(3, 3, 6, 0.75);
    backdrop-filter: blur(16px);
}

.ark-nav-link {
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
}

.ark-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.ark-nav-link.is-active {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
}

.ark-alert-error {
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.08);
    padding: 0.75rem 1rem;
    color: #fca5a5;
    font-size: 0.875rem;
}

.ark-alert-success {
    border-radius: 0.75rem;
    border: 1px solid rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
    padding: 0.75rem 1rem;
    color: #86efac;
    font-size: 0.875rem;
}

.drop-zone.dragover {
    border-color: var(--cyan);
    background: rgba(34, 211, 238, 0.06);
}

html.light .ark-bg {
    background-color: #fafafa;
    color: #18181b;
}

html.light .glass {
    background: rgba(255, 255, 255, 0.9);
}

html.light .auth-sheet {
    background: rgba(255, 255, 255, 0.96);
}

html.light .ark-input {
    background: #fff;
    color: #18181b;
}

.mc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.625rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.mc-status-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
}

.mc-status-group .mc-status {
    margin-top: 0;
}

.mc-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #a5b4fc;
}

.mc-version-badge--muted {
    opacity: 0.65;
}

.mc-game-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #fcd34d;
}

.mc-game-time-badge--night {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.28);
    color: #c4b5fd;
}

.mc-game-time-badge--muted {
    opacity: 0.65;
}

.mc-game-time-sep {
    opacity: 0.7;
}

.mc-weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #7dd3fc;
}

.mc-weather-badge--rain {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
    color: #93c5fd;
}

.mc-weather-badge--thunder {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.28);
    color: #c4b5fd;
}

.mc-weather-badge--muted {
    opacity: 0.65;
}

.mc-memory-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #6ee7b7;
}

.mc-memory-label {
    opacity: 0.85;
}

.is-hidden {
    display: none !important;
}

.mc-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.mc-status--online {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.mc-status--online .mc-status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.mc-status--offline {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.mc-status--offline .mc-status-dot {
    background: #ef4444;
}

.mc-status--starting {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

.mc-status--starting .mc-status-dot {
    background: #f59e0b;
    animation: mc-status-pulse 1.4s ease-in-out infinite;
}

@keyframes mc-status-pulse {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
    }
    50% {
        opacity: 0.65;
        box-shadow: 0 0 10px 2px rgba(245, 158, 11, 0.35);
    }
}

.dip-age-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.625rem;
}

.dip-age-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dip-age-badge--16 {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #93c5fd;
}

.dip-age-badge--18 {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.28);
    color: #fdba74;
}

.dip-age-badge--21 {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fca5a5;
}
