@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;600;700;800;900&display=swap');

:root {
    --bg: #f7f8f4;
    --surface: #ffffff;
    --surface-soft: #fff6ee;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e0d8;
    --primary: #ff6b57;
    --primary-dark: #e14f3d;
    --mint: #2ec4b6;
    --mint-soft: #dff7f3;
    --yellow: #ffd166;
    --shadow: 0 18px 45px rgba(59, 45, 32, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Pretendard', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

.app-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px clamp(16px, 3vw, 36px);
    border-bottom: 1px solid var(--line);
    background: rgba(247, 248, 244, 0.92);
    backdrop-filter: blur(16px);
    z-index: 50;
}

.brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff8f68 48%, var(--mint) 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(255, 107, 87, 0.28);
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(46, 196, 182, .26);
    border-radius: 17px;
    pointer-events: none;
}

.brand-copy {
    min-width: 0;
}

.brand-copy h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.035em;
}

.brand-copy p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.header-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-link {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid rgba(46, 196, 182, .3);
    border-radius: 999px;
    background: var(--mint-soft);
    color: #14665d;
    font-size: .76rem;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.admin-link:hover {
    transform: translateY(-1px);
    border-color: rgba(46, 196, 182, .6);
    box-shadow: 0 8px 18px rgba(46, 196, 182, .16);
}

.time-pill,
.live-pill {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.live-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(255, 107, 87, 0.14);
}

.app-footer {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.login-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: clamp(22px, 4vw, 46px);
    background:
            linear-gradient(135deg, rgba(255, 246, 238, 0.86), rgba(223, 247, 243, 0.72)),
            var(--bg);
}

.login-panel {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.login-copy {
    min-width: 0;
    padding: clamp(28px, 5vw, 56px);
    background: #fffaf4;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--mint-soft);
    color: #14665d;
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.login-copy h1 {
    margin: 18px 0 12px;
    color: var(--text);
    font-size: clamp(2rem, 5vw, 3.7rem);
    font-weight: 900;
    line-height: .98;
}

.login-copy p {
    max-width: 420px;
    margin: 0;
    color: var(--muted);
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.65;
}

.login-signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 34px;
}

.login-signal-grid div {
    min-width: 0;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
}

.login-signal-grid i {
    color: var(--primary);
}

.login-signal-grid span {
    overflow-wrap: anywhere;
    color: #3c4a47;
    font-size: .74rem;
    font-weight: 900;
}

.login-form {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 16px;
    padding: clamp(24px, 4vw, 42px);
}

.login-form-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}

.login-lock {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    color: #ffffff;
}

.login-form-head strong,
.login-form-head span {
    display: block;
}

.login-form-head strong {
    font-size: 1rem;
    font-weight: 900;
}

.login-form-head span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 900;
}

.login-alert.error {
    background: #fff0ed;
    color: #b2382b;
}

.login-alert.success {
    background: var(--mint-soft);
    color: #14665d;
}

.login-field {
    display: grid;
    gap: 7px;
}

.login-field span {
    color: #3c4a47;
    font-size: .75rem;
    font-weight: 900;
}

.login-field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcf9;
    color: var(--text);
    font-size: .92rem;
    font-weight: 800;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-field input:focus {
    border-color: var(--mint);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(46, 196, 182, .14);
}

.login-submit {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    font-size: .92rem;
    font-weight: 900;
    box-shadow: 0 14px 26px rgba(255, 107, 87, .22);
}

.login-submit:hover {
    background: var(--primary-dark);
}

.bubble-stage {
    position: relative;
    height: clamp(190px, 26vh, 260px);
    flex-shrink: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(46, 196, 182, 0.18), rgba(255, 209, 102, 0.24)),
        var(--surface-soft);
}

.stage-copy {
    position: absolute;
    top: 22px;
    left: clamp(18px, 4vw, 44px);
    z-index: 2;
    max-width: min(460px, calc(100% - 36px));
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.stage-copy h2 {
    margin: 8px 0 0;
    font-size: clamp(1.45rem, 3vw, 2.4rem);
    line-height: 1.12;
    font-weight: 900;
    color: var(--text);
}

.stage-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.stage-feature-list span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 999px;
    background: rgba(255, 255, 255, .64);
    color: #3e625d;
    font-size: .67rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(72, 94, 88, .08);
}

