:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --gradient-1: #6366f1;
    --gradient-2: #ec4899;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-en: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-en), var(--font-jp);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-1);
    top: -100px;
    left: -100px;
}

.globe-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-2);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.globe-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-color);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
    opacity: 0.4;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    z-index: 1;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--gradient-1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glass Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Screens */
.screen {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 2rem; /* Match card padding logic internally */
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) translateY(0);
}

.screen.hidden {
    display: none;
}

/* Typography & Elements */
.title-primary {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-align: center;
}

.description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.info-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    display: block;
    margin: 0 auto;
}

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

/* Question Screen specific */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--accent-color);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.question-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    min-height: 80px; /* Prevent layout shift */
}

.param-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 12px;
    color: var(--text-primary);
    text-align: left;
    font-size: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.option-btn:active {
    transform: scale(0.98);
}

/* Results Screen */
.result-content {
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.percentage {
    fill: #fff;
    font-family: var(--font-en);
    font-weight: bold;
    font-size: 0.5em;
    text-anchor: middle;
}

.score-label {
    margin-top: -20px; /* Adjust visual balance */
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Color classes for result score */
.risk-low { stroke: #4ade80; } /* Green */
.risk-med { stroke: #facc15; } /* Yellow */
.risk-high { stroke: #f43f5e; } /* Red */
