:root {
    --primary: #6366f1;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-error {
    background: var(--error);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 16px;
}

.card-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 16px;
    min-height: 44px;
    transition: border-color 0.15s;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-error {
    border-color: var(--error);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

.navbar-toggle-input {
    display: none;
}

.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

.navbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 44px;
}

.navbar-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.navbar-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: all 0.3s ease;
    margin: auto;
}

.navbar-toggle-bar::before,
.navbar-toggle-bar::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
    left: 0;
}

.navbar-toggle-bar::before {
    top: -8px;
}

.navbar-toggle-bar::after {
    top: 8px;
}

.navbar-toggle-active .navbar-toggle-bar {
    background: transparent;
}

.navbar-toggle-active .navbar-toggle-bar::before {
    top: 0;
    transform: rotate(45deg);
}

.navbar-toggle-active .navbar-toggle-bar::after {
    top: 0;
    transform: rotate(-45deg);
}

.navbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-menu li {
    margin: 0;
    padding: 0;
}

.navbar-link {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.navbar-link:hover {
    background: #f5f3ff;
    color: var(--primary);
}

.navbar-link-accent {
    color: var(--primary);
    font-weight: 600;
}

.navbar-link-danger {
    color: var(--error);
}

.navbar-link-danger:hover {
    background: #fee2e2;
    color: var(--error);
}

.navbar-link-upgrade {
    color: #d97706;
    font-weight: 700;
}

.navbar-link-register {
    background: var(--primary);
    color: white;
    text-align: center;
}

.navbar-link-register:hover {
    background: #4f46e5;
    color: white;
}

.navbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.navbar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
}

.navbar-backdrop-active {
    display: block;
}

/* Mobile Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    min-width: 0;
    transition: color 0.15s ease;
}

.bottom-nav-item:hover {
    color: var(--primary);
}

.bottom-nav-item-active {
    color: var(--primary);
}

.bottom-nav-item-danger {
    color: var(--error);
}

.bottom-nav-item-danger:hover {
    color: var(--error);
}

.bottom-nav-icon {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav-admin {
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
}

.bottom-nav-admin .bottom-nav-item {
    flex: 0 0 auto;
    min-width: 84px;
    padding: 0 6px;
}

/* Quiz */
.quiz-option {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 16px 18px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.5;
    min-height: 44px;
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--primary);
    background: #f5f3ff;
}

.quiz-option:active:not(:disabled) {
    transform: scale(0.98);
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option.correct {
    border-color: var(--success);
    background: #d1fae5;
    color: #065f46;
}

.quiz-option.wrong {
    border-color: var(--error);
    background: #fee2e2;
    color: #991b1b;
}

.quiz-option strong {
    margin-right: 8px;
    color: var(--primary);
}

.quiz-option.correct strong,
.quiz-option.wrong strong {
    color: inherit;
}

/* HP bars */
.hp-bar {
    width: 100%;
    height: 14px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.hp-bar.boss-hp {
    height: 18px;
    background: #fee2e2;
}

.hp-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.hp-bar.boss-hp .hp-fill {
    background: var(--error);
}

@media (max-width: 767px) {
    .navbar-toggle {
        display: none;
    }

    .navbar-menu {
        display: none;
    }

    .navbar-link-register {
        margin-top: 8px;
    }

    body {
        padding-bottom: 76px;
    }

    .bottom-nav {
        display: flex;
    }
}

/* Admin Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 90;
    overflow-y: auto;
}

.admin-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 0 0 12px 8px;
}

.admin-sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.15s ease;
}

.admin-sidebar-link:hover {
    background: #f5f3ff;
    color: var(--primary);
}

.admin-sidebar-link-active {
    background: var(--primary);
    color: #ffffff;
}

.admin-sidebar-link-active:hover {
    background: var(--primary);
    color: #ffffff;
}

.admin-sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    font-size: 15px;
    opacity: 0.9;
}

.admin-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.admin-sidebar-link-danger {
    color: var(--error);
}

.admin-sidebar-link-danger:hover {
    background: #fee2e2;
    color: var(--error);
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }
}

