:root {
    color-scheme: dark;
    --bg: #0f141a;
    --panel: #151b22;
    --panel-soft: #1a212a;
    --panel-hover: #1c364a;
    --text: #d6dce5;
    --muted: #a9b3c0;
    --border: #29323c;
    --border-strong: #36414d;
    --primary: #3b6790;
    --primary-hover: #4777a4;
    --accent: #79c0ff;
    --success: #22c55e;
    --danger: #c27174;
}

* {
    box-sizing: border-box;
}

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

html {
    scroll-padding-top: 7.5rem;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

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

.app-chrome {
    backdrop-filter: blur(16px);
    background: rgba(15, 20, 26, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar {
    align-items: center;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    min-height: 3.5rem;
    padding: 0.7rem clamp(1rem, 2vw, 1.6rem);
}

.brand {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.nav {
    align-items: center;
    display: flex;
    gap: 0.8rem;
}

.nav a,
.user-name {
    color: var(--muted);
    font-size: 0.82rem;
}

.studio-tabs {
    align-items: center;
    background: transparent;
    border-bottom: none;
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.35rem clamp(1rem, 2vw, 1.6rem) 0.55rem;
}

.studio-tabs a,
.studio-tabs span {
    border-radius: 999px;
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.38rem 0.72rem;
}

.studio-tabs a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.studio-tabs a.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.studio-tabs span {
    opacity: 0.45;
}

.demo-badge {
    background: rgba(121, 192, 255, 0.16);
    border: 1px solid rgba(121, 192, 255, 0.35);
    border-radius: 999px;
    color: #9fd1ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.32rem 0.62rem;
    text-transform: uppercase;
}

.page {
    margin: 0;
    max-width: none;
    padding: 1rem;
    width: 100%;
}

.hero {
    max-width: 720px;
    padding: 6rem 0;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: clamp(1rem, 7vw, 7rem);
    min-height: calc(100vh - 5.5rem);
    max-width: min(880px, calc(100vw - 2rem));
    padding: clamp(3.5rem, 9vh, 7rem) 0;
}

.landing-hero .eyebrow {
    margin-bottom: 0.75rem;
}

.landing-hero .lead {
    max-width: 560px;
}

.landing-hero .button {
    align-self: flex-start;
    padding: 0.72rem 1rem;
}

.hero h1,
.section-heading h1 {
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1.05;
    margin: 0.4rem 0 1rem;
}

.landing-hero h1 {
    font-size: clamp(2.35rem, 4.2vw, 4.6rem);
    letter-spacing: -0.045em;
    line-height: 1.12;
    max-width: 820px;
    word-break: keep-all;
}

.lead {
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.eyebrow {
    color: #79c0ff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0 0 0.45rem;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.button {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.58rem 0.86rem;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
}

.button.danger {
    background: rgba(239, 68, 68, 0.13);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fecaca;
}

.button:hover {
    border-color: #64748b;
}

.button.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.button.subtle {
    background: #121920;
    color: var(--muted);
}

.button.mini {
    font-size: 0.72rem;
    padding: 0.42rem 0.62rem;
}

body.is-action-loading {
    overflow: hidden;
}

.action-loading[hidden] {
    display: none;
}

.action-loading {
    align-items: center;
    backdrop-filter: blur(6px);
    background: rgba(6, 9, 13, 0.72);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 80;
}

.action-loading-card {
    align-items: center;
    background: rgba(26, 33, 42, 0.98);
    border: 1px solid var(--border-strong);
    border-radius: 0.9rem;
    box-shadow: 0 1.4rem 3.5rem rgba(0, 0, 0, 0.45);
    display: grid;
    gap: 0.55rem;
    justify-items: center;
    max-width: 22rem;
    padding: 1.2rem 1.15rem;
    text-align: center;
    width: min(100%, 22rem);
}

.action-loading-card strong {
    font-size: 0.95rem;
}

.action-loading-card p {
    margin: 0;
}

.action-loading-spinner {
    animation: action-spin 0.8s linear infinite;
    border: 2px solid rgba(121, 192, 255, 0.2);
    border-radius: 999px;
    border-top-color: #79c0ff;
    height: 1.7rem;
    width: 1.7rem;
}

@keyframes action-spin {
    to {
        transform: rotate(360deg);
    }
}

.action-toast[hidden] {
    display: none;
}

.action-toast {
    background: rgba(26, 33, 42, 0.96);
    border: 1px solid rgba(121, 192, 255, 0.28);
    border-radius: 0.75rem;
    bottom: 1.1rem;
    box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.35);
    color: #9fd1ff;
    font-size: 0.82rem;
    font-weight: 800;
    left: 50%;
    max-width: min(92vw, 26rem);
    padding: 0.72rem 0.9rem;
    position: fixed;
    text-align: center;
    transform: translateX(-50%);
    z-index: 85;
}

.section-heading,
.studio-hero {
    margin-bottom: 1rem;
}

.guild-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.2rem 0 0.4rem;
}

.studio-hero {
    align-items: flex-end;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.studio-hero h1 {
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 0 0 0.55rem;
}

.hero-actions {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.sync-pill {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 999px;
    color: #86efac;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.45rem 0.72rem;
}

.sync-pill.admin-pill {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.sync-pill.sync-pill-warn {
    background: rgba(239, 68, 68, 0.13);
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--danger);
}

.guild-grid,
.stats-grid,
.content-grid,
.dashboard-layout,
.main-column,
.side-column,
.role-grid {
    display: grid;
    gap: 1rem;
}

.guild-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.guild-card,
.stat-card,
.panel,
.empty-state,
.raid-card {
    background: rgba(26, 33, 42, 0.92);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.guild-card {
    align-items: center;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.guild-card:hover {
    background: var(--panel-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.guild-card h2 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.guild-card p {
    color: var(--muted);
    margin: 0;
}

.guild-icon {
    border-radius: 0.75rem;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.guild-icon.placeholder {
    align-items: center;
    background: var(--panel-soft);
    display: flex;
    font-size: 1.5rem;
    font-weight: 800;
    justify-content: center;
}

.stats-grid {
    grid-template-columns: repeat(5, minmax(0, 180px));
    margin-bottom: 0.9rem;
}

.filter-panel {
    align-items: center;
    background: rgba(26, 33, 42, 0.92);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    display: flex;
    gap: 0.8rem;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    padding: 0.75rem;
}

.raid-create-panel {
    background: rgba(26, 33, 42, 0.86);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 0.9rem;
    padding: 1rem;
}

.raid-create-form {
    align-items: end;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(5, minmax(110px, 1fr)) minmax(220px, 1.6fr) auto;
}

.raid-create-submit-wrap {
    display: inline-flex;
    position: relative;
    width: fit-content;
}

.raid-create-submit-wrap.is-blocked {
    cursor: not-allowed;
}

.raid-create-submit-wrap.is-blocked .button {
    opacity: 0.45;
    pointer-events: none;
}

.raid-create-submit-wrap.is-blocked::after {
    background: #0b0f14;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.55rem;
    bottom: calc(100% + 0.45rem);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
    content: attr(data-tooltip);
    font-size: 0.74rem;
    font-weight: 600;
    left: 50%;
    line-height: 1.35;
    max-width: 16rem;
    opacity: 0;
    padding: 0.55rem 0.7rem;
    pointer-events: none;
    position: absolute;
    text-align: center;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: normal;
    width: max-content;
    z-index: 5;
}

.raid-create-submit-wrap.is-blocked:hover::after,
.raid-create-submit-wrap.is-blocked:focus-within::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.raid-join-submit-wrap {
    display: inline-flex;
    position: relative;
    width: fit-content;
}

.raid-join-submit-wrap.is-blocked {
    cursor: not-allowed;
}

.raid-join-submit-wrap.is-blocked .button {
    opacity: 0.45;
    pointer-events: none;
}

.raid-join-submit-wrap.is-blocked::after {
    background: #0b0f14;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.55rem;
    bottom: calc(100% + 0.45rem);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
    content: attr(data-tooltip);
    font-size: 0.74rem;
    font-weight: 600;
    left: 50%;
    line-height: 1.35;
    max-width: 16rem;
    opacity: 0;
    padding: 0.55rem 0.7rem;
    pointer-events: none;
    position: absolute;
    text-align: center;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: normal;
    width: max-content;
    z-index: 5;
}

.raid-join-submit-wrap.is-blocked:hover::after,
.raid-join-submit-wrap.is-blocked:focus-within::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.raid-create-preview {
    grid-column: 1 / -1;
    margin: 0.15rem 0 0;
}

.raid-create-form label {
    display: grid;
    gap: 0.28rem;
}

.raid-create-form label span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.raid-create-form select,
.raid-create-form input {
    appearance: none;
    background: #121920;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    min-height: 2.35rem;
    padding: 0.5rem 0.6rem;
    width: 100%;
}

.filter-group,
.filter-selects {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.filter-label,
.filter-selects label span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.filter-chip {
    background: #121920;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.42rem 0.65rem;
}

.filter-chip.active,
.filter-chip:hover {
    background: rgba(121, 192, 255, 0.16);
    border-color: rgba(121, 192, 255, 0.24);
    color: #9fd1ff;
}

.filter-selects label {
    align-items: center;
    display: flex;
    gap: 0.35rem;
    min-width: 0;
}

.filter-selects label span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.filter-selects select {
    appearance: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b929e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        no-repeat right 0.65rem center,
        #121920;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--text);
    cursor: pointer;
    flex: 1 1 auto;
    font-size: 0.76rem;
    font-weight: 700;
    min-width: 0;
    padding: 0.42rem 1.7rem 0.42rem 0.6rem;
    text-align: center;
    text-align-last: center;
}

.filter-selects select:hover {
    border-color: var(--border-strong);
}

.filter-selects select:focus {
    border-color: rgba(121, 192, 255, 0.4);
    outline: none;
}

.stat-card {
    padding: 0.95rem;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    font-size: 1.45rem;
    margin-top: 0.35rem;
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(121, 192, 255, 0.16), rgba(26, 33, 42, 0.92));
    border-color: rgba(121, 192, 255, 0.28);
}

.content-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.dashboard-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.main-column,
.side-column {
    min-width: 0;
}

.side-column {
    position: sticky;
    top: 7.75rem;
}

.panel {
    padding: 1rem;
}

.panel.wide {
    min-width: 0;
}

.panel-header,
.raid-main,
.role-count,
.ranking-list li {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.panel-header {
    margin-bottom: 0.9rem;
}

.panel h2,
.raid-card h3 {
    margin: 0;
}

.raid-list {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
    max-height: min(68vh, 54rem);
    overflow: auto;
    padding-right: 0.2rem;
}

.raid-list::-webkit-scrollbar {
    width: 0.45rem;
}

.raid-list::-webkit-scrollbar-thumb {
    background: #303641;
    border-radius: 999px;
}

.raid-card {
    min-height: 0;
    padding: 0.85rem;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.raid-card .role-stack {
    gap: 0.38rem;
}

.raid-card .participants {
    max-height: 3.4rem;
    overflow: auto;
}

.raid-card:hover {
    background: var(--panel-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.raid-card.past {
    opacity: 0.58;
}

.raid-time {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0;
}

.raid-card-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
}

.status-dot {
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
    height: 0.45rem;
    width: 0.45rem;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.status-dot.closed {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.status-dot.past {
    background: #64748b;
}

.raid-main {
    align-items: flex-start;
}

.raid-thumb {
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    flex: 0 0 64px;
    height: 64px;
    object-fit: cover;
    width: 64px;
}

.raid-main > div {
    flex: 1;
    min-width: 0;
}

.raid-main h3 {
    font-size: 0.98rem;
    letter-spacing: -0.02em;
}

.raid-main .muted {
    font-size: 0.76rem;
    margin: 0.35rem 0 0;
}

.icon-button {
    background: #121920;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #cbd5e1;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.36rem 0.58rem;
}

.pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    padding: 0.16rem 0.42rem;
}

.pill.accent {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.fill-bar {
    background: #0d1116;
    border-radius: 999px;
    display: block;
    height: 0.35rem;
    margin: 0.85rem 0;
    overflow: hidden;
}

.fill-bar span {
    background: linear-gradient(90deg, #3b6790, #22c55e);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: var(--fill);
}

.role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.role-stack {
    display: grid;
    gap: 0.48rem;
    margin-top: 1rem;
}

.raid-action-panel {
    background: rgba(121, 192, 255, 0.055);
    border: 1px solid rgba(121, 192, 255, 0.1);
    border-radius: 0.65rem;
    display: grid;
    gap: 0.55rem;
    margin-top: 0.8rem;
    padding: 0.65rem;
}

.join-form {
    display: grid;
    gap: 0.5rem;
}

.join-form label {
    display: grid;
    gap: 0.25rem;
}

.join-form [hidden] {
    display: none;
}

.join-form label span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
}

.join-form select {
    appearance: none;
    background: #0d1116;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 700;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    width: 100%;
}

.raid-action-panel form:not(.join-form) {
    margin: 0;
}

.role-row {
    align-items: center;
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.58rem;
    display: flex;
    justify-content: space-between;
    padding: 0.48rem 0.55rem;
}

.role-row strong {
    font-size: 0.82rem;
}

.role-label {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 800;
    gap: 0.35rem;
    padding: 0.18rem 0.46rem;
}

.role-label.dealer {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.role-label.supporter {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.participants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32rem;
    margin: 0;
}

.participants span {
    align-items: center;
    background: #0f1116;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #cbd5e1;
    display: inline-flex;
    font-size: 0.7rem;
    gap: 0.28rem;
    padding: 0.22rem 0.48rem;
}

.character-face {
    background: #0d1116;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.45rem;
    height: 2rem;
    object-fit: cover;
    object-position: top center;
    width: 2rem;
}

.character-face.tiny {
    border-radius: 999px;
    height: 1.2rem;
    width: 1.2rem;
}

.compact-text {
    font-size: 0.72rem;
    margin: 0;
}

.ranking-list {
    display: grid;
    gap: 0.65rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ranking-tabs > input {
    display: none;
}

.tab-switch {
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.7rem;
    display: grid;
    gap: 0.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0.75rem;
    padding: 0.25rem;
}

.tab-switch label {
    border-radius: 0.5rem;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.45rem 0.5rem;
    text-align: center;
}

#ranking-top:checked ~ .tab-switch label[for="ranking-top"],
#ranking-all:checked ~ .tab-switch label[for="ranking-all"],
#lopec-rank-top:checked ~ .tab-switch label[for="lopec-rank-top"],
#lopec-rank-all:checked ~ .tab-switch label[for="lopec-rank-all"] {
    background: rgba(121, 192, 255, 0.16);
    color: #9fd1ff;
}

.ranking-tab-panel {
    display: none;
}

#ranking-top:checked ~ .top-panel,
#ranking-all:checked ~ .all-panel,
#lopec-rank-top:checked ~ .lopec-top-panel,
#lopec-rank-all:checked ~ .lopec-all-panel {
    display: block;
}

.all-ranking-scroll {
    max-height: 28rem;
    overflow: auto;
    padding-right: 0.25rem;
}

.all-ranking-scroll::-webkit-scrollbar {
    width: 0.45rem;
}

.all-ranking-scroll::-webkit-scrollbar-thumb {
    background: #303641;
    border-radius: 999px;
}

.ranking-list li {
    align-items: stretch;
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.65rem;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 2.35rem minmax(0, 1fr);
    padding: 0.58rem;
}

.ranking-list span {
    display: block;
}

.rank-number {
    align-items: center;
    background: rgba(121, 192, 255, 0.12);
    border: 1px solid rgba(121, 192, 255, 0.18);
    border-radius: 0.55rem;
    color: #9fd1ff;
    display: flex;
    font-size: 0.76rem;
    font-weight: 900;
    justify-content: center;
    min-height: 2.7rem;
    overflow: hidden;
}

.rank-number.has-image {
    background: #0d1116;
    padding: 0;
}

.rank-number.has-image img {
    height: 100%;
    object-fit: cover;
    object-position: top center;
    width: 100%;
}

.ranking-body {
    min-width: 0;
}

.ranking-main {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    justify-content: space-between;
}

.ranking-name {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.rate {
    color: #79c0ff;
    font-weight: 800;
}

.rate-bar {
    background: #0d1116;
    border-radius: 999px;
    height: 0.32rem;
    margin-top: 0.45rem;
    overflow: hidden;
}

.rate-bar span {
    background: linear-gradient(90deg, #3b6790, #22c55e);
    border-radius: inherit;
    height: 100%;
    width: var(--rate);
}

.lopec-bar span {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.lopec-rank-score {
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
}

.ranking-list li.is-self {
    border-color: rgba(251, 191, 36, 0.38);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.self-tag {
    background: rgba(251, 191, 36, 0.16);
    border-radius: 999px;
    color: #fbbf24;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.4rem;
}

.roster-flash {
    background: rgba(121, 192, 255, 0.12);
    border: 1px solid rgba(121, 192, 255, 0.22);
    border-radius: 0.65rem;
    color: #9fd1ff;
    font-size: 0.78rem;
    font-weight: 700;
    margin: 0 0 0.8rem;
    padding: 0.55rem 0.7rem;
}

.roster-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.roster-header-actions form {
    margin: 0;
}

.roster-header-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.roster-lookup-form {
    align-items: end;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 0.85rem;
}

.roster-lookup-form label {
    display: grid;
    gap: 0.28rem;
}

.roster-lookup-form label span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.roster-lookup-form input {
    appearance: none;
    background: #121920;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    min-height: 2.35rem;
    padding: 0.5rem 0.65rem;
    width: 100%;
}

.roster-select-form {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}

.roster-select-header,
.roster-select-actions {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.roster-select-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-bottom: 0.85rem;
}

.roster-select-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.roster-select-card {
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.7rem;
    cursor: pointer;
    display: grid;
    gap: 0.18rem;
    padding: 0.7rem;
}

.roster-select-card:has(input:checked) {
    background: rgba(121, 192, 255, 0.14);
    border-color: rgba(121, 192, 255, 0.34);
}

.roster-select-card input {
    accent-color: var(--primary);
    margin-bottom: 0.2rem;
}

.roster-select-card strong,
.roster-select-card span {
    display: block;
}

.roster-select-card span {
    color: var(--muted);
    font-size: 0.72rem;
}

.roster-select-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.roster-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.roster-card {
    align-items: center;
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.7rem;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 3rem minmax(0, 1fr);
    padding: 0.65rem;
}

.roster-card strong,
.roster-card span {
    display: block;
}

.roster-card strong {
    font-size: 0.9rem;
}

.roster-card span {
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 0.16rem;
}

.lopec-score {
    color: #fbbf24;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    margin-top: 0.22rem;
}

.lopec-score.muted {
    color: var(--muted);
    font-weight: 700;
}

.roster-face {
    background: #0d1116;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    height: 3rem;
    object-fit: cover;
    object-position: top center;
    width: 3rem;
}

.roster-face.placeholder {
    align-items: center;
    display: flex;
    font-weight: 900;
    justify-content: center;
}

.homework-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.mini-section-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.mini-section-header h3 {
    font-size: 1rem;
    margin: 0;
}

.homework-list {
    display: grid;
    gap: 0.55rem;
}

.gold-table {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 0.65rem;
    overflow: hidden;
}

.gold-table > summary {
    color: #fbbf24;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 900;
    list-style: none;
    padding: 0.65rem 0.72rem;
}

.gold-table > summary::-webkit-details-marker {
    display: none;
}

.gold-table > div {
    display: grid;
    gap: 0.35rem 0.8rem;
    grid-template-columns: minmax(0, 1fr) auto;
    max-height: 16rem;
    overflow: auto;
    padding: 0 0.72rem 0.72rem;
}

.gold-table span,
.gold-table strong {
    font-size: 0.7rem;
}

.gold-table span {
    color: var(--muted);
}

.gold-table strong {
    color: #fbbf24;
}

.homework-card {
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.65rem;
    overflow: hidden;
}

.homework-summary {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.72rem;
}

.homework-card small {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

.homework-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.72rem 0.72rem;
}

.homework-chips span,
.homework-completed span {
    background: rgba(121, 192, 255, 0.12);
    border: 1px solid rgba(121, 192, 255, 0.14);
    border-radius: 999px;
    color: #9fd1ff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.26rem 0.5rem;
}

.homework-completed {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.72rem 0.5rem;
}

.homework-completed span {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.18);
    color: #86efac;
    opacity: 0.68;
    text-decoration: line-through;
}

.homework-edit-row {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.55rem 0.72rem;
}

.homework-edit-row .button,
.homework-dialog .icon-button {
    cursor: pointer;
}

.homework-modal[hidden] {
    display: none;
}

.homework-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 70;
}

.homework-modal-backdrop {
    background: rgba(6, 9, 13, 0.74);
    inset: 0;
    position: absolute;
}

.homework-dialog {
    background: rgba(26, 33, 42, 0.98);
    border: 1px solid var(--border-strong);
    border-radius: 0.9rem;
    box-shadow: 0 1.6rem 5rem rgba(0, 0, 0, 0.42);
    display: grid;
    gap: 0.75rem;
    max-height: min(80vh, 42rem);
    max-width: 460px;
    overflow: auto;
    padding: 1rem;
    position: relative;
    width: min(100%, 460px);
}

.homework-dialog-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.homework-dialog h4 {
    font-size: 1rem;
    margin: 0;
}

.homework-custom-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0 0 0.7rem;
}

.homework-custom-row .button.active {
    background: rgba(121, 192, 255, 0.18);
    border-color: rgba(121, 192, 255, 0.35);
    color: #9fd1ff;
}

.homework-options {
    display: grid;
    gap: 0.35rem;
    max-height: 14rem;
    overflow: auto;
    padding: 0;
}

.homework-option-row {
    align-items: center;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.homework-options label {
    align-items: center;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 0.55rem;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.48rem 0.55rem;
}

.homework-option-row[data-completed-option] label {
    border-color: rgba(148, 163, 184, 0.2);
}

.homework-options label.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.homework-options input {
    accent-color: var(--primary);
}

.homework-options span,
.homework-options em {
    font-size: 0.7rem;
}

.homework-options em {
    color: #fbbf24;
    font-style: normal;
    font-weight: 900;
}

.homework-options .homework-completed-tag {
    color: #94a3b8;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 800;
    margin-left: 0.35rem;
}

.homework-undo-clear-form {
    margin: 0;
}

.homework-mark-clear-toggle {
    align-items: center;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 0.45rem;
    color: #fbbf24;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    gap: 0.28rem;
    margin: 0;
    padding: 0.28rem 0.45rem;
    white-space: nowrap;
}

.homework-mark-clear-toggle input {
    accent-color: #fbbf24;
}

.homework-mark-clear-batch {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.65rem;
}

.admin-panel {
    margin-top: 0.9rem;
}

.admin-search {
    display: grid;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
}

.admin-search span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.admin-search input {
    background: #0d1116;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--text);
    padding: 0.55rem 0.7rem;
}

.admin-roster-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.75rem;
}

.admin-member-card {
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
}

.admin-member-card[hidden] {
    display: none;
}

.admin-member-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.admin-member-header > div {
    display: grid;
    gap: 0.2rem;
}

.admin-character-grid {
    display: grid;
    gap: 0.45rem;
}

.admin-character-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.6rem;
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
    padding: 0.55rem 0.6rem;
}

.admin-character-card > div {
    display: grid;
    gap: 0.15rem;
}

.recent-list {
    display: grid;
    gap: 0.55rem;
}

.recent-card {
    background: #121920;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.65rem;
    overflow: hidden;
}

.recent-card summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    list-style: none;
    padding: 0.72rem;
}

.recent-card summary::-webkit-details-marker {
    display: none;
}

.recent-card summary::after {
    color: #79c0ff;
    content: "+";
    flex: 0 0 auto;
    font-weight: 900;
}

.recent-card[open] summary {
    background: rgba(121, 192, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-card[open] summary::after {
    content: "-";
}

.recent-card strong,
.recent-card small,
.recent-card span,
.recent-card em {
    display: block;
}

.recent-card strong {
    font-size: 0.82rem;
}

.recent-card small {
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

.recent-count {
    background: rgba(121, 192, 255, 0.14);
    border: 1px solid rgba(121, 192, 255, 0.16);
    border-radius: 999px;
    color: #9fd1ff;
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 0.22rem 0.48rem;
}

.recent-detail {
    display: grid;
    gap: 0.65rem;
    padding: 0.72rem;
}

.recent-detail p {
    color: var(--muted);
    font-size: 0.72rem;
    margin: 0;
}

.recent-participants {
    display: grid;
    gap: 0.42rem;
}

.recent-participants span {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 0.55rem;
    padding: 0.5rem 0.55rem;
}

.recent-participants em {
    color: var(--muted);
    font-size: 0.68rem;
    font-style: normal;
    margin-top: 0.18rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.empty-state.compact {
    padding: 1rem;
}

@media (max-width: 900px) {
    .stats-grid,
    .content-grid,
    .dashboard-layout,
    .role-grid,
    .studio-hero {
        grid-template-columns: 1fr;
    }

    .side-column {
        position: static;
    }

    .filter-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-group,
    .filter-selects {
        width: 100%;
    }

    .filter-selects {
        display: grid;
        gap: 0.55rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-selects label {
        display: grid;
        gap: 0.28rem;
        min-width: 0;
    }

    .filter-selects select,
    .filter-selects .button {
        width: 100%;
    }

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

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

    .raid-create-form .wide-field,
    .raid-create-form .button,
    .raid-create-form .raid-create-submit-wrap {
        grid-column: 1 / -1;
    }

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

    .landing-hero {
        margin-left: 0;
        min-height: calc(100vh - 5rem);
    }

    .raid-main {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .topbar,
    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .roster-lookup-form {
        grid-template-columns: 1fr;
    }

    .raid-create-form {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

.table-scroll {
    margin-top: 0.75rem;
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0.7rem;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.data-table td {
    color: var(--text);
    font-size: 0.85rem;
}
