:root {
    --bg-dark: #000000;
    --bg-gradient: radial-gradient(circle at center, rgba(30, 20, 0, 1) 0%, rgba(5, 5, 5, 1) 100%);
    --gold: #d4af37;
    --gold-light: #fde047;
    --gold-dark: #854d0e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-line: rgba(212, 175, 55, 0.5);
    --border-faint: rgba(212, 175, 55, 0.2);
    --card-bg: rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Noto Serif JP', serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.page-wrapper {
    width: 100%;
    max-width: 1400px;
    background: var(--bg-gradient);
    border: 3px solid var(--gold);
    border-radius: 4px;
    padding: 8px;
    position: relative;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.2);
}

.gold-frame {
    border: 1px solid var(--border-line);
    padding: 3rem;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.gold-frame::before {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vh;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.stats-overview {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.overview-pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-line);
    padding-bottom: 0.5rem;
}

.overview-pill span:first-child {
    color: var(--text-muted);
}

.overview-pill .count {
    color: var(--gold-light);
    font-weight: 700;
    font-size: 1.5rem;
}

main {
    position: relative;
    z-index: 1;
}

.stat-section {
    margin-bottom: 5rem;
}

.section-title-wrap {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title-wrap h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-main);
    letter-spacing: 0.1em;
    display: inline-block;
    padding: 0 2rem;
    position: relative;
}

.section-title-wrap h2::before,
.section-title-wrap h2::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background-color: var(--border-line);
}

.section-title-wrap h2::before { left: -60px; }
.section-title-wrap h2::after { right: -60px; }

.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    justify-items: center;
}

.stat-card {
    background: var(--card-bg);
    border-top: 1px solid var(--border-faint);
    border-bottom: 1px solid var(--border-line);
    padding: 1rem;
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-bottom-color: var(--gold-light);
}

.item-rank {
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 2rem;
    font-weight: 900;
    color: var(--border-faint);
    line-height: 1;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
}

.rank-1 .item-rank { color: rgba(253, 224, 71, 0.4); }
.rank-2 .item-rank { color: rgba(203, 213, 225, 0.4); }
.rank-3 .item-rank { color: rgba(180, 83, 9, 0.4); }

.item-img-container {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.item-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.8));
}

.stage-card .item-img-container {
    height: 120px;
}

.stage-card .item-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rule-card .item-img-container {
    height: 120px;
}

.rule-card .item-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-info {
    width: 100%;
}

.item-name {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-bar-bg {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.item-bar-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 1s ease-out;
}

.item-count {
    color: var(--gold-light);
    font-size: 1.1rem;
    font-weight: 700;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}
