/* fonts */
@import url('https://fonts.googleapis.com/css2?family=WDXL+Lubrifont+JP+N&display=swap');

:root {
    --brue: #6fb8c1;
    --blue-shadow: #4f8792;
    --pink: #e099ae;
    --pink-soft: #f7e3e9;
    --pink-shadow: #c57f94;
    --surface: #fff;
    --text: #1f1f1f;
    --overlay-light: #00000033;
    --overlay-medium: #00000055;
    --overlay-strong: #000000aa;
    --focus: #ffbf47;
}

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

* {
    font-family: "WDXL Lubrifont JP N", sans-serif;
    font-weight: 400;
    font-style: normal;
}

/* グローバル */
html,
body {
    margin: 0;
    scroll-behavior: smooth;
}

body {
    background-image: url(../assets/server_icon.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

button,
a,
input,
textarea {
    font: inherit;
}

button,
a {
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    transform: translateY(calc(-100% - 2rem));
    background: var(--surface);
    color: #000;
    padding: 0.75em 1em;
    border: 4px solid var(--pink);
    box-shadow: var(--pink-shadow) 5px 5px 0 0;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.skip-link:focus-visible {
    transform: translateY(0);
}


.site-header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 1500;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    pointer-events: none;
}

.site-logo,
.menu-toggle,
.global-nav {
    pointer-events: auto;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0.45em 0.9em;
    background: var(--surface);
    color: #000;
    border: 4px solid var(--pink);
    box-shadow: var(--pink-shadow) 5px 5px 0 0;
    text-decoration: none;
    font-size: clamp(1rem, 3vw, 1.25rem);
}

.menu-toggle {
    position: relative;
    z-index: 1600;
    display: grid;
    grid-template-columns: 28px auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 54px;
    padding: 0.55em 0.9em;
    background: var(--brue);
    color: #fff;
    border: 4px solid var(--brue);
    box-shadow: var(--blue-shadow) 5px 5px 0 0;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
    background: var(--surface);
    color: #000;
    box-shadow: var(--brue) 5px 5px 0 0;
}

.menu-toggle:active {
    transform: translate(2px, 2px);
    box-shadow: var(--blue-shadow) 3px 3px 0 0;
}

.menu-toggle__line {
    grid-column: 1 / 2;
    display: block;
    width: 28px;
    height: 4px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle__line:nth-child(1) {
    grid-row: 1 / 2;
}

.menu-toggle__line:nth-child(2) {
    grid-row: 1 / 2;
    transform: translateY(8px);
}

.menu-toggle__line:nth-child(3) {
    grid-row: 1 / 2;
    transform: translateY(-8px);
}

.menu-toggle__text {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) {
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(3) {
    transform: rotate(-45deg);
}

.global-nav {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(88vw, 340px);
    padding: 1rem;
    background: #ffffffee;
    border: 5px solid var(--pink);
    box-shadow: var(--pink-shadow) 7px 7px 0 0;
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.98);
    transform-origin: top right;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.global-nav.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.global-nav ul {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.global-nav a {
    display: block;
    padding: 0.75em 1em;
    background: var(--pink-soft);
    color: #000;
    border: 3px solid transparent;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.global-nav a:hover {
    background: var(--surface);
    border-color: var(--pink);
    transform: translateX(0.2rem);
}

body.menu-open {
    overflow: hidden;
}

/* 参加ボタン共通デザイン */
.join_button {
    background-color: var(--brue);
    padding: 1em 2em;
    display: block;
    width: fit-content;
    max-width: min(92vw, 520px);
    margin: 10px auto;
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: #fff;
    border: var(--brue) 5px solid;
    box-shadow: var(--blue-shadow) 7px 7px 0 0;
    transition: background-color 0.1s, color 0.1s, box-shadow 0.1s, transform 0.1s;
    z-index: 1000;
    text-align: center;
}

.join_button:hover {
    background-color: #fff;
    box-shadow: var(--brue) 7px 7px 0 0;
    color: #000;
}

.join_button:active {
    transform: translate(3px, 3px);
    box-shadow: var(--blue-shadow) 4px 4px 0 0;
}

.join_button.clicked {
    background-color: var(--pink-soft);
}

/* セクションタイトル系共通表示 */
h2 {
    font-size: clamp(1.6rem, 6vw, 2rem);
    display: block;
    width: fit-content;
    max-width: calc(100vw - 2rem);
    margin: 0 auto;
    text-align: center;
    background-color: #e6dade;
    padding: 0.5em 1em;
    border: var(--pink) solid 5px;
    box-shadow: var(--pink-shadow) 7px 7px 0 0;
    word-break: keep-all;
}

/* トップの要素 */
#top {
    background-color: var(--overlay-strong);
    min-height: 90svh;
    margin: 0;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

#top div {
    height: fit-content;
    width: min(90vw, 900px);
    margin: auto;
    text-align: center;
}

#top h1 {
    color: #fff;
    font-size: clamp(3rem, 12vw, 5rem);
    margin: 0;
    word-break: keep-all;
    line-height: 1.15;
}

#top p {
    color: #f2f2f2;
    font-size: clamp(1.15rem, 4vw, 1.5rem);
}

#top a {
    text-align: center;
    display: inline-flex;
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
    border-radius: 999px;
}

#top img {
    width: 80px;
    margin: 0 auto 20px auto;
    animation: float 1.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* おすすめポイント類 */
#features,
#news,
#server-info,
#events,
#rules,
#admin,
#sns {
    background-color: var(--overlay-light);
}

#features,
#bots,
#rules,
#admin,
#sns,
#contact {
    padding: 5vh 0;
}

