:root {
    --accent: #ff4d4d;
    --accent-hover: #ff3333;
    --accent-soft: rgba(255, 77, 77, 0.16);
    --accent-light: #ff8888;
    --accent-lighter: #ff8888;
    --hue-rotate: 0deg;
    --nav-hover: rgba(255, 77, 77, 0.12);
    --bg1: #111215;
    --bg2: #06070a;
    --bg3: #1a1b21;
    --bg-dark: #060608;
    --card-bg: #121215;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loading-text {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#loading-skip {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 12px 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

#loading-skip.visible {
    opacity: 1;
    visibility: visible;
}

#loading-skip:hover {
}

#loading-text::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

#loading-progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
}

#loading-progress {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-soft);
}





.player-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    margin: 0 auto;
    flex: 0 1 auto;
    width: 100%;
    max-width: 1500px;
    height: calc(100vh - 80px);
    min-width: 0;
}

.player-area.hidden { 
    display: none; 
}

.player-content {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    background: transparent;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-holder {
    position: relative;
    width: min(100vw - 40px, 1500px, calc((100vh - 80px) * 3 / 2));
    max-width: 100%;
}

.player-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    border: none;
    border-radius: 8px;
    background: #000;
}

.player-controls {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0;
    justify-content: flex-start;
    background: transparent;
    border: none;
    z-index: 10;
}

.icon-btn {
    background: rgba(30, 30, 35, 0.7);
    border: none;
    color: var(--text-main);
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    width: 44px;
    height: 44px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    text-decoration: none;
}

.icon-btn i {
    display: block;
}

.icon-btn img {
    width: 24px;
    height: 24px;
    display: block;
    filter: brightness(0) invert(1);
}

.icon-btn:hover {
    background: rgba(40, 40, 45, 0.9);
    transform: scale(1.1);
    text-decoration: none;
}

@media (max-width: 1100px) {
    .player-wrapper {
        align-items: center;
    }
}

@media (max-width: 950px) {
    .player-holder {
        width: min(100vw - 40px, 1500px, calc((100vh - 80px) * 16 / 9));
    }

    .player-iframe {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 600px) {
    .player-holder {
        width: min(100vw - 40px, 1500px, calc((100vh - 80px) * 4 / 3));
    }

    .player-iframe {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 600px) {
    .player-holder {
        width: min(100vw - 40px, 1500px, calc((100vh - 80px) * 4 / 3));
    }

    .player-iframe {
        aspect-ratio: 4 / 3;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .player-controls {
        gap: 8px;
        bottom: 8px;
        left: 8px;
    }
}






body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: "Chiron GoRound TC", -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background 0.4s ease-in-out;
    overflow-x: hidden;
    text-transform: lowercase;
}

body:not(:has(#mainSearch)):not(.proxy-page) {
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 80px;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: transparent;
}

body,
button,
input,
a,
h1,
h2,
h3,
p,
li,
span {
    font-family: "Chiron GoRound TC", -apple-system, BlinkMacSystemFont, sans-serif;
    text-transform: lowercase;
}

#flex {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 0;
    z-index: 10;
}

body:not(:has(#mainSearch)) #flex {
    gap: 8px;
}

body:not(:has(#mainSearch)) #flex h1 {
    font-size: clamp(2.8rem, 5vw, 4rem);
}

body:has(#mainSearch) #flex {
    padding-top: 0;
}







body:has(#mainSearch) #flex {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    padding: 60px 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
}

body:has(#mainSearch) {
    padding-top: 0;
    padding-bottom: 0;
}

h1 {
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    color: #ffffff;
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #ffffff 25%,
        var(--accent-lighter) 35%,
        var(--accent) 40%,
        var(--accent-hover) 45%,
        var(--accent) 50%,
        var(--accent-lighter) 55%,
        #ffffff 65%,
        #ffffff 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: none;
    animation: anko-logo-shimmer 4s linear infinite;
    will-change: background-position;
}

@keyframes anko-logo-shimmer {
    0% { 
        background-position: 100% 0;
    }
    50% { 
        background-position: 0% 0;
    }
    100% { 
        background-position: -100% 0;
    }
}


p,
li {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
}

#subtext {
    display: block;
    max-width: 540px;
    margin: -10px auto 28px auto;
    text-align: center;
    font-size: 1.05rem;
    color: var(--text-muted);
    padding: 0 16px;
}

#mainSearch,
#librarySearch {
    display: flex;
    align-items: center;
    width: min(90vw, 400px);
    margin: 0 auto;
    padding: 16px 24px;
    font-size: 1.1rem;
    line-height: 1;
    background: rgba(18, 18, 22, 0.85);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    outline: none;
    box-shadow: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.15s ease, border-width 0.15s ease;
    text-align: center;
}

#librarySearch {
    margin-bottom: 8px;
    width: min(90vw, 300px);
}

#mainSearch::placeholder,
#librarySearch::placeholder {
    color: rgba(243, 243, 243, 0.45);
}

