:root {
    --bg-top: #f3e6cc;
    --bg-bottom: #f8f3eb;
    --surface: rgba(255, 250, 241, 0.92);
    --surface-strong: #fff7eb;
    --surface-soft: rgba(255, 255, 255, 0.64);
    --text: #2b2118;
    --muted: #6d5e50;
    --line: rgba(74, 52, 28, 0.1);
    --accent: #f28d4f;
    --accent-deep: #dc6f2d;
    --accent-soft: #ffe5c7;
    --green: #317c66;
    --green-soft: #d6f0e7;
    --blue-soft: #dbefff;
    --shadow-lg: 0 24px 60px rgba(76, 51, 18, 0.15);
    --shadow-md: 0 16px 40px rgba(76, 51, 18, 0.1);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 211, 146, 0.45), transparent 34%),
        radial-gradient(circle at top right, rgba(177, 222, 255, 0.36), transparent 28%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before,
body::after {
    position: fixed;
    content: "";
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(4px);
}

body::before {
    width: 240px;
    height: 240px;
    top: 112px;
    right: -68px;
    background: rgba(255, 182, 130, 0.18);
}

body::after {
    width: 280px;
    height: 280px;
    bottom: -72px;
    left: -80px;
    background: rgba(122, 207, 175, 0.16);
}

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

button,
input,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.page-shell {
    position: relative;
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 24px 72px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    color: #ffffff;
    font-family: "Jua", sans-serif;
    font-size: 1.2rem;
    background: linear-gradient(145deg, #ff9f5c 0%, #e86f3c 100%);
    box-shadow: var(--shadow-md);
}

.brand__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand__copy strong {
    font-family: "Jua", sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.brand__copy span {
    color: var(--muted);
    font-size: 0.9rem;
}

.site-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(49, 124, 102, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--green);
    font-weight: 700;
}

.user-chip {
    border-color: rgba(242, 141, 79, 0.2);
    color: var(--accent-deep);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    color: #ffffff;
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 14px 28px rgba(220, 111, 45, 0.22);
}

.button--ghost {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.75);
}

.button--small {
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.95rem;
}

.button--full {
    width: 100%;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash {
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
}

.flash--success {
    background: rgba(214, 240, 231, 0.92);
    border-color: rgba(49, 124, 102, 0.2);
    color: #16533f;
}

.flash--error {
    background: rgba(255, 229, 225, 0.92);
    border-color: rgba(224, 96, 74, 0.22);
    color: #8a3427;
}

.flash--warning {
    background: rgba(255, 244, 215, 0.92);
    border-color: rgba(201, 132, 30, 0.2);
    color: #8a5c16;
}

.catalog,
.detail-layout,
.auth-layout,
.fallback-play {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}

.detail-layout__copy h1,
.auth-copy h1,
.fallback-play h1 {
    margin: 16px 0 12px;
    font-family: "Jua", sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.1;
    font-weight: 400;
}

.auth-copy p,
.detail-layout__copy p,
.fallback-play p {
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

.catalog {
    padding: 22px;
}

.catalog__toolbar {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 88px;
    padding: 18px 22px 16px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--line);
}

.toolbar-field span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.toolbar-field select,
.toolbar-field input {
    border: 0;
    outline: none;
    padding: 0;
    color: var(--text);
    background: transparent;
    font-size: 1.12rem;
    font-weight: 700;
}

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

.game-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-card__media {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: var(--shadow-md);
}

.game-card__media img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.game-card:hover .game-card__media img {
    transform: scale(1.03);
}

.game-card__body {
    padding: 2px 6px;
}

.game-card__meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.game-card__meta span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    font-size: 0.86rem;
    font-weight: 700;
}

.game-card h3 {
    margin: 0 0 8px;
    font-size: 1.65rem;
    line-height: 1.22;
    letter-spacing: -0.02em;
}

.game-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.game-card__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.empty-state {
    margin-top: 18px;
    padding: 18px 22px;
    border-radius: 22px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.8);
    border: 1px dashed rgba(74, 52, 28, 0.18);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: 28px;
    padding: 28px;
}

.auth-copy {
    padding: 18px 12px 18px 6px;
}

.auth-copy__list {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.auth-copy__list li {
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.56);
}

.auth-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.56);
}

.auth-card__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: rgba(247, 236, 220, 0.92);
}

.auth-tab {
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-weight: 800;
}

.auth-tab.is-active {
    color: #ffffff;
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 12px 24px rgba(220, 111, 45, 0.18);
}

.auth-panel {
    padding: 12px 4px 6px;
}

.auth-panel h2 {
    margin: 0 0 16px;
    font-family: "Jua", sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
}

.auth-panel[hidden] {
    display: none !important;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field span {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
}

.form-field select {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
}

.form-field input:focus,
.form-field select:focus {
    border-color: rgba(242, 141, 79, 0.56);
    box-shadow: 0 0 0 4px rgba(242, 141, 79, 0.12);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
    gap: 26px;
    padding: 24px;
}

.detail-layout__media img {
    width: 100%;
    border-radius: 28px;
    box-shadow: var(--shadow-md);
}

.detail-layout__copy {
    padding: 8px 6px;
}

.detail-info {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.detail-info div {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
}

.detail-info strong {
    font-size: 0.92rem;
}

.detail-info span {
    color: var(--muted);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.admin-panel {
    margin-top: 24px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
}

.admin-panel h2 {
    margin: 0 0 14px;
    font-family: "Jua", sans-serif;
    font-size: 1.55rem;
    font-weight: 400;
}

.admin-form {
    display: grid;
    gap: 14px;
    max-width: 360px;
}

.fallback-play {
    max-width: 760px;
    margin: 28px auto 0;
    padding: 42px 32px;
    text-align: center;
}

.fallback-play .button {
    margin-top: 20px;
}

@media (max-width: 1120px) {
    .catalog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

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

    .site-header {
        flex-direction: column;
        align-items: stretch;
    }

    .site-header__actions {
        justify-content: flex-start;
    }

    .catalog,
    .auth-layout,
    .detail-layout,
    .fallback-play {
        padding: 20px;
    }

    .catalog__toolbar {
        grid-template-columns: 1fr;
    }

    .catalog__grid {
        grid-template-columns: 1fr;
    }

    .toolbar-field {
        min-height: 76px;
        padding-inline: 18px;
    }

    .game-card h3 {
        font-size: 1.45rem;
    }

    .game-card__actions,
    .detail-actions {
        flex-direction: column;
    }

    .button,
    .button--small {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
