/* ===== HABINOTE ランキングページ プレミアムデザイン ===== */

/* ===== CSS Reset & Base (ランキング専用) ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding-bottom: 100px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* ===== 背景エフェクト（トップページと統一） ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 212, 170, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(255, 123, 84, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 60% 40%, rgba(108, 92, 231, 0.1) 0%, transparent 30%);
    z-index: -2;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* ===== プレミアムカラーシステム（トップページと統一） ===== */
:root {
    /* ===== ブランドカラー（index.htmlと同じ） ===== */
    --brand-turquoise: #00d4aa;
    --brand-turquoise-light: #26e4c9;
    --brand-turquoise-dark: #00b894;
    --brand-turquoise-ultra-light: #e8fffe;
    
    /* ===== アクセントカラー ===== */
    --accent-coral: #ff6b6b;
    --accent-coral-light: #ff8e8e;
    --accent-coral-dark: #d63031;
    
    --accent-purple: #6c5ce7;
    --accent-purple-light: #a29bfe;
    --accent-purple-dark: #5f3dc4;
    
    --accent-gold: #fdcb6e;
    --accent-gold-light: #ffeaa7;
    --accent-gold-dark: #e17055;
    
    /* ===== ランキング専用カラー ===== */
    --rank-1st: #ffd700;
    --rank-1st-dark: #ffb700;
    --rank-2nd: #c0c0c0;
    --rank-2nd-dark: #a0a0a0;
    --rank-3rd: #cd7f32;
    --rank-3rd-dark: #b8722c;
    
    /* ===== ニュートラルカラー ===== */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    
    /* ===== グラデーション（トップページと統一） ===== */
    --gradient-brand: linear-gradient(135deg, #00d4aa 0%, #26e4c9 50%, #00b894 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b6b 0%, #fdcb6e 100%);
    --gradient-ocean: linear-gradient(135deg, #3b82f6 0%, #00d4aa 100%);
    --gradient-cosmic: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.1) 100%);
    
    /* ===== ランキンググラデーション ===== */
    --gradient-1st: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff8f00 100%);
    --gradient-2nd: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #999999 100%);
    --gradient-3rd: linear-gradient(135deg, #cd7f32 0%, #daa554 50%, #8b5a2b 100%);
    
    /* ===== シャドウシステム（トップページと統一） ===== */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* ===== ランキングシャドウ ===== */
    --shadow-1st: 0 10px 40px rgba(255, 215, 0, 0.4);
    --shadow-2nd: 0 8px 32px rgba(192, 192, 192, 0.3);
    --shadow-3rd: 0 8px 32px rgba(205, 127, 50, 0.3);
    
    /* ===== ブランドシャドウ ===== */
    --shadow-brand: 0 8px 32px rgba(0, 212, 170, 0.25);
    --shadow-coral: 0 8px 32px rgba(255, 107, 107, 0.25);
    --shadow-purple: 0 8px 32px rgba(108, 92, 231, 0.25);
    --shadow-gold: 0 8px 32px rgba(253, 203, 110, 0.25);
    
    /* ===== スペーシング ===== */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* ===== タイポグラフィ ===== */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    
    /* ===== ボーダーラディウス ===== */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;
    --radius-full: 9999px;
    
    /* ===== トランジション ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ===== Z-index ===== */
    --z-header: 50;
    --z-modal: 40;
    --z-navigation: 30;
    --z-tooltip: 20;
    --z-normal: 1;
}

/* ===== レイアウトユーティリティ ===== */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

