/* 
   =================================================
   Base Variables & Resets
   =================================================
*/
:root {
    /* Colors - Premium Dark Theme */
    --bg-base: #09090b; /* Zinc 950 */
    --bg-surface: #18181b; /* Zinc 900 */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-teal: #14b8a6;
    
    --gradient-primary: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    --gradient-secondary: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
    
    /* Glassmorphism */
    --glass-bg: rgba(24, 24, 27, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* Animation Speeds */
    --trans-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* 
   =================================================
   Background Ornaments (Gradients & Blobs)
   =================================================
*/
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-shape-1 {
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    animation-delay: 0s;
}

.bg-shape-2 {
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    animation-delay: -5s;
}

.bg-shape-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: var(--accent-teal);
    opacity: 0.3;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 40px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* 
   =================================================
   Main Container & Screens
   =================================================
*/
.app-container {
    width: 100%;
    max-width: 640px;
    min-height: 560px;
    margin: 20px;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    z-index: 10;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-slow), transform var(--trans-slow);
    transform: translateY(20px) scale(0.98);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    transform: translateY(0) scale(1);
    min-height: 560px;
}

.screen-content {
    padding: 3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 
   =================================================
   Typography & Common Elements
   =================================================
*/
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1.title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(to right, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--accent-blue);
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--trans-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
}

.btn-primary:hover::before {
    left: 150%;
    transition: left 0.7s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* 
   =================================================
   Start Screen Specific
   =================================================
*/
.start-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.icon-pulse-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-icon {
    font-size: 3.5rem;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
}

.description-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 2.5rem;
    text-align: left;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.description-box .highlight {
    margin-top: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    text-align: center;
}

.start-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.question-count-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.question-count-info span { margin: 0 0.5rem; }

/* 
   =================================================
   Question Screen Specific
   =================================================
*/
.question-content {
    justify-content: space-between;
}

.progress-container {
    padding: 2rem 3rem 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.4s ease-out;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-text .counter {
    color: var(--accent-blue);
    font-weight: 700;
}

.question-box {
    margin: 2rem 0 3rem;
}

.q-label {
    display: inline-block;
    color: var(--accent-purple);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: left;
    justify-content: flex-start;
    border-radius: 16px;
}

.btn-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.btn-option .option-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.btn-option .option-text {
    flex: 1;
}

/* 
   =================================================
   Result Screen Specific
   =================================================
*/
.result-content {
    align-items: center;
}

.result-header { margin-bottom: 1.5rem; }

.result-label {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.result-card {
    width: 100%;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    background: linear-gradient(180deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.8) 100%);
}

.neon-border::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.result-icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.result-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.result-specialty {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.score-bar-wrapper {
    margin: 0 auto 1.5rem;
    width: 80%;
    text-align: left;
}
.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.score-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
.score-fill {
    height: 100%;
    background: var(--accent-teal);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-teal);
}

.result-description {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
    text-align: left;
}

.secondary-results {
    width: 100%;
    margin-bottom: 2rem;
}

.secondary-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.secondary-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.secondary-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.secondary-item:hover {
    background: rgba(255,255,255,0.06);
}

.secondary-item-icon {
    font-size: 1.5rem;
}

.secondary-item-info h5 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.secondary-item-info p {
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 700;
}

/* 
   =================================================
   Animations
   =================================================
*/
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.fade-in-down {
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.fade-in-right {
    animation: fadeInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 
   =================================================
   Responsive
   =================================================
*/
@media (max-width: 640px) {
    .screen-content {
        padding: 2rem 1.5rem;
    }
    
    .progress-container {
        padding: 1.5rem 1.5rem 0;
    }
    
    h1.title { font-size: 2rem; }
    
    .secondary-list {
        grid-template-columns: 1fr;
    }
}
