/* ========================================
   スマブラSP キャラクター診断 - Theme CSS
   ======================================== */

/* --- CSS Variables --- */
:root {
    --bg-dark: #0a0a1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252545;
    --accent-red: #e63946;
    --accent-blue: #457b9d;
    --accent-gold: #f4a261;
    --accent-green: #2a9d8f;
    --text-primary: #f1f1f1;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c80;
    --border-color: #2a2a4a;
    --gradient-fire: linear-gradient(135deg, #e63946, #f4a261);
    --gradient-smash: linear-gradient(135deg, #457b9d, #2a9d8f);
    --shadow-glow: 0 0 20px rgba(230, 57, 70, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Animated Background --- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(230, 57, 70, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(69, 123, 157, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(42, 157, 143, 0.06) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* --- Container --- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
}

/* --- Page Wrapper --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

/* --- Logo / Title --- */
.site-logo {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 0.5rem;
}

.page-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: 1.5rem;
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* --- Card --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-fire);
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(230, 57, 70, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-yes {
    background: var(--accent-green);
    color: #fff;
    flex: 1;
    padding: 1rem;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(42, 157, 143, 0.3);
}

.btn-yes:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(42, 157, 143, 0.4); }

.btn-no {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    flex: 1;
    padding: 1rem;
    font-size: 1.2rem;
}

.btn-no:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.btn-answered-yes {
    background: var(--accent-green);
    color: #fff;
    opacity: 0.85;
}

.btn-answered-no {
    background: var(--border-color);
    color: var(--text-secondary);
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 1rem;
}

/* --- Progress Bar --- */
.progress-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-fire);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* --- Question Card --- */
.question-card {
    text-align: center;
}

.question-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.question-text {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.question-prompt {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* --- Question Navigation (回答済み一覧) --- */
.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.question-nav-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    background: transparent;
}

.question-nav-item:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.question-nav-item.active {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(230, 57, 70, 0.1);
}

.question-nav-item.answered-yes {
    border-color: var(--accent-green);
    background: var(--accent-green);
    color: #fff;
}

.question-nav-item.answered-no {
    border-color: var(--text-muted);
    background: var(--border-color);
    color: var(--text-secondary);
}

/* --- Result Page --- */
.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-announce {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.rank-section {
    margin-bottom: 2rem;
}

.rank-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.rank-card:hover {
    background: var(--bg-card-hover);
}

.rank-card.rank-1 {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(244, 162, 97, 0.15);
}

.rank-badge {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
}

.rank-1 .rank-badge { background: var(--accent-gold); color: #000; }
.rank-2 .rank-badge { background: #c0c0c0; color: #000; }
.rank-3 .rank-badge { background: #cd7f32; color: #fff; }

.rank-char-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

.rank-1 .rank-char-img { width: 100px; height: 100px; }

.rank-char-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.rank-1 .rank-char-name { font-size: 1.5rem; }

/* --- Radar Chart --- */
.chart-section {
    margin: 2rem 0;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

/* --- Ranking Table --- */
.ranking-section {
    margin-top: 2rem;
}

.ranking-toggle {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.95rem;
}

.ranking-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.ranking-table th {
    text-align: left;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.ranking-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.ranking-table tr:hover td {
    background: var(--bg-card-hover);
}

/* --- Share Buttons --- */
.share-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* --- Notes (入口画面の注意書き) --- */
.notes-list {
    list-style: none;
    margin-top: 2rem;
}

.notes-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.notes-list li:last-child { border-bottom: none; }

.note-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--border-color);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 0.5rem;
}

/* --- Credit --- */
.credit {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.credit a {
    color: var(--accent-blue);
    text-decoration: none;
}

.credit a:hover {
    text-decoration: underline;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.question-card {
    animation: fadeIn 0.3s ease;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .container { padding: 0.75rem; }
    .card { padding: 1.5rem; }
    .btn-group { flex-direction: column; }
    .rank-card { flex-direction: column; text-align: center; gap: 0.8rem; }
    .question-nav-item { width: 28px; height: 28px; font-size: 0.65rem; }
}