#mainSearch:hover,
#librarySearch:hover {
    border-color: var(--accent);
    border-width: 5px;
    box-shadow: 0 0 25px var(--accent-soft), 0 0 50px var(--accent-soft);
}

#discord-box {
    display: block;
    width: min(90vw, 400px);
    margin: 12px auto 0 auto;
    padding: 14px 24px;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    background: rgba(18, 18, 22, 0.85);
    color: var(--text-main);
    border: 5px solid var(--accent);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.15s ease;
    box-shadow: 0 0 25px var(--accent-soft), 0 0 50px var(--accent-soft);
}

#discord-box:hover {
    background: rgba(18, 18, 22, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 0 35px var(--accent-soft), 0 0 70px var(--accent-soft);
}

#content {
    max-width: 1800px;
    width: 100%;
    margin: 0 auto 36px auto;
    padding: 0 20px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.settings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 20px;
}

#content h2 {
    margin: 0 0 20px 0;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
    border: 1px solid var(--border-subtle);
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(9, 180px);
    gap: 8px;
    row-gap: 8px;
    margin-top: 16px;
    width: 100%;
    justify-content: center;
}

.tile-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    row-gap: 8px;
    margin-top: 2px;
    width: 100%;
}

.tile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 180px;
    max-width: 100%;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s ease, margin-bottom 0.2s ease;
    margin: 0 0 0 0;
    position: relative;
}

.tile-card img {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: cover;
    background-color: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease, border-color 0.2s ease, border-width 0.2s ease;
}

.tile-card:hover img {
    transform: scale(1.04);
    border-color: var(--accent);
    border-width: 5px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-soft);
}

