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

:root {
    --bg: #05070b;
    --bg-soft: #0b1017;
    --panel: rgba(6, 9, 13, 0.72);
    --panel-strong: rgba(5, 8, 12, 0.88);
    --panel-soft: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #f3f5f7;
    --muted: #98a2b3;
    --muted-strong: #b4bfce;
    --accent: #d7e6ff;
    --glow: rgba(255, 255, 255, 0.08);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --content-width: 1120px;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(101, 120, 158, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.06), transparent 24%),
        linear-gradient(180deg, #0a0d12 0%, #05070b 100%);
}

body {
    min-height: 100vh;
    color: var(--text);
    font: 15px/1.6 "Space Grotesk", "Noto Sans JP", "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 50%);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #ffffff;
}

img {
    max-width: 100%;
}

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

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

select option {
    color: #111827;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5.25 7 9l4-3.75' fill='none' stroke='%23d9e1ec' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 14px center;
    background-size: auto, 14px 14px;
    padding-right: 42px;
}

.ts-wrapper {
    font: inherit;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control,
.ts-control {
    min-height: 50px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.03);
    box-shadow: none;
}

.ts-wrapper.single .ts-control::after {
    border-color: var(--muted-strong) transparent transparent transparent;
    margin-top: -2px;
}

.ts-wrapper.single.dropdown-active .ts-control::after {
    border-color: transparent transparent var(--muted-strong) transparent;
    margin-top: -7px;
}

.ts-control,
.ts-control input,
.ts-dropdown,
.ts-dropdown .option,
.ts-dropdown .active,
.ts-dropdown .create {
    color: var(--text);
}

.ts-control input::placeholder {
    color: var(--muted);
}

.ts-wrapper.focus .ts-control {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.ts-dropdown {
    margin-top: 8px;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(7, 10, 15, 0.96);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
}

.ts-dropdown .option,
.ts-dropdown .create {
    padding: 10px 12px;
    border-radius: 10px;
}

.ts-dropdown .active,
.ts-dropdown .option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.hide {
    display: none;
}

.clear,
.right,
.transparent {
    all: unset;
}

body.page-root {
    padding: 28px 18px 80px;
}

body.page-root.room-page {
    padding-top: 214px;
}

#body {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    position: relative;
}

.site-shell {
    position: relative;
}

.site-shell::before,
.site-shell::after {
    content: "";
    position: fixed;
    z-index: -1;
    filter: blur(18px);
    opacity: 0.55;
}

.site-shell::before {
    top: 72px;
    left: -40px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(124, 137, 160, 0.2), transparent 70%);
}

.site-shell::after {
    right: -30px;
    bottom: 40px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 68%);
}

