@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@media (min-width: 500px) {
    html {
        background: #e5e7eb;
        display: flex;
        justify-content: center;
        min-height: 100%;
    }

    body {
        width: 500px;
        min-width: 500px;
        max-width: 500px;
        min-height: 100%;
        position: relative;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    }

    header {
        width: 500px;
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }

    nav {
        width: 500px;
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #111113;
    color: #e8e8ec;
    height: 100dvh;
    overflow-y: auto;
}

body:has(.popup-overlay.show) {
    overflow-y: hidden;
}

/* ─── header ─── */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    background: linear-gradient(
        135deg,
        rgba(58, 36, 22, 0.98) 0%,
        rgba(44, 26, 16, 0.99) 50%,
        rgba(34, 20, 12, 0.99) 100%
    );
    backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(150, 110, 70, 0.22);
    box-shadow: 0 2px 16px rgba(30, 15, 8, 0.5);
}

.header-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.header-back svg {
    width: 20px;
    height: 20px;
    color: rgba(230, 200, 160, 0.8);
}

.header-logo {
    display: flex;
    align-items: center;
    position: relative;
    gap: 8px;
}

.header-logo-text {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-info {
    flex: 1;
    min-width: 0;
}

.header-room-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-room-members {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

.header-login {
    font-size: 13px;
    font-weight: 600;
    color: #1a1208;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(
        135deg,
        rgba(210, 170, 120, 0.85) 0%,
        rgba(180, 140, 90, 0.85) 100%
    );
    font-family: inherit;
    transition: all 0.2s;
    display: block;
    box-shadow: 0 2px 8px rgba(180, 140, 90, 0.25);
}

.header-login:active {
    opacity: 0.85;
    transform: scale(0.96);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.header-nickname {
    font-size: 13px;
    font-weight: 600;
    color: rgba(210, 170, 120, 0.8);
    margin-left: 6px;
}

.header-my {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(210, 170, 120, 0.12);
    border: 1px solid rgba(210, 170, 120, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-my svg {
    width: 18px;
    height: 18px;
    color: rgba(210, 170, 120, 0.8);
}

.header-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.header-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.header-action svg {
    width: 18px;
    height: 18px;
    color: rgba(230, 200, 160, 0.8);
}

.header-share {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.header-share svg {
    width: 18px;
    height: 18px;
    color: rgba(230, 200, 160, 0.8);
}

.header-timer {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 200, 160, 0.7);
    flex-shrink: 0;
    min-width: 38px;
    text-align: center;
    transition: color 0.3s;
}

.header-timer.warn {
    color: rgba(255, 100, 100, 0.9);
    animation: timerBlink 1s ease-in-out infinite;
}

@keyframes timerBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.header-exit {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: rgba(255, 80, 80, 0.12);
    color: rgba(255, 120, 120, 0.8);
    border: 1px solid rgba(255, 80, 80, 0.2);
    flex-shrink: 0;
    transition: all 0.2s;
}

.header-exit:active {
    background: rgba(255, 80, 80, 0.25);
}

/* ─── main ─── */
main {
    flex: 1;
    overflow-y: auto;
    padding-top: 56px;
    background: #111113;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ─── navigation ─── */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 76px;
    background: linear-gradient(
        135deg,
        rgba(58, 36, 22, 0.99) 0%,
        rgba(44, 26, 16, 0.99) 50%,
        rgba(34, 20, 12, 0.99) 100%
    );
    backdrop-filter: blur(24px);
    border-top: 1px solid rgba(150, 110, 70, 0.22);
    box-shadow: 0 -2px 16px rgba(30, 15, 8, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0 4px 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 1.0s cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 10px 14px 14px;
    font-size: 10px;
    color: rgba(200, 170, 130, 0.35);
    transition: color 0.2s;
    flex: 1;
}

.nav-item.active {
    color: rgba(230, 200, 160, 0.95);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: pointer;
    padding: 0 14px 14px;
}

.nav-center-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(
            135deg,
            #3a2010,
            #2a1808,
            #1e1008
    );
    border: 3px solid rgba(150, 110, 70, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -30px;
    box-shadow:
        0 4px 24px rgba(50, 25, 15, 0.6),
        inset 0 1px 0 rgba(210, 170, 120, 0.15);
    transition: transform 0.2s;
}

.nav-center.active .nav-center-circle {
    background: linear-gradient(
        135deg,
        #5c3828 0%,
        #452a1c 50%,
        #362014 100%
    );
    border: 3px solid rgba(150, 110, 70, 0.6);
}

.nav-center-circle:active {
    transform: scale(0.93);
}

.nav-center-circle svg {
    width: 28px;
    height: 28px;
    color: rgba(200, 170, 130, 0.35);
}

.nav-center.active .nav-center-circle svg {
    color: rgba(230, 200, 160, 0.95);
}

.nav-center-label {
    font-size: 10px;
    color: rgba(200, 170, 130, 0.35);
    margin-top: 4px;
}

.nav-center.active .nav-center-label {
    color: rgba(230, 200, 160, 0.95);
}

nav.hidden {
    transform: translateY(100%);
}

/* ─── footer ─── */
footer {
    margin-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo-text {
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    font-style: italic;
    letter-spacing: -1px;
}

.footer-version {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
}

.footer-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    line-height: 1.7;
}

.footer-copy {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.15);
}

/* ─── common ─── */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}