* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #202124;
    font-family:
        "Yu Gothic",
        "Meiryo",
        sans-serif;
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #111827;
    color: white;
}

.header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
}

main {
    padding-top: 32px;
    padding-bottom: 64px;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading h1 {
    margin-bottom: 8px;
}

.card-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.price-card {
    padding: 24px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

.price-card h2 {
    min-height: 56px;
    margin-top: 0;
    font-size: 18px;
}

.latest-price {
    margin: 18px 0;
    font-size: 30px;
    font-weight: 700;
}

.price-card dl {
    margin: 0;
}

.price-card dl div {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #eeeeee;
}

.price-card dt {
    color: #666666;
}

.price-card dd {
    margin: 0;
    font-weight: 700;
}

.detail-button {
    display: block;
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    text-align: center;
    text-decoration: none;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f3f4f6;
}

.summary-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.summary-grid div {
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

.summary-grid span,
.summary-grid strong {
    display: block;
}

.summary-grid span {
    margin-bottom: 8px;
    color: #666666;
}

.summary-grid strong {
    font-size: 24px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #2563eb;
    text-decoration: none;
}

@media (max-width: 700px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 0;
    }

    nav {
        flex-wrap: wrap;
    }
}

.chart-section,
.history-section {
    margin-top: 32px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.section-heading p {
    margin: 0;
    color: #666666;
}

.chart-panel {
    padding: 24px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

.price-chart {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
}

.chart-empty {
    color: #666666;
    text-align: center;
}

.chart-empty p {
    margin: 6px 0;
}

@media (max-width: 700px) {
    .chart-panel {
        padding: 12px;
    }
}

.card-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 260px;
    margin: -24px -24px 20px;
    padding: 18px;
    border-radius: 14px 14px 0 0;
    background: #f3f4f6;
    overflow: hidden;
}

.card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-image-empty {
    color: #8a8a8a;
}

.detail-card-image-panel {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
    padding: 24px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

.detail-card-image {
    display: block;
    width: min(320px, 100%);
    height: auto;
    object-fit: contain;
}

.search-section {
    margin-bottom: 28px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

.search-input:focus {
    border-color: #2563eb;
    outline: 2px solid rgb(37 99 235 / 15%);
}

.search-button {
    padding: 13px 22px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.search-reset {
    padding: 12px 14px;
    color: #4b5563;
    text-decoration: none;
}

.search-result-text {
    margin: 12px 4px 0;
    color: #4b5563;
}

@media (max-width: 700px) {
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .search-button,
    .search-reset {
        width: 100%;
        text-align: center;
    }
}

.series-select {
    min-width: 170px;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.series-select:focus {
    border-color: #2563eb;
    outline: 2px solid rgb(37 99 235 / 15%);
}

@media (max-width: 700px) {
    .series-select {
        width: 100%;
    }
}

.rarity-select {
    min-width: 150px;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.rarity-select:focus {
    border-color: #2563eb;
    outline: 2px solid rgb(37 99 235 / 15%);
}

@media (max-width: 700px) {
    .rarity-select {
        width: 100%;
    }
}

.sort-select {
    min-width: 190px;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.sort-select:focus {
    border-color: #2563eb;
    outline: 2px solid rgb(37 99 235 / 15%);
}

@media (max-width: 700px) {
    .sort-select {
        width: 100%;
    }
}

.ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.ranking-tabs a {
    padding: 10px 16px;
    border-radius: 8px;
    background: white;
    color: #374151;
    text-decoration: none;
    box-shadow: 0 2px 10px rgb(0 0 0 / 7%);
}

.ranking-tabs a:hover {
    background: #eff6ff;
}

.ranking-tabs a.active {
    background: #2563eb;
    color: white;
    font-weight: 700;
}

.latest-sales-section {
    margin-top: 48px;
}

.table-card-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.table-card-link:hover {
    text-decoration: underline;
}

.interactive-chart-wrapper {
    position: relative;
    width: 100%;
    height: 420px;
}

@media (max-width: 700px) {
    .interactive-chart-wrapper {
        height: 300px;
    }
}

.movement-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 32px;
}

.movement-grid > div {
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 18px rgb(0 0 0 / 8%);
}

.movement-grid span,
.movement-grid strong {
    display: block;
}

.movement-grid span {
    margin-bottom: 8px;
    color: #666666;
}

.movement-grid strong {
    font-size: 24px;
}

.price-up {
    color: #dc2626;
}

.price-down {
    color: #2563eb;
}

.price-flat {
    color: #374151;
}

.no-data {
    color: #9ca3af;
    font-size: 18px !important;
}

.detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.price-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
}

.status-icon {
    font-size: 20px;
    line-height: 1;
}

.status-up {
    background: #fee2e2;
    color: #b91c1c;
}

.status-down {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-flat {
    background: #f3f4f6;
    color: #374151;
}

.status-no-data {
    background: #f3f4f6;
    color: #9ca3af;
}

@media (max-width: 700px) {
    .detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

.card-change-rate {
    margin: -8px 0 18px;
    font-size: 14px;
    font-weight: 700;
}

.shop-links-section{

    margin:30px 0;

    padding:25px;

    background:#ffffff;

    border-radius:12px;

    box-shadow:0 2px 10px rgba(0,0,0,.08);

}

.mercari-button{

    display:inline-block;

    background:#ff4d5a;

    color:white;

    padding:14px 28px;

    border-radius:999px;

    font-size:16px;

    font-weight:bold;

    text-decoration:none;

    transition:.2s;

}

.mercari-button:hover{

    background:#e63d4b;

    transform:translateY(-2px);

}

.mercari-button-disabled{

    display:inline-block;

    background:#dddddd;

    color:#666;

    padding:14px 28px;

    border-radius:999px;

}

.affiliate-note{

    margin-top:12px;

    font-size:12px;

    color:#888;

}