/* ==========================================
   保険クイズマスター - プレミアムミリオネア風スタイル
   ========================================== */

/* CSS変数 - 高級感のあるカスタムプロパティ */
:root {
    /* プレミアムな背景グラデーション */
    --primary-gradient: linear-gradient(135deg, #0c0c1d 0%, #1a1a2e 25%, #1e3c72 50%, #2a5298 75%, #0c0c1d 100%);
    --secondary-gradient: linear-gradient(45deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --premium-dark: linear-gradient(180deg, #050510 0%, #0c0c1d 100%);
    
    /* ゴールドの高級感 */
    --gold: #ffdd44;
    --gold-light: #fff59d;
    --gold-dark: #b8860b;
    --gold-premium: linear-gradient(135deg, #ffdd44 0%, #fff59d 25%, #ffd700 50%, #fff59d 75%, #ffdd44 100%);
    --gold-metallic: linear-gradient(45deg, #ffd700 0%, #ffec8b 20%, #fff59d 40%, #ffec8b 60%, #ffd700 80%, #b8860b 100%);
    --gold-shadow: 0 0 40px rgba(255, 221, 68, 0.6), 0 0 80px rgba(255, 221, 68, 0.3);
    --gold-border: linear-gradient(90deg, #b8860b 0%, #ffd700 50%, #b8860b 100%);
    
    /* プレミアムな色調 */
    --correct-green: #00e676;
    --correct-green-bg: rgba(0, 230, 118, 0.15);
    --wrong-red: #ff5252;
    --wrong-red-bg: rgba(255, 82, 82, 0.15);
    --accent-blue: #40c4ff;
    --accent-purple: #b388ff;
    --accent-cyan: #18ffff;
    
    /* カードと背景 */
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-bg-hover: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 221, 68, 0.4);
    --card-border-hover: rgba(255, 221, 68, 0.8);
    --card-glow: 0 0 30px rgba(255, 221, 68, 0.2), inset 0 0 20px rgba(255, 221, 68, 0.1);
    
    /* テキスト */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-gold: #ffdd44;
    
    /* 影と光沢 */
    --shadow-premium: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-gold: 0 0 30px rgba(255, 221, 68, 0.4), 0 0 60px rgba(255, 221, 68, 0.2);
    --shadow-blue: 0 0 20px rgba(64, 196, 255, 0.4);
    --shadow-purple: 0 0 25px rgba(179, 136, 255, 0.4);
    
    /* アニメーション */
    --transition-premium: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* リセット */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ベーススタイル - プレミアム感のある土台 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--premium-dark);
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    position: relative;
}

/* スクロールバー全体を非表示にする設定 */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* プレミアムな背景エフェクト */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 221, 68, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(64, 196, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 40% 70%, rgba(179, 136, 255, 0.1) 0%, transparent 35%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundPulse 8s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { opacity: 0.4; }
    100% { opacity: 0.7; }
}

/* プレミアムなオーバーレイ */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 48%, rgba(255, 221, 68, 0.05) 49%, rgba(255, 221, 68, 0.05) 51%, transparent 52%);
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
    animation: shimmer 20s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* コンテナ - プレミアムな中央配置 */
.container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0.75rem;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--primary-gradient);
    border-left: 1px solid rgba(255, 221, 68, 0.2);
    border-right: 1px solid rgba(255, 221, 68, 0.2);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    scrollbar-width: none;
}

/* ローディング画面 - プレミアムな演出 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--premium-dark);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 221, 68, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 3px solid transparent;
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-screen p {
    margin-top: 2rem;
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulseText 2s ease infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ヘッダー - プレミアムなナビゲーション */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid;
    border-image: var(--gold-border) 1;
    position: relative;
    flex-shrink: 0;
}

.header::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold-premium);
    opacity: 0.6;
}

/* プレミアムなロゴ */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    font-weight: 900;
    background: var(--gold-premium);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-shadow: 0 0 30px rgba(255, 221, 68, 0.5);
}

.logo i {
    font-size: 1.5rem;
    -webkit-text-fill-color: var(--gold);
    animation: premiumBounce 3s ease infinite;
    filter: drop-shadow(0 0 10px rgba(255, 221, 68, 0.6));
}

@keyframes premiumBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-5px) scale(1.05); }
    50% { transform: translateY(-10px) scale(1.1); }
    75% { transform: translateY(-5px) scale(1.05); }
}

.logo.clickable {
    cursor: pointer;
    transition: var(--transition-premium);
}

