:root {
    --bg-main: #0f1115;
    --bg-surface-1: #111521;
    --bg-surface-2: #121622;
    --bg-surface-3: #121723;
    --bg-surface-4: #131722;
    --bg-surface-5: #161a22;
    --bg-surface-6: #171b26;
    --bg-surface-7: #171b27;

    --fg-main: #e6e6e6;
    --fg-soft: #c6c8ce;
    --fg-muted: #969896;
    --fg-white: #ffffff;

    --accent-primary: #795da3;
    --accent-primary-light: #8a6bbd;
    --accent-purple-bright: #8c70ff;
    --accent-purple-soft: #a47adf;
    --accent-blue: #6d8fff;
    --accent-blue-light: #6d9dff;
    --accent-green: #3dbb7a;
    --accent-amber: #d6a24b;
    --accent-red: #ed6a43;

    --border-soft: #242938;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-lighter: rgba(255, 255, 255, 0.05);
    --border-accent-soft: rgba(138, 107, 189, 0.35);
    --border-accent-medium: rgba(138, 107, 189, 0.55);
    --border-accent-strong: rgba(121, 93, 163, 0.45);
    --border-success: rgba(61, 187, 122, 0.28);
    --border-danger: rgba(237, 106, 67, 0.28);

    --overlay-accent-soft: rgba(121, 93, 163, 0.08);
    --overlay-accent-medium: rgba(121, 93, 163, 0.12);
    --overlay-accent-strong: rgba(121, 93, 163, 0.14);
    --overlay-blue-soft: rgba(109, 143, 255, 0.12);
    --overlay-green-soft: rgba(61, 187, 122, 0.12);
    --overlay-red-soft: rgba(237, 106, 67, 0.1);
    --overlay-white-faint: rgba(255, 255, 255, 0.02);
    --overlay-white-strong: rgba(255, 255, 255, 0.15);
    --overlay-white-avatar: rgba(255, 255, 255, 0.2);
    --overlay-white-surface: rgba(255, 255, 255, 0.015);

    --shadow-black-soft: rgba(0, 0, 0, 0.22);
    --shadow-black-medium: rgba(0, 0, 0, 0.35);
    --shadow-black-strong: rgba(0, 0, 0, 0.45);
    --shadow-accent-soft: rgba(121, 93, 163, 0.2);
    --shadow-accent-strong: rgba(121, 93, 163, 0.45);
    --shadow-red-soft: rgba(237, 106, 67, 0.3);
    --shadow-blue-soft: rgba(109, 143, 255, 0.28);
    --shadow-purple-soft: rgba(140, 112, 255, 0.32);

    --shadow-elevated: 0 10px 30px var(--shadow-black-medium);
    --shadow-floating: 0 16px 44px var(--shadow-black-strong);
    --shadow-button: 0 8px 18px var(--shadow-black-soft);
    --shadow-icon: 0 8px 20px var(--shadow-black-soft);
    --shadow-icon-hover: 0 12px 28px var(--shadow-accent-soft);
    --shadow-primary-button: 0 14px 34px var(--shadow-blue-soft), 0 8px 24px var(--shadow-purple-soft);

    --gradient-nav-active: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-light) 100%);
    --gradient-card: linear-gradient(180deg, var(--bg-surface-5) 0%, var(--bg-surface-4) 100%);
    --gradient-create: linear-gradient(135deg, var(--accent-purple-bright) 0%, var(--accent-blue-light) 100%);
    --gradient-control: linear-gradient(180deg, var(--bg-surface-7) 0%, var(--bg-surface-3) 100%);
    --gradient-avatar: linear-gradient(135deg, var(--accent-purple-soft) 0%, var(--accent-blue) 100%);
    --gradient-dropdown: linear-gradient(180deg, var(--bg-surface-6) 0%, var(--bg-surface-1) 100%);
    --gradient-highlight: linear-gradient(135deg, rgba(140, 112, 255, 0.18), rgba(109, 157, 255, 0.06));
    --gradient-success: linear-gradient(180deg, rgba(61, 187, 122, 0.14), rgba(61, 187, 122, 0.04));
    --gradient-danger: linear-gradient(180deg, rgba(237, 106, 67, 0.14), rgba(237, 106, 67, 0.04));

    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-3xl: 28px;
    --radius-pill: 999px;

    --container-page: 1380px;
    --container-content: 980px;
    --container-auth: 620px;
    --container-auth-compact: 560px;
    --container-profile: 680px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 10px;
    --space-4: 12px;
    --space-5: 14px;
    --space-6: 16px;
    --space-7: 18px;
    --space-8: 20px;
    --space-9: 22px;
    --space-10: 24px;
    --space-11: 26px;
    --space-12: 28px;
    --space-13: 32px;
}

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

