* {
    box-sizing: border-box
}

:root {
    --bg: #0b0d13;
    --panel: #141823;
    --panel2: #1a2030;
    --line: #282f40;
    --text: #f2f4f8;
    --muted: #929bad;
    --accent: #a78bfa;
    --accent2: #7c5ce7
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Google Sans', sans-serif;
    min-height: 100vh
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% -20%, #29204a66, transparent 55%);
    z-index: -1
}

button,
input {
    font: inherit
}

button {
    cursor: pointer;
    color: inherit
}

.hidden {
    display: none !important
}

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

.small {
    font-size: 12px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 700 18px 'Google Sans', sans-serif;
    letter-spacing: 2px;
    color: var(--text);
    text-decoration: none
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #a78bfa, #6846cb);
    color: white;
    font: 800 20px 'Google Sans', sans-serif;
    letter-spacing: 0
}

.landing {
    max-width: 1080px;
    margin: auto;
    padding: 34px 28px;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.hero {
    width: min(100%, 510px);
    margin: auto;
    padding: 45px 0 60px
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #a78bfa
}

.hero h1 {
    font: 700 clamp(52px, 9vw, 82px)/.98 'Google Sans', sans-serif;
    letter-spacing: -4px;
    margin: 16px 0
}

.hero h1 em {
    color: #a78bfa;
    font-style: normal
}

.lead {
    font-size: 17px;
    line-height: 1.6;
    max-width: 440px;
    margin-bottom: 28px
}

.panel {
    background: linear-gradient(145deg, #171c29, #121621);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 20px 60px #0003
}

.entry-panel {
    padding: 25px
}

.entry-panel label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px
}

.entry-panel input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--line);
    background: #0e121c;
    border-radius: 10px;
    color: white;
    outline: none;
    margin-bottom: 13px
}

.entry-panel input:focus {
    border-color: var(--accent)
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 13px 17px;
    font-weight: 700;
    transition: .18s
}

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

.primary {
    background: linear-gradient(135deg, #a78bfa, #7957df);
    color: white
}

.primary:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px)
}

.secondary {
    background: #252b3b;
    border: 1px solid #343d52
}

.wide {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.or {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
    margin: 20px 0
}

.or:before,
.or:after {
    content: '';
    height: 1px;
    background: var(--line);
    flex: 1
}

.join-row {
    display: flex;
    gap: 9px
}

.join-row input {
    margin: 0;
    flex: 1
}

.code-input {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 800
}

.entry-panel .small {
    margin-top: 15px
}

.text-button {
    background: none;
    border: 0;
    color: #c7b9ff;
    padding: 20px 0 10px
}

.rules {
    font-size: 13px;
    line-height: 1.6;
    color: #bdc3d1
}

.debug-tag {
    font-size: 10px;
    color: #e7c66c;
    margin-top: 20px;
    letter-spacing: 1px
}

footer {
    font-size: 11px;
    color: #687184;
    text-align: center;
    padding: 18px
}

footer span {
    color: #a78bfa
}

.page-shell {
    max-width: 800px;
    margin: auto;
    padding: 28px
}

.topbar,
.game-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 55px
}

.pill {
    font-size: 10px;
    letter-spacing: 1px;
    color: #b9a8ff;
    border: 1px solid #51417b;
    border-radius: 30px;
    padding: 8px 12px
}

.lobby-wrap {
    max-width: 550px;
    margin: auto;
    padding: 34px
}

.lobby-wrap h1 {
    font: 700 38px 'Google Sans', sans-serif;
    margin: 8px 0
}

.accent {
    color: #b39bff
}

.code-display {
    font: 700 38px 'Google Sans', sans-serif;
    letter-spacing: 10px;
    background: #0c1019;
    border: 1px dashed #64529a;
    border-radius: 12px;
    padding: 17px;
    text-align: center;
    margin: 25px 0 32px;
    color: #c6b5ff
}

.code-display button {
    font-size: 18px;
    background: none;
    border: 0;
    color: #a78bfa;
    letter-spacing: 0
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.section-head h2,
.section-head h3 {
    font: 600 18px 'Google Sans', sans-serif;
    margin: 0
}

.players-list {
    margin-bottom: 22px
}

.player-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid #252b38
}

.seat {
    font-size: 10px;
    color: #626d80;
    width: 20px
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #29233d;
    color: #c5b3ff;
    display: grid;
    place-items: center;
    font-weight: 800
}

.host-tag {
    font-size: 9px;
    color: #d6bd70;
    border: 1px solid #6d5b2c;
    padding: 4px 6px;
    border-radius: 5px
}