.page-card,
.header,
#login,
#profile,
.message_box,
#talks_box,
#setting_pannel,
.trans-card {
    background: var(--panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.page-card,
.header,
#login,
.trans-card {
    border-radius: var(--radius-xl);
}

.page-card,
#login,
.header {
    padding: 28px;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
    gap: 28px;
    align-items: start;
}

.hero-copy,
.auth-card,
.form-card,
.form-stack,
.lounge-shell,
.create-shell,
.admin-shell,
.announce-shell,
.message_box_inner,
.room-title-block,
.settings-grid,
.announce-composer {
    display: grid;
    gap: 18px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 6px;
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
}

.hero-title {
    font-size: clamp(34px, 5.4vw, 66px);
    line-height: 0.95;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.hero-text,
.panel-note,
.copyright,
.footer,
.form-help,
.stat-label,
.section-subtitle,
.room-meta,
.members-inline,
.room-card-caption {
    color: var(--muted);
}

.hero-text {
    max-width: 38rem;
    font-size: 16px;
}

.hero-points,
.stats-grid,
.rooms-list,
.meta-list,
.room-card-meta,
.settings-actions {
    display: grid;
    gap: 14px;
}

.hero-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-point,
.stat-card,
.meta-card,
.room-card,
.talk.system {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
}

.hero-point,
.stat-card,
.meta-card,
.room-card {
    padding: 18px;
}

.hero-point strong,
.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.hero-panel {
    padding: 24px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(4, 6, 10, 0.78);
    border: 1px solid var(--line);
}

.hero-panel h2,
.section-title,
.header h2,
#room_name {
    font-size: clamp(24px, 2.8vw, 34px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.button,
input[type=submit],
input[type=button],
button {
    appearance: none;
    border: 0;
    cursor: pointer;
}

.button {
    display: inline-flex;
    border-radius: 12px;
    background: transparent;
}

.button input,
input[type=submit],
input[type=button] {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    min-height: 48px;
    padding: 0 22px;
    width: auto;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.button input {
    min-width: 100%;
}

input[type=submit]:hover,
input[type=button]:hover,
.button:hover input {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.button-secondary,
.ghost-action,
.menu li input {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.ghost-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
}

.error {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f4d2d2;
}

.language select {
    max-width: 220px;
    margin-left: auto;
}

.room-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
    gap: 24px;
    align-items: start;
}

.character-picker {
    display: grid;
    gap: 10px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 10px;
    list-style: none;
}

.icon-grid li {
    list-style: none;
}

.character-option {
    position: relative;
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 12px 10px 10px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.character-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line);
    transform: translateY(-2px);
}

.character-option input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.character-visual {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.character-visual img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: grayscale(0.2) brightness(0.56) saturate(0.74);
    transition: filter 0.18s ease, transform 0.18s ease;
}

.character-option:hover .character-visual img {
    filter: grayscale(0) brightness(0.92) saturate(1);
    transform: scale(1.04);
}

.character-name {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.character-option input[type=radio]:checked + .character-visual {
    border-color: rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.character-option input[type=radio]:checked + .character-visual img {
    filter: grayscale(0) brightness(1) saturate(1.04);
    transform: scale(1.06);
}

.character-option input[type=radio]:checked ~ .character-name {
    color: var(--text);
}

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

.meta-card strong {
    display: block;
    font-size: 11px;
    color: var(--muted-strong);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.footer {
    margin-top: 8px;
    font-size: 14px;
}

.copyright {
    margin-top: 6px;
    font-size: 12px;
}

#profile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    list-style: none;
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    margin-bottom: 18px;
}

#profile li {
    list-style: none;
}

#profile li.icon img {
    display: block;
    width: 68px;
    height: 68px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    object-fit: contain;
}

#profile li.name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

#profile li.logout form {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.panel-header .eyebrow {
    margin-bottom: 12px;
}

.panel-header .section-title {
    margin-bottom: 6px;
}

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

.stat-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.rooms-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.room-card {
    display: grid;
    gap: 14px;
}

.room-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.room-card h3 {
    font-size: 22px;
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.room-pill,
.room-full {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

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

.room-card-meta div {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.room-card-meta strong {
    display: block;
    color: var(--muted-strong);
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.form-grid,
.form-row,
.form-actions {
    display: grid;
    gap: 14px;
}

.form-actions {
    align-items: center;
}

.message_box {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 24px), var(--content-width));
    padding: 16px;
    border-radius: 22px;
    z-index: 99999;
}

.room-topbar {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.room-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted-strong);
}

ul.menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

ul.menu li {
    list-style: none;
}

ul.menu li.setting,
ul.menu li.sound,
ul.menu li.member,
ul.menu li.animation {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background-color: rgba(255, 255, 255, 0.05);
    background-position: center;
    background-repeat: no-repeat;
    display: none;
}

ul.menu li.logout input {
    min-height: 40px;
    padding: 0 16px;
}

ul.menu li.setting {
    background-image: url('setting.png');
}

ul.menu li.sound_on {
    background-image: url('sound_on.png');
}

ul.menu li.sound_off {
    background-image: url('sound_off.png');
}

ul.menu li.member_on {
    background-image: url('member_on.png');
}

ul.menu li.member_off {
    background-image: url('member_off.png');
}

ul.menu li.animation_on {
    background-image: url('animation_on.png');
}

ul.menu li.animation_off {
    background-image: url('animation_off.png');
}

#message {
    display: grid;
    gap: 14px;
}

.room-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

#message textarea {
    min-height: 84px;
    resize: vertical;
}

#message .submit input {
    min-width: 146px;
}

#members {
    list-style: none;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

#members li {
    display: inline;
    color: var(--muted);
}

