/* Wabi-Sabi Softer Edo Harmony Theme */
:root {
    --primary: #1c305c; /* Deep Indigo */
    --primary-dark: #0f1c35; 
    --accent: #d3381c; /* Vermilion */
    --text: #1a1a1a; 
    --text-dim: #555;
    --bg: #ffffff; 
    --card-bg: rgba(255, 255, 255, 0.4); /* Glassmorphism on washi */
    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'M PLUS Rounded 1c', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg);
    /* 犬がそばを食べる和風画用紙背景（文字が見やすいように白で薄く覆う） */
    background-image: 
        linear-gradient(rgba(253, 252, 240, 0.85), rgba(253, 252, 240, 0.85)),
        url('bg-washi-dogs.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    line-height: 1.7;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header with softer shadow and border */
header {
    background: transparent;
    padding: 50px 0 30px; /* 上部の余白を増やしてバランスを調整 */
    border-bottom: none; /* Borderless Minimalism */
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-serif);
    letter-spacing: 1px;
}

/* Header Navigation */
.lang-toggle {
    margin-left: auto;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: flex-end;
}
.nav-link, .back-btn {
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    font-size: 0.95rem;
    transition: 0.2s;
}
.nav-link:hover, .back-btn:hover {
    color: var(--primary);
}

#lang-btn {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
#lang-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Hero Section: Relaxed and Muted */
.hero {
    display: flex;
    align-items: center;
    padding: 80px 0;
    gap: 50px;
}

.hero-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 2px;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.hero-sub {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font-serif);
    opacity: 0.8;
}

.hero h1 {
    font-size: 4.2rem;
    font-weight: 900;
    margin: 10px 0;
    line-height: 1.2;
    color: var(--text);
    text-shadow: none; /* Removed harsh shadow */
}

/* ヒーローメインタイトル：黒・力強い和風スタイル */
.hero-main-title {
    color: #0f0f0f !important;
    font-size: 4.4rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.12em !important;
    text-shadow:
        2px 4px 0px rgba(0, 0, 0, 0.08),
        0px 8px 20px rgba(0, 0, 0, 0.12) !important;
    font-family: var(--font-serif) !important;
    line-height: 1.1 !important;
    position: relative;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 450px;
}

/* トプ画（ロゴ画像）用スタイリング */
.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo-img {
    max-width: 100%;
    height: auto;
    width: 400px; /* PCでの基本サイズ */
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.08));
    animation: bounceLogo 4s ease-in-out infinite;
}

/* ロゴがまるで回転している／浮遊しているようなアニメーション */
@keyframes bounceLogo {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* Rules / How to Play Section */
.rule-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    width: 220px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
    transition: transform 0.3s ease;
}
.rule-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}
.rule-step {
    background: var(--primary);
    color: #fff;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 15px;
}
.rule-card h3 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-family: var(--font-serif);
}
.rule-card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Ranking Table: Clean and Soft */
.ranking-section {
    padding: 80px 0;
    background-color: var(--bg);
}

.ranking-title {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 50px;
    font-family: var(--font-serif);
    text-align: center;
}

.ranking-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap; /* スマホで折り返す用 */
}

.tab-btn {
    border: 1.5px solid #ccc;
    color: #888;
    background: transparent;
    border-radius: 8px; /* 角をほんのり丸く */
    padding: 12px 24px; /* クリックしやすい大きさに */
    font-size: 1.15rem; /* 文字を大きく */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(28, 48, 92, 0.3); /* 立体感を追加 */
}

.ranking-tables {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 30px;
}

.ranking-table-container {
    flex: 1; /* Stretch to fill half the width each */
    min-width: 0; /* Prevent overflow */
}

@media (max-width: 768px) {
    .ranking-tables {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }
    .ranking-table-container {
        width: 100%;
    }
}

.ranking-table-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    border: none;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* Soft premium shadow instead of border */
}



.ranking-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* テーブルの横幅をコンテンツの中身に関わらず固定する */
}

.ranking-table th {
    background: transparent;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    font-family: var(--font-serif);
    font-weight: 900;
}

/* 各列の幅を固定化（ガタつき防止） */
.ranking-table th:nth-child(1) { width: 20%; text-align: center; } /* 順位 */
.ranking-table th:nth-child(2) { width: 50%; text-align: left; }   /* 名前 */
.ranking-table th:nth-child(3) { width: 30%; text-align: right; }  /* 杯数 */