.logo.clickable:hover {
    transform: scale(1.05);
    filter: brightness(1.3) drop-shadow(0 0 20px rgba(255, 221, 68, 0.8));
}

/* プレミアムなヘッダー右側 */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ホームボタン - プレミアム */
.home-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
}

.home-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--gold-premium);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.home-button:hover::before {
    width: 100%;
    height: 100%;
}

.home-button:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    transform: scale(1.1);
}

.home-button i {
    position: relative;
    z-index: 1;
}

.home-button:hover i {
    color: #1a1a2e;
}



/* スクリーン共通 */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* スタート画面 - プレミアムな演出 */
.start-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.start-screen::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 221, 68, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: premiumGlow 4s ease infinite alternate;
}

@keyframes premiumGlow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

.title-container {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gold-premium);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-shadow: 0 0 40px rgba(255, 221, 68, 0.6);
    letter-spacing: -1px;
}

.main-title i {
    -webkit-text-fill-color: var(--gold);
    animation: premiumBounce 3s ease infinite;
    filter: drop-shadow(0 0 15px rgba(255, 221, 68, 0.8));
    font-size: 1.75rem;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* プレミアムなスタートボタン */
.start-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0c0c1d;
    background: var(--gold-premium);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-premium);
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.7s ease;
}

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

.start-button:hover {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 0 80px rgba(255, 221, 68, 0.8), 0 0 120px rgba(255, 221, 68, 0.4);
}

.pulse {
    animation: premiumPulse 3s ease infinite;
}

@keyframes premiumPulse {
    0%, 100% { 
        box-shadow: var(--shadow-gold);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 80px rgba(255, 221, 68, 0.9), 0 0 120px rgba(255, 221, 68, 0.5);
        transform: scale(1.02);
    }
}

/* カテゴリ画面 - プレミアムな選択 */
.screen-title {
    font-size: 1.4rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--gold-premium);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 221, 68, 0.4);
    letter-spacing: -0.5px;
}

.category-section {
    margin-bottom: 1rem;
    position: relative;
}

.section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid;
    border-image: var(--gold-border) 1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* プレミアムなカテゴリボタン */
.category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 221, 68, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn i {
    font-size: 1.2rem;
    color: var(--gold);
    transition: var(--transition-smooth);
    filter: drop-shadow(0 0 8px rgba(255, 221, 68, 0.4));
}

.category-btn:hover {
    background: var(--card-bg-hover);
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--card-glow);
}

.category-btn:hover i {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px rgba(255, 221, 68, 0.8));
}

.category-btn.active {
    background: rgba(255, 221, 68, 0.15);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    transform: translateY(-3px);
}

.category-btn.all-btn {
    background: linear-gradient(135deg, rgba(64, 196, 255, 0.2) 0%, rgba(64, 196, 255, 0.1) 100%);
    border-color: var(--accent-blue);
}

.category-btn.all-btn i {
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px rgba(64, 196, 255, 0.6));
}

.category-btn.all-btn.active {
    box-shadow: var(--shadow-blue);
}

/* プレミアムなアクションボタン */
.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    margin-top: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0c0c1d;
    background: var(--gold-premium);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-premium);
    box-shadow: var(--shadow-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-button:hover:not(:disabled) {
    transform: scale(1.03) translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.action-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* クイズ画面 - プレミアムな問題演出 */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 15px;
    border: 2px solid var(--card-border);
    backdrop-filter: blur(10px);
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: var(--gold-premium);
    border-radius: 15px;
    transition: width 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    font-size: 1rem;
    color: var(--gold);
    font-weight: 700;
    background: rgba(255, 221, 68, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 221, 68, 0.3);
}

/* プレミアムな問題カード */
.question-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(255, 221, 68, 0.05) 49%, rgba(255, 221, 68, 0.05) 51%, transparent 52%);
    background-size: 100px 100px;
    pointer-events: none;
}

.question-card.shake {
    animation: premiumShake 0.6s ease;
}

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

.question-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.q-label {
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: 900;
    background: rgba(255, 221, 68, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 221, 68, 0.3);
}

.q-num {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 221, 68, 0.6);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
}

/* プレミアムな選択肢 */
.options-container {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.options-container button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, rgba(12, 12, 29, 0.9) 0%, rgba(26, 26, 46, 0.9) 100%);
    border: 2px solid var(--card-border);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
}

.options-container button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 221, 68, 0.1), transparent);
    transition: left 0.6s ease;
}

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

.options-container button:hover:not(:disabled) {
    background: rgba(255, 221, 68, 0.1);
    border-color: var(--gold);
    transform: translateX(8px) scale(1.02);
    box-shadow: var(--shadow-gold);
}