.connection {
    font-size: 10px;
    color: #a56b6b;
    margin-left: auto
}

.connection.online {
    color: #68c99b
}

.lobby-wrap .small {
    text-align: center;
    margin-bottom: 0
}

.game-shell {
    max-width: 1500px;
    margin: auto;
    padding: 22px 28px
}

.game-topbar {
    margin-bottom: 20px
}

.round-label {
    font: 700 13px 'Google Sans', sans-serif;
    letter-spacing: 2px
}

.round-label b {
    color: #b8a1ff;
    font-size: 18px
}

.round-label span {
    color: #687184
}

.room-label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 1px
}

.room-label b {
    color: #c5b4ff
}

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

.side-panel {
    padding: 18px;
    height: calc(100vh - 100px);
    min-height: 650px;
    display: flex;
    flex-direction: column
}

.side-panel .section-head {
    margin-bottom: 10px
}

.opponent {
    padding: 12px 0;
    border-bottom: 1px solid #252b38
}

.opponent.active {
    background: #a78bfa12;
    margin: 0 -9px;
    padding: 12px 9px;
    border-radius: 9px
}

.opponent-head {
    display: flex;
    align-items: center;
    gap: 9px
}

.opponent-head>div {
    display: flex;
    flex-direction: column;
    gap: 3px
}

.opponent-head b {
    font-size: 12px
}

.opponent-head small,
.opponent-meta {
    font-size: 10px;
    color: var(--muted)
}

.opponent-head .connection {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #714c4c
}

.opponent-head .connection.online {
    background: #55c68d
}

.opponent-items {
    display: flex;
    gap: 5px;
    margin: 9px 0 4px 41px;
    flex-wrap: wrap
}

.opponent-items span {
    color: var(--item-color);
    font-size: 15px
}

.opponent-meta {
    margin-left: 41px
}

.history-wrap {
    margin-top: auto;
    padding-top: 16px
}

.history {
    max-height: 190px;
    overflow: auto
}

.history-line {
    font-size: 10px;
    color: #9da6b7;
    padding: 6px 0;
    border-bottom: 1px solid #252b38
}

.center-column {
    display: flex;
    flex-direction: column;
    gap: 17px;
    min-width: 0
}

.turn-banner {
    height: 46px;
    background: #1a2030;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    font-size: 12px;
    color: #b6bdcb
}

.turn-banner.my-turn {
    border-color: #7258b7;
    background: #211d32;
    color: #e1d8ff
}

.turn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #778196
}

.my-turn .turn-dot {
    background: #b49aff;
    box-shadow: 0 0 12px #a78bfa
}

.turn-banner strong {
    margin-left: auto;
    font: 700 18px 'Google Sans', sans-serif;
    color: white
}

.market-section {
    padding: 5px 2px
}

.market-section .section-head {
    margin-bottom: 13px
}

.market-section h2,
.my-section h2,
.actions-panel h2 {
    font: 600 22px 'Google Sans', sans-serif;
    margin: 5px 0 0
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px
}

.market-card,
.item-card {
    background: #171d2a;
    border: 1px solid var(--line);
    border-radius: 13px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: .18s;
    padding: 10px
}

.market-card .item-symbol,
.item-symbol {
    font-size: 28px;
    color: var(--item-color)
}

.market-card b,
.item-card b {
    font-size: 11px
}

.market-card small,
.item-card small {
    font-size: 10px;
    color: var(--muted)
}

.market-card.can-pick:hover {
    border-color: var(--item-color);
    transform: translateY(-3px);
    background: #222a3b
}

.market-card:disabled {
    opacity: .55;
    cursor: default
}

.my-section {
    padding: 18px 20px
}

.score-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px
}

.score-chip span {
    font-size: 9px;
    letter-spacing: 1px
}

.score-chip b {
    font: 700 23px 'Google Sans', sans-serif;
    color: #c4afff
}

.items-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 78px
}

.item-card {
    min-width: 98px;
    min-height: 88px;
    position: relative
}

.item-card.selectable {
    cursor: pointer
}

.item-card.selectable:hover,
.item-card.selected {
    border-color: #a78bfa;
    background: #29223d
}

.item-card.selected:after {
    content: '✓';
    position: absolute;
    right: 7px;
    top: 5px;
    color: #bca8ff
}

.mission-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #101520;
    border: 1px solid #292d42;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 14px
}

.mission-box b {
    font-size: 13px
}

.mission-box p {
    margin: 4px 0 0
}

.mission-progress {
    font-size: 11px;
    color: #bca8ff;
    text-align: right
}

