.selected-event-chip {
    border-color: #facc15;
    box-shadow: 0 0 0 2px #facc15;
    background: rgba(251, 146, 60, 0.92);
}

.selected-target-chip {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px #38bdf8;
    background: rgba(59, 130, 246, 0.12);
}
:root {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-soft: #334155;
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --danger: #ef4444;
    --ok: #22c55e;
}

* {
    box-sizing: border-box;
}

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

.auth-page {
    display: grid;
    place-items: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--surface-soft);
    border-radius: 10px;
    padding: 24px;
}

.auth-container.wide {
    max-width: 1100px;
}

.subtitle {
    color: var(--text-dim);
    margin-top: 0;
}

.helper-text {
    margin-top: 16px;
    color: var(--text-dim);
    font-size: 13px;
}

.auth-form {
    display: grid;
    gap: 10px;
}

label {
    font-size: 14px;
}

input,
select,
textarea,
button {
    font: inherit;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--surface-soft);
}

input {
    background: #0b1221;
    color: var(--text);
}

select {
    background: #0b1221;
    color: var(--text);
}

textarea {
    background: #0b1221;
    color: var(--text);
    resize: vertical;
}

button {
    cursor: pointer;
    background: var(--ok);
    color: #001107;
    font-weight: bold;
    border: none;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-message {
    display: none;
    background: color-mix(in srgb, var(--danger) 22%, transparent);
    border: 1px solid var(--danger);
    color: #fecaca;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.error-message.show {
    display: block;
}

.success-message {
    margin-top: 12px;
    color: #86efac;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card {
    border: 1px solid var(--surface-soft);
    border-radius: 10px;
    background: var(--surface);
    padding: 20px;
    margin-bottom: 16px;
}

.grid-form {
    display: grid;
    gap: 10px;
    max-width: 460px;
}

.inline-message {
    color: var(--text-dim);
    margin-top: 8px;
}

.inline-message.error {
    color: #fecaca;
}

.stack {
    display: grid;
    gap: 12px;
}

.game-card {
    border: 1px solid var(--surface-soft);
    border-radius: 10px;
    padding: 14px;
    background: #172033;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    background: #0b1221;
    color: var(--text-dim);
    border: 1px solid var(--surface-soft);
}

.inline-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--surface-soft);
}

.qr-block {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--surface-soft);
    border-radius: 8px;
    background: #111827;
}

.qr-image {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 8px;
}

.rounds-block {
    margin-top: 12px;
}

.round-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.round-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--surface-soft);
    border-radius: 8px;
    padding: 8px;
}

.round-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.round-state-box {
    margin-top: 6px;
    padding: 8px;
    border: 1px dashed var(--surface-soft);
    border-radius: 8px;
}

.round-player-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.round-player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.player-board {
    margin-top: 16px;
    border-top: 1px dashed var(--surface-soft);
    padding-top: 14px;
}

.roulette-help {
    margin: 8px 0 12px;
    color: var(--text-dim);
}

.roulette-board {
    position: relative;
    background: transparent;
    border: 2px solid #0a3d1c;
    border-radius: 10px;
    width: min(100%, 760px);
    aspect-ratio: 7 / 9;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.roulette-board::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--roulette-bg-image, url("/img/board_background.png"));
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    z-index: 0;
}

.roulette-overlay {
    position: absolute;
    inset: 0;
    border: none;
    z-index: 1;
    overflow: hidden;
}

.roulette-grid-23 {
    position: relative;
    height: 100%;
}