.options-container button:disabled {
    cursor: default;
    opacity: 0.7;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gold-premium);
    color: #0c0c1d;
    font-weight: 900;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 0.95rem;
    box-shadow: 0 0 15px rgba(255, 221, 68, 0.4);
}

.option-text {
    flex: 1;
    font-weight: 500;
}

/* 選択肢の状態 - プレミアム */
.options-container button.selected {
    background: rgba(64, 196, 255, 0.15);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-blue);
}

.options-container button.correct {
    background: var(--correct-green-bg);
    border-color: var(--correct-green);
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.4);
}

.options-container button.correct .option-letter {
    background: var(--correct-green);
    color: white;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.6);
}

.options-container button.wrong {
    background: var(--wrong-red-bg);
    border-color: var(--wrong-red);
    box-shadow: 0 0 30px rgba(255, 82, 82, 0.4);
}

.options-container button.wrong .option-letter {
    background: var(--wrong-red);
    color: white;
    box-shadow: 0 0 20px rgba(255, 82, 82, 0.6);
}

/* プレミアムなヒント */
.hint-section {
    margin-bottom: 1rem;
}

.hint-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 2px dashed rgba(255, 221, 68, 0.6);
    border-radius: 12px;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-premium);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hint-button:hover {
    background: rgba(255, 221, 68, 0.15);
    border-style: solid;
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.hint-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem;
    background: rgba(255, 221, 68, 0.1);
    border: 2px solid var(--gold);
    border-radius: 12px;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-gold);
}

.hint-box i {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 221, 68, 0.6));
}

/* プレミアムな結果表示 */
.result-display {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
    animation: premiumSlideUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.result-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(255, 221, 68, 0.05) 49%, rgba(255, 221, 68, 0.05) 51%, transparent 52%);
    background-size: 80px 80px;
    pointer-events: none;
}

@keyframes premiumSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-display.correct {
    border: 3px solid var(--correct-green);
    box-shadow: var(--shadow-gold);
}

.result-display.wrong {
    border: 3px solid var(--wrong-red);
    box-shadow: 0 0 30px rgba(255, 82, 82, 0.3);
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    animation: premiumBounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes premiumBounceIn {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-display.correct .result-icon {
    color: var(--correct-green);
    filter: drop-shadow(0 0 15px rgba(0, 230, 118, 0.6));
}

.result-display.wrong .result-icon {
    color: var(--wrong-red);
    filter: drop-shadow(0 0 15px rgba(255, 82, 82, 0.6));
}

.result-text {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.correct-answer {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 500;
}

.next-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    background: var(--gold-premium);
    border: none;
    border-radius: 25px;
    color: #0c0c1d;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-premium);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-gold);
}

.next-button:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 0 60px rgba(255, 221, 68, 0.8), 0 0 100px rgba(255, 221, 68, 0.4);
}

/* 結果画面 - プレミアムなフィナーレ */
.result-screen {
    justify-content: center;
    align-items: center;
}

.result-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 25px;
    padding: 2rem;
    text-align: center;
    width: 100%;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-premium);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(255, 221, 68, 0.05) 49%, rgba(255, 221, 68, 0.05) 51%, transparent 52%);
    background-size: 120px 120px;
    pointer-events: none;
}

.trophy-container {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: premiumTrophy 2s ease infinite;
}

@keyframes premiumTrophy {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(255, 221, 68, 0.6));
    }
    25% { 
        transform: scale(1.1) rotate(-5deg);
        filter: drop-shadow(0 0 30px rgba(255, 221, 68, 0.8));
    }
    75% { 
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 0 30px rgba(255, 221, 68, 0.8));
    }
}

.trophy-container .fa-trophy {
    color: var(--gold);
    filter: drop-shadow(0 0 25px rgba(255, 221, 68, 0.8));
}

.trophy-container .fa-medal {
    color: #e0e0e0;
    filter: drop-shadow(0 0 20px rgba(224, 224, 224, 0.6));
}

.trophy-container .fa-award {
    color: #cd7f32;
    filter: drop-shadow(0 0 20px rgba(205, 127, 50, 0.6));
}

.result-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: var(--gold-premium);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 221, 68, 0.5);
    letter-spacing: -0.5px;
}

.final-score {
    margin-bottom: 1.5rem;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border: 4px solid var(--gold);
    border-radius: 50%;
    background: rgba(255, 221, 68, 0.1);
    position: relative;
    overflow: hidden;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 221, 68, 0.3), transparent);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.score-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 221, 68, 0.8);
    position: relative;
    z-index: 1;
}