.tile-card span {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    display: block;
    margin: 0;
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    text-align: center;
    line-height: 1.3;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease, color 0.15s ease;
    pointer-events: none;
    max-width: calc(100% - 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tile-card:hover span {
    opacity: 1;
    visibility: visible;
}

.tile-grid.loading,
.tile-grid.error,
.tile-row.loading,
.tile-row.error {
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 40px 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 920px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .settings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.settings-card {
    background: rgba(18, 18, 22, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: lowercase;
}

.settings-select {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Chiron GoRound TC", -apple-system, BlinkMacSystemFont, sans-serif;
    text-transform: lowercase;
    outline: none;
}

.settings-select:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.settings-select option {
    background: var(--bg2);
    color: var(--text-main);
}

.settings-section {
    background: rgba(18, 18, 22, 0.6);
    border: 5px solid var(--accent);
    border-radius: 24px;
    padding: 30px;
    backdrop-filter: blur(10px);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-width: 180px;
    aspect-ratio: 1;
}

.settings-section.theme-section {
    flex: 0 1 auto;
    width: fit-content;
    min-width: 240px;
    max-width: 420px;
    aspect-ratio: auto;
}

.custom-select {
    width: 100%;
    position: relative;
}

.dropdown-trigger {
    width: 100%;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 999px;
    background: #070707;
    border: none;
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.dropdown-trigger:hover {
    background: #121217;
}

.dropdown-icon {
    font-size: 0.92rem;
    opacity: 0.8;
}

.custom-select {
    width: 100%;
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #070707;
    border: none;
    border-radius: 0;
    padding: 0;
    display: grid;
    gap: 0;
    max-height: 260px;
    overflow: auto;
    box-shadow: none;
    z-index: 20;
}

.dropdown-panel.hidden {
    display: none;
}

.dropdown-options {
    display: grid;
    gap: 0;
    overflow: auto;
    padding: 0;
}

.dropdown-option {
    width: 100%;
    padding: 14px 16px;
    border-radius: 0;
    border: none;
    background: #070707;
    color: #f5f5ff;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    outline: none;
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.dropdown-option.active {
    background: #2d5cff;
    color: #ffffff;
    font-weight: 700;
}

.settings-hint {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-muted);
    opacity: 0.7;
    text-align: center;
    max-width: 22ch;
}

.settings-section h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: lowercase;
    text-align: center;
}

.settings-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.settings-buttons button {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-buttons button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-buttons button.active {
    background: var(--accent);
    color: #09090b;
    font-weight: 700;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-soft);
}


.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 10px;
    margin-left: auto;
    margin-right: auto;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    background: rgba(18, 18, 22, 0.94);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    width: fit-content;
}

.nav-item,
.pullout-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.nav-item:hover,
.pullout-item:hover {
    transform: translateY(-2px);
}

.nav-item:hover img,
.pullout-item:hover img {
    filter: brightness(0) invert(1);
}

.nav-item:active,
.pullout-item:active {
    transform: translateY(0) scale(0.96);
}

.nav-item img,
.pullout-item img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

.nav-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
    padding: 0 12px;
    height: 38px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
}

.status-text {
    letter-spacing: 0.01em;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.pullout-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 66px;
    margin-left: auto;
    margin-right: auto;
    transform: translateY(12px);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 20px;
    background: rgba(18, 18, 22, 0.92);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
    width: fit-content;
}

.pullout-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

ul {
    text-align: left;
    display: inline-block;
    padding-left: 20px;
    line-height: 1.8;
}

@media (max-width: 1700px) {
    .tile-grid {
        grid-template-columns: repeat(8, 180px);
    }
}

@media (max-width: 1520px) {
    .tile-grid {
        grid-template-columns: repeat(7, 180px);
    }
}

@media (max-width: 1340px) {
    .tile-grid {
        grid-template-columns: repeat(6, 180px);
    }
}

@media (max-width: 1160px) {
    .tile-grid {
        grid-template-columns: repeat(5, 180px);
    }
}

@media (max-width: 980px) {
    .tile-grid {
        grid-template-columns: repeat(4, 180px);
    }
}

@media (max-width: 800px) {
    .tile-grid {
        grid-template-columns: repeat(3, 180px);
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .tile-grid {
        grid-template-columns: repeat(2, 180px);
    }
}

@media (max-width: 420px) {
    .tile-grid {
        grid-template-columns: repeat(2, 160px);
        gap: 6px;
    }
    
    .tile-card {
        width: 160px;
    }

    .tile-card img {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 2.8rem;
    }

    #logo {
        width: 76px;
        height: 76px;
    }

    #content {
        padding: 0 14px 24px;
    }
    
    body:has(#mainSearch) #flex {
        padding: 40px 16px 110px;
    }
    
    #mainSearch,
    #librarySearch {
        width: min(90vw, 350px);
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    #discord-box {
        width: min(90vw, 350px);
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .settings-container {
        gap: 10px;
        margin-top: 12px;
    }
    
    .settings-section {
        min-width: 160px;
        padding: 24px;
    }
    
    .settings-section h3 {
        font-size: 1.1rem;
    }
    
    .bottom-nav {
        padding: 5px 8px;
        gap: 1px;
    }
    
    .nav-item {
        width: 40px;
        height: 40px;
    }
    
    .nav-item img {
        width: 24px;
        height: 24px;
    }
    
    .nav-status {
        font-size: 0.85rem;
        padding: 0 10px;
        height: 36px;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: 2.5rem;
    }
    
    #mainSearch,
    #librarySearch,
    #discord-box {
        width: 92vw;
    }
    
    .tile-grid {
        grid-template-columns: repeat(2, 150px);
    }
    
    .tile-card {
        width: 150px;
    }

    .tile-card img {
        width: 150px;
        height: 150px;
    }
    
    .bottom-nav {
        flex-wrap: wrap;
        padding: 4px 6px;
        max-width: 95vw;
    }
    
    .nav-status {
        font-size: 0.8rem;
        padding: 0 8px;
    }
}