.stage-feature-list i {
    color: var(--primary);
}

.bullet-layer {
    position: absolute;
    inset: 0;
}

.chat-input-wrap {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 30;
    width: min(620px, calc(100% - 28px));
    transform: translateX(-50%);
}

.chat-form {
    position: relative;
}

.chat-form input,
.add-menu-form input {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.chat-form input {
    height: 50px;
    padding: 0 58px 0 20px;
    border-radius: 999px;
    box-shadow: var(--shadow);
}

.chat-form input:focus,
.add-menu-form input:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.16);
}

.chat-form button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
}

.stage-resizer {
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #efece5;
    cursor: row-resize;
    flex-shrink: 0;
}

.stage-resizer div {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d3ccc0;
}

.app-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
    gap: 22px;
    overflow-y: auto;
    padding: 24px clamp(16px, 3vw, 36px) 34px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-card,
.note-panel,
.content-panel,
.state-panel,
.vote-panel,
.result-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.info-card {
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.info-card span,
.note-panel h3 {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.info-card strong {
    display: block;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.2;
}

.time-card strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.45rem;
}

.info-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 8px;
}

.info-icon.coral {
    background: rgba(255, 107, 87, 0.14);
    color: var(--primary-dark);
}

.info-icon.yellow {
    background: rgba(255, 209, 102, 0.28);
    color: #b47b00;
}

.note-panel {
    padding: 18px;
    background: #fffaf2;
}

.note-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 700;
}

.content-panel {
    min-width: 0;
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-head.centered {
    display: block;
    text-align: center;
}

.panel-head h2,
.state-panel h2 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.15;
    font-weight: 900;
}

.board-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--mint-soft);
    color: #137f75;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.add-menu-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 18px;
}

.add-menu-form input {
    height: 46px;
    padding: 0 15px;
    border-radius: 8px;
}

.add-menu-form button,
.show-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    transition: transform 0.16s ease, background 0.16s ease;
}

.add-menu-form button {
    padding: 0 18px;
}

.add-menu-form button:hover,
.show-more-btn:hover {
    background: var(--primary-dark);
}

.add-menu-form button:active,
.show-more-btn:active,
.battle-card:active {
    transform: scale(0.98);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.battle-card {
    position: relative;
    width: 100%;
    min-height: 146px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.battle-card:hover {
    transform: translateY(-2px);
    border-color: rgba(46, 196, 182, 0.55);
    box-shadow: 0 16px 32px rgba(46, 196, 182, 0.13);
}

.battle-card.rank-1 {
    border-color: rgba(255, 209, 102, 0.9);
    background: linear-gradient(180deg, #fff9e7 0%, #ffffff 78%);
}

.menu-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-width: 42px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--mint-soft);
    color: #137f75;
    font-size: 0.72rem;
    font-weight: 900;
}

.menu-title {
    margin: 14px 0 18px;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.35;
    font-weight: 900;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.menu-score {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.menu-score strong {
    color: var(--primary-dark);
    font-size: 1.45rem;
    font-weight: 900;
}

.progress-container {
    height: 8px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee7dd;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--yellow));
    transition: width 0.55s ease;
}

.state-panel {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px;
    text-align: center;
}

.state-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--mint-soft);
    color: #137f75;
    font-size: 2rem;
}

.state-panel p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.podium-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 18px;
    min-height: 320px;
    padding: 16px 0 30px;
}