.actions-panel {
    padding: 18px 20px
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

.action-btn {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #1a2030;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    text-align: left
}

.action-btn>span {
    font-size: 20px;
    color: #b49cff
}

.action-btn b {
    font-size: 12px
}

.action-btn small {
    font-size: 10px;
    color: var(--muted)
}

.action-btn.chosen {
    border-color: #9b7bea;
    background: #28213c
}

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

.action-help {
    font-size: 11px;
    padding-top: 12px;
    min-height: 28px
}

.action-help .btn {
    margin-left: 12px;
    padding: 8px 12px;
    font-size: 11px
}

.modal,
.overlay,
.result-overlay {
    position: fixed;
    inset: 0;
    background: #05070bc9;
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 10
}

.modal-card {
    width: min(100%, 430px);
    padding: 28px;
    position: relative
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 12px;
    border: 0;
    background: none;
    font-size: 25px;
    color: var(--muted)
}

.modal-card h2 {
    font: 600 24px 'Google Sans', sans-serif
}

.target-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #1a2030;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 8px 0;
    text-align: left
}

.target-row small {
    color: var(--muted);
    margin-left: auto
}

.result-card {
    width: min(100%, 620px);
    padding: 30px
}

.result-card h1 {
    font: 700 32px 'Google Sans', sans-serif
}

.result-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--line)
}

.result-row .muted {
    grid-column: 2
}

.result-row strong {
    grid-column: 3;
    grid-row: 1/3;
    color: #c5b1ff
}

.result-row.winner {
    background: #33294b;
    border-radius: 10px
}

.rank {
    color: #b7a0ff;
    font-weight: 800
}

.result-card .btn {
    margin-top: 22px
}

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    background: #2a3040;
    border: 1px solid #454e62;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 12px;
    z-index: 30;
    transition: .2s
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0)
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #444;
    border-top-color: #b49cff;
    border-radius: 50%;
    animation: spin .8s linear infinite
}

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

@media(max-width:900px) {
    .game-layout {
        grid-template-columns: 1fr
    }

    .side-panel {
        height: auto;
        min-height: 0;
        display: block
    }

    .history-wrap {
        margin-top: 15px
    }

    .history {
        max-height: 100px
    }

    .opponent {
        display: inline-block;
        width: 48%;
        vertical-align: top;
        margin-right: 1%
    }

    .game-shell {
        padding: 15px
    }

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

    .market-card {
        min-height: 100px;
        padding: 6px
    }

    .market-card b {
        font-size: 9px
    }
}

@media(max-width:560px) {
    .landing {
        padding: 22px 18px
    }

    .hero {
        padding: 55px 0
    }

    .entry-panel {
        padding: 18px
    }

    .page-shell {
        padding: 18px
    }

    .lobby-wrap {
        padding: 22px
    }

    .topbar {
        margin-bottom: 35px
    }

    .game-topbar {
        margin-bottom: 14px
    }

    .game-shell {
        padding: 12px
    }

    .room-label {
        display: none
    }

    .market-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .market-card {
        min-height: 90px
    }

    .market-card .item-symbol {
        font-size: 23px
    }

    .market-section .section-head .muted {
        font-size: 9px
    }

    .action-buttons {
        gap: 6px
    }

    .action-btn {
        padding: 10px 7px
    }

    .action-btn small {
        font-size: 9px
    }

    .my-section,
    .actions-panel {
        padding: 14px
    }

    .items-row {
        gap: 5px
    }

    .item-card {
        min-width: 82px
    }

    .opponent {
        width: 100%
    }

    .result-card {
        padding: 20px
    }

    .result-row {
        font-size: 12px
    }

    .result-row .muted {
        font-size: 10px
    }
}

/* ===== Pantalla de partida: mesa + cartas ===== */
.game-layout {
    grid-template-columns: 250px minmax(0, 1fr) 260px;
    align-items: start
}

.center-column {
    gap: 12px
}

.right-panel {
    min-height: 0;
    height: calc(100vh - 100px);
    min-height: 650px;
    display: flex;
    flex-direction: column;
    overflow: auto
}

.right-panel .items-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    align-content: start
}

.right-panel .item-card {
    min-width: 0;
    min-height: 84px
}

.right-panel .mission-box {
    margin-top: auto;
    flex-direction: column;
    align-items: flex-start
}

.right-panel .mission-progress {
    text-align: left
}

.table-scene {
    position: relative;
    padding: 6px 18px 34px
}