#features ul {
    width: min(90vw, 500px);
    margin: 0 auto;
    padding: 0;
    counter-reset: feature-counter;
}

#features li {
    counter-increment: feature-counter;
    min-height: 20em;
    list-style-type: none;
    background-color: var(--surface);
    margin: 5vh 0;
    padding: 1em 2em;
    text-align: center;
    border: var(--brue) 5px solid;
    box-shadow: var(--blue-shadow) 7px 7px 0 0;
}

#features li::before {
    content: counter(feature-counter);
    font-size: 2em;
    color: #05687f;
}

#features li h3 {
    font-size: clamp(1.5rem, 5vw, 1.9rem);
}

#features li img {
    width: 100%;
    margin: 0 0 2em 0;
}

#features p {
    font-size: 1.2em;
}

#features strong,
#rules h3 {
    color: #035d73;
}

#news,
#server-info,
#events {
    padding: 0 0 5vh 0;
}

#news_box,
#api-data-area,
#events-api,
#rules ul,
#contact form {
    width: min(90vw, 600px);
    background-color: var(--surface);
    margin: 5vh auto;
    padding: 1em;
    border: var(--brue) 5px solid;
    box-shadow: var(--blue-shadow) 7px 7px 0 0;
}

#news_box {
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    text-align: left;
}

#news_box > .loading-message,
#events-api > .loading-message,
#api-data-area,
#events-api {
    text-align: center;
}

.news-toggle {
    display: block;
    width: 100%;
    margin: 0.5em 0;
    padding: 0.75em 1em;
    background: var(--pink-soft);
    color: #000;
    border: 4px solid var(--pink);
    box-shadow: var(--pink-shadow) 4px 4px 0 0;
    text-align: left;
}

.news-toggle[aria-expanded="true"] {
    background: #fff;
}

.news-body {
    padding: 0.5em 0.75em;
}

.news-body[hidden] {
    display: none;
}

#server-info div span,
#events div span {
    font-size: 2em;
    color: #4f8792;
}

.event {
    border-top: 2px solid #d8edf0;
    padding-top: 1em;
    margin-top: 1em;
}

#bots {
    background-color: var(--overlay-medium);
}

#bots p {
    text-align: center;
    color: #fff;
    font-size: 1.5em;
}

#bots ul {
    padding: 0 0.5rem 0.75rem 0;
    margin: 0 5vw;
    list-style: none;
    display: grid;
    gap: 1em;
    overflow-x: auto;
    scrollbar-width: thin;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
}

#bots li {
    display: block;
    width: min(400px, 80vw);
    background-color: var(--surface);
    padding: 1em 2em;
    border: var(--brue) 5px solid;
    box-shadow: var(--blue-shadow) 7px 7px 0 0;
}

