@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

/* Minecraft font (place `fonts/Minecraft.ttf` in repo) */
@font-face {
    font-family: 'Minecraft';
    /* primary: your downloaded file (minecraft_font.ttf) with fallback to common name */
    src: url('fonts/minecraft_font.ttf') format('truetype'), url('fonts/Minecraft.ttf') format('truetype');
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --bg-2: #eaf0ff;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.62);
    --text: #10213a;
    --muted: #5f6f87;
    --heading: #0b1f3d;
    --line: rgba(16, 33, 58, 0.1);
    --shadow: 0 24px 60px rgba(17, 35, 66, 0.12);
    --shadow-soft: 0 12px 30px rgba(17, 35, 66, 0.08);
    --accent: #f7c948;
    --accent-2: #4d7cff;
    --accent-3: #13b8a6;
    --danger: #d6455d;
    --success: #1d8f64;
    --page-gradient: radial-gradient(circle at top left, rgba(77, 124, 255, 0.16), transparent 28%), radial-gradient(circle at top right, rgba(247, 201, 72, 0.22), transparent 24%), linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body[data-theme='dark'] {
    color-scheme: dark;
    --bg: #08111f;
    --bg-2: #0f1b31;
    --surface: rgba(10, 18, 34, 0.72);
    --surface-strong: rgba(10, 18, 34, 0.92);
    --surface-soft: rgba(15, 28, 53, 0.7);
    --text: #e7eefc;
    --muted: #a5b4cf;
    --heading: #f5f8ff;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.28);
    --accent: #f6ca52;
    --accent-2: #7ea2ff;
    --accent-3: #47d7c4;
    --danger: #ff7d8f;
    --success: #48d39f;
    --page-gradient: radial-gradient(circle at top left, rgba(126, 162, 255, 0.18), transparent 24%), radial-gradient(circle at top right, rgba(246, 202, 82, 0.12), transparent 22%), linear-gradient(180deg, #07101e 0%, #0c1628 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--page-gradient);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(24px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.55;
}

body::before {
    width: 22rem;
    height: 22rem;
    top: -6rem;
    right: -6rem;
    background: rgba(77, 124, 255, 0.28);
}

body::after {
    width: 18rem;
    height: 18rem;
    bottom: 6rem;
    left: -5rem;
    background: rgba(247, 201, 72, 0.24);
}

header {
    width: min(1180px, calc(100% - 2rem));
    margin: 1.25rem auto 0;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(18px);
    border-radius: 22px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 1rem;
    z-index: 10;
}

.brand-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--heading);
}

.tagline {
    font-size: 0.98rem;
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--surface-strong), var(--surface));
    color: var(--heading);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(247, 201, 72, 0.45);
}

.theme-toggle-icon {
    font-size: 1.05rem;
}

.theme-toggle-text {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 4rem;
}

section {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 2rem;
    margin: 1.35rem 0;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(247, 201, 72, 0.08), transparent 30%, rgba(77, 124, 255, 0.06));
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--heading);
    margin-bottom: 1rem;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    letter-spacing: -0.03em;
}

h3 {
    color: var(--heading);
    margin-top: 1.4rem;
    margin-bottom: 0.7rem;
}

p {
    color: var(--text);
}

code {
    background: rgba(77, 124, 255, 0.12);
    color: var(--heading);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-card {
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-soft));
    padding: 1.35rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    border-top: 4px solid rgba(247, 201, 72, 0.9);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 36px rgba(17, 35, 66, 0.14);
}

.feature-card h4 {
    color: var(--heading);
    margin-bottom: 0.45rem;
}

.commands-section,
.search-section {
    background: var(--surface);
}

.command-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.95rem;
}

.command {
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-soft));
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-soft);
}

.command-name {
    font-weight: 800;
    color: var(--heading);
    font-family: 'Space Grotesk', sans-serif;
}