html {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--fg-main);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    border: none;
}

img,
svg {
    display: block;
}

.hidden {
    display: none !important;
}

.page-wrapper {
    margin: 0 auto;
    padding: 22px 22px 56px;
}

.page-shell {
    margin: 0 auto;
    padding: 32px 22px 60px;
}

.main-content {
    padding-top: 32px;
    animation: floatIn 0.68s ease both;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--border-soft);
    animation: floatIn 0.6s ease both;
    position: relative;
    z-index: 30;
}

:is(.personal-profile, .user-profile, .chatroom) .topbar {
    padding: 14px 22px;
    position: sticky;
    top: 0;
    z-index: 40;
}

:is(.main-nav, .nav-actions, .action-row, .footer-actions, .participant-actions, .interests-row, .game-meta, .game-title-row) {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-actions {
    position: relative;
}

.topbar-auth {
    justify-content: center;
}

.nav-actions-auth {
    justify-content: center;
    width: 100%;
}

.nav-link {
    position: relative;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-pill);
    color: var(--fg-muted);
    font-weight: 600;
    transition: transform 0.22s ease, color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.nav-link:hover {
    color: var(--fg-main);
    background: var(--overlay-accent-medium);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--fg-white);
    background: var(--gradient-nav-active);
    box-shadow: 0 8px 22px var(--shadow-accent-strong), inset 0 1px 0 var(--overlay-white-strong);
}

.icon-button.active {
    border-color: var(--border-accent-medium);
    color: var(--fg-white);
    background: var(--gradient-nav-active);
    box-shadow: 0 8px 22px var(--shadow-accent-strong), inset 0 1px 0 var(--overlay-white-strong);
}

.icon-button,
.avatar-button,
.link-icon-button {
    position: relative;
    border: 1px solid var(--border-soft);
    background: var(--gradient-control);
    color: var(--fg-main);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow-icon);
}

:is(.icon-button, .avatar-button, .link-icon-button):is(:hover, :focus-visible) {
    transform: translateY(-2px);
    border-color: var(--border-accent-medium);
    box-shadow: var(--shadow-icon-hover);
    outline: none;
}

.icon-button,
.link-icon-button {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
}

.link-icon-button {
    width: 50px;
    height: 50px;
}

.icon {
    display: block;
    width: 100%;
    height: 100%;
    background-color: currentColor;
    opacity: 0.95;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.icon--chat {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon--caret {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.1 1.02l-4.25 4.5a.75.75 0 0 1-1.1 0l-4.25-4.5a.75.75 0 0 1 .02-1.06z' fill='%23000'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.1 1.02l-4.25 4.5a.75.75 0 0 1-1.1 0l-4.25-4.5a.75.75 0 0 1 .02-1.06z' fill='%23000'/%3E%3C/svg%3E");
}

.icon--refresh {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='23 4 23 10 17 10' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolyline points='1 20 1 14 7 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='23 4 23 10 17 10' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolyline points='1 20 1 14 7 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon--copy {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon--send {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cline x1='22' y1='2' x2='11' y2='13' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cline x1='22' y1='2' x2='11' y2='13' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon--close {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cline x1='18' y1='6' x2='6' y2='18' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3Cline x1='6' y1='6' x2='18' y2='18' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cline x1='18' y1='6' x2='6' y2='18' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3Cline x1='6' y1='6' x2='18' y2='18' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.icon--eye {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
}

.icon--eye-off {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M3 3l18 18' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M3 3l18 18' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:is(.icon-button, .link-icon-button) .icon {
    width: 22px;
    height: 22px;
}

.avatar-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px 7px 7px;
    border-radius: var(--radius-pill);
}

.avatar,
.big-avatar {
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--fg-white);
    font-weight: 800;
    box-shadow: inset 0 1px 0 var(--overlay-white-avatar);
    flex-shrink: 0;
    background: var(--gradient-avatar);
    overflow: hidden;
}

.avatar {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
}

.big-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

.avatar img,
.big-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.caret {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 220px;
    padding: 10px;
    background: var(--gradient-dropdown);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-floating);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 10;
}

.dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border-lighter);
    margin-bottom: 6px;
}

.dropdown-header strong {
    display: block;
    font-size: 0.95rem;
}

.dropdown a,
.dropdown button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--fg-main);
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, transform 0.18s ease;
}