/* ===== ヘッダーセクション ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) 0;
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo h1 {
    font-size: var(--text-3xl);
    font-weight: 900;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--neutral-600);
    font-size: var(--text-sm);
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.auth-btn, .social-btn {
    padding: var(--space-2) var(--space-4);
    border: 2px solid var(--brand-turquoise);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--brand-turquoise);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.auth-btn:hover, .social-btn:hover {
    background: var(--brand-turquoise);
    color: var(--neutral-800);
    transform: translateY(-1px);
}

.social-login {
    display: flex;
    gap: var(--space-2);
}

.google-btn:hover {
    background: linear-gradient(135deg, #ea4335 0%, #fbbc04 100%);
}

.line-btn:hover {
    background: linear-gradient(135deg, #00c300 0%, #00b300 100%);
}

/* ===== メインコンテンツ ===== */
.app-main {
    min-height: calc(100vh - 200px);
    padding: var(--space-8) 0;
    position: relative;
}

/* ===== セクションヘッダー ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
    position: relative;
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: 900;
    color: var(--neutral-800);
    margin-bottom: var(--space-4);
    position: relative;
    display: inline-block;
    animation: title-glow 3s ease-in-out infinite alternate;
}

@keyframes title-glow {
    0% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    100% {
        text-shadow: 
            0 0 20px rgba(255, 215, 0, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4),
            0 0 40px rgba(255, 215, 0, 0.2);
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-1st);
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--neutral-600);
    font-weight: 500;
}

/* ===== カードシステム ===== */
.card-container {
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-content {
    padding: var(--space-8);
    position: relative;
    z-index: 2;
}

/* ===== ゲストメッセージ ===== */
#guest-message .card {
    background: linear-gradient(135deg, 
        rgba(139, 92, 231, 0.1) 0%, 
        rgba(255, 107, 107, 0.1) 100%);
    border-color: rgba(139, 92, 231, 0.3);
}

#guest-message h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: var(--space-4);
    text-align: center;
}

#guest-message p {
    color: var(--neutral-600);
    text-align: center;
    margin-bottom: var(--space-6);
    font-size: var(--text-lg);
}

.button-group {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}

.primary-button, .secondary-button {
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.primary-button {
    background: var(--gradient-brand);
    color: var(--neutral-800);
    box-shadow: var(--shadow-brand);
}

.secondary-button {
    background: transparent;
    color: var(--brand-turquoise);
    border: 2px solid var(--brand-turquoise);
}

.primary-button:hover, .secondary-button:hover {
    transform: translateY(-2px);
}

.primary-button:hover {
    box-shadow: var(--shadow-xl);
}

.secondary-button:hover {
    background: var(--brand-turquoise);
    color: white;
    border-color: var(--brand-turquoise);
}

/* ===== ランキングタブ ===== */
.ranking-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--space-2);
    box-shadow: var(--shadow-sm);
}

.ranking-tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--neutral-600);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.ranking-tab.active {
    background: var(--gradient-brand);
    color: white;
    box-shadow: var(--shadow-brand);
    transform: translateY(-2px);
}

.ranking-tab:not(.active):hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--brand-turquoise);
}

/* ===== ランキングコンテナ ===== */
.ranking-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.ranking-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1st);
}

