body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #1a202c;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background: #ffffff;
    width: 100%;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4a90e2;
    cursor: pointer;
}

.tagline {
    font-size: 1rem;
    color: #718096;
    margin-top: 0.5rem;
}

main {
    max-width: 600px;
    width: 100%;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.question-container {
    background: #ffffff;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    width: 100%;
    max-width: calc(100% - 40px);
    text-align: center;
    margin: 0 20px;
}

@media (max-width: 768px) {
    .question-container {
        margin: 0 20px;
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
    }
    .toast {
        max-width: calc(100% - 40px);
        left: 20px !important;
        right: 20px !important;
    }
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.instruction {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1.5rem;
}

.input-area {
    margin-bottom: 1.5rem;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

button {
    background: #4a90e2;
    color: #ffffff;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #357abd;
}

.feedback {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #718096;
    min-height: 1.2rem;
}

.glitch {
    animation: glitch 0.3s ease-in-out 2;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 0); }
    80% { transform: translate(2px, 2px); }
    100% { transform: translate(0); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: 2rem;
    overflow: hidden;
    max-width: calc(100% - 40px);
}

#progress-fill {
    width: 0;
    height: 100%;
    background: #4a90e2;
    transition: width 0.5s;
}

.badge-container {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100% - 40px);
}

.badge {
    background: #edf2f7;
    color: #4a90e2;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.status {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #4a90e2;
    font-weight: 500;
    max-width: calc(100% - 40px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.modal-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    max-width: calc(100% - 40px);
    width: 400px;
    text-align: center;
    box-sizing: border-box;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-content button {
    margin-top: 1rem;
}

.toast {
    position: fixed;
    background: #e53e3e;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    max-width: calc(100% - 40px);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes slideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}