:root {
    --powell_gomoku-card: rgba(255, 251, 243, 0.84);
    --powell_gomoku-card-strong: rgba(255, 252, 247, 0.95);
    --powell_gomoku-surface: rgba(255, 255, 255, 0.56);
    --powell_gomoku-line: rgba(88, 55, 24, 0.48);
    --powell_gomoku-border: rgba(120, 87, 51, 0.18);
    --powell_gomoku-border-strong: rgba(120, 87, 51, 0.26);
    --powell_gomoku-shadow: 0 20px 60px rgba(91, 63, 35, 0.14);
    --powell_gomoku-shadow-soft: 0 14px 34px rgba(109, 74, 43, 0.1);
    --powell_gomoku-text: #2f2114;
    --powell_gomoku-muted: #7f6651;
    --powell_gomoku-wood-1: #d8af73;
    --powell_gomoku-wood-2: #c89054;
    --powell_gomoku-wood-3: #e8c38d;
    --powell_gomoku-accent: #cf6a32;
    --powell_gomoku-dark: #121212;
    --powell_gomoku-light: #f8f3ea;
}

body {
    color: var(--powell_gomoku-text);
}

.powell_gomoku-page {
    position: relative;
    max-width: var(--ls-width);
    margin: 0 auto;
    padding: 20px 0 50px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.powell_gomoku-page > * {
    position: relative;
    z-index: 1;
}

.powell_gomoku-hero,
.powell_gomoku-card {
    background: linear-gradient(180deg, var(--powell_gomoku-card-strong), var(--powell_gomoku-card));
    border: 1px solid var(--powell_gomoku-border);
    backdrop-filter: blur(14px);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.powell_gomoku-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 30px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 253, 249, 0.96), rgba(252, 240, 221, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
}

.powell_gomoku-hero-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.powell_gomoku-hero h1,
.powell_gomoku-card h2,
.powell_gomoku-card h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.powell_gomoku-hero h1 {
    font-size: 46px;
    line-height: 1;
    margin-bottom: 12px;
}

.powell_gomoku-desc,
.powell_gomoku-card p,
.powell_gomoku-muted,
.powell_gomoku-player-main span,
.powell_gomoku-hero-user span {
    color: var(--powell_gomoku-muted);
}

.powell_gomoku-desc {
    max-width: 680px;
    margin: 0;
    line-height: 1.7;
}

.powell_gomoku-hero-user {
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.82), rgba(252, 239, 216, 0.9));
    border: 1px solid rgba(123, 89, 51, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.powell_gomoku-page img.avatar {
    display: block;
    background: linear-gradient(145deg, rgba(255, 250, 241, 0.95), rgba(236, 220, 200, 0.88));
    box-shadow: 0 10px 24px rgba(91, 63, 35, 0.12);
}

.powell_gomoku-page .powell_gomoku-hero-user > img.avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 50%;
    object-fit: cover;
}

.powell_gomoku-hero-user strong,
.powell_gomoku-player-main strong,
.powell_gomoku-stat strong {
    display: block;
    font-size: 18px;
}

.powell_gomoku-chip,
.powell_gomoku-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.powell_gomoku-chip {
    color: #8f5a2e;
    background: rgba(223, 183, 127, 0.24);
}

.powell_gomoku-chip.is-on {
    color: #17644e;
    background: rgba(29, 159, 119, 0.16);
}

.powell_gomoku-chip.is-off {
    color: #9a4f35;
    background: rgba(210, 93, 49, 0.14);
}

.powell_gomoku-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(123, 89, 51, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.powell_gomoku-tab,
.powell_gomoku-btn,
.powell_gomoku-text-btn,
.powell_gomoku-segmented button,
.powell_gomoku-board-intersection,
.powell_gomoku-inline-form select,
.powell_gomoku-join-row input {
    font: inherit;
}

.powell_gomoku-tab,
.powell_gomoku-segmented button {
    border: 0;
    cursor: pointer;
    color: var(--powell_gomoku-muted);
    border-radius: 999px;
    padding: 8px 16px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.powell_gomoku-tab {
    background: transparent;
}

.powell_gomoku-segmented button {
    background: rgba(255, 251, 243, 0.78);
}

.powell_gomoku-tab.is-active,
.powell_gomoku-segmented button.is-active {
    color: #fff;
    background: linear-gradient(135deg, #d07236, #b8562d);
    box-shadow: 0 8px 18px rgba(197, 94, 46, 0.22);
}

.powell_gomoku-panel {
    display: none;
}

.powell_gomoku-panel.is-active {
    display: block;
}

.powell_gomoku-layout,
.powell_gomoku-data-grid {
    display: grid;
    gap: 22px;
}

.powell_gomoku-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    margin-bottom: 24px;
}

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

.powell_gomoku-card {
    border-radius: 28px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.powell_gomoku-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.powell_gomoku-card-head p {
    margin: 6px 0 0;
}

.powell_gomoku-inline-form,
.powell_gomoku-room-meta,
.powell_gomoku-lobby-actions,
.powell_gomoku-join-row,
.powell_gomoku-actions,
.powell_gomoku-segmented {
    display: flex;
    gap: 10px;
    align-items: center;
}

.powell_gomoku-inline-form label {
    font-size: 13px;
    color: var(--powell_gomoku-muted);
}

.powell_gomoku-inline-form select,
.powell_gomoku-join-row input {
    border: 1px solid rgba(112, 81, 48, 0.14);
    background: rgba(255, 255, 255, 0.75);
    color: var(--powell_gomoku-text);
    border-radius: 14px;
    padding: 6px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.powell_gomoku-join-row input {
    flex: 1;
}

.powell_gomoku-btn,
.powell_gomoku-text-btn {
    border: 0;
    cursor: pointer;
}

.powell_gomoku-btn {
    border-radius: 14px;
    padding: 8px 18px;
    color: var(--powell_gomoku-text);
    background: rgba(110, 82, 50, 0.1);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.powell_gomoku-btn:disabled,
.powell_gomoku-text-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.powell_gomoku-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #d07236, #b8562d);
}

.powell_gomoku-text-btn {
    background: transparent;
    color: var(--powell_gomoku-accent);
    padding: 0;
    transition: opacity 0.18s ease, color 0.18s ease;
}

.powell_gomoku-tab:hover,
.powell_gomoku-btn:hover:not(:disabled),
.powell_gomoku-segmented button:hover,
.powell_gomoku-text-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.powell_gomoku-tab:hover,
.powell_gomoku-btn:hover:not(:disabled),
.powell_gomoku-segmented button:hover {
    box-shadow: 0 12px 24px rgba(91, 63, 35, 0.12);
}

.powell_gomoku-text-btn:hover:not(:disabled) {
    opacity: 0.72;
}

.powell_gomoku-tab:focus-visible,
.powell_gomoku-btn:focus-visible,
.powell_gomoku-text-btn:focus-visible,
.powell_gomoku-segmented button:focus-visible,
.powell_gomoku-inline-form select:focus-visible,
.powell_gomoku-join-row input:focus-visible,
.powell_gomoku-board-intersection:focus-visible {
    outline: 2px solid rgba(208, 114, 54, 0.42);
    outline-offset: 2px;
}

.powell_gomoku-inline-form select:focus,
.powell_gomoku-join-row input:focus {
    border-color: rgba(208, 114, 54, 0.42);
    box-shadow: 0 0 0 3px rgba(208, 114, 54, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

.powell_gomoku-board-stage {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    min-height: 620px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.powell_gomoku-board {
    position: relative;
    width: 100%;
    max-width: 785px;
    aspect-ratio: 1;
    margin: 0 auto;
    box-sizing: border-box;
}

.powell_gomoku-board-grid {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.42), transparent 24%),
        radial-gradient(circle at 80% 10%, rgba(137, 85, 36, 0.1), transparent 26%),
        linear-gradient(135deg, var(--powell_gomoku-wood-3), var(--powell_gomoku-wood-1) 42%, var(--powell_gomoku-wood-2) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -10px 24px rgba(122, 74, 24, 0.14);
}

.powell_gomoku-board-line,
.powell_gomoku-board-star,
.powell_gomoku-board-intersection,
.powell_gomoku-stone {
    position: absolute;
}

.powell_gomoku-board-line {
    background: var(--powell_gomoku-line);
}

.powell_gomoku-board-line.is-horizontal {
    left: 6.2%;
    right: 6.2%;
    height: 1px;
    transform: translateY(-0.5px);
}

.powell_gomoku-board-line.is-vertical {
    top: 6.2%;
    bottom: 6.2%;
    width: 1px;
    transform: translateX(-0.5px);
}

.powell_gomoku-board-star {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: rgba(76, 47, 20, 0.58);
}

.powell_gomoku-board-intersection {
    width: 6.7%;
    height: 6.7%;
    margin: -3.35% 0 0 -3.35%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.powell_gomoku-board-intersection.is-disabled {
    cursor: default;
}

.powell_gomoku-stone {
    top: 50%;
    left: 50%;
    width: 72%;
    height: 72%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.powell_gomoku-stone.is-black {
    background: radial-gradient(circle at 28% 26%, #595959, #1c1c1c 58%, #050505 100%);
}

.powell_gomoku-stone.is-white {
    background: radial-gradient(circle at 28% 26%, #ffffff, #f3efe7 52%, #d9d2c6 100%);
}

.powell_gomoku-stone.is-last::after {
    content: '';
    position: absolute;
    inset: 38%;
    border-radius: 50%;
    background: #e9502f;
}

.powell_gomoku-board-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(252, 245, 235, 0.54), rgba(251, 242, 226, 0.88));
}

.powell_gomoku-board-mask.is-hidden {
    display: none;
}

.powell_gomoku-mask-card {
    max-width: 320px;
    text-align: center;
    padding: 28px 26px;
    border-radius: 24px;
    background: rgba(255, 252, 247, 0.9);
    box-shadow: 0 18px 34px rgba(109, 74, 43, 0.16);
    border: 1px solid rgba(123, 89, 51, 0.1);
}

.powell_gomoku-mask-card h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.powell_gomoku-mask-card p {
    margin: 0 0 18px;
    line-height: 1.7;
}

.powell_gomoku-actions {
    margin-top: 18px;
    justify-content: flex-end;
}

.powell_gomoku-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.powell_gomoku-player-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.powell_gomoku-player-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    background: var(--powell_gomoku-surface);
    border: 1px solid rgba(122, 94, 61, 0.1);
    box-shadow: var(--powell_gomoku-shadow-soft);
}

.powell_gomoku-player-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.powell_gomoku-page .powell_gomoku-player-main > img.avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    object-fit: cover;
}

.powell_gomoku-ai-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(94, 121, 159, 0.14);
    color: #3e5f8a;
    font-size: 20px;
}

.powell_gomoku-badge {
    background: rgba(110, 82, 50, 0.1);
    color: var(--powell_gomoku-muted);
}

.powell_gomoku-badge.is-black {
    color: #fff;
    background: rgba(25, 25, 25, 0.9);
}

.powell_gomoku-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.powell_gomoku-stat {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--powell_gomoku-surface);
    border: 1px solid rgba(122, 94, 61, 0.1);
    box-shadow: var(--powell_gomoku-shadow-soft);
}

.powell_gomoku-stat span {
    display: block;
    font-size: 12px;
    color: var(--powell_gomoku-muted);
    margin-bottom: 8px;
}

.powell_gomoku-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.powell_gomoku-feed-scroll {
    max-height: 790px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

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

.powell_gomoku-feed-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(122, 94, 61, 0.2);
}

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

.powell_gomoku-load-more {
    margin-top: 14px;
    padding: 12px 14px;
    text-align: center;
    color: var(--powell_gomoku-muted);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px dashed rgba(122, 94, 61, 0.16);
}

.powell_gomoku-load-more.is-loading {
    color: var(--powell_gomoku-accent);
}

.powell_gomoku-load-more.is-end {
    opacity: 0.82;
}

.powell_gomoku-load-more.is-hidden {
    display: none;
}

.powell_gomoku-rank-item,
.powell_gomoku-record-item,
.powell_gomoku-record-head {
    display: grid;
    align-items: center;
    gap: 12px;
}

.powell_gomoku-rank-item {
    grid-template-columns: 46px minmax(0, 1fr) 74px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--powell_gomoku-surface);
    border: 1px solid rgba(122, 94, 61, 0.1);
}

.powell_gomoku-rank-index {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #d07236, #b8562d);
}

.powell_gomoku-rank-user,
.powell_gomoku-record-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.powell_gomoku-page .powell_gomoku-rank-user > img.avatar,
.powell_gomoku-page .powell_gomoku-record-user > img.avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.powell_gomoku-rank-user span,
.powell_gomoku-record-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.powell_gomoku-record-head,
.powell_gomoku-record-item {
    grid-template-columns: minmax(0, 1.2fr) 92px minmax(0, 1fr) 72px 72px;
}

.powell_gomoku-record-head {
    padding: 0 10px 8px;
    color: var(--powell_gomoku-muted);
    font-size: 12px;
}

.powell_gomoku-record-item {
    padding: 14px 12px;
    border-radius: 18px;
    background: var(--powell_gomoku-surface);
    border: 1px solid rgba(122, 94, 61, 0.1);
}

.powell_gomoku-record-mode,
.powell_gomoku-record-result {
    font-size: 13px;
    font-weight: 700;
}

.powell_gomoku-record-result.is-win {
    color: #1b7f58;
}

.powell_gomoku-record-result.is-lose {
    color: #b04a33;
}

.powell_gomoku-record-result.is-draw {
    color: #8b6d4f;
}

.powell_gomoku-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--powell_gomoku-muted);
}

@media (max-width: 1080px) {
    .powell_gomoku-layout,
    .powell_gomoku-data-grid,
    .powell_gomoku-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .powell_gomoku-hero-user {
        min-width: 0;
    }

    .powell_gomoku-hero {
        align-items: stretch;
    }
}

@media (max-width: 760px) {
    .powell_gomoku-page {
        padding: 24px 14px 44px;
        border-radius: 28px;
    }

    .powell_gomoku-card,
    .powell_gomoku-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .powell_gomoku-tabs {
        width: 100%;
        justify-content: center;
    }

    .powell_gomoku-card-head,
    .powell_gomoku-inline-form,
    .powell_gomoku-room-meta,
    .powell_gomoku-join-row,
    .powell_gomoku-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .powell_gomoku-board-stage {
        min-height: 420px;
    }

    .powell_gomoku-status-grid,
    .powell_gomoku-record-head,
    .powell_gomoku-record-item {
        grid-template-columns: 1fr 1fr;
    }

    .powell_gomoku-feed-scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}