#setting_pannel {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.settings-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

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

#setting_pannel ul#user_list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    list-style: none;
}

#setting_pannel ul#user_list li {
    min-height: 122px;
    padding: 72px 10px 14px;
    text-align: center;
    border-radius: 14px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.03);
    background-position: center 12px;
    background-repeat: no-repeat;
    cursor: pointer;
}

#setting_pannel ul#user_list li.select {
    border-color: rgba(255, 255, 255, 0.18);
    background-color: rgba(255, 255, 255, 0.06);
}

#talks_box {
    border-radius: 28px;
    padding: 18px;
    margin-top: 18px;
}

#talks {
    display: grid;
    gap: 12px;
    margin-top: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#talks dl.talk {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 16px;
    align-items: start;
    min-height: 0;
}

#talks dl.talk dt {
    min-height: 86px;
    padding-top: 66px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.3;
    background-position: center 6px;
    background-repeat: no-repeat;
}

#talks dl.talk dd {
    display: block;
    max-width: none;
}

#talks dl.talk dd div.bubble {
    display: inline-block;
    max-width: min(100%, 720px);
}

#talks dl.talk dd div.bubble p.body {
    float: none;
    display: flex;
    align-items: center;
    clear: none;
    padding: 16px 18px;
    min-height: 86px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    letter-spacing: 0.01em;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

#talks div.system {
    margin: 0;
    padding: 12px 16px;
    color: var(--muted-strong);
}

#talks dl.setton dt {
    background-image: url('icon_setton.png');
}

#talks dl.tanaka dt {
    background-image: url('icon_tanaka.png');
}

#talks dl.kanra dt {
    background-image: url('icon_kanra.png');
}

#talks dl.zaika dt {
    background-image: url('icon_zaika.png');
}

#talks dl.zawa dt {
    background-image: url('icon_zawa.png');
}

#talks dl.gg dt {
    background-image: url('icon_gg.png');
}

#talks dl.admin dt {
    background-image: url('icon_admin.png');
}

#talks dl.setton dd div.bubble p.body,
#talks dl.tanaka dd div.bubble p.body,
#talks dl.kanra dd div.bubble p.body,
#talks dl.zaika dd div.bubble p.body,
#talks dl.zawa dd div.bubble p.body,
#talks dl.gg dd div.bubble p.body,
#talks dl.admin dd div.bubble p.body {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.announce-composer textarea {
    min-height: 120px;
    resize: vertical;
}

.trans-card {
    margin-top: 48px;
    padding: 30px;
}

@media (max-width: 980px) {
    .page-hero,
    .hero-points,
    .stats-grid,
    .meta-list,
    .room-create-grid,
    .room-compose,
    .settings-top,
    .room-card-meta {
        grid-template-columns: 1fr;
    }

    .panel-header,
    #profile,
    .room-topbar {
        align-items: start;
    }

    #profile {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #profile li.icon {
        margin: 0 auto;
    }

    #profile li.logout form {
        justify-content: center;
        flex-wrap: wrap;
    }

    body.page-root.room-page {
        padding-top: 308px;
    }

    #talks dl.talk {
        grid-template-columns: 1fr;
    }

    #talks dl.talk dt {
        width: 100%;
        min-height: 28px;
        padding: 0 0 0 60px;
        text-align: left;
        background-position: left center;
    }
}

@media (max-width: 720px) {
    body.page-root {
        padding: 18px 12px 48px;
    }

    body.page-root.room-page {
        padding-top: 354px;
    }

    .page-card,
    .header,
    #login,
    .message_box,
    #talks_box,
    .trans-card {
        padding: 20px;
        border-radius: 20px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-text,
    #profile li.name {
        font-size: 16px;
    }

    #profile li.name {
        font-size: 24px;
    }

    ul.menu {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    ul.menu li.logout {
        width: 100%;
    }

    ul.menu li.logout input,
    #message .submit input,
    .button input,
    input[type=submit],
    input[type=button],
    .ghost-action {
        width: 100%;
    }

    .rooms-list,
    .settings-actions {
        grid-template-columns: 1fr;
    }
}