.ranking-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.ranking-title {
    font-size: var(--text-3xl);
    font-weight: 900;
    color: var(--neutral-800);
    margin-bottom: var(--space-3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ranking-date {
    font-size: var(--text-lg);
    color: var(--neutral-500);
    font-weight: 500;
}

/* ===== 表彰台（1-3位特別表示） ===== */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
    position: relative;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
    transition: all var(--transition-slow);
    animation: podium-entrance 1s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
}

@keyframes podium-entrance {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.podium-1st {
    order: 2;
    background: var(--gradient-1st);
    box-shadow: var(--shadow-1st);
    transform: scale(1.1);
    z-index: 3;
    animation-delay: 0.3s;
}

.podium-2nd {
    order: 1;
    background: var(--gradient-2nd);
    box-shadow: var(--shadow-2nd);
    z-index: 2;
    animation-delay: 0.1s;
}

.podium-3rd {
    order: 3;
    background: var(--gradient-3rd);
    box-shadow: var(--shadow-3rd);
    z-index: 1;
    animation-delay: 0.5s;
}

.podium-item:hover {
    transform: translateY(-8px) scale(1.05);
    animation: podium-bounce 0.6s ease-in-out;
}

@keyframes podium-bounce {
    0%, 100% { transform: translateY(-8px) scale(1.05); }
    50% { transform: translateY(-12px) scale(1.08); }
}

.podium-crown {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-3);
    animation: crown-float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes crown-float {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

.podium-info {
    text-align: center;
}

.podium-rank {
    font-size: var(--text-2xl);
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--space-2);
}

.podium-name {
    font-size: var(--text-base);
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--space-2);
    max-width: 100px;
    min-height: 1.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    text-align: center;
}

.podium-count {
    font-size: var(--text-xl);
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== ランキングリスト（4位以下） ===== */
.ranking-list-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ranking-list-title {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--neutral-800);
    text-align: center;
    margin-bottom: var(--space-6);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    animation: item-slide-in 0.6s ease-out forwards;
    opacity: 0;
    transform: translateX(-50px);
}

@keyframes item-slide-in {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.ranking-item:nth-child(1) { animation-delay: 0.1s; }
.ranking-item:nth-child(2) { animation-delay: 0.2s; }
.ranking-item:nth-child(3) { animation-delay: 0.3s; }
.ranking-item:nth-child(4) { animation-delay: 0.4s; }
.ranking-item:nth-child(5) { animation-delay: 0.5s; }

.ranking-item:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, 
        rgba(0, 212, 170, 0.1) 0%, 
        rgba(255, 255, 255, 0.9) 100%);
}

.ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-brand);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.ranking-item:hover::before {
    transform: scaleY(1);
}

.rank-number {
    font-size: var(--text-xl);
    font-weight: 900;
    color: var(--neutral-700);
    width: 50px;
    text-align: center;
    position: relative;
}

.rank-number::after {
    content: '位';
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--neutral-500);
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
}

.rank-info {
    flex: 1;
    margin-left: var(--space-4);
}

.rank-name {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: var(--space-1);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

.rank-count {
    font-size: var(--text-2xl);
    font-weight: 900;
    color: var(--brand-turquoise);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.rank-count::after {
    content: '回';
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--neutral-500);
}

/* ===== ローディング表示 ===== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    color: var(--neutral-500);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--neutral-200);
    border-left-color: var(--brand-turquoise);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
    
    .header-logo h1 {
        font-size: var(--text-2xl);
    }
    
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .ranking-tabs {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .ranking-tab {
        text-align: center;
    }
    
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: var(--space-6);
    }
    
    .podium-item {
        width: 100%;
        max-width: 300px;
    }
    
    .podium-1st {
        order: 1;
        transform: scale(1);
    }
    
    .podium-2nd {
        order: 2;
    }
    
    .podium-3rd {
        order: 3;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-button, .secondary-button {
        width: 100%;
        max-width: 200px;
    }
    
    .auth-buttons {
        align-items: center;
    }
    
    .social-login {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: var(--space-4) 0;
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .ranking-container {
        padding: var(--space-4);
    }
    
    .podium-crown {
        font-size: var(--text-4xl);
    }
    
    .podium-rank {
        font-size: var(--text-xl);
    }
    
    .podium-name {
        font-size: var(--text-base);
    }
    
    .podium-count {
        font-size: var(--text-lg);
    }
    
    .ranking-item {
        padding: var(--space-3);
    }
    
    .rank-number {
        font-size: var(--text-lg);
        width: 40px;
    }
    
    .rank-name {
        font-size: var(--text-base);
    }
    
    .rank-count {
        font-size: var(--text-xl);
    }
}

/* ===== アクセシビリティ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== bodyのpadding-bottomをnew-footer.cssよりも優先 ===== */
body {
    padding-bottom: 100px !important;
}

/* ===== カスタムスクロールバー ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-sunset);
}