* {
    box-sizing: border-box;
    color: rgb(255, 255, 255);
}

html,
body {
    min-height: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: rgb(0, 0, 0);
    color: black;
    font-family: Arial, sans-serif;
    z-index: 2;
    background-image: url('https://r2.jeshi.link/contentsbgspacenew.gif');
    background-attachment: fixed;
    /* filter: blur(8px);
    -webkit-filter: blur(8px); */
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    text-align: center;
    padding: 0 8px;
}

.welcome-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border: 1px solid black;
    margin-bottom: 10px;
    border-color: white;
    flex-shrink: 0;
}

.welcome-box h1 {
    font-size: clamp(1.25rem, 4vw, 2rem);
    margin: 0.25em 0;
}

.welcome-box p {
    margin: 0.25em 0;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.welcome-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-badge {
    margin-top: 8px;
    height: 20px;
    width: auto;
}

.welcome-text a:has(.welcome-badge) {
    text-decoration: none;
    display: inline-block;
}

.welcome-status-link {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.welcome-status-link:hover {
    text-decoration: underline;
}

.back-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    color: rgb(255, 255, 255);
    text-decoration: none;
    border: 1px solid white;
    border-radius: 4px;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.logo {
    width: clamp(90px, 18vw, 220px);
    height: auto;
    margin: 0 clamp(8px, 2vw, 20px);
    flex-shrink: 0;
}

.konata {
    width: auto;
    height: clamp(40px, 10vw, 80px);
    flex-shrink: 0;
}

.button {
    padding: clamp(3px, 1vw, 5px);
    max-width: 100%;
    height: auto;
}

.announcement-and-server-box {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    flex: 1;
    padding: 10px;
    min-height: 0;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 45%;
    min-width: 0;
    min-height: 100%;
}

.left-column .about-me,
.left-column .announcement-box,
.left-column .links-tools-box {
    border: 1px solid black;
    border-color: white;
    padding: 10px;
    box-sizing: border-box;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 45%;
    min-width: 0;
    min-height: 100%;
}

.right-column .announcement-box,
.right-column .server-list {
    border: 1px solid black;
    border-color: white;
    padding: 10px;
    box-sizing: border-box;
}

.links-tools-box {
    min-height: 0;
    flex: 1 1 0;
    max-height: 220px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.links-tools-box p {
    text-align: left;
    margin: 0.5em 0;
}

.server-list {
    padding: 10px;
    min-width: 0;
    flex: 1 1 0;
    max-height: 220px;
    min-height: 0;
    overflow-y: auto;
}

.about-me {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.about-me p {
    text-align: left;
    margin: 0.5em 0;
}

.announcement-box {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.announcement-box .logo {
    align-self: center;
}

ul.a {
    text-align: left;
    list-style-type: circle;
  }

.announcement-box p {
    text-align: left;
    width: 50%;
    margin: 0.25em 0;
}

.announcement-box ul {
    margin: 0.25em 0 0.5em 0;
    padding-left: 1.2em;
}

.server-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.server-list table {
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
}

.server-list th,
.server-list td {
    border: 1px solid black;
    padding: 5px;
    border-color: white;
}

.footer-container {
    display: flex;
    flex-direction: column;
    /* height: 100%; */
    text-align: center;
    align-items: center;
    /* flex: 1; */
    /* gap: 10px; */
    position: relative;
}

.footer-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border: 1px solid black;
    /* margin-bottom: 10px; */
    border-color: white;
    /* height: 30%; */
    /* width: 30%; */
    /* flex: 1; */
}

.server-loading {
    color: rgba(255, 255, 255, 0.7);
}

.server-offline {
    color: rgba(255, 150, 150, 0.9);
}

.server-connect-btn {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    color: rgb(255, 255, 255);
    border: 1px solid white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}

.server-connect-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Miku page: embed grid */
.miku-content {
    flex: 1;
    padding: 10px;
    min-height: 0;
}

.miku-embeds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.embed-card {
    border: 1px solid white;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 0;
    text-align: left;
}

.embed-card h3 {
    margin: 0 0 2px 0;
    font-size: 1rem;
}

.embed-artist {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.home-link {
    color: inherit;
    text-decoration: none;
}

.home-link:hover {
    text-decoration: underline;
}

.user-count-box {
    position: fixed;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-count-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53935;
    flex-shrink: 0;
    animation: user-count-live-pulse 1.5s ease-in-out infinite;
}

@keyframes user-count-live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.5); }
    50% { opacity: 0.9; }
    70% { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0); }
}

.user-count-num {
    font-weight: 600;
}

@media (max-width: 900px) {
    .announcement-and-server-box {
        flex-direction: column;
        align-items: center;
    }

    .left-column,
    .right-column {
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 6px;
    }

    .welcome-box {
        flex-direction: column;
        padding: 8px;
    }

    .welcome-box .logo {
        margin: 4px 0;
    }

    .announcement-and-server-box {
        padding: 6px;
    }

    .left-column .about-me,
    .left-column .announcement-box,
    .left-column .links-tools-box,
    .right-column .announcement-box,
    .right-column .server-list {
        padding: 8px;
        max-width: 100%;
    }

    .announcement-box p {
        width: 100%;
    }

    .server-list th,
    .server-list td {
        padding: 4px 6px;
        font-size: 0.9em;
    }

    .server-connect-btn {
        padding: 4px 10px;
        font-size: 0.85em;
    }

    .footer-box {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
        justify-content: center;
    }

    .footer-box .konata {
        height: 50px;
    }

    .footer-box .button {
        max-height: 31px;
        width: auto;
    }

    .miku-embeds {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .miku-content {
        padding: 6px;
    }
}