.podium-item {
    width: min(30%, 150px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.podium-item span {
    width: 100%;
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-item.first i {
    margin-bottom: 8px;
    color: #d99800;
    font-size: 2rem;
}

.podium-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 8px 0 0;
    color: #3d2b12;
    font-size: 2rem;
    font-weight: 900;
}

.podium-1 {
    height: 220px;
    background: var(--yellow);
}

.podium-2 {
    height: 160px;
    background: #dfe6ea;
}

.podium-3 {
    height: 118px;
    background: #f2b980;
}

.ranking-list {
    margin-top: 12px;
}

.ranking-list h4 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ranking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf4;
    color: var(--text);
    font-weight: 800;
}

.ranking-row + .ranking-row {
    margin-top: 8px;
}

.show-more-btn {
    margin: 18px auto 0;
    padding: 0 18px;
}

.bullet-msg {
    position: absolute;
    max-width: min(420px, 82vw);
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-shadow: 0 14px 30px rgba(77, 63, 44, 0.13);
    backdrop-filter: blur(10px);
    will-change: transform, opacity;
}

@keyframes popAndStay {
    0% {
        transform: scale(0.72) translateY(18px);
        opacity: 0;
    }
    10% {
        transform: scale(1.04) translateY(0);
        opacity: 1;
    }
    18%,
    84% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.86) translateY(-18px);
        opacity: 0;
    }
}

.custom-scroll::-webkit-scrollbar {
    width: 8px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #d7d0c4;
    border-radius: 999px;
}

.resizing {
    cursor: row-resize;
    user-select: none;
}

.hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .app-main {
        grid-template-columns: 1fr;
    }

    .side-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-panel {
        grid-column: 1 / -1;
    }

    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .app-header {
        min-height: 66px;
        padding: 12px 14px;
    }

    .brand-copy p,
    .time-pill {
        display: none;
    }

    .admin-link {
        width: 34px;
        justify-content: center;
        padding: 0;
    }

    .admin-link span {
        display: none;
    }

    .bubble-stage {
        height: 230px;
    }

    .stage-copy h2 {
        font-size: 1.55rem;
    }

    .stage-feature-list span {
        padding: 5px 8px;
        font-size: .62rem;
    }

    .app-main {
        padding: 16px 12px 26px;
    }

    .side-panel,
    .menu-grid {
        grid-template-columns: 1fr;
    }

    .content-panel {
        padding: 14px;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .add-menu-form {
        grid-template-columns: 1fr;
    }

    .podium-wrap {
        gap: 8px;
    }

    .bullet-msg {
        font-size: 0.78rem;
    }
}

::selection {
    background: rgba(255, 107, 87, .22);
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(46, 196, 182, .32);
    outline-offset: 3px;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: .58;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Chat room experience */
.chat-context {
    width: fit-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 8px;
    padding: 7px 12px;
    border: 1px solid rgba(46, 196, 182, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #176d66;
    font-size: 0.76rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(46, 196, 182, 0.12);
}

.context-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.14);
}

.app-main {
    grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
    align-items: start;
}

.room-hub {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.room-hub-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    background: linear-gradient(135deg, #fff8f2, #f1fbf9);
    border-bottom: 1px solid var(--line);
}

.room-hub-head h2 {
    margin: 5px 0 7px;
    font-size: 1.35rem;
    font-weight: 900;
}

.room-hub-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
}

.room-home-btn,
.section-title-row button {
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.room-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 900;
}

.room-actions {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 14px;
    padding: 18px;
}

.room-create-form,
.room-code-form {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.room-create-form {
    box-shadow: 0 12px 26px rgba(255, 107, 87, 0.08);
}

.form-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.form-title.compact {
    margin-bottom: 20px;
}

.form-title strong,
.form-title small {
    display: block;
}

.form-title strong {
    font-size: 0.9rem;
    font-weight: 900;
}

.form-title small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.35;
}

.step-number {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.step-number.muted {
    background: #e9eeec;
    color: #50716c;
}

.field-label,
.room-options label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
}

.room-create-form > input,
.room-options input[type="number"],
.code-input-row input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfa;
    outline: none;
}

.room-create-form input:focus,
.code-input-row input:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.12);
}

.room-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 10px;
    margin: 10px 0;
}

.private-toggle {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfa;
    cursor: pointer;
}

.private-toggle input {
    margin-right: 7px;
}

.private-toggle span {
    margin: 0 !important;
    color: var(--text) !important;
}

