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

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

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

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

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

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 25px 40px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    max-width: 1100px;
    width: 95%;
    max-height: 98vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideUp 0.6s ease;
}

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

/* Lobby 3-Column Layout */
.lobby-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    max-width: 1400px;
    width: 98%;
    max-height: 98vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-title {
    text-align: center;
    color: #667eea;
    margin: 0;
    font-size: 1.8em;
    text-shadow: 2px 4px 6px rgba(0, 0, 0, 0.2);
}

.lobby-columns {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 10px;
    height: calc(98vh - 60px);
    overflow: hidden;
}

.lobby-column {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    padding: 10px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lobby-column h2 {
    color: #667eea;
    margin: 0 0 6px 0;
    font-size: 1.2em;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 6px;
}

.lobby-column h3 {
    color: #764ba2;
    margin: 6px 0 4px 0;
    font-size: 1em;
}

/* Left Column: Account */
.lobby-left {
    display: flex;
    flex-direction: column;
}

.account-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
}

.account-avatar {
    font-size: 3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.account-details {
    text-align: center;
    width: 100%;
}

.account-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    margin: 0 0 10px 0;
}

/* Center Column: Duck Customization */
.lobby-center {
    overflow-y: auto;
}

.duck-customization {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Right Column: Room Management */
.lobby-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.room-create-section,
.room-list-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-list-section {
    flex: 1;
    overflow-y: auto;
}

/* Room Configuration */
.room-config {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 10px;
    margin: 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-config h4 {
    margin: 0 0 6px 0;
    color: #4CAF50;
    font-size: 0.9em;
    font-weight: 600;
}

.config-section {
    margin-bottom: 8px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-label {
    display: block;
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 4px;
    font-weight: 500;
}

.config-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.config-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.config-checkbox:hover {
    background: rgba(255, 255, 255, 0.2);
}

.config-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #4CAF50;
}

.config-checkbox span {
    color: #fff;
    font-size: 0.8em;
}

.config-checkbox:hover span {
    color: #4CAF50;
}

/* Player Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.player-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.player-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.player-slider::-webkit-slider-thumb:hover {
    background: #45a049;
    transform: scale(1.1);
}

.player-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.2s;
}

.player-slider::-moz-range-thumb:hover {
    background: #45a049;
    transform: scale(1.1);
}

.slider-value {
    min-width: 28px;
    text-align: center;
    background: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
}

/* Field Validation */
.field-hint {
    display: none;
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 500;
}

.field-hint.show {
    display: block;
}

input.error, select.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

input.error:focus, select.error:focus {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.2) !important;
}

h1 {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8)); }
}

.app-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 1000;
    pointer-events: none;
}

.version-number {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75em;
    font-weight: 400;
}

h2 {
    color: #764ba2;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.6em;
}

input, select {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1),
                0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

button {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.3);
}

.secondary-btn:hover {
    box-shadow: 0 15px 35px rgba(245, 87, 108, 0.4);
}

.small-btn {
    padding: 10px 20px;
    font-size: 14px;
    width: auto;
    border-radius: 12px;
}

.error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Room Management */
.control-group {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

#rooms-list {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 15px;
    background: rgba(102, 126, 234, 0.05);
    padding: 10px;
}

#rooms-list::-webkit-scrollbar {
    width: 8px;
}

#rooms-list::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

#rooms-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.room-card {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.room-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #667eea;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

.room-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.room-info {
    color: #666;
    font-size: 0.95em;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.room-info span {
    background: rgba(102, 126, 234, 0.1);
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 500;
}

/* Waiting Room */
.player-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.player-item:hover {
    transform: translateX(5px);
    border-color: #667eea;
}

.player-item.ready {
    background: linear-gradient(135deg, rgba(76, 209, 55, 0.2) 0%, rgba(52, 211, 153, 0.2) 100%);
    border-color: #4cd137;
}

.player-item .badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
}

.player-item.ready .badge {
    background: linear-gradient(135deg, #4cd137 0%, #34d399 100%);
}

/* Game HUD */
#game-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    z-index: 100;
    pointer-events: none;
}

#game-hud > * {
    pointer-events: all;
}

.hud-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-weight: 600;
    color: #333;
    display: flex;
    gap: 20px;
    align-items: center;
    animation: slideDown 0.5s ease;
}

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

.hud-section span {
    color: #667eea;
}

#players-status {
    position: absolute;
    top: 90px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
}

.player-status {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.player-status:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#game-container {
    width: 100vw;
    height: calc(100vh - 150px);
    position: relative;
}

/* Weapon Controls */
#weapon-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideUp 0.5s ease;
    z-index: 200;
}

/* Weapons Panel */
.weapons-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideUp 0.5s ease;
}

.weapon-btn {
    width: auto;
    padding: 12px 24px;
    margin: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.weapon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s ease;
}

.weapon-btn:hover:not(:disabled)::before {
    left: 100%;
}

.weapon-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.weapon-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.weapon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Accessories Grid */
.accessories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 500px;
    margin-top: 4px;
}

.accessory-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 60px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    user-select: none;
}

.accessory-card:hover {
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.accessory-card:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.5);
    color: white;
}

.accessory-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.accessory-icon {
    font-size: 1.5em;
    line-height: 1;
}

.accessory-name {
    font-size: 0.7em;
    font-weight: 600;
    text-align: center;
    color: #667eea;
    margin-top: 2px;
}