.ranking-table td:nth-child(1) { text-align: center; } /* 順位 */
.ranking-table td:nth-child(2) { 
    text-align: left; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; /* 長い名前は...で省略されるようにする */
}
.ranking-table td:nth-child(3) { text-align: right; font-weight: bold; } /* 杯数 */

.ranking-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ranking-table tr:hover {
    background: #fdfaf5;
}

/* SNS Section */
.sns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    text-align: left;
}
.sns-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ddd;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.sns-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fdfcf0;
}
.sns-icon {
    font-size: 1.4rem;
    line-height: 1;
}
.sns-label {
    font-weight: bold;
    font-size: 1rem;
    font-family: var(--font-serif);
    color: var(--primary);
}
.sns-feed {
    height: 450px;
    overflow: hidden;
}
.sns-feed iframe {
    display: block;
}

/* Price Cards: Muted and Elegant */
.price-card {
    background: #fff;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}
.price-card h3 {
    color: var(--primary-dark);
}

/* Forms: Low Contrast Comfort */
.btn-cert-issue {
    background-color: var(--primary);
    color: #ffffff; /* 文字を白にして読みやすく */
    border: none;
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--font-serif);
    box-shadow: 0 4px 0 var(--primary-dark);
    transition: 0.2s;
}
.btn-cert-issue:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-dark);
}

input, textarea, select {
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: var(--text) !important;
}

/* PC等では改行しない */
.mobile-br {
    display: none;
}

/* rules-title: PC表示はdesktop版のみ、スマホはmobile版のみ */
.rules-desktop { display: inline; }
.rules-mobile  { display: none; }

@media (max-width: 768px) {
    /* スマホでは改行として機能させる */
    .mobile-br {
        display: block;
    }

    /* rules-title: スマホではmobile版のみ表示 */
    .rules-desktop { display: none; }
    .rules-mobile  { display: block; }

    .hero { padding: 40px 0; text-align: center; flex-direction: column; }
    .hero h1 { 
        font-size: 2.0rem; /* Adjusted for 1-line fit on mobile */
        white-space: nowrap; /* Prevent wrapping */
    }
    
    /* スマホ時のヘッダー：シンプルに戻す（Englishボタンのみ表示） */
    header {
        flex-direction: row;
        padding: 25px 0 15px; /* スマホでも上部の余白にゆとりを持たせる */
        gap: 0;
    }

    /* スマホ時はナビリンクを全て非表示にする */
    .nav-link {
        display: none !important;
    }

    /* スマホ時はEnglishボタンだけを右端に表示 */
    .lang-toggle {
        display: flex;
        width: auto;
        gap: 15px;
        padding: 0;
        margin-left: auto;
    }
    #lang-btn {
        margin-left: 0;
        font-size: 0.9rem;
        padding: 8px 18px;
        width: auto;
        border-radius: 4px;
    }
    


    /* スマホ表記時のみ：番付の4つのボタンを強制的に横1列に並べる */
    .ranking-tabs {
        flex-wrap: nowrap !important;
        gap: 4px;
        margin-bottom: 20px;
    }
    .tab-btn {
        flex: 1; /* 4つを均等な幅に分割 */
        padding: 10px 0 !important; /* 横の余白を削って詰め込む */
        font-size: 0.85rem !important; /* 1列に収まるサイズに縮小 */
    }

    /* スマホ表記時のみ：ルールカードを縦並びに */
    .rules-grid {
        flex-direction: column;
        align-items: center;
    }
    .rule-card {
        width: 100%;
        max-width: 300px;
    }

    /* スマホ表記時のみ：賞品説明の文字を小さくして2列で収める */
    .award-text {
        font-size: 0.95rem !important;
        line-height: 1.5;
    }

    /* スマホ表記時のみ：SNSカードを縦積みに変更 */
    .sns-grid {
        grid-template-columns: 1fr;
    }
    .sns-feed {
        height: 380px;
    }
}

/* PC等の通常時の賞品説明の文字サイズ */
.award-text {
    font-size: 1.1rem;
}

/* --- Dynamic News Styles --- */
.news-section {
    margin-bottom: 80px;
}
.news-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-family: var(--font-serif);
    color: var(--primary-dark);
}
.news-list {
    padding: 0;
    max-width: 700px;
    margin: 0 auto;
}
