* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    color: #fff;
    font-family: sans-serif;
}

/* ── Header ── */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

#header #logo {
    margin-right: 2rem;
    height: 1.5rem;
    color: #fee100;
}

#header h1 {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fee100;
}

#search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 6px 10px;
    border-radius: 6px;
}

#search-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

#search-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Spotlight overlay ── */
#spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#spotlight-overlay.open {
    opacity: 1;
    pointer-events: all;
}

#spotlight-box {
    width: min(640px, 90vw);
    background: rgba(28, 28, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s ease;
}

#spotlight-overlay.open #spotlight-box {
    transform: scale(1) translateY(0);
}

#spotlight-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#spotlight-input-wrap svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
}

#spotlight-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.3rem;
    caret-color: #fee100;
}

#spotlight-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#spotlight-shortcut {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.07);
    padding: 3px 7px;
    border-radius: 5px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

#spotlight-results {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.sp-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sp-result:last-child {
    border-bottom: none;
}

.sp-result:hover,
.sp-result.focused {
    background: rgba(255, 224, 138, 0.1);
}

.sp-result img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    object-position: top center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.sp-result-info {
    flex: 1;
    min-width: 0;
}

.sp-result-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-result-name mark {
    background: none;
    color: #fee100;
    font-weight: 800;
}

.sp-result-rank {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.sp-result-rank span {
    color: #fee100;
    font-weight: 600;
}

.sp-arrow {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1rem;
}

#spotlight-empty {
    padding: 32px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    display: none;
}

#spotlight-footer {
    display: flex;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

.sp-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.7rem;
}

/* ── Carousel ── */
#carousel {
    position: fixed;
    top: 50px;
    bottom: 130px;
    left: 0;
    right: 0;
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#carousel::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    height: 100%;
}

.slide-photo {
    width: 70%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: #000;
}

/* Blurred background layer */
.slide-photo .photo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: top center;
    filter: blur(20px) brightness(0.5);
    transform: scale(1.1);
    /* avoid blur edges */
}

/* Foreground image — contained */
.slide-photo img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}


.slide-photo .rank-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid #fee100;
    color: #fee100;
    font-size: 1.4rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 4px;
}

.slide-info {
    width: 30%;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    background: #111;
    border-left: 2px solid #222;
}

.slide-info .player-rank {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: #fee100;
    text-transform: uppercase;
}

.slide-info .player-name {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.slide-info .player-text {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #ccc;
}

/* ── Ribbon ── */
#ribbon {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 130px;
    background: rgba(10, 10, 10, 0.95);
    border-top: 1px solid #222;
    display: flex;
    align-items: center;
    z-index: 100;
}

.ribbon-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    transition: background 0.2s;
}

.ribbon-arrow:hover {
    background: rgba(255, 224, 138, 0.2);
    color: #fee100;
}

#ribbon-track {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: scroll;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 8px 0;
    scroll-snap-type: x mandatory;
}

#ribbon-track::-webkit-scrollbar {
    display: none;
}

.thumb {
    flex: 0 0 80px;
    scroll-snap-align: start;
    height: 100px;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.thumb .thumb-rank {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    font-size: 0.65rem;
    text-align: center;
    color: #fee100;
    padding: 2px 0;
}

.thumb:hover {
    transform: scale(1.05);
}

.thumb.active {
    border-color: #fee100;
    transform: scale(1.08);
}

/* ── Prev / Next arrows ── */
.swipe-hint {
    background: transparent;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    border: none;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
}

.swipe-hint:hover {
    color: rgba(255, 255, 255, 0.15);
}

.swipe-hint.left {
    left: 12px;
}

.swipe-hint.right {
    right: 12px;
}

.swipe-hint[style*="hidden"] {
    pointer-events: none;
}


/* ── Mobile ── */
@media (max-width: 768px) {
    .swipe-hint {
        top: 30%;
    }

    /* Let the whole page scroll */
    html,
    body {
        height: auto;
        overflow: auto;
    }

    .slide-photo img {
        object-fit: cover;
    }

    .photo-bg {
        display: none;
    }

    /* Ribbon hidden */
    #ribbon {
        display: none;
    }

    #search-btn span {
        display: none;
    }

    /* Carousel: no longer fixed, sits below header */
    #carousel {
        position: relative;
        top: 0;
        bottom: auto;
        margin-top: 50px;
        height: auto;
    }

    /* Slide stacks vertically, natural height */
    .slide {
        flex-direction: column;
        height: auto;
        min-height: calc(100svh - 50px);
    }

    /* Photo takes full width, fixed height */
    .slide-photo {
        width: 100%;
        height: 55vw;
        flex-shrink: 0;
    }

    /* Info panel: natural height, NO scroll */
    .slide-info {
        width: 100%;
        height: auto;
        overflow-y: visible;
        border-left: none;
        border-top: 2px solid #222;
        padding: 16px;
    }

    /* Swipe hint arrows */
    .swipe-hint {
        display: flex;
    }
}