:root {
    --primary: #003580;
    --primary-lt: #0052cc;
    --orange: #ff6b00;
    --orange-lt: #ff8c40;
    --yellow: #ffd700;
    --coral: #ff4757;
    --green: #20bf6b;
    --bg: #fffbee;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-sub: #5a5a7a;
    --border: #e0d8c0;
    --star: #ffd700;
    --shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 0 rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font:
        "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", system-ui,
        sans-serif;
}

/* ===== BASE ===== */
body {
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(var(--yellow) 1.5px, transparent 1.5px),
        radial-gradient(var(--orange) 1px, transparent 1px);
    background-size:
        40px 40px,
        20px 20px;
    background-position:
        0 0,
        10px 10px;
    /* ごくうっすらドット柄 */
    background-color: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
/* ドット柄は極薄に */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--bg);
    opacity: 0.88;
    pointer-events: none;
    z-index: -1;
}

main > section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 72px;
    position: relative;
}

/* ===== SECTION TITLES ===== */
.section-title {
    display: inline-block;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--orange) 0%, var(--coral) 100%);
    padding: 8px 22px 8px 16px;
    border-radius: 8px 8px 8px 0;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
    letter-spacing: 0.5px;
    clip-path: polygon(
        0 0,
        calc(100% - 10px) 0,
        100% 50%,
        calc(100% - 10px) 100%,
        0 100%
    );
    padding-right: 28px;
}
.section-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    border-left: 12px solid transparent;
    border-right: 0 solid transparent;
    border-top: 8px solid #cc3500;
}

.section-more a {
    color: var(--orange);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px dotted var(--orange);
    padding-bottom: 1px;
    transition: color 0.2s;
}
.section-more a:hover {
    color: var(--coral);
}

.home-section {
    margin-bottom: 56px;
}
.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

/* ===== RANK CARDS ===== */
.rank-card {
    background: var(--surface);
    border: 2.5px solid #ddd;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    position: relative;
    transition: all 0.2s;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.08);
}
.rank-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.12);
    border-color: var(--orange);
}

/* 1位: 金色 */
.rank-card:nth-child(2) {
    border-color: #f7c600;
    background: linear-gradient(135deg, #fffef0 0%, #fffad0 100%);
    box-shadow: 5px 5px 0 rgba(247, 198, 0, 0.35);
}
.rank-card:nth-child(2):hover {
    box-shadow: 8px 8px 0 rgba(247, 198, 0, 0.5);
}

/* 1位リボン */
.rank-card:nth-child(2)::before {
    content: "👑 BEST";
    position: absolute;
    top: -1px;
    right: 20px;
    background: linear-gradient(135deg, #f7c600, #f7a500);
    color: #5a3000;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 14px 5px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
}

/* 2位: 銀色 */
.rank-card:nth-child(3) {
    border-color: #b0b0b0;
    background: linear-gradient(135deg, #fafafa 0%, #f3f3f3 100%);
}
/* 3位: 銅色 */
.rank-card:nth-child(4) {
    border-color: #c4611e;
    background: linear-gradient(135deg, #fff8f4 0%, #ffeee0 100%);
}

.rank-num {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.rank-card:nth-child(2) .rank-num {
    background: linear-gradient(135deg, #ebb502, #cda700);
    color: #fff;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
    font-size: 14px;
}
.rank-card:nth-child(3) .rank-num {
    background: linear-gradient(135deg, #b8b8b8, #8d8d8d);
    color: #fff;
}
.rank-card:nth-child(4) .rank-num {
    background: linear-gradient(135deg, #e08040, #c4611e);
    color: #fff;
}
.rank-card:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)):not(
        :nth-child(4)
    )
    .rank-num {
    background: linear-gradient(135deg, var(--primary), var(--primary-lt));
    color: #fff;
}

.rank-desc {
    color: var(--text-sub);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.55;
}

.rank-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.rank-score-item {
    background: #f0f4ff;
    border: 1.5px solid #c8d4ff;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 13px;
    color: var(--text-sub);
}
.rank-score-item b {
    color: var(--primary);
    font-weight: 900;
}
.scores {
    color: var(--orange);
    letter-spacing: 3px;
}

/* ===== SITE ITEMS ===== */
.site-item {
    background: var(--surface) !important;
    border: 2.5px solid #ddd !important;
    border-radius: var(--radius) !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    display: flex !important;
    gap: 14px;
    align-items: center;
    transition: all 0.2s;
    color: var(--text);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.08);
    text-decoration: none;
}
.site-item:hover {
    border-color: var(--orange) !important;
    box-shadow: 6px 6px 0 rgba(255, 107, 0, 0.3) !important;
    transform: translate(-3px, -3px);
}
.site-item img {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 2px solid var(--border);
}
.site-item-name {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--primary);
}
.site-item-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

/* ===== REVIEW ITEMS ===== */
.review-item {
    background: var(--surface) !important;
    border: 2px solid #ddd !important;
    border-radius: var(--radius) !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    display: block;
    color: var(--text);
    transition: all 0.2s;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.07);
    text-decoration: none;
}
.review-item:hover {
    border-color: var(--yellow) !important;
    box-shadow: 5px 5px 0 rgba(255, 215, 0, 0.4) !important;
    transform: translate(-2px, -2px);
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.review-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2.5px solid var(--yellow);
}
.review-site-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--primary);
}
.review-date {
    font-size: 12px;
    color: var(--text-sub);
    margin-left: auto;
}
.review-comment {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.6;
    border-top: 1.5px dashed #ddd;
    padding-top: 8px;
}

/* ===== STARS ===== */
.stars {
    color: var(--star);
    letter-spacing: 3px;
    font-size: 17px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== AVG RATING ===== */
.avg-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff9d0, #fff3a0);
    border: 2.5px solid var(--yellow);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 16px;
    box-shadow: 4px 4px 0 rgba(255, 215, 0, 0.3);
}
.avg-rating .stars {
    font-size: 22px;
}
.avg-rating .value {
    font-size: 32px;
    font-weight: 900;
    color: var(--orange);
    line-height: 1;
}
.avg-rating .count {
    font-size: 13px;
    color: var(--text-sub);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 900;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
    letter-spacing: 0.3px;
    position: relative;
}
.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
}
.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #003580, #0052cc);
    color: #fff;
}
.btn-accent {
    background: linear-gradient(135deg, #ff6b00, #ff4757);
    color: #fff;
}
.btn-success {
    background: linear-gradient(135deg, #20bf6b, #0fb066);
    color: #fff;
}
.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 2.5px solid var(--primary);
    box-shadow: 3px 3px 0 var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* Actions row */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Load more / toggle buttons */
#toggle-site,
#toggle-reviews,
#load-more-btn {
    display: block;
    width: 280px;
    margin: 28px auto;
    padding: 14px;
    background: linear-gradient(135deg, var(--orange) 0%, var(--coral) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.18);
    transition: all 0.15s;
    letter-spacing: 0.5px;
    position: relative;
}
#toggle-site:hover,
#toggle-reviews:hover,
#load-more-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
}
#toggle-site:active,
#toggle-reviews:active,
#load-more-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

