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

body {
    background: #0a0a0a;
    font-family: 'Geist', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    color: #fff;
    padding: 10vh 2vh 15vh;
}

.list-header {
    font-size: 1.7rem;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ccc;
}

h2, h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: #aaa;
    margin-bottom: 8px;
}

/* ---- player list view ---- */
#player-list-view {
    width: 100%;
    max-width: 520px;
}

#player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.api-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.api-player-card:hover {
    background: #1a1a1a;
    border-color: #333;
}

.api-player-card img {
    border-radius: 4px;
    image-rendering: pixelated;
}

.api-player-card span {
    font-size: 0.78rem;
    color: #aaa;
}

/* ---- profile view ---- */
#player-profile-view {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#back-btn {
    background: transparent;
    border: 1px solid #1f1f1f;
    color: #666;
    font-family: inherit;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    width: fit-content;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#back-btn:hover {
    color: #aaa;
    border-color: #333;
}

#player-profile {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#player-head img {
    border-radius: 6px;
    image-rendering: pixelated;
}

#player-name {
    font-size: 1.7rem;
    font-weight: 500;
    color: #fff;
}

/* ---- stat sections ---- */
#player-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-section {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    padding: 16px;
}

.stat-section h3 {
    font-size: 0.78rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1f1f1f;
}

.stat-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.stat-section table tr td {
    padding: 4px 0;
    color: #444;
}

.stat-section table tr td:first-child {
    color: #888;
    width: 60%;
}

.stat-section table tr td b {
    font-weight: 400;
}

.stat-section table tr:hover td {
    color: #aaa;
}

.stat-section details summary {
    font-size: 0.78rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding-bottom: 8px;
    border-bottom: 1px solid #1f1f1f;
    list-style: none;
}

.stat-section details summary:hover {
    color: #aaa;
}

.stat-section details[open] summary {
    margin-bottom: 8px;
}

.stat-section details summary::after {
    content: '▸';
    float: right;
    color: #444;
}

.stat-section details[open] summary::after {
    content: '▾';
}

@keyframes fetchingPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(142, 32, 157, 0.8)); }
    50% { filter: drop-shadow(0 0 16px rgba(31, 7, 141, 1)); }
}

.fetching-txt {
    background: linear-gradient(90deg, rgb(31, 7, 141), rgb(142, 32, 157));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    padding-left: 100px;
    animation: fetchingPulse 1.5s ease-in-out infinite;
}

.card-playtime {
    font-size: 0.7rem;
    color: #444;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00ff2f;
    box-shadow: 0 0 6px #00ff2f, 0 0 12px #00ff2f;
    display: inline-block;
}

#player-search {
    width: 100%;
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #aaa;
    outline: none;
    margin-bottom: 16px;
    transition: border-color 0.15s ease;
}

#player-search:focus {
    border-color: #333;
}

#player-search::placeholder {
    color: #333;
}