.roulette-text-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.svg-zone-text {
    fill: #f8fafc;
    font-size: 1.7px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.zone-textless {
    color: transparent;
    text-shadow: none;
}

.roulette-heading {
    margin: 0;
    font-size: 12px;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.zone {
    position: absolute;
    box-sizing: border-box;
    min-height: 0;
    border: 1px solid #111827;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.66);
    color: #f8fafc;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3px;
    font-size: clamp(10px, 1.1vw, 13px);
    line-height: 1.1;
    z-index: 1;
}

.zone-logo {
    background: rgba(2, 6, 23, 0.72);
    text-transform: uppercase;
    font-size: clamp(11px, 1.2vw, 14px);
}

.zone-top-action {
    background: rgba(34, 197, 94, 0.82);
    color: #052e16;
    white-space: nowrap;
}

.zone-player-list {
    box-sizing: border-box;
    padding: 8px;
    justify-content: flex-start;
    align-items: stretch;
    display: grid;
    gap: 8px;
    background: rgba(2, 6, 23, 0.6);
    z-index: 4;
}

.zone-player-list .player-list-slip {
    max-height: 100%;
    overflow: auto;
}

.zone-side-team {
    background: rgba(30, 41, 59, 0.74);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-event-slot {
    background: rgba(250, 204, 21, 0.84);
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-bottom-center {
    background: rgba(120, 53, 15, 0.78);
    white-space: nowrap;
}

.selected-chip {
    border-color: #facc15;
    box-shadow: inset 0 0 0 1px #facc15;
    background: rgba(251, 146, 60, 0.92);
}

.zone-disabled {
    opacity: 0.45;
}

.zone-empty {
    background: rgba(2, 6, 23, 0.45);
    border-color: rgba(148, 163, 184, 0.5);
}

.bet-action-row {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.pending-pairs-block {
    border: 1px solid var(--surface-soft);
    border-radius: 8px;
    padding: 8px;
    background: #111827;
}

.player-list-slip {
    display: grid;
    gap: 0;
}

.player-row-chip {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #f8fafc;
    box-shadow: none;
    text-align: left;
    padding: 4px 2px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-row-index {
    font-weight: bold;
    color: #e5e7eb;
}

.team-bet-button {
    min-height: 46px;
    border-radius: 0;
    color: #f8fafc;
    border: 1px solid #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#leftTeamBetButton {
    background: #020617;
}

#rightTeamBetButton {
    background: #dc2626;
}

#zoneTopLeftLogo {
    left: 0%;
    top: 0%;
    width: 20%;
    height: 10%;
    border-top-left-radius: 18px;
}

#noEvent3Button {
    left: 20%;
    top: 0%;
    width: 20%;
    height: 10%;
}

#noEvent6Button {
    left: 40%;
    top: 0%;
    width: 20%;
    height: 10%;
}

#noEvent9Button {
    left: 60%;
    top: 0%;
    width: 20%;
    height: 10%;
}

#zoneTopRightLogo {
    left: 80%;
    top: 0%;
    width: 20%;
    height: 10%;
    border-top-right-radius: 18px;
}

#leftPlayerZone {
    left: 0%;
    top: 10%;
    width: 38%;
    height: 70%;
}

#leftDefenseZone {
    left: 38%;
    top: 10%;
    width: 4%;
    height: 23%;
}

#leftMidZone {
    left: 38%;
    top: 33%;
    width: 4%;
    height: 23%;
}

#leftAttackZone {
    left: 38%;
    top: 56%;
    width: 4%;
    height: 24%;
}

#rightPlayerZone {
    left: 62%;
    top: 10%;
    width: 38%;
    height: 70%;
}

#rightDefenseZone {
    left: 58%;
    top: 10%;
    width: 4%;
    height: 23%;
}

#rightMidZone {
    left: 58%;
    top: 33%;
    width: 4%;
    height: 23%;
}

#rightAttackZone {
    left: 58%;
    top: 56%;
    width: 4%;
    height: 24%;
}

#eventSlot1 {
    left: 42%;
    top: 20%;
    width: 16%;
    height: 8.57%;
}

#eventSlot2 {
    left: 42%;
    top: 28.57%;
    width: 16%;
    height: 8.57%;
}

#eventSlot3 {
    left: 42%;
    top: 37.14%;
    width: 16%;
    height: 8.57%;
}

#eventSlot4 {
    left: 42%;
    top: 45.71%;
    width: 16%;
    height: 8.57%;
}

#eventSlot5 {
    left: 42%;
    top: 54.28%;
    width: 16%;
    height: 8.57%;
}

#eventSlot6 {
    left: 42%;
    top: 62.85%;
    width: 16%;
    height: 8.57%;
}

#eventSlot7 {
    left: 42%;
    top: 71.42%;
    width: 16%;
    height: 8.58%;
}

#leftTeamBetButton {
    left: 0%;
    top: 80%;
    width: 50%;
    height: 20%;
    border-bottom-left-radius: 18px;
}

#zoneBottomCenter {
    left: 42%;
    top: 74%;
    width: 16%;
    height: 6%;
    z-index: 2;
    font-size: 10px;
}

#rightTeamBetButton {
    left: 50%;
    top: 80%;
    width: 50%;
    height: 20%;
    border-bottom-right-radius: 18px;
}

.selected-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-target-chip {
    background: #78350f;
    color: var(--text);
    border: 2px solid #38bdf8;
    box-shadow: 0 0 0 2px #38bdf8;
    font-weight: normal;
    padding: 6px 10px;
}

.lock-button {
    margin-top: 10px;
    width: 100%;
}

.bets-block {
    margin-top: 12px;
}

.bet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.bet-item {
    border: 1px solid var(--surface-soft);
    border-radius: 8px;
    padding: 8px;
    background: #111827;
}

.error-inline {
    color: #fecaca;
}

@media (max-width: 900px) {
    .auth-container.wide {
        max-width: 100%;
    }

    .roulette-board {
        width: min(100%, 620px);
        min-width: 320px;
    }

    .zone {
        font-size: 12px;
        padding: 2px;
    }

    .zone-player-list {
        padding: 6px;
    }

    .player-row-chip {
        font-size: 11px;
    }
}