/* ===== SEARCH FORM ===== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin: 20px 0;
}
.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    background: #fff;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
.search-form input:focus {
    border-color: var(--orange);
    box-shadow: 3px 3px 0 rgba(255, 107, 0, 0.2);
}
.search-form button {
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--orange), var(--coral));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    transition: all 0.15s;
}
.search-form button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.18);
}

/* ===== SITE DETAIL ===== */
.site-detail-header {
    background: var(--surface);
    border: 2.5px solid #ddd;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.08);
}
.site-detail-imgs {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}
.site-detail-imgs .thumbnail {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.site-detail-imgs .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--yellow);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}
.site-detail-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 4px;
}
.site-detail-url {
    color: var(--orange);
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 8px;
}
.site-detail-desc {
    color: var(--text-sub);
    font-size: 14px;
    margin-bottom: 16px;
}
.site-detail-body {
    line-height: 1.9;
}

/* ===== REVIEW SECTION ===== */
.review-section {
    background: var(--surface);
    border: 2.5px solid #ddd;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.08);
}
.reviews-scroll {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}
.more-link {
    display: inline-block;
    float: right;
    margin-top: 12px;
    color: var(--orange);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px dotted var(--orange);
    transition: color 0.2s;
}
.more-link:hover {
    color: var(--coral);
}

/* ===== SITE OVERVIEW ===== */
.site-overview {
    background: var(--surface);
    border: 2.5px solid #ddd;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.08);
    text-decoration: none;
}
.site-overview:hover {
    border-color: var(--orange);
    box-shadow: 7px 7px 0 rgba(255, 107, 0, 0.25);
    transform: translate(-3px, -3px);
}
.site-overview .thumbnail {
    width: 120px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}
.site-overview .icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--yellow);
}
.site-overview-body {
    flex: 1;
}
.site-overview-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}
.site-overview-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

/* ===== REVIEW FORM ===== */
.review-form-section {
    background: var(--surface);
    border: 2.5px solid #ddd;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 32px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.08);
}
.review-form-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--orange);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px dashed var(--yellow);
}
.review-form-title::before {
    content: "✍️ ";
}

/* ===== RESULT COUNT ===== */
.result-count {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-sub);
    background: #f0f4ff;
    border-left: 5px solid var(--primary);
    padding: 5px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 16px;
}

/* ===== PAGE MESSAGE ===== */
.page-message {
    text-align: center;
    padding: 80px 20px;
}
.page-message p {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-sub);
    font-size: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
    main > section {
        padding: 20px 12px 56px;
    }

    .site-item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .site-item img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .review-meta {
        flex-wrap: wrap;
    }
    .review-date {
        margin-left: 0;
    }
    .site-detail-title{
        text-align: center;
    }

    .site-detail-imgs {
        flex-wrap: wrap;
        flex-direction: column;
    }
    .site-detail-imgs .thumbnail {
        width: 100%;
    }

    .site-overview {
        flex-direction: column;
    }
    .site-overview .thumbnail {
        width: 100%;
    }

    .home-section-header {
        /* flex-direction: column; */
        gap: 6px;
    }

    .actions {
        flex-direction: column;
    }
    .actions .btn {
        width: 100%;
    }

    #toggle-site,
    #toggle-reviews,
    #load-more-btn {
        width: 100%;
    }

    .rank-card:nth-child(1)::before {
        font-size: 10px;
        padding: 3px 10px 4px;
    }
}
