:root {
    --bg: #17151d;
    --panel: #fffaf0;
    --ink: #211e27;
    --muted: #746e78;
    --line: #ddd4c8;
    --red: #e23b38;
    --yellow: #f2c335;
    --green: #31a85b;
    --blue: #3182d8;
    --purple: #663399;
    --shadow: 0 17px 45px #0004
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(circle at 50% 0, #37303f, #15131a 65%);
    color: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif
}

button,
input,
select {
    font: inherit
}

button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0 14px;
    background: #fff;
    color: var(--ink);
    cursor: pointer
}

button:disabled {
    opacity: .4;
    cursor: not-allowed
}

.primary {
    background: #5d2f91;
    border-color: #5d2f91;
    color: #fff;
    font-weight: 900
}

.wide {
    width: 100%
}

.hidden {
    display: none !important
}

.shell {
    min-height: 100vh;
    padding: 18px 22px
}

header,
#setupPanel,
.layout {
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px
}

h1,
h2,
p {
    margin: 0
}

h1 {
    display: flex;
    font-size: 44px;
    font-style: italic;
    letter-spacing: -.15em;
    text-shadow: 3px 3px 0 #fff
}

h1 i:nth-child(1) {
    color: var(--red)
}

h1 i:nth-child(2) {
    color: var(--yellow)
}

h1 i:nth-child(3) {
    color: var(--blue)
}

.eyebrow {
    margin-bottom: 4px;
    color: #e3bcff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em
}

.status {
    padding: 7px 11px;
    border: 1px solid #8e70a7;
    border-radius: 999px;
    background: #2f2638;
    font-size: 12px;
    font-weight: 900
}

.modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    margin-bottom: 13px
}

.mode {
    display: grid;
    height: auto;
    padding: 17px;
    text-align: left
}

.mode b {
    font-size: 18px
}

.mode span {
    color: var(--muted);
    font-size: 13px
}

.mode.active {
    border-color: #864ab8;
    box-shadow: inset 0 0 0 1px #864ab8
}

.panel {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow)
}

.setup {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr auto;
    align-items: end;
    gap: 15px
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900
}

input,
select {
    min-height: 42px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink)
}

.layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 11px
}

.layout aside {
    display: grid;
    align-content: start;
    gap: 10px
}

.main {
    display: grid;
    grid-template-columns: minmax(480px, 1.35fr) minmax(330px, 1fr);
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    align-content: start;
    gap: 10px
}

.notice {
    grid-column: 1/-1;
    padding: 9px 13px;
    border: 1px solid #8f6aaa;
    border-radius: 10px;
    background: #32263d;
    color: #f0ddff;
    font-size: 13px;
    font-weight: 800
}

.players-panel {
    grid-column: 1/-1;
    padding: 10px 12px
}

.players-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px
}

.players-panel-head .eyebrow {
    margin: 0
}

.players-panel-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900
}

.room-code {
    margin: 5px 0 10px;
    padding: 9px;
    border-radius: 10px;
    background: #221b2a;
    color: #fff;
    font-size: 29px;
    font-weight: 900;
    letter-spacing: .16em;
    text-align: center
}

.rules p:last-child {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65
}

.table {
    grid-column: 1;
    grid-row: 3/6;
    position: relative;
    overflow: hidden;
    min-height: 370px;
    background: radial-gradient(ellipse, #ede2ca, #d5c19d);
    border: 6px solid #63432f
}

.table:after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid #fff8;
    border-radius: 9px;
    pointer-events: none
}

.table-head,
.action-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.table-head {
    position: relative;
    z-index: 2;
    font-size: 13px;
    font-weight: 900
}

.players {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px
}

.player {
    min-width: 0;
    padding: 7px;
    border: 1px solid #c9b590;
    border-radius: 8px;
    background: #fff9
}

.player.turn {
    border-color: #6b2f9c;
    box-shadow: 0 0 0 2px #6b2f9c55
}

.player-name {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    font-size: 13px;
    font-weight: 900
}

.player-meta {
    min-height: 15px;
    color: var(--muted);
    font-size: 10px
}

.kick-player {
    min-height: 25px;
    margin-top: 5px;
    padding: 0 8px;
    font-size: 10px
}

.mini-cards {
    display: flex;
    margin-top: 3px
}