.primary-action,
.code-input-row button {
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.primary-action {
    width: 100%;
    min-height: 44px;
}

.code-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.code-input-row input {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.code-input-row button {
    padding: 0 15px;
    background: #334b47;
}

.public-room-section {
    padding: 0 18px 18px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-title-row strong {
    font-size: 0.82rem;
    font-weight: 900;
}

.section-title-row span {
    margin-left: 7px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.section-title-row button {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.room-list {
    display: grid;
    gap: 8px;
}

.room-list-item {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.room-list-item:hover {
    transform: translateY(-1px);
    border-color: rgba(46, 196, 182, .6);
    background: #f8fffd;
}

.room-list-item.active {
    border-color: var(--mint);
    background: var(--mint-soft);
}

.room-list-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #f1f4f2;
    color: #52726d;
}

.room-list-copy strong,
.room-list-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-list-copy strong {
    font-size: .86rem;
    font-weight: 900;
}

.room-list-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
}

.room-capacity {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f4f2;
    color: #52615e;
    font-size: .68rem;
    font-weight: 900;
}

.room-empty-state {
    padding: 24px 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
}

.room-pagination {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.room-pagination button {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #f1f4f2;
    color: #52615e;
}

.room-pagination button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.room-pagination span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    text-align: center;
}

.quick-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.room-stage-copy {
    position: absolute;
    top: 24px;
    left: 50%;
    z-index: 4;
    width: min(680px, calc(100% - 36px));
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

.room-stage-copy h2 {
    margin: 9px 0 5px;
    color: #123b36;
    font-size: clamp(1.65rem, 3.4vw, 2.7rem);
    font-weight: 900;
    line-height: 1.1;
}

.room-stage-copy p {
    margin: 0;
    color: #47706a;
    font-size: .8rem;
    font-weight: 900;
}

.room-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .84);
    color: #168278;
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.room-live-badge i,
.connected-badge i {
    color: #22c55e;
    font-size: .48rem;
}

.bubble-stage.room-active {
    height: clamp(260px, 38vh, 390px);
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .72), transparent 30%),
        linear-gradient(135deg, rgba(46, 196, 182, .28), rgba(209, 250, 229, .62)),
        #e9faf6;
}

.bubble-stage.room-active .chat-input-wrap {
    bottom: 24px;
}

.bubble-stage.room-active .chat-form input {
    border-color: rgba(46, 196, 182, .45);
}

.app-main.room-mode {
    grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
}

.room-session-panel {
    overflow: hidden;
    border: 1px solid rgba(46, 196, 182, .35);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(31, 104, 94, .12);
}

.room-session-hero {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #edfcf8, #fff);
    border-bottom: 1px solid #dff3ee;
}

.room-session-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--mint);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 10px 24px rgba(46, 196, 182, .25);
}

.room-session-hero span {
    color: #65817d;
    font-size: .67rem;
    font-weight: 900;
}

.room-session-hero h2 {
    margin: 4px 0 0;
    overflow: hidden;
    color: #173f3a;
    font-size: 1.25rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-session-hero .connected-badge {
    position: absolute;
    top: 13px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: .6rem;
}

.room-session-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 18px;
}

.room-session-details > div {
    padding: 12px;
    border-radius: 12px;
    background: #f6faf9;
}

.room-session-details > div:last-child {
    grid-column: 1 / -1;
}

.room-session-details span,
.room-session-details strong {
    display: block;
}

.room-session-details span {
    color: var(--muted);
    font-size: .65rem;
    font-weight: 900;
}

.room-session-details strong {
    margin-top: 4px;
    color: #173f3a;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: .04em;
}

#btn-copy-room-code {
    align-self: stretch;
    padding: 0 12px;
    border: 1px solid #cfe8e3;
    border-radius: 12px;
    background: #fff;
    color: #27746b;
    cursor: pointer;
    font-size: .7rem;
    font-weight: 900;
}

.room-session-guide {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 18px 16px;
    padding: 12px;
    border-radius: 12px;
    background: #fff8ed;
    color: #8b6330;
}

.room-session-guide p {
    margin: 0;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.45;
}

.leave-room-btn {
    width: calc(100% - 36px);
    min-height: 43px;
    margin: 0 18px 18px;
    border: 1px solid #fecaca;
    border-radius: 11px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    font-weight: 900;
}

