/* Responsive additions: desktop design stays almost the same, mobile gets hamburger nav. */
* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-size: 16px;
    line-height: 1.7;
}

a {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.18);
}

body.nav-open {
    overflow: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

#global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(30, 215, 96, 0.50);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 5px 12px rgba(8, 8, 8, 0.2);
    z-index: 9999;
}

#global-nav .inner {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.nav-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-shrink: 0;
}

#global-nav #rogo,
#global-nav #realtime {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
}

#global-nav img,
#global-nav img:hover {
    width: 100px !important;
    height: 40px !important;
    max-width: 100px !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 2px;
    transform: none !important;
    transition: none !important;
}

.hamburger {
    display: none;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    font: inherit;
}

.nav-backdrop {
    display: none;
}

#global-nav .global-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

#global-nav .global-list li {
    margin: 0 0 0 22px;
}

#global-nav .global-list a {
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
}

.container {
    width: 100%;
}

@media screen and (max-width: 1100px) {
    #global-nav .inner {
        max-width: 100%;
        gap: 14px;
    }

    #global-nav .global-list li {
        margin-left: 18px;
    }

    #global-nav .global-list a,
    #global-nav #realtime {
        font-size: 14px;
    }
}

@media screen and (max-width: 900px) {
    body {
        padding-top: 64px;
    }

    #global-nav {
        background: rgba(30, 215, 96, 0.48);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    #global-nav .inner {
        display: block;
        padding: 8px 12px;
        position: relative;
        z-index: 10002;
    }

    .nav-head {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    #global-nav #realtime {
        flex: 1;
        justify-content: center;
        text-align: center;
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hamburger {
        width: 44px;
        height: 44px;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        border-radius: 14px;
        cursor: pointer;
        background: rgba(53, 54, 53, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.22);
        box-shadow: 0 5px 12px rgba(8, 8, 8, 0.22);
        flex-shrink: 0;
        transition: background-color 0.2s ease, transform 0.2s ease;
    }

    .hamburger:active {
        transform: scale(0.96);
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        border-radius: 999px;
        background-color: #ffffff;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    #global-nav.is-open .hamburger {
        background: rgba(30, 215, 96, 0.38);
    }

    #global-nav.is-open .hamburger span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    #global-nav.is-open .hamburger span:nth-child(2) {
        opacity: 0;
    }

    #global-nav.is-open .hamburger span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(20, 22, 22, 0.34);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
        z-index: 10000;
    }

    #global-nav.is-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    #global-nav .global-list {
        display: flex !important;
        position: fixed;
        top: 66px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 86px);
        max-height: calc(100dvh - 86px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        margin: 0 !important;
        padding: 8px;
        list-style: none;
        border-radius: 22px;
        background: linear-gradient(135deg, rgba(30, 215, 96, 0.42), rgba(53, 54, 53, 0.78));
        border: 1px solid rgba(255, 255, 255, 0.20);
        box-shadow: 0 18px 35px rgba(8, 8, 8, 0.34);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-12px) scale(0.98);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
        z-index: 10003;
    }

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

    #global-nav .global-list li {
        margin: 0 !important;
    }

    #global-nav .global-list a {
        display: block;
        width: 100%;
        padding: 14px 16px;
        margin: 0;
        color: #ffffff;
        border-radius: 14px !important;
        border: 1px solid transparent;
        transform: none !important;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    }

    #global-nav .global-list a:hover,
    #global-nav .global-list a:focus-visible {
        background-color: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.16);
        color: #00eeff;
        box-shadow: none !important;
        transform: none !important;
        outline: none;
    }

    .container {
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    h1,
    h2,
    h3,
    p,
    .zvz,
    .sofu,
    .madashi,
    .mi {
        overflow-wrap: anywhere;
    }

    img:not(#global-nav img) {
        height: auto;
    }

    table {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media screen and (max-width: 600px) {
    h1 {
        height: auto;
    }

    h2,
    .zvz,
    .sofu,
    .madashi {
        font-size: clamp(26px, 8vw, 40px) !important;
    }

    h3,
    p,
    .naiyou,
    .sohu,
    .mi2 {
        font-size: clamp(16px, 4.5vw, 22px) !important;
    }

    .midashi,
    .sns {
        margin-top: 32px !important;
        font-size: clamp(18px, 5vw, 28px) !important;
        padding: 12px !important;
    }

    .snsz {
        width: 100% !important;
        height: auto !important;
        padding: 14px !important;
    }

    .snsz img.youtube-icon,
    .snsz img {
        position: static !important;
        width: 100% !important;
        max-width: 240px !important;
        height: auto !important;
        margin: 0 auto 12px !important;
    }

    .dentaku,
    table {
        transform: none !important;
    }

    input {
        max-width: 100%;
    }
}

/* Unified responsive typography / sizing */
@media screen and (max-width: 900px) {
    #global-nav .global-list a {
        font-size: 15px;
        line-height: 1.45;
        font-weight: 600;
    }

    #global-nav #realtime {
        font-size: 12px;
    }

    .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}

@media screen and (max-width: 600px) {
    body {
        font-size: 15.5px;
        line-height: 1.75;
    }

    h1,
    h2,
    .title,
    .zvz,
    .sofu,
    .madashi {
        font-size: clamp(24px, 6.6vw, 34px) !important;
        line-height: 1.35 !important;
        letter-spacing: 0.02em;
    }

    h3,
    .snsz h3 {
        font-size: clamp(21px, 5.8vw, 28px) !important;
        line-height: 1.4 !important;
    }

    h4,
    .snsz h4 {
        font-size: clamp(18px, 5vw, 23px) !important;
        line-height: 1.45 !important;
    }

    p,
    li,
    .naiyou,
    .sohu,
    .mi2,
    .snsz p {
        font-size: clamp(15px, 3.9vw, 18px) !important;
        line-height: 1.75 !important;
    }

    .mi {
        font-size: clamp(18px, 5vw, 24px) !important;
        line-height: 1.6 !important;
    }

    .midashi,
    .sns {
        margin-top: 28px !important;
        padding: 14px !important;
        border-width: 6px !important;
        border-top-width: 6px !important;
        border-radius: 18px !important;
    }

    .zvz,
    .sofu,
    .madashi {
        margin-top: 88px !important;
    }

    input,
    button,
    textarea,
    select {
        font-size: 16px;
    }
}

@media screen and (max-width: 420px) {
    #global-nav .inner {
        padding-left: 10px;
        padding-right: 10px;
    }

    #global-nav img,
    #global-nav img:hover {
        width: 86px !important;
        height: 34px !important;
        max-width: 86px !important;
    }

    .hamburger {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    #global-nav .global-list {
        left: 10px;
        right: 10px;
        top: 62px;
        padding: 8px;
    }

    #global-nav .global-list a {
        padding: 13px 14px;
    }
}