#bots li h3 {
    font-size: 1.5em;
}

#bots li p {
    color: #000;
    font-size: 1em;
    text-align: left;
}

#bots li a {
    display: block;
    padding: 1em;
    margin: 1em 0;
    background-color: var(--brue);
    color: #fff;
    text-decoration: none;
    border: var(--brue) 5px solid;
    box-shadow: var(--blue-shadow) 7px 7px 0 0;
}

#bots li a:hover {
    background-color: #fff;
    color: #000;
}

.bots_sakurabot {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
}

#bots_others {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
}

.bot-card-header {
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: center;
    gap: 1em;
}

.bot-card-header img {
    width: 50px;
    border: solid var(--pink) 4px;
}

.bot-card-header h3 {
    margin: 0;
}

.section-lead {
    width: min(90vw, 600px);
    margin: 2rem auto 0;
    padding: 1em 1.25em;
    background: var(--surface);
    border: var(--pink) solid 5px;
    box-shadow: var(--pink-shadow) 7px 7px 0 0;
}

#rules ul {
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
}

#rules strong {
    font-size: 1.1em;
}

#admin ul {
    list-style: none;
    margin: 1em 2em;
    padding: 0 0.5rem 0.75rem 0;
    display: flex;
    gap: 2em;
    overflow-x: auto;
    scrollbar-width: thin;
}

#admin li {
    background-color: var(--surface);
    padding: 1em 2em;
    border: var(--brue) 5px solid;
    box-shadow: var(--blue-shadow) 7px 7px 0 0;
    width: calc(100px + 12em);
    min-width: calc(100px + 12em);
}

#admin ul li div {
    display: grid;
    grid-template-columns: 130px 1fr;
}

#admin img {
    height: 100px;
    width: 100px;
    object-fit: cover;
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    border: var(--pink) 5px solid;
    box-shadow: var(--pink-shadow) 5px 5px 0 0;
}

#admin div.admin_tags {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
}

#admin small {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    background-color: var(--pink-soft);
    padding: 0.35em 0.75em;
    margin: 1.5em 0.5em 0 0;
}

#admin h3 {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    font-size: 1.5em;
    margin: 0.5em 0;
}

#sns ul {
    padding: 0;
    margin: 1em 2em;
    list-style: none;
    max-height: 1000px;
}

#sns li.sns_x {
    width: min(90vw, 700px);
    height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    margin: 0 auto;
}

#contact form {
    margin: 2em auto;
    padding: 1em 2em;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#contact label {
    font-size: 1.1em;
}

#contact input,
#contact textarea {
    border: var(--pink) 5px solid;
    box-shadow: var(--pink-shadow) 5px 5px 0 0;
    width: 100%;
    margin: 0 0 1em 0;
    padding: 1em;
    background: #fff;
    color: #000;
}

#contact textarea {
    min-height: 10rem;
    resize: vertical;
}

#contact button {
    background-color: var(--pink);
    color: #fff;
    border: var(--pink) 5px solid;
    box-shadow: var(--pink-shadow) 5px 5px 0 0;
    padding: 1em 2em;
    min-height: 48px;
}

#contact button:hover {
    background: #fff;
    color: #000;
}

footer {
    background: #ffffffdd;
    padding: 1.5rem 1rem;
}

footer p {
    text-align: center;
    margin: 0.35em 0;
}

@media (max-width: 640px) {
    .site-header {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }

    .site-logo {
        max-width: calc(100vw - 10rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .menu-toggle__text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .menu-toggle {
        grid-template-columns: 28px;
        padding: 0.55em 0.7em;
    }

    .global-nav {
        width: min(92vw, 360px);
        max-height: calc(100svh - 6.5rem);
        overflow-y: auto;
    }

    body {
        background-attachment: scroll;
    }

    #features li,
    #bots li,
    #admin li,
    #contact form {
        padding: 1em;
    }

    #admin li {
        width: min(82vw, 320px);
        min-width: min(82vw, 320px);
    }

    #admin ul li div {
        grid-template-columns: 100px 1fr;
        gap: 0.5rem;
    }

    #admin img {
        width: 82px;
        height: 82px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html,
    body {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
