* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #f8b500;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --text-dark: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-dark);
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.main-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: var(--white);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--bg-gradient-2);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 10;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-admin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-admin:hover::before {
    width: 300px;
    height: 300px;
}

.btn-admin:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-admin:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Інформаційна панель користувача */
.user-info-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.user-info-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.user-icon {
    font-size: 1.5rem;
}

.current-quest-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 15px;
    border-left: 4px solid var(--accent-color);
}

.info-label {
    font-weight: 600;
    color: var(--text-dark);
}

.current-quest-name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Секції квестів */
.quests-section {
    margin-bottom: 40px;
    /* Всі квести відображаються без обмежень */
    overflow: visible;
    max-height: none;
}

.section-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--white);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    text-align: center;
}

.quests-container {
    margin-top: 40px;
    /* Всі квести відображаються без обмежень */
    overflow: visible;
}

.quests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
    /* Немає обмежень на кількість відображених квестів - всі квести будуть показані */
    overflow: visible !important;
    max-height: none !important;
    min-height: auto;
    height: auto !important;
    grid-auto-rows: auto;
}

.quest-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease backwards;
}

.quest-card:nth-child(1) { animation-delay: 0.1s; }
.quest-card:nth-child(2) { animation-delay: 0.2s; }
.quest-card:nth-child(3) { animation-delay: 0.3s; }
.quest-card:nth-child(4) { animation-delay: 0.4s; }
.quest-card:nth-child(5) { animation-delay: 0.5s; }
.quest-card:nth-child(6) { animation-delay: 0.6s; }

.quest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--bg-gradient-2);
}

.quest-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.quest-card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.quest-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-family: 'Dancing Script', cursive;
}

.quest-card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Модальні вікна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border-radius: 25px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.greeting-content {
    text-align: center;
    max-width: 700px;
}

.greeting-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.greeting-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.greeting-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.greeting-text p {
    margin-bottom: 15px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.form-actions .btn {
    flex: 1;
}

/* Адмін панель */
.admin-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 25px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.admin-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 25px 25px 0 0;
}

.admin-panel.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-20px);
}

.admin-panel h2 {
    color: var(--text-dark);
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-panel h2::before {
    content: '🔐';
    font-size: 2rem;
    -webkit-text-fill-color: initial;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.admin-quests-list {
    display: grid;
    gap: 15px;
}

.admin-quest-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.admin-quest-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-left-color: #667eea;
}

.admin-quest-item-info h3 {
    color: var(--text-dark);
    margin-bottom: 5px;
}

.admin-quest-item-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.admin-quest-item-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-danger {
    background: #e74c3c;
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #28a745;
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

/* Повідомлення про помилку */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
    font-size: 0.95rem;
    text-align: center;
}

/* Вміст квесту */
.quest-content {
    max-width: 800px;
}

.quest-view-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.quest-view-content p {
    margin-bottom: 20px;
}

.quest-button {
    display: inline-block;
    margin: 10px 10px 10px 0;
    padding: 15px 30px;
    background: var(--bg-gradient-2);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.quest-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.edit-quest-modal {
    max-width: 700px;
}

/* Стилі для користувачів в адмін-панелі */
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.user-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.user-card.user-active {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.user-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.user-card h4 {
    margin: 0;
    color: var(--text-dark);
    flex: 1;
}

.user-status-badge {
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-card-info {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-quests-summary {
    margin-top: 10px;
}

.user-card .btn-danger {
    margin-top: 10px;
    font-size: 0.85rem;
    padding: 8px 15px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-status.online {
    color: #28a745;
}

.user-status.offline {
    color: #6c757d;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.user-status.online .status-indicator {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
}

.user-status.offline .status-indicator {
    background: #6c757d;
}

.status-text {
    font-weight: 600;
}

.admin-section {
    margin-bottom: 30px;
}

.admin-quests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Стилі для квестів користувача */
.user-quests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.user-quest-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    border-left: 5px solid #ccc;
    transition: all 0.3s ease;
}

.user-quest-card.quest-status-completed {
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
    border-left-color: #28a745;
}

.user-quest-card.quest-status-in-progress {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border-left-color: #ffc107;
}

.user-quest-card.quest-status-not-started {
    background: rgba(255, 255, 255, 0.95);
    border-left-color: #ccc;
}

.user-quest-status {
    font-weight: 600;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
}

.quest-status-completed .user-quest-status {
    background: #d4edda;
    color: #155724;
}

.quest-status-in-progress .user-quest-status {
    background: #fff3cd;
    color: #856404;
}

.quest-status-not-started .user-quest-status {
    background: #e9ecef;
    color: #6c757d;
}

.user-quest-card h4 {
    margin: 10px 0;
    color: var(--text-dark);
}

.user-quest-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Квест в процесі */
.quest-in-progress {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 5px solid #ffc107;
}

.quest-in-progress-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffc107;
    color: #856404;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Виконаний квест */
.quest-completed {
    opacity: 0.8;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 5px solid #28a745;
}

.quest-completed-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quest-completed:hover {
    transform: translateY(-5px) scale(1.01);
}

/* Закриті квести */
.quest-closed {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-left: 5px solid #6c757d;
    opacity: 0.7;
    cursor: not-allowed !important;
    filter: grayscale(0.5);
}

.quest-closed:hover {
    transform: none !important;
    box-shadow: var(--shadow) !important;
}

.quest-closed-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #6c757d;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quest-closed .quest-card-icon {
    opacity: 0.6;
}

.quest-closed .quest-card-title {
    color: #6c757d;
}

.quest-closed .quest-card-description {
    color: #868e96;
}

/* Підказка квесту */
.quest-hint {
    animation: fadeIn 0.5s ease;
}

/* Вміст квесту */
.word-input-section {
    animation: slideUp 0.3s ease;
}

/* Модальне вікно з кавою */
.coffee-content {
    text-align: center;
    max-width: 400px;
}

.coffee-emoji {
    font-size: 8rem;
    animation: bounce 2s infinite;
    margin: 20px 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивність */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    .btn-admin {
        position: static;
        margin-top: 15px;
    }

    .quests-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 25px;
    }

    .greeting-title {
        font-size: 2rem;
    }

    .greeting-text {
        font-size: 1rem;
    }

    .admin-quest-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-quest-item-actions {
        width: 100%;
    }

    .admin-quest-item-actions .btn {
        flex: 1;
    }
    
    .user-info-panel {
        padding: 20px;
    }
    
    .user-name {
        font-size: 1.1rem;
    }
    
    .current-quest-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .users-list {
        grid-template-columns: 1fr;
    }
    
    .user-quests-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-quests-grid {
        grid-template-columns: 1fr;
    }
}