.command-desc {
    font-size: 0.92rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.6rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.82rem 1.35rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(17, 35, 66, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #f7c948 0%, #ffdf72 100%);
    color: #12213d;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ffd85c 0%, #ffe88f 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #223b73 0%, #355ea8 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1b3263 0%, #2d56a3 100%);
}

footer {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto 1.25rem;
    background: var(--surface);
    color: var(--text);
    text-align: center;
    padding: 1.4rem 1rem;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

footer p:last-child {
    color: var(--muted);
    margin-top: 0.25rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-box {
    background: linear-gradient(160deg, rgba(247, 201, 72, 0.98), rgba(255, 231, 144, 0.94));
    padding: 1.35rem;
    border-radius: 18px;
    text-align: center;
    color: #14213d;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.stat-number {
    font-size: 2rem;
    margin-bottom: 0.35rem;
    font-family: 'Space Grotesk', sans-serif;
}

.search-box {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box input,
.player2-wrap input {
    flex: 1;
    min-width: 240px;
    padding: 0.88rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-box input::placeholder,
.player2-wrap input::placeholder {
    color: var(--muted);
}

.search-box input:focus,
.player2-wrap input:focus {
    outline: none;
    border-color: rgba(247, 201, 72, 0.9);
    box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.16);
}

.mode-selector {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    font-size: 0.92rem;
    font-weight: 600;
}

.mode-btn:hover {
    border-color: rgba(247, 201, 72, 0.8);
    transform: translateY(-1px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #f7c948 0%, #ffe284 100%);
    border-color: rgba(247, 201, 72, 0.8);
    color: #12213d;
    font-weight: 800;
}

.results-container {
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1.35rem;
    margin-top: 1.5rem;
    display: none;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

body[data-theme='dark'] .results-container {
    background: rgba(8, 16, 30, 0.44);
}

.results-container.show {
    display: block;
}

.player-header {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.player-avatar {
    width: 82px;
    height: 82px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(210,220,240,0.72));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    object-fit: cover;
}

.player-info h3 {
    font-size: 1.5rem;
    color: var(--heading);
    margin: 0;
}

.player-name-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.player-bedwars-star-badge {
    display: inline-block;
    height: auto;
    max-width: 220px;
    margin-right: 8px;
    vertical-align: middle;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.player-info .username {
    color: var(--muted);
    margin-top: 0.25rem;
}

.blacklist-status {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 800;
    margin-top: 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    position: relative;
}

.blacklist-status[title] {
    cursor: help;
}

.blacklist-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0;
    background: transparent;
}

.blacklist-icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    object-fit: cover;
    display: inline-block;
}

.blacklist-status.clean {
    background: rgba(29, 143, 100, 0.12);
    color: var(--success);
    border-color: rgba(29, 143, 100, 0.18);
}

.blacklist-status.flagged {
    background: transparent;
    color: var(--danger);
    border-color: transparent;
    padding: 0;
    margin-top: 0.45rem;
    min-height: 22px;
    gap: 0.45rem;
}

.blacklist-status.flagged .blacklist-icon,
.blacklist-status.flagged .blacklist-icon-fallback,
.blacklist-status.flagged .blacklist-badge {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.blacklist-details {
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.35rem;
}

.blacklist-detail {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.25;
}

.blacklist-detail-source {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.blacklist-detail-icon {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 auto;
}

.blacklist-detail-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--heading);
    white-space: pre-line;
    word-break: break-word;
}

.blacklist-icon-fallback {
    font-size: 1.15rem;
    line-height: 1;
    color: var(--danger);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bedwars-board {
    display: grid;
    gap: 0.9rem;
    margin-top: 0.8rem;
}

.bedwars-section {
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.bedwars-section::before {
    display: none;
}

.bedwars-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.55rem;
    margin-left: 0.15rem;
    padding-left: 0.15rem;
    line-height: 1.2;
}

.bedwars-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.bedwars-layout-tight {
    margin-top: 0;
}

.bedwars-stat-item {
    min-height: 72px;
    padding: 0.78rem 0.9rem;
}

.bedwars-stat-item .stat-label {
    font-size: 0.74rem;
    margin-bottom: 0.18rem;
}

.bedwars-stat-item .stat-value {
    font-size: 1.12rem;
}

.stat-item {
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-soft));
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    box-shadow: var(--shadow-soft);
}

.stat-label {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--heading);
    word-break: break-word;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(127, 146, 178, 0.35);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.45rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message,
.success-message {
    padding: 1rem;
    border-radius: 16px;
    margin-top: 1rem;
    border: 1px solid transparent;
}

.error-message {
    background: rgba(214, 69, 93, 0.12);
    color: var(--danger);
    border-color: rgba(214, 69, 93, 0.18);
}

.success-message {
    background: rgba(29, 143, 100, 0.12);
    color: var(--success);
    border-color: rgba(29, 143, 100, 0.18);
}

.hidden {
    display: none !important;
}

.player2-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 240px;
}

.player2-wrap input {
    min-width: 180px;
}

.vs-label {
    font-weight: 800;
    color: var(--heading);
    font-size: 1rem;
    white-space: nowrap;
    padding: 0 0.15rem;
}

.compare-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.9rem;
    align-items: stretch;
    margin-bottom: 1.2rem;
}

.compare-player-card {
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-soft));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.compare-player-card.right {
    text-align: right;
}

.vs-badge {
    align-self: center;
    justify-self: center;
    min-width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #f7c948 0%, #ffe48c 100%);
    color: #12213d;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.7rem;
}

.compare-table td {
    padding: 0.95rem 1rem;
    background: var(--surface-strong);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.compare-table td:first-child {
    border-left: 1px solid var(--line);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    font-weight: 800;
    color: var(--heading);
    text-align: right;
}

.compare-table td:last-child {
    border-right: 1px solid var(--line);
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.stat-name-cell {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    width: 35%;
}

.p1-cell.winner,
.p2-cell.winner {
    background: rgba(29, 143, 100, 0.12);
    color: var(--success);
}

.p1-cell.loser,
.p2-cell.loser {
    background: rgba(214, 69, 93, 0.12);
    color: var(--danger);
}

@media (max-width: 900px) {
    header {
        position: static;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .compare-header {
        grid-template-columns: 1fr;
    }

    .vs-badge {
        width: 3rem;
        margin: 0 auto;
    }

    .bedwars-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .container,
    footer {
        width: min(100% - 1rem, 1180px);
    }

    section {
        padding: 1.35rem;
    }

    .search-box,
    .buttons,
    .player-header {
        flex-direction: column;
        align-items: stretch;
    }

    .player-header {
        gap: 1rem;
    }

    .player-avatar {
        width: 72px;
        height: 72px;
    }

    .mode-selector {
        width: 100%;
    }

    .mode-btn,
    .theme-toggle {
        width: 100%;
        justify-content: center;
    }

    .stats-grid,
    .bedwars-layout {
        grid-template-columns: 1fr;
    }

    .bedwars-layout {
        gap: 0.6rem;
    }

    .bedwars-stat-item {
        min-height: 66px;
        padding: 0.75rem 0.85rem;
    }

    .blacklist-status.flagged {
        align-items: flex-start;
    }

    .blacklist-details {
        display: flex;
    }

    .bedwars-meta-row {
        justify-content: flex-start;
    }

}
