:root {
    --bg-dark: #0a0c10;
    --card-bg: rgba(18, 22, 34, 0.75);
    --card-border: rgba(255, 185, 0, 0.15);
    --card-border-glow: rgba(255, 185, 0, 0.35);
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.4);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.4);
    --yellow: #eab308;
    --yellow-glow: rgba(234, 179, 8, 0.4);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Atmospheric Lighting */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #f59e0b, transparent 70%);
    top: -150px;
    right: -100px;
}

.orb-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #10b981, transparent 70%);
    bottom: -200px;
    left: -150px;
}

/* Glassmorphic Container */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
}

.view {
    position: relative;
    z-index: 1;
    width: 100%;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hidden {
    display: none !important;
}

/* --- LOGIN VIEW --- */
#login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    text-align: center;
    border-top: 2px solid var(--gold);
}

.logo-shield {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    margin-bottom: 16px;
    box-shadow: 0 0 25px var(--gold-glow);
}

.game-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
}

.error-banner {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--red);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    user-select: none;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Disabled State Styling */
.btn:disabled,
.btn[disabled] {
    opacity: 0.28 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.9) brightness(0.7) !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-weight: 700;
    box-shadow: 0 8px 25px var(--gold-glow);
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 12px 30px var(--gold-glow);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000;
    font-weight: 700;
    box-shadow: 0 8px 25px var(--yellow-glow);
}

.btn-warning:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 12px 30px var(--yellow-glow);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 8px 25px var(--green-glow);
}

.btn-success:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 12px 30px var(--green-glow);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 8px 25px var(--red-glow);
}

.btn-danger:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 12px 30px var(--red-glow);
}

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

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 16px;
}

.full-width {
    width: 100%;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.spin-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* --- DASHBOARD VIEW --- */
.top-nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    color: var(--gold);
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    color: #f3f4f6;
}

.dashboard-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero Status Card */
.hero-status-card {
    padding: 32px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b7280;
}

.status-online {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.status-online .status-dot {
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

.status-offline {
    border-color: var(--red);
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.status-offline .status-dot {
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.status-sleeping {
    border-color: var(--yellow);
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
}

.status-sleeping .status-dot {
    background: var(--yellow);
    box-shadow: 0 0 12px var(--yellow);
}

.status-waking {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-waking .status-dot {
    background: var(--gold);
    box-shadow: 0 0 16px var(--gold);
    animation: pulse 0.8s infinite;
}

.live-pulse {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

.server-title-row {
    margin-bottom: 30px;
}

.server-title-row h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.world-meta {
    color: var(--text-muted);
    font-size: 15px;
}

.world-meta strong {
    color: var(--gold);
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.action-feedback {
    margin-top: 16px;
    padding: 14px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--gold);
    color: #fde68a;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

/* Info Card */
.info-card {
    padding: 28px 32px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--gold);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.card-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-muted);
}

.spec-val {
    font-weight: 600;
    color: #e5e7eb;
}

.spec-val.code {
    font-family: var(--font-mono);
    color: #fde047;
}

.val-copy-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--gold);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2937;
    border: 1px solid var(--gold);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    font-size: 14px;
    z-index: 100;
    animation: slideIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr !important;
    }
    .hero-status-card, .info-card {
        padding: 24px 18px;
    }
}