.accessory-card:has(input[type="checkbox"]:checked) .accessory-name {
    color: white;
}

/* Color Swatches */
.color-swatches {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    width: 100%;
    padding: 4px;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.color-swatch.active {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.color-swatch.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2em;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-group label {
        min-width: auto;
    }

    .weapons-panel {
        flex-wrap: wrap;
        justify-content: center;
    }

    #game-hud {
        flex-direction: column;
    }
}

/* Tooltip */
[title] {
    position: relative;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3px;
    border-radius: 20px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content > * {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 18px;
}

.modal-content h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #2d3748;
    text-align: center;
}

.modal-content p {
    margin: 0 0 25px 0;
    font-size: 16px;
    color: #4a5568;
    text-align: center;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons button {
    min-width: 120px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-buttons .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.modal-buttons .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-buttons .btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Challenge Modal */
.challenge-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 3px;
    border-radius: 20px;
    min-width: 600px;
    max-width: 700px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.challenge-content > * {
    background: rgba(255, 255, 255, 0.95);
}

.challenge-content h2 {
    margin: 0;
    padding: 20px 30px 10px;
    font-size: 24px;
    color: #c0392b;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px 18px 0 0;
}

.challenge-warning {
    margin: 0;
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
}

.challenge-timer {
    margin: 0;
    padding: 10px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
}

.challenge-question {
    margin: 0;
    padding: 15px 30px 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
}

.code-snippet {
    margin: 0;
    padding: 20px 30px;
    background: #2d3748;
    color: #a0aec0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 0;
    overflow-x: auto;
    white-space: pre;
    text-align: left;
}

.challenge-content .modal-buttons {
    padding: 20px 30px 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 18px 18px;
}

.challenge-content .modal-buttons button {
    min-width: 200px;
}

/* Smooth transitions for all interactive elements */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Notification */
.floating-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    max-width: 500px;
    min-width: 300px;
}

.floating-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.floating-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.notification-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.notification-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    line-height: 1.4;
}

/* Update Notification */
.update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.update-notification.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.update-notification.dismissed {
    opacity: 0;
    transform: translateX(100px);
}

.update-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 400px;
}

.update-icon {
    font-size: 32px;
    animation: rotate 2s linear infinite;
}

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

.update-text h3 {
    color: #fff;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 4px;
}

.update-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9em;
}

.update-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 10px;
}

.update-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.update-btn.primary {
    background: #fff;
    color: #667eea;
}

.update-btn.primary:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.update-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.update-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsiveness for update notification */
@media (max-width: 480px) {
    .update-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .update-notification-content {
        flex-wrap: wrap;
        max-width: none;
        padding: 15px;
    }

    .update-actions {
        flex-direction: row;
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .update-btn {
        flex: 1;
    }
}

/* Duck Preview Click Animation */
.duck-preview canvas {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.duck-preview canvas:hover {
    transform: scale(1.02);
}

.duck-preview canvas.duck-jumping {
    animation: duckJump 0.4s ease-out;
}

@keyframes duckJump {
    0% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(-15px) scale(1.05);
    }
    50% {
        transform: translateY(-20px) scale(1.03);
    }
    70% {
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Rick Astley Easter Egg */
.version-number {
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
}

.rick-easter-egg {
    position: absolute;
    bottom: 100%;
    right: 0;
    font-size: 2rem;
    animation: rickPopUp 0.3s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
    margin-bottom: 5px;
}

.rick-easter-egg.rick-fade-out {
    animation: rickFadeOut 0.3s ease-out forwards;
}

@keyframes rickPopUp {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.5);
    }
    50% {
        transform: translateY(-5px) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rickFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.5);
    }
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 80px;
    left: 15px;
    width: 280px;
    max-height: 300px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-container.minimized {
    width: 50px;
    height: 50px;
    max-height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.chat-container.minimized .chat-header {
    border-radius: 50%;
    justify-content: center;
    padding: 0;
    height: 100%;
}

.chat-container.minimized .chat-title,
.chat-container.minimized .chat-body {
    display: none;
}

.chat-container.minimized .chat-header-right {
    position: relative;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 12px 12px 0 0;
    cursor: pointer;
}

.chat-title {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-unread-badge {
    background: #e74c3c;
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.chat-container.minimized .chat-unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
}

.chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85em;
    word-wrap: break-word;
}

.chat-message.own-message {
    background: rgba(102, 126, 234, 0.4);
    align-self: flex-end;
}

.chat-message-name {
    color: #ffd700;
    font-weight: 600;
    margin-right: 6px;
    font-size: 0.85em;
}

.chat-message.own-message .chat-message-name {
    color: #a8d4ff;
}

.chat-message-text {
    color: white;
}

.chat-input-container {
    display: flex;
    padding: 6px;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px 10px;
    color: white;
    font-size: 0.9em;
    outline: none;
    min-width: 0;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input:focus {
    border-color: rgba(102, 126, 234, 0.8);
}

.chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-send:hover {
    transform: scale(1.1);
}

.chat-send:active {
    transform: scale(0.95);
}

/* Mobile responsive chat */
@media (max-width: 600px) {
    .chat-container {
        width: 240px;
        bottom: 70px;
        left: 10px;
    }

    .chat-container.minimized {
        width: 45px;
        height: 45px;
    }

    .chat-messages {
        max-height: 140px;
    }
}