.score-total {
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.9rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 221, 68, 0.3);
    transform: translateY(-3px);
}

.stat-item i {
    font-size: 1.2rem;
    color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(255, 221, 68, 0.4));
}

.stat-item .correct-icon {
    color: var(--correct-green);
    filter: drop-shadow(0 0 8px rgba(0, 230, 118, 0.4));
}

.stat-item .wrong-icon {
    color: var(--wrong-red);
    filter: drop-shadow(0 0 8px rgba(255, 82, 82, 0.4));
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* プレミアムな結果ボタン */
.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.retry-button, .category-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-premium);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.retry-button {
    background: var(--gold-premium);
    border: none;
    color: #0c0c1d;
    box-shadow: var(--shadow-gold);
}

.retry-button:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 0 50px rgba(255, 221, 68, 0.8), 0 0 80px rgba(255, 221, 68, 0.4);
}

.category-button {
    background: transparent;
    border: 3px solid var(--gold);
    color: var(--gold);
}

.category-button:hover {
    background: rgba(255, 221, 68, 0.1);
    box-shadow: var(--shadow-gold);
    transform: scale(1.05) translateY(-3px);
}

/* プレミアムなフッター */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 221, 68, 0.2);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 100px;
    height: 1px;
    background: var(--gold-premium);
    transform: translateX(-50%);
}

.footer p {
    opacity: 0.7;
    letter-spacing: 1px;
}

/* ==========================================
   プレミアムなレスポンシブデザイン
   ========================================== */

