/* B12: стол. Тёмная палитра, крупный тап, подсветка ходовых карт пульсом. */

:root {
    --felt: #1d6b45;
    --felt-dark: #14492f;
    --ink: #e9e4d8;
    --muted: #9a948a;
    --card-bg: #fdfcf7;
    --accent: #ffd166;
    --error: #ff8787;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: radial-gradient(ellipse at 50% 30%, var(--felt) 0%, var(--felt-dark) 80%);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

#app { min-height: 100%; }
.boot { padding: 2rem; text-align: center; font-size: 1.2rem; }

#blazor-error-ui {
    display: none;
    background: #402020;
    color: var(--error);
    padding: .6rem 1rem;
}

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: .8rem;
    min-height: 100vh;
}

.logo { text-align: center; margin: .4rem 0 0; font-weight: 600; letter-spacing: .08em; }

/* ===== лобби ===== */

.panel {
    background: rgba(0, 0, 0, .25);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

    .panel h2 { margin: 0; font-size: 1.05rem; }

.hint { color: var(--muted); font-size: .85rem; }

.text, select {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .2);
    color: var(--ink);
    border-radius: 10px;
    padding: .55rem .7rem;
    font-size: 1rem;
}

button {
    font: inherit;
    border: none;
    border-radius: 10px;
    padding: .55rem 1rem;
    cursor: pointer;
    transition: transform .08s ease, opacity .08s ease;
}

    button:active { transform: scale(.97); }
    button:disabled { opacity: .35; cursor: default; }

.primary { background: var(--accent); color: #3a2c00; font-weight: 600; }
.secondary { background: rgba(255, 255, 255, .14); color: var(--ink); }
.link { background: none; color: var(--muted); text-decoration: underline; padding: 0 .3rem; font-size: .85rem; }

/* ===== статусы ===== */

.status { text-align: center; color: var(--muted); }
.status.mine { color: var(--accent); animation: glow 1.6s ease-in-out infinite; }
.status-error { color: var(--error); text-align: center; }

@keyframes glow {
    0%, 100% { text-shadow: 0 0 4px transparent; }
    50% { text-shadow: 0 0 12px var(--accent); }
}

/* ===== карты ===== */

.card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    height: 4.4rem;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

.card.faceup {
    background: var(--card-bg);
    color: #222;
    border: 1px solid #c9c2b2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    animation: deal .25s ease;
}

.card.red { color: #c0272d; }
.card.back { background: #2b2f6b; border: 1px solid #4a4f9e; color: #8a90e0; position: relative; }
.card.back small { position: absolute; bottom: 2px; right: 5px; font-size: .7rem; font-weight: 400; }

@keyframes deal {
    from { transform: translateY(14px) scale(.9); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* ===== стол ===== */

.table-page { justify-content: space-between; }

.opponents {
    display: flex;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.opponent {
    background: rgba(0, 0, 0, .22);
    border-radius: 10px;
    padding: .35rem .7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    transition: box-shadow .3s ease;
}

    .opponent.current { box-shadow: 0 0 0 2px var(--accent); }
    .opponent.out { opacity: .45; }

.seat { font-size: .8rem; color: var(--muted); }
.opponent.current .seat { color: var(--accent); }
.backs { letter-spacing: 2px; font-size: 1.05rem; }
.out-badge { font-size: .7rem; color: var(--error); }

.center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    min-height: 7rem;
}

.deck { display: flex; gap: .4rem; align-items: center; }
.empty-deck { color: var(--muted); font-size: .85rem; }

.pairs { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }

.pair { display: flex; flex-direction: column; gap: .25rem; animation: deal .25s ease; }
.pair .defense { margin-left: 1.4rem; transform: rotate(4deg); }
.pair.open-attack .card { box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0, 0, 0, .35); }

.discard { color: var(--muted); font-size: .8rem; min-width: 4rem; text-align: center; }

/* ===== рука ===== */

.hand {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: center;
    min-height: 4.8rem;
    padding: .2rem;
}

.hand-card { cursor: default; }
.hand-card.playable {
    cursor: pointer;
    animation: pulse 1.5s ease-in-out infinite;
}

    .hand-card.playable:hover { transform: translateY(-10px); box-shadow: 0 8px 18px rgba(0, 0, 0, .5); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 2px 6px rgba(0, 0, 0, .35); }
    50% { box-shadow: 0 0 10px 2px var(--accent), 0 2px 6px rgba(0, 0, 0, .35); }
}

.actions { display: flex; gap: .6rem; justify-content: center; min-height: 2.6rem; }

.result {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    animation: appear .5s ease;
}

@keyframes appear {
    from { opacity: 0; transform: scale(.8); }
    to { opacity: 1; transform: none; }
}

.meta {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
}

code { background: rgba(0, 0, 0, .3); border-radius: 5px; padding: 0 .3rem; }

a { color: var(--accent); }

/* B22: генерический стол — зоны любой игры */
.game-title { font-size: 1.1rem; margin: 0 0 .4rem; opacity: .85; }
.zone { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.zone-label { font-size: .75rem; opacity: .65; }
.zone-row { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; }
.zone-chip { font-size: .75rem; opacity: .8; background: rgba(255,255,255,.08); border-radius: .5rem; padding: .1rem .45rem; }
.scores { font-size: .85rem; opacity: .8; text-align: center; margin: .3rem 0; }
.my-zones { display: flex; gap: .4rem; justify-content: center; margin: .3rem 0; }