.table-top {
    position: relative;
    border-radius: 26px;
    padding: 34px 22px 26px;
    background: repeating-linear-gradient(180deg, transparent 0 58px, #0003 58px 60px), linear-gradient(180deg, #9a5a38, #6e3b24);
    border: 3px solid #4e2815;
    box-shadow: inset 0 0 0 6px #ffffff10, inset 0 -18px 40px #0004, 0 24px 40px #0007
}

.table-top:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: #0002;
    border-radius: 8px;
    pointer-events: none
}

.table-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #f6d9b8aa
}

.table-top .market-grid {
    position: relative;
    gap: 12px
}

.table-top .market-card {
    background: #161a26f2;
    border: 2px solid #ffffff22;
    box-shadow: 0 8px 14px #0006;
    min-height: 122px
}

.table-top .market-card.can-pick:hover {
    border-color: var(--item-color)
}

.table-leg {
    position: absolute;
    bottom: 0;
    width: 30px;
    height: 38px;
    background: linear-gradient(90deg, #4e2815, #6e3b24);
    border-radius: 0 0 8px 8px
}

.table-leg.l {
    left: 56px
}

.table-leg.r {
    right: 56px
}

.actions-panel {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0
}

.actions-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px
}

.actions-head h2 {
    font: 600 18px 'Google Sans', sans-serif;
    margin: 3px 0 0
}

.actions-head .small {
    margin-left: auto
}

.actions-head .btn {
    padding: 8px 12px;
    font-size: 11px
}

.actions-panel .action-buttons {
    display: flex;
    justify-content: center;
    gap: 22px;
    padding: 14px 0 6px
}

.actions-panel .action-btn.poker {
    --c: #8b5cf6;
    position: relative;
    width: 150px;
    aspect-ratio: 5/7;
    padding: 0;
    border: 3px solid var(--c);
    border-radius: 14px;
    background: linear-gradient(160deg, #1b2033, #0f1320);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    box-shadow: 0 10px 24px #0008, 0 0 0 1px #0008;
    transition: transform .2s, box-shadow .2s
}

.actions-panel .action-btn.poker:before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid var(--c);
    opacity: .35;
    border-radius: 9px;
    pointer-events: none
}

.actions-panel .action-btn.rob {
    --c: #ef4f5f;
    transform: rotate(-3deg)
}

.actions-panel .action-btn.protect {
    --c: #4c93f0;
    transform: rotate(3deg)
}

.actions-panel .action-btn.collect {
    transform: translateY(-4px)
}

.actions-panel .action-btn.poker .art {
    width: 78px;
    height: 78px
}

.actions-panel .action-btn.poker .card-name {
    font: 700 15px 'Google Sans', sans-serif;
    color: #fff
}

.actions-panel .action-btn.poker small {
    font-size: 10px;
    color: var(--muted)
}

.actions-panel .action-btn.poker .corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    color: var(--c);
    font-size: 15px
}

.actions-panel .action-btn.poker .corner b {
    font: 800 17px 'Google Sans', sans-serif;
    color: var(--c)
}

.actions-panel .action-btn.poker .corner i {
    font-style: normal;
    font-size: 16px
}

.actions-panel .action-btn.poker .corner.tl {
    top: 9px;
    left: 10px
}

.actions-panel .action-btn.poker .corner.br {
    bottom: 9px;
    right: 10px;
    transform: rotate(180deg)
}

.actions-panel .action-btn.poker:not(:disabled):hover {
    transform: translateY(-12px) rotate(0);
    box-shadow: 0 18px 30px #000a, 0 0 22px var(--c)
}

.actions-panel .action-btn.poker.chosen {
    transform: translateY(-18px) rotate(0);
    background: linear-gradient(160deg, #2a2146, #141226);
    box-shadow: 0 20px 34px #000a, 0 0 28px var(--c)
}

.actions-panel .action-btn.poker:disabled {
    opacity: .5;
    cursor: not-allowed
}

.actions-panel .action-help {
    text-align: center;
    padding-top: 14px
}

.actions-panel #confirm-btn {
    display: block;
    margin: 10px auto 0
}

@media(max-width:1180px) {
    .game-layout {
        grid-template-columns: 1fr
    }

    .right-panel {
        height: auto;
        min-height: 0;
        display: block
    }

    .right-panel .items-row {
        grid-template-columns: repeat(auto-fill, minmax(98px, 1fr))
    }

    .right-panel .mission-box {
        margin-top: 14px
    }

    .side-panel {
        height: auto;
        min-height: 0
    }
}