.dropdown a:hover,
.dropdown button:hover {
    background: var(--overlay-accent-strong);
    transform: translateX(2px);
}

.page-heading,
.intro-text {
    text-align: center;
    margin-bottom: 30px;
}

:is(.page-heading h1, .intro-text h1, .auth-title) {
    margin: 0;
    color: var(--fg-white);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

:is(.page-heading h1, .intro-text h1) {
    font-size: clamp(2rem, 4vw, 3rem);
}

.auth-title {
    font-size: 2.6rem;
}

:is(.page-heading p, .intro-text p, .auth-intro, .panel-header p, .join-panel-header p, .helper, .field-hint) {
    color: var(--fg-muted);
}

.page-heading p,
.intro-text p {
    margin: 12px auto 0;
    max-width: 720px;
    font-size: 1rem;
}

:is(.card, .panel, .surface-card, .sidebar-card, .summary-card, .game-card, .join-panel, .auth-card, .profile-header) {
    border: 1px solid var(--border-soft);
}

:is(.card, .auth-card, .surface-card, .profile-header) {
    background: var(--bg-surface-1);
    box-shadow: var(--shadow-elevated);
}

:is(.panel, .sidebar-card, .summary-card, .game-card, .join-panel) {
    background: var(--gradient-card);
    border-radius: 24px;
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
}

.surface-card,
.auth-card,
.profile-header,
.sidebar-card,
.summary-card {
    border-radius: 22px;
}

.card {
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 14px;
}

.game-card {
    width: 100%;
    min-height: 220px;
    padding: 26px 28px;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    animation: floatIn 0.72s ease both;

    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-floating);
}

.personal-profile .card {
    border-radius: 18px;
    padding: 26px;
    margin-bottom: 18px;
}

:is(.panel-header, .card-header) {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.panel-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-lighter);
}

:is(.panel-header h2, .sidebar-card h3, .join-panel-header h2, .card-title, .subsection-title, .field label, .form-group label, .join-side label) {
    color: var(--fg-white);
}

:is(.toggle-copy strong, .toggle-subsection-copy strong, .summary-card strong, .budget-card strong, .checklist-item strong, .organizer-block strong, .invite-dropdown strong, .invite-person-name, .chat-header-name, .msg-name, .profile-name, .identity-name) {
    color: var(--fg-white);
}

.panel-header h2,
.sidebar-card h3 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}

.panel-header p {
    margin: 0;
    max-width: 62ch;
    font-size: 0.95rem;
}

.panel-body {
    padding: 20px;
}

.sidebar-card h3 {
    margin: 0 0 16px;
}

.sidebar-card,
.summary-card {
    padding: 22px 24px 24px;
}

.card-title {
    font-weight: 700;
    font-size: 0.98rem;
    margin-bottom: 18px;
}

.card-header {
    align-items: center;
    margin-bottom: 20px;
}

.divider {
    height: 1px;
    background: var(--border-lighter);
    margin: 20px 0;
}

