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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(45deg, #000 0%, #1a1a1a 25%, #ff0040 26%, #ff0040 27%, #1a1a1a 28%, #000 50%, #0066ff 51%, #0066ff 52%, #000 53%, #1a1a1a 75%, #ffff00 76%, #ffff00 77%, #1a1a1a 78%, #000 100%);
    background-size: 100px 100px;
    animation: backgroundShift 8s linear infinite;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

@keyframes backgroundShift {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%);
    box-shadow: 0 0 50px rgba(255, 0, 64, 0.5), 0 0 100px rgba(0, 102, 255, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: containerFloat 6s ease-in-out infinite;
}

@keyframes containerFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(0.5deg); }
    50% { transform: translateY(-5px) rotate(-0.5deg); }
    75% { transform: translateY(-15px) rotate(0.3deg); }
}

.container:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 0 0 70px rgba(255, 255, 0, 0.6), 0 0 120px rgba(255, 0, 64, 0.4);
}

.header {
    background: linear-gradient(135deg, #ff0040 0%, #000 30%, #0066ff 60%, #ffff00 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.1) 50%, transparent 60%);
    animation: headerGlitch 4s linear infinite;
}

@keyframes headerGlitch {
    0%, 90%, 100% { transform: translateX(-100%); }
    10%, 80% { transform: translateX(100%); }
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 0, 64, 0.8), 0 0 40px rgba(0, 102, 255, 0.6);
    position: relative;
    z-index: 1;
    animation: titleGlitch 3s ease-in-out infinite;
}

@keyframes titleGlitch {
    0%, 90%, 100% { 
        transform: translateX(0);
        text-shadow: 0 0 20px rgba(255, 0, 64, 0.8), 0 0 40px rgba(0, 102, 255, 0.6);
    }
    5% { 
        transform: translateX(-2px);
        text-shadow: 2px 0 20px rgba(255, 255, 0, 0.8), -2px 0 40px rgba(255, 0, 64, 0.6);
    }
    10% { 
        transform: translateX(2px);
        text-shadow: -2px 0 20px rgba(0, 102, 255, 0.8), 2px 0 40px rgba(255, 255, 0, 0.6);
    }
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.main {
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 240, 240, 0.9) 100%);
    position: relative;
}

.main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 45%, rgba(255, 0, 64, 0.05) 50%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, rgba(0, 102, 255, 0.05) 50%, transparent 55%);
    animation: mainPattern 10s linear infinite;
}

@keyframes mainPattern {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 200px 200px, -200px -200px; }
}

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

.input-label {
    display: block;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.text-input {
    width: 100%;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.6;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.check-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-family: inherit;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.check-button:active {
    transform: translateY(0);
}

.quiz-section {
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 0;
    clip-path: polygon(0 0, 95% 0, 100% 100%, 5% 100%);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #ff0040 0%, #0066ff 50%, #ffff00 100%);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 0;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.6);
    animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
    0% { box-shadow: 0 0 20px rgba(255, 0, 64, 0.6); }
    100% { box-shadow: 0 0 30px rgba(0, 102, 255, 0.8); }
}

.question-counter {
    text-align: center;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 30px;
}

.question-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0;
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
    padding: 40px 30px;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0040, #0066ff, #ffff00, #ff0040);
    z-index: -1;
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.question-text {
    font-size: 1.4rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: left;
    position: relative;
}

.question-text::before {
    content: '⚡';
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #ff0040;
    animation: iconBounce 2s ease-in-out infinite;
}

.question-text::after {
    content: '💥';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #0066ff;
    animation: iconBounce 2s ease-in-out infinite reverse;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

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

.option-button {
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 240, 240, 0.95) 100%);
    border: 2px solid #e0e0e0;
    border-radius: 0;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: left;
    position: relative;
    overflow: hidden;
    color: #333;
}

.option-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;
}

.option-button:hover::before {
    left: 100%;
}

.option-button:hover {
    border-color: #ff0040;
    background: linear-gradient(135deg, rgba(255, 0, 64, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
    transform: translateY(-3px) translateX(5px);
    box-shadow: -5px 10px 20px rgba(255, 0, 64, 0.2);
}

.option-button.selected {
    border-color: #ff0040;
    background: linear-gradient(135deg, #ff0040 0%, #0066ff 100%);
    color: white;
    transform: translateY(-3px) translateX(5px);
    box-shadow: -5px 10px 20px rgba(255, 0, 64, 0.4);
}

.next-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #ff0040 0%, #000 50%, #0066ff 100%);
    color: white;
    border: none;
    border-radius: 0;
    clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.next-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.6s ease;
}

.next-button:hover:not(:disabled)::before {
    left: 100%;
}

.next-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 0, 64, 0.4);
}

.next-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.restart-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ffff00 0%, #ff0040 50%, #0066ff 100%);
    color: #000;
    border: none;
    border-radius: 0;
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.restart-button::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.6s ease;
}

.restart-button:hover::before {
    left: 100%;
}

.restart-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 255, 0, 0.4);
}

.result-section {
    transition: all 0.5s ease;
}

.result-section.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.result-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0;
    clip-path: polygon(0 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
    padding: 30px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0040, #ffff00, #0066ff, #ff0040);
    background-size: 200% 200%;
    z-index: -1;
    clip-path: polygon(0 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
    animation: resultBorderGlow 4s linear infinite;
}

@keyframes resultBorderGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.result-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 0;
    clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 0, 64, 0.05), rgba(0, 102, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 0 15px 25px rgba(255, 0, 64, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.level-display {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 0;
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.level-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 64, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 102, 255, 0.1) 0%, transparent 50%);
    animation: levelGlow 3s ease-in-out infinite alternate;
}

@keyframes levelGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.level-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: levelIconGlitch 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes levelIconGlitch {
    0%, 90%, 100% { 
        transform: translateX(0) scale(1);
        filter: hue-rotate(0deg);
    }
    5% { 
        transform: translateX(-3px) scale(1.1);
        filter: hue-rotate(90deg);
    }
    10% { 
        transform: translateX(3px) scale(0.9);
        filter: hue-rotate(180deg);
    }
    15% { 
        transform: translateX(-1px) scale(1.05);
        filter: hue-rotate(270deg);
    }
}

.level-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.level-description {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
    text-align: left;
}

.alternatives-section {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 0;
    clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 100%, 15% 100%, 0 85%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.alternatives-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 0, 0.05), rgba(255, 0, 64, 0.05), rgba(0, 102, 255, 0.05));
    background-size: 300% 300%;
    animation: alternativesBg 8s linear infinite;
}

@keyframes alternativesBg {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.alternatives-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.alternatives-description {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.alternatives-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.alternative-phrase {
    background: linear-gradient(135deg, #ff0040 0%, #0066ff 50%, #ffff00 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 0;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.alternative-phrase::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;
}

.alternative-phrase:hover::before {
    left: 100%;
}

.alternative-phrase:hover {
    transform: translateY(-3px) rotate(2deg);
    box-shadow: 0 10px 20px rgba(255, 0, 64, 0.3);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        clip-path: polygon(0 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
    }
    
    .title {
        font-size: 2rem;
    }
    
    .header {
        padding: 30px 20px;
        clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
    }
    
    .main {
        padding: 30px 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .question-card {
        padding: 30px 20px;
        clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%);
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .question-text::before,
    .question-text::after {
        display: none;
    }
    
    .option-button {
        padding: 15px;
        clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    }
    
    .next-button {
        clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    }
    
    .restart-button {
        clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    }
}