@media(max-width:560px) {
    .table-scene {
        padding: 4px 0 26px
    }

    .table-top {
        padding: 30px 10px 16px
    }

    .table-top .market-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px
    }

    .table-leg.l {
        left: 24px
    }

    .table-leg.r {
        right: 24px
    }

    .actions-panel .action-buttons {
        gap: 8px
    }

    .actions-panel .action-btn.poker {
        width: 31%
    }

    .actions-panel .action-btn.poker .art {
        width: 48px;
        height: 48px
    }

    .actions-panel .action-btn.poker .card-name {
        font-size: 11px
    }

    .actions-panel .action-btn.poker small {
        display: none
    }

    .actions-panel .action-btn.poker .corner b {
        font-size: 12px
    }

    .actions-panel .action-btn.poker .corner i {
        font-size: 11px
    }

    .actions-head .small {
        display: none
    }
}

.table-top .market-card:disabled {
    opacity: 1;
    filter: saturate(.8) brightness(.92)
}

.table-top .market-card.can-pick:not(:disabled) {
    filter: none
}

.logo-steal {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block
}

/* ===== Iconos de objetos (SVG) ===== */
.item-symbol {
    display: flex
}

.item-symbol svg {
    width: 36px;
    height: 36px;
    display: block
}

.opponent-items span {
    display: inline-flex
}

.opponent-items svg {
    width: 18px;
    height: 18px;
    display: block
}

.right-panel .item-symbol svg {
    width: 32px;
    height: 32px
}

/* ===== Botón y ventana de QR ===== */
#qr-fab {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 9;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #1a2030e6;
    color: #c7b9ff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px #0006;
    opacity: .75;
    transition: .18s
}

#qr-fab:hover,
#qr-fab:focus-visible {
    opacity: 1;
    border-color: var(--accent);
    transform: translateY(-2px)
}

#qr-fab svg {
    width: 22px;
    height: 22px
}

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

.qr-card {
    position: relative;
    width: min(100%, 340px);
    padding: 28px 24px 24px;
    text-align: center
}

.qr-card .eyebrow {
    margin-bottom: 16px
}

.qr-box {
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    width: min(100%, 260px);
    margin: 0 auto
}

.qr-box svg {
    display: block;
    width: 100%;
    height: auto
}

.qr-link {
    display: block;
    margin-top: 16px;
    font-size: 15px;
    font-weight: 700;
    color: #c7b9ff;
    word-break: break-all;
    text-decoration: underline;
    text-underline-offset: 3px
}

.game-shell {
    padding-bottom: 72px
}

@media(max-width:560px) {
    #qr-fab {
        width: 38px;
        height: 38px;
        right: 10px;
        bottom: 10px
    }
}

/* ===== Botón y ventana de ayuda (solo partida) ===== */
#help-fab {
    position: fixed;
    right: 64px;
    bottom: 14px;
    z-index: 9;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #1a2030e6;
    color: #c7b9ff;
    font: 700 20px 'Google Sans', sans-serif;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px #0006;
    opacity: .75;
    transition: .18s
}

#help-fab:hover,
#help-fab:focus-visible {
    opacity: 1;
    border-color: var(--accent);
    transform: translateY(-2px)
}

.help-card {
    position: relative;
    width: min(100%, 520px);
    max-height: 88vh;
    overflow: auto;
    padding: 26px 24px
}

.help-card h2 {
    font: 600 22px 'Google Sans', sans-serif;
    margin: 6px 0 8px
}

.help-card h3 {
    font: 600 15px 'Google Sans', sans-serif;
    margin: 22px 0 8px;
    color: #c7b9ff
}

.help-card p {
    margin: 0 0 8px;
    line-height: 1.5
}

.help-list {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.help-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a2030;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px
}

.help-row .help-ico {
    display: flex;
    width: 26px;
    height: 26px;
    flex: none
}

.help-row .help-ico svg {
    width: 26px;
    height: 26px
}

.help-row b {
    font-size: 13px
}

.help-need {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px
}

.help-pts {
    margin-left: auto;
    font-weight: 800;
    color: #c4afff;
    white-space: nowrap
}

.help-need+.help-pts {
    margin-left: 14px;
    min-width: 28px;
    text-align: right
}

.help-row.mission {
    align-items: flex-start;
    justify-content: space-between
}

.help-row.mission small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
    line-height: 1.4
}

.help-row.mission.mine {
    border-color: #7258b7;
    background: #211d32
}

.mine-tag {
    font-style: normal;
    font-size: 9px;
    letter-spacing: 1px;
    font-weight: 800;
    color: #d6bd70;
    border: 1px solid #6d5b2c;
    padding: 2px 5px;
    border-radius: 5px;
    margin-left: 6px;
    vertical-align: middle
}

@media(max-width:560px) {
    #help-fab {
        width: 38px;
        height: 38px;
        right: 56px;
        bottom: 10px
    }

    .help-card {
        padding: 22px 16px
    }
}