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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    background: linear-gradient(135deg, #5865f2, #7289da);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.main-content {
    padding: 30px 20px;
}

.token-section {
    margin-bottom: 30px;
}

.token-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.token-section {
    position: static;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

#token {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#token:focus {
    outline: none;
    border-color: #5865f2;
    background: white;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.badge-selection h3 {
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.badge-options {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.badge-option {
    flex: 1;
    padding: 20px 10px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.badge-option:hover {
    border-color: #5865f2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.2);
}

.badge-option.selected {
    border-color: #5865f2;
    background: linear-gradient(135deg, #5865f2, #7289da);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.3);
}

.badge-icon {
    /* font-size: 24px; Removed font-size as we are using images */
    margin-bottom: 8px;
    display: flex;
    /* Changed to flex for better centering if needed */
    justify-content: center;
    align-items: center;
}

.badge-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.badge-option:hover .badge-icon img {
    transform: scale(1.1);
}

.badge-option span {
    font-size: 12px;
    font-weight: 500;
}

.bravery {
    color: #43b581;
}

.brilliance {
    color: #9c84ef;
}

.balance {
    color: #f04747;
}

.badge-option.selected .bravery,
.badge-option.selected .brilliance,
.badge-option.selected .balance {
    color: white;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.set-btn {
    background: linear-gradient(135deg, #43b581, #5cbf2a);
    color: white;
}

.set-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 181, 129, 0.4);
}

.set-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.remove-btn {
    background: linear-gradient(135deg, #f04747, #d63031);
    color: white;
}

.remove-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 71, 71, 0.4);
}

.status-section {
    margin-bottom: 20px;
}

.status-message {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 15px;
    min-height: 20px;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #5865f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.footer p {
    margin-bottom: 5px;
}

.footer strong {
    color: #f04747;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .badge-options {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .main-content {
        padding: 20px 15px;
    }
}

/* Hover effects for better UX */
.action-btn:active {
    transform: translateY(0);
}

.badge-option:active {
    transform: translateY(0);
}

/* Focus styles for accessibility */
.action-btn:focus,
.badge-option:focus {
    outline: 2px solid #5865f2;
    outline-offset: 2px;
}

/* Animation for status messages */
.status-message {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}