.room-inside-panel {
    min-height: 350px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(46, 196, 182, .25);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 40%, rgba(46, 196, 182, .1), transparent 34%),
        #fff;
    box-shadow: var(--shadow);
}

.room-inside-visual {
    max-width: 460px;
    padding: 34px;
    text-align: center;
}

.room-inside-rings {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(46, 196, 182, .34);
    border-radius: 50%;
    background: #e8faf6;
    color: #19998d;
    font-size: 2rem;
    box-shadow: 0 0 0 12px rgba(46, 196, 182, .07), 0 0 0 24px rgba(46, 196, 182, .035);
}

.room-inside-visual h2 {
    margin: 7px 0 8px;
    color: #173f3a;
    font-size: 1.65rem;
    font-weight: 900;
}

.room-inside-visual p {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.room-inside-visual button {
    min-height: 43px;
    margin-top: 22px;
    padding: 0 17px;
    border: 0;
    border-radius: 11px;
    background: var(--mint);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

/* Admin dashboard */
body:has(.admin-shell) {
    height: auto !important;
    min-height: 100vh;
    overflow: auto;
    background: #f3f5f8;
}

body:has(.admin-shell) .app-footer {
    display: none;
}

.admin-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 54px;
    color: #172033;
}

.admin-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-kicker {
    color: #6b7280;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.admin-hero h1 {
    margin: 5px 0 7px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -.04em;
}

.admin-hero p,
.admin-help,
.danger-zone p {
    margin: 0;
    color: #6b7280;
    font-size: .82rem;
    font-weight: 700;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn,
.admin-wide-btn,
.admin-icon-btn,
.admin-text-btn {
    border: 0;
    cursor: pointer;
    font-weight: 900;
}

.admin-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border-radius: 10px;
}

.admin-btn.secondary {
    border: 1px solid #dce1e8;
    background: #fff;
    color: #344054;
}

.admin-btn.danger {
    background: #202939;
    color: #fff;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.admin-stat-card,
.admin-card {
    border: 1px solid #e1e5eb;
    background: #fff;
    box-shadow: 0 10px 26px rgba(35, 45, 65, .06);
}

.admin-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 20px;
    border-radius: 16px;
}

.admin-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #64748b;
}