:is(.field, .form-group, .join-side, .code-stack) {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.field.compact-field {
    max-width: 560px;
}

:is(.field label, .form-group label, .subsection-title, .join-side label) {
    font-weight: 700;
    font-size: 0.96rem;
}

:is(.field-hint, .helper) {
    font-size: 0.88rem;
}

:is(.input, .select, .textarea, .form-input, .field input, .field textarea, .wish-input) {
    width: 100%;
    color: var(--fg-main);
    outline: none;
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border-radius: 16px;
    padding: 14px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.form-input {
    padding: 16px;
}

.textarea,
.field textarea {
    min-height: 80px;
    resize: vertical;
}

.textarea {
    min-height: 112px;
}

:is(.input, .select, .textarea, .form-input, .field input, .field textarea, .wish-input)::placeholder {
    color: #767b88;
}

:is(.input, .select, .textarea, .form-input, .field input, .field textarea, .wish-input):focus {
    border-color: var(--border-accent-medium);
    box-shadow: 0 0 0 4px rgba(138, 107, 189, 0.15);
    transform: translateY(-1px);
}

:is(.form-row, .agree-box label, .form-row label) {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    justify-content: space-between;
    margin-bottom: 18px;
    color: var(--fg-muted);
    font-size: 0.95rem;
}

.agree-box {
    text-align: left;
    background: var(--bg-surface-5);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
    color: var(--fg-muted);
}

.form-input,
.form-row input[type="checkbox"],
.agree-box input[type="checkbox"],
input[type="range"] {
    accent-color: var(--accent-primary-light);
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

:is(.button, .mini-button, .action-button, .save-btn, .add-btn, .send-btn, .remove-btn, .remove-button) {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.button,
.mini-button,
.action-button,
.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0.88rem 1.2rem;
    color: var(--fg-white);
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
}

:is(.button, .mini-button, .action-button, .save-btn, .send-btn, .add-btn, .remove-btn, .remove-button):hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

:is(.button, .mini-button, .action-button, .save-btn, .send-btn):active {
    transform: translateY(0);
}

.mini-button {
    padding: 0.74rem 0.95rem;
    font-size: 0.92rem;
    white-space: nowrap;
}

.button-primary,
.mini-button.primary,
.action-button--super-primary {
    background: var(--gradient-create);
    box-shadow: var(--shadow-primary-button);
}

:is(.button-secondary, .button-ghost, .mini-button.secondary, .action-button--secondary, .remove-button) {
    background: var(--overlay-white-faint);
    border-color: var(--border-light);
    color: var(--fg-main);
    box-shadow: var(--shadow-button);
}

:is(.button-secondary, .button-ghost, .mini-button.secondary, .action-button--secondary, .remove-button):hover {
    border-color: var(--border-accent-strong);
    background: var(--overlay-accent-soft);
}

.action-button {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    text-align: center;
}

.action-button + .action-button {
    margin-top: 18px;
}

.action-button--primary {
    background: var(--gradient-nav-active);
    color: var(--fg-white);
    margin-bottom: 18px;
    box-shadow: 0 10px 24px var(--shadow-accent-strong);
}

.save-btn {
    width: 100%;
    padding: 13px 26px;
    border-radius: 12px;
    background: var(--gradient-nav-active);
    box-shadow: 0 6px 20px var(--shadow-accent-strong);
}

.add-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px dashed var(--border-soft);
    border-radius: 10px;
    color: var(--fg-muted);
    font-size: 0.86rem;
    padding: 9px 14px;
    cursor: pointer;
}

.add-btn:hover {
    border-color: var(--border-accent-medium);
    color: var(--accent-primary-light);
}

.send-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--gradient-nav-active);
    color: var(--fg-white);
    box-shadow: 0 4px 14px var(--shadow-accent-strong);
    cursor: pointer;
    margin-left: auto;
}

.send-btn .icon {
    width: 16px;
    height: 16px;
}

.remove-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--fg-muted);
    cursor: pointer;
}

.remove-btn:hover {
    background: rgba(237, 106, 67, 0.12);
    color: var(--accent-red);
    border-color: rgba(237, 106, 67, 0.35);
}

.remove-btn .icon {
    width: 14px;
    height: 14px;
}

.remove-button {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 0;
    font-size: 1rem;
    font-weight: 800;
    flex: none;
    cursor: pointer;
}

.button[disabled],
.mini-button[disabled],
.action-button[disabled],
.save-btn[disabled],
.add-btn[disabled],
.remove-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none !important;
    filter: none !important;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-pill);
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.pill.organizer {
    background: var(--overlay-blue-soft);
    color: #cdd9ff;
    border: 1px solid rgba(109, 143, 255, 0.24);
}

.pill.member,
.pill.draft {
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg-soft);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pill.open {
    background: var(--overlay-green-soft);
    color: #bfe9d1;
    border: 1px solid rgba(61, 187, 122, 0.22);
}

.pill.pending {
    background: rgba(214, 162, 75, 0.12);
    color: #f0d39b;
    border: 1px solid rgba(214, 162, 75, 0.2);
}

.pill.closed {
    background: var(--overlay-red-soft);
    color: #ffd0c3;
    border: 1px solid rgba(237, 106, 67, 0.2);
}

.bottom-note {
    margin-top: 28px;
    text-align: center;
    color: var(--fg-muted);
    font-size: 0.98rem;
}

.bottom-note a {
    color: var(--fg-white);
    padding: 0.14rem 0.4rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(121, 93, 163, 0.35), rgba(138, 107, 189, 0.15));
    box-shadow: inset 0 -1px 0 var(--overlay-white-strong);
}

.bottom-note a:hover {
    filter: brightness(1.08);
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav {
        justify-content: center;
    }

    .nav-actions {
        justify-content: flex-end;
    }

    .nav-actions-auth {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding-inline: 14px;
    }

    .main-nav {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .page-wrapper {
        padding-inline: 14px;
    }

    .panel-header,
    .panel-body,
    .sidebar-card,
    .summary-card,
    .game-card,
    .join-panel,
    .auth-card {
        padding-left: 16px;
        padding-right: 16px;
    }
}