/* タブレット */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .main-title {
        font-size: 2.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .main-title i {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .start-button {
        padding: 1.25rem 3rem;
        font-size: 1.2rem;
    }
    
    .screen-title {
        font-size: 1.8rem;
    }
    
    .category-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-btn {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .question-card {
        padding: 2rem;
        border-radius: 20px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .options-container button {
        padding: 1.1rem 1.25rem;
        font-size: 1rem;
    }
    
    .result-card {
        padding: 2.5rem 2rem;
        border-radius: 25px;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-number {
        font-size: 3rem;
    }
}

/* スマートフォン（iPhone SE含む: 375x667px） */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0.5rem 0.75rem;
    }
    
    /* ヘッダー：横並びのまま超コンパクト */
    .header {
        padding: 0.4rem 0;
        margin-bottom: 0.4rem;
        flex-direction: row;
        gap: 0;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .logo {
        font-size: 1rem;
        gap: 0.4rem;
    }
    
    .logo i {
        font-size: 1.1rem;
    }
    
    .home-button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* スタート画面 */
    .premium-crown {
        font-size: 1.8rem;
        margin-bottom: 0.25rem;
    }
    
    .main-title {
        font-size: 1.6rem;
        gap: 0.4rem;
    }
    
    .main-title i {
        font-size: 1.4rem;
    }
    
    .title-container {
        margin-bottom: 0.75rem;
    }
    
    .premium-line {
        width: 80px;
        margin: 0.3rem auto;
    }
    
    .start-button {
        padding: 0.85rem 2rem;
        font-size: 1rem;
    }
    
    /* カテゴリ選択画面 */
    .screen-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .screen-title i {
        font-size: 1rem;
    }
    
    .category-section {
        margin-bottom: 0.5rem;
    }
    
    .section-title {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
        padding-left: 0.5rem;
        letter-spacing: 1px;
    }
    
    .category-buttons {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.4rem;
    }
    
    .category-buttons.minor {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }
    
    .category-btn {
        padding: 0.5rem 0.3rem;
        font-size: 0.7rem;
        border-width: 1.5px;
        border-radius: 8px;
        gap: 0.2rem;
    }
    
    .category-btn i {
        font-size: 0.9rem;
    }
    
    .action-button {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
        margin-top: 0.5rem;
    }
    
    /* クイズ画面 */
    .progress-container {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        gap: 0.75rem;
        border-radius: 10px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .progress-text {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    .question-card {
        padding: 0.75rem;
        border-radius: 12px;
        border-width: 1.5px;
        margin-bottom: 0.5rem;
    }
    
    .question-number {
        margin-bottom: 0.3rem;
        gap: 0.3rem;
    }
    
    .q-label {
        font-size: 0.85rem;
        padding: 0.15rem 0.5rem;
    }
    
    .q-num {
        font-size: 1.2rem;
    }
    
    .question-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .options-container {
        gap: 0.35rem;
        margin-bottom: 0.4rem;
    }
    
    .options-container button {
        padding: 0.55rem 0.7rem;
        font-size: 0.8rem;
        border-width: 1.5px;
        border-radius: 10px;
        gap: 0.5rem;
    }
    
    .option-letter {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    
    .option-text {
        line-height: 1.3;
    }
    
    /* ヒントセクション */
    .hint-section {
        margin-bottom: 0.3rem;
    }
    
    .hint-button {
        padding: 0.5rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .hint-box {
        padding: 0.5rem;
        font-size: 0.75rem;
        border-radius: 8px;
        gap: 0.5rem;
    }
    
    .hint-box i {
        font-size: 1rem;
    }
    
    /* 結果画面 */
    .result-card {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .trophy-container {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }
    
    .result-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .final-score {
        margin-bottom: 0.75rem;
    }
    
    .score-circle {
        width: 90px;
        height: 90px;
        border-width: 3px;
    }
    
    .score-number {
        font-size: 1.6rem;
    }
    
    .score-total {
        font-size: 0.7rem;
    }
    
    .stats-grid {
        gap: 0.4rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-item {
        padding: 0.5rem 0.25rem;
        border-width: 1px;
        border-radius: 8px;
        gap: 0.15rem;
    }
    
    .stat-item i {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .result-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .retry-button, .category-button {
        padding: 0.7rem;
        font-size: 0.85rem;
        border-width: 2px;
        border-radius: 10px;
    }
}

/* iPhone SE 専用最適化 (375x667) - スクロールなし */
@media (max-width: 375px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 0.4rem 0.6rem;
    }
    
    .header {
        padding: 0.3rem 0;
        margin-bottom: 0.3rem;
    }
    
    .logo {
        font-size: 0.9rem;
    }
    
    .logo i {
        font-size: 1rem;
    }
    
    /* スタート画面 */
    .premium-crown {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }
    
    .main-title {
        font-size: 1.4rem;
    }
    
    .main-title i {
        font-size: 1.2rem;
    }
    
    .start-button {
        padding: 0.75rem 1.8rem;
        font-size: 0.9rem;
    }
    
    /* カテゴリ画面 */
    .screen-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .category-buttons {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.3rem;
    }
    
    .category-buttons.minor {
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.25rem;
        font-size: 0.65rem;
        gap: 0.15rem;
    }
    
    .category-btn i {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    
    .action-button {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    /* クイズ画面 */
    .progress-container {
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.4rem;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .progress-text {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .question-card {
        padding: 0.6rem;
        margin-bottom: 0.4rem;
        border-radius: 10px;
    }
    
    .question-number {
        margin-bottom: 0.2rem;
    }
    
    .q-label {
        font-size: 0.75rem;
        padding: 0.1rem 0.4rem;
    }
    
    .q-num {
        font-size: 1rem;
    }
    
    .question-text {
        font-size: 0.8rem;
        line-height: 1.35;
    }
    
    .options-container {
        gap: 0.3rem;
        margin-bottom: 0.3rem;
    }
    
    .options-container button {
        padding: 0.45rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .option-letter {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .hint-button {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    
    .hint-box {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    
    .hint-box i {
        font-size: 0.9rem;
    }
    
    /* 結果画面 */
    .result-card {
        padding: 0.8rem;
        border-radius: 14px;
    }
    
    .trophy-container {
        font-size: 1.8rem;
        margin-bottom: 0.2rem;
    }
    
    .result-title {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }
    
    .final-score {
        margin-bottom: 0.5rem;
    }
    
    .score-circle {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }
    
    .score-number {
        font-size: 1.4rem;
    }
    
    .score-total {
        font-size: 0.65rem;
    }
    
    .stats-grid {
        gap: 0.35rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-item {
        padding: 0.4rem 0.2rem;
        gap: 0.1rem;
    }
    
    .stat-item i {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    .result-buttons {
        gap: 0.4rem;
    }
    
    .retry-button, .category-button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* アニメーション無効設定対応 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner,
    .logo i,
    .main-title i {
        animation: none !important;
    }
}

/* プレミアムな王冠アイコン */
.premium-crown {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    animation: crownFloat 4s ease infinite;
    filter: drop-shadow(0 0 20px rgba(255, 221, 68, 0.8));
}

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

/* プレミアムなライン演出 */
.premium-line {
    width: 120px;
    height: 2px;
    background: var(--gold-premium);
    margin: 0.5rem auto;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.premium-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: lineShine 3s infinite;
}

@keyframes lineShine {
    0% { left: -100%; }
    100% { left: 100%; }
}