.admin-stat-card.accent-green::before { background: #16a34a; }
.admin-stat-card.accent-blue::before { background: #2563eb; }
.admin-stat-card.accent-orange::before { background: #ea580c; }
.admin-stat-card.accent-purple::before { background: #7c3aed; }

.admin-stat-card > span,
.status-line > span:first-child {
    color: #697386;
    font-size: .72rem;
    font-weight: 900;
}

.admin-stat-card > strong {
    display: block;
    margin: 12px 0 3px;
    font-size: 2.25rem;
    font-weight: 900;
}

.admin-stat-card small {
    color: #98a2b3;
    font-size: .7rem;
    font-weight: 700;
}

.status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    font-size: .62rem;
    font-weight: 900;
}

.status-badge.status-ok {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.status-error {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-card {
    padding: 20px;
    border-radius: 16px;
}

.admin-room-summary {
    margin-bottom: 14px;
}

.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-section-head h2 {
    margin: 3px 0 0;
    font-size: 1.1rem;
    font-weight: 900;
}

.admin-icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e1e5eb;
    border-radius: 10px;
    background: #fff;
}

.room-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.room-metric-grid > div {
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.room-metric-grid span {
    color: #697386;
    font-size: .68rem;
    font-weight: 900;
}

.room-metric-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 1.45rem;
    font-weight: 900;
}

.room-metric-grid .good strong { color: #15803d; }
.room-metric-grid .warn strong { color: #b45309; }
.room-metric-grid .bad strong { color: #b42318; }

.admin-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-main-grid .span-two {
    grid-column: 1 / -1;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.admin-table th {
    padding: 10px 9px;
    border-bottom: 1px solid #e6eaf0;
    color: #697386;
    text-align: left;
    font-size: .64rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 9px !important;
    border-bottom: 1px solid #f0f2f5;
    color: #344054 !important;
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: #f8fafc !important;
}

.admin-room-close {
    padding: 6px 9px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    font-size: .68rem;
    font-weight: 900;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.admin-pagination button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dce1e8;
    border-radius: 9px;
    background: #ffffff;
    color: #344054;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 900;
}

.admin-pagination button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.admin-pagination span {
    color: #697386;
    font-size: .72rem;
    font-weight: 900;
}

.admin-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.admin-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 180px)) auto;
    gap: 8px;
    margin-bottom: 14px;
}

.security-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.security-filter-grid label {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.security-filter-grid span {
    color: #697386;
    font-size: .66rem;
    font-weight: 900;
}

.admin-inline-form input,
.admin-inline-form select,
.admin-filter-row select,
.security-filter-grid input,
.security-filter-grid select,
.admin-time-grid input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #dce1e8;
    border-radius: 10px;
    background: #f8fafc;
    outline: none;
}

.admin-inline-form button,
.admin-filter-row button,
.security-filter-grid button,
.admin-wide-btn {
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 900;
}

.admin-inline-form button,
.admin-filter-row button,
.security-filter-grid button {
    min-height: 42px;
    padding: 0 16px;
}

.admin-help {
    margin-top: 9px;
}

.admin-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-time-grid label {
    color: #697386;
    font-size: .68rem;
    font-weight: 900;
}

.admin-time-grid input {
    display: block;
    margin-top: 6px;
}

.admin-wide-btn {
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
}

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #edf0f3;
    font-size: .76rem;
    font-weight: 900;
}

.admin-toggle-row button {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #dce1e8;
    background: #fff;
    cursor: pointer;
}

.admin-toggle-row button:first-child { border-radius: 8px 0 0 8px; }
.admin-toggle-row button:last-child { border-radius: 0 8px 8px 0; }

.admin-toggle-row button.is-open {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.admin-toggle-row button.is-closed {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.admin-list,
.admin-chat-list {
    max-height: 270px;
    overflow-y: auto;
    margin-top: 12px;
}

.admin-list > div {
    background: #f8fafc !important;
    border-color: #e3e7ed !important;
}

.admin-list span {
    color: #344054 !important;
}

.admin-text-btn {
    margin-top: 10px;
    background: transparent;
    color: #2563eb;
    font-size: .72rem;
}

.admin-chat-list {
    min-height: 230px;
}

.admin-chat-list > div {
    padding: 10px;
    border-bottom: 1px solid #edf0f3;
}

.admin-chat-list .bg-slate-800 {
    border-color: #e1e5eb !important;
    background: #f8fafc !important;
    color: #344054 !important;
}

.danger-zone {
    border-color: #fecaca;
    background: #fffafa;
}

.danger-zone button {
    width: 100%;
    min-height: 42px;
    margin-top: 18px;
    border: 1px solid #ef4444;
    border-radius: 10px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .app-main {
        grid-template-columns: 1fr;
    }

    .app-main.room-mode {
        grid-template-columns: 1fr;
    }

    .admin-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .room-actions,
    .admin-main-grid,
    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .quick-info-grid,
    .room-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-main-grid .span-two {
        grid-column: auto;
    }

    .admin-filter-row {
        grid-template-columns: 1fr;
    }

    .security-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .security-filter-grid button {
        grid-column: 1 / -1;
    }

    .admin-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-copy {
        padding-bottom: 24px;
    }

    .login-signal-grid {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }
}

@media (max-width: 520px) {
    .room-hub-head {
        flex-direction: column;
    }

    .room-home-btn {
        width: 100%;
        justify-content: center;
    }

    .room-options {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        width: min(100% - 20px, 1480px);
        padding-top: 20px;
    }

    .room-stage-copy {
        top: 18px;
    }

    .room-stage-copy h2 {
        font-size: 1.55rem;
    }

    .room-session-details {
        grid-template-columns: 1fr;
    }

    .room-session-details > div:last-child {
        grid-column: auto;
    }

    #btn-copy-room-code {
        min-height: 40px;
    }

    .security-filter-grid {
        grid-template-columns: 1fr;
    }

    .login-shell {
        place-items: stretch;
        padding: 14px;
        overflow-y: auto;
    }

    .login-panel {
        border-radius: 14px;
    }

    .login-copy h1 {
        font-size: 2rem;
    }
}