.mini-card {
    width: 12px;
    height: 20px;
    margin-right: -6px;
    border: 2px solid #fff;
    border-radius: 3px;
    background: repeating-linear-gradient(45deg, #623295, #623295 3px, #fff 3px, #fff 4px)
}

.center {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin: 24px 0 13px
}

.draw-pile,
.uno-card {
    width: 78px;
    height: 112px;
    border-radius: 12px;
    transform: rotate(-3deg);
    box-shadow: 0 7px 14px #0004
}

.draw-pile {
    display: grid;
    align-content: center;
    background: #25202a;
    border: 5px solid #fff;
    color: #fff
}

.draw-pile span {
    font-size: 23px;
    font-weight: 1000;
    font-style: italic
}

.draw-pile small {
    font-size: 10px
}

.uno-card {
    display: grid;
    position: relative;
    align-content: center;
    justify-content: center;
    padding: 7px;
    border: 5px solid #fff;
    color: #fff;
    font-weight: 1000;
    text-align: center;
    transform: rotate(4deg)
}

.uno-card.red {
    background: var(--red)
}

.uno-card.yellow {
    background: #e5b414;
    color: #2b2417
}

.uno-card.green {
    background: var(--green)
}

.uno-card.blue {
    background: var(--blue)
}

.uno-card.wild {
    background: conic-gradient(var(--red), var(--yellow), var(--green), var(--blue), var(--red))
}

.uno-card .value {
    font-size: 22px
}

.uno-card .symbol {
    font-size: 31px
}

.current-color {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 13px;
    font-weight: 900
}

.penalty {
    position: relative;
    z-index: 2;
    margin: 10px auto 0;
    width: max-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    background: #b63532;
    color: #fff;
    font-size: 12px;
    font-weight: 900
}

.action-panel {
    grid-column: 2;
    grid-row: 3;
    min-height: 104px
}

.action-panel h2,
.hand-panel h2,
.log-panel h2 {
    font-size: 18px
}

.timer {
    position: relative;
    width: 100px;
    padding-bottom: 7px;
    text-align: right
}

.timer:after,
.timer i {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    border-radius: 4px
}

.timer:after {
    width: 100%;
    background: #ddd
}

.timer i {
    z-index: 1;
    width: 100%;
    background: #7134a0
}

.actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.actions button {
    min-height: 36px;
    font-size: 12px;
    font-weight: 900
}

.challenge {
    background: #d9473f;
    color: #fff;
    border-color: #d9473f
}

.accept {
    background: #27212d;
    color: #fff;
    border-color: #27212d
}

.hand-panel {
    grid-column: 2;
    grid-row: 4;
    min-height: 185px
}

.uno-button {
    min-height: 38px;
    background: #e23b38;
    border: 3px solid #f1c532;
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 1000;
    transform: rotate(-3deg)
}

.uno-button.called {
    background: #31a85b
}

.hand {
    display: flex;
    align-items: flex-end;
    min-height: 122px;
    padding: 12px 6px 3px;
    overflow-x: auto
}

.hand .uno-card {
    flex: 0 0 68px;
    width: 68px;
    height: 98px;
    margin-right: -16px;
    transition: .16s
}

.hand button.uno-card:hover:not(:disabled) {
    z-index: 3;
    transform: translateY(-10px) rotate(0)
}

.hand button.uno-card.playable {
    box-shadow: 0 0 0 3px #743ba7, 0 8px 16px #0004
}

.hand-count {
    font-size: 13px
}

.log-panel {
    grid-column: 2;
    grid-row: 5;
    min-height: 0
}

.log {
    display: grid;
    gap: 5px;
    max-height: 105px;
    overflow: auto
}

.log.collapsed {
    display: none
}

.log-item {
    padding: 6px 8px;
    border-radius: 7px;
    background: #eee7db;
    font-size: 11px
}

.small {
    min-height: 30px;
    font-size: 11px
}

.modal {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #0009
}

.modal-card {
    width: min(430px, 100%);
    text-align: center
}

.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 17px 0
}

.color-grid button {
    height: 62px;
    color: #fff;
    font-weight: 900
}

.color-grid [data-color=red] {
    background: var(--red)
}

.color-grid [data-color=yellow] {
    background: #dcae17;
    color: #211
}

.color-grid [data-color=green] {
    background: var(--green)
}

.color-grid [data-color=blue] {
    background: var(--blue)
}

@media(max-width:1100px) {
    .players {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media(max-width:960px) {
    .shell {
        padding: 14px
    }

    .layout {
        grid-template-columns: 190px minmax(0, 1fr)
    }

    .main {
        grid-template-columns: 1fr
    }

    .notice,
    .players-panel,
    .table,
    .action-panel,
    .hand-panel,
    .log-panel {
        grid-column: 1;
        grid-row: auto
    }

    .table {
        min-height: 360px
    }
}

@media(max-width:720px) {

    .layout,
    .setup {
        grid-template-columns: 1fr
    }

    .players {
        grid-template-columns: 1fr 1fr
    }

    .layout aside {
        grid-template-columns: 1fr 1fr
    }

    .rules {
        min-height: 100%
    }
}

@media(max-width:520px) {

    header,
    .action-head {
        align-items: flex-start;
        flex-direction: column
    }

    .modes,
    .layout aside {
        grid-template-columns: 1fr
    }

    .center {
        gap: 15px
    }

    .draw-pile,
    .uno-card {
        width: 66px;
        height: 95px
    }

    .hand .uno-card {
        flex-basis: 62px
    }

    .players {
        grid-template-columns: 1fr 1fr
    }
}
.spectator-action-note{line-height:1.6}
.layout>.room-role-banner{grid-column:1/-1}
