@font-face {
    font-family: "Inglobal BI";
    src: url("shrift/inglobalbi.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Стандартный стол: синий "текстиль" в стиле мобильного стола */
    --table-bg: radial-gradient(circle at 20% 0, #426f96 0, #254463 55%);
    /* Рубашка по умолчанию – PNG */
    --card-back-bg: url("assets/backs/default/card-back.png");
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Inglobal BI", "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #020617;
    background-image: var(--table-bg);
    background-size: cover;
    background-position: center;
    color: #e5e7eb;
}

button,
input,
select,
textarea {
    font-family: "Inglobal BI", "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#app {
    position: relative;
    padding: 24px 12px 24px;
    box-sizing: border-box;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px 10px;
    border-radius: 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: relative;
    overflow: hidden;
}

.top-bar::before {
    display: none;
}

.top-bar h1 {
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow:
        -0.5px -0.5px 0 #000,
        0.5px -0.5px 0 #000,
        -0.5px 0.5px 0 #000,
        0.5px 0.5px 0 #000;
}

.logo-icon {
    font-size: 1.2em;
}

.logo-img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    display: inline-block;
    transform: translate(25px, -10px);
}

#username {
    text-shadow:
        -0.5px -0.5px 0 #000,
        0.5px -0.5px 0 #000,
        -0.5px 0.5px 0 #000,
        0.5px 0.5px 0 #000;
}

/* Полноэкранный режим стола в духе мобильной версии */
body.game-mode {
    background-image: var(--table-bg);
    background-color: #254463;
    color: #f9fafb;
}

body.game-mode #app {
    padding: 0;
}

body.game-mode .top-bar,
body.game-mode .main-menu {
    display: none;
}

body.game-mode main {
    padding-bottom: 0;
    height: 100vh;
    display: flex;
}

body.game-mode #game.view {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.game-mode #game::before {
    /* большое сердечко слева, как в референсе */
    content: "♥";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    color: #f97373;
    opacity: 0.9;
    pointer-events: none;
}

body.game-mode #game .status {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    font-size: 12px;
    opacity: 0.9;
}

body.game-mode #game .players {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

body.game-mode #game .player {
    position: absolute;
    background: rgba(15, 23, 42, 0.75);
    border-radius: 16px;
    padding: 8px;
    min-width: 72px;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.profile-rank-container {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.rank-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #a5b4fc;
    color: #a5b4fc;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.rank-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    width: 240px;
    padding: 12px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    pointer-events: auto;
}

.rank-tooltip.hidden {
    display: none;
}

.rank-tooltip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 10px;
    width: 10px;
    height: 10px;
    background: #1e293b;
    border-left: 1px solid #475569;
    border-top: 1px solid #475569;
    transform: rotate(45deg);
}

#rank-tooltip-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #e2e8f0;
    white-space: pre-wrap;
}

/* Top Position (Standard) */
body.game-mode #game .player.pos-top {
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
}

/* Left Position (Vertical) */
body.game-mode #game .player.pos-left {
    top: 40%;
    left: 8px;
    transform: translateY(-50%);
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    padding: 8px 6px;
    border-radius: 12px;
    gap: 6px;
    min-width: 60px;
}

/* Right Position (Vertical) */
body.game-mode #game .player.pos-right {
    top: 40%;
    right: 8px;
    transform: translateY(-50%);
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    padding: 8px 6px;
    border-radius: 12px;
    gap: 6px;
    min-width: 60px;
}

/* Adjust inner layout for vertical players */
body.game-mode #game .player.pos-left .player-main,
body.game-mode #game .player.pos-right .player-main {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    width: 100%;
}

/* Remove rotation */
body.game-mode #game .player.pos-left .player-main,
body.game-mode #game .player.pos-right .player-main {
    transform: none;
}

/* Cards layout for side players */
body.game-mode #game .player.pos-left .player-backs,
body.game-mode #game .player.pos-right .player-backs {
    margin-top: 2px;
    display: flex;
    flex-direction: row;
    /* Cards horizontally */
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    max-width: 60px;
}

/* Reset background for side players wrapper since we moved it to the main container */
body.game-mode #game .player.pos-left .player-backs,
body.game-mode #game .player.pos-right .player-backs {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* Smaller text for side players */
body.game-mode #game .player.pos-left .player-name,
body.game-mode #game .player.pos-right .player-name {
    font-size: 11px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Smaller avatar for side players */
body.game-mode #game .player.pos-left .player-avatar,
body.game-mode #game .player.pos-right .player-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

body.game-mode #game .player.me {
    border: 2px solid #22c55e;
    background: rgba(22, 163, 74, 0.35);
}

.turn-hints {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.turn-hint {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #f9fafb;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.turn-hint.visible {
    opacity: 1;
}

.turn-hint-arrow {
    font-size: 26px;
}

.turn-hint-label {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.85);
}

.turn-hint--attack {
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
}

.turn-hint--attack .turn-hint-arrow {
    color: #f97373;
}

.turn-hint--defend {
    bottom: 120px;
    right: 24px;
    flex-direction: row;
}

.turn-hint--defend .turn-hint-arrow {
    transform: rotate(-40deg);
    color: #a5b4fc;
}

button {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(24, 36, 58, 0.015);
    background-image:
        linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.008)),
        radial-gradient(circle at 15% 0, rgba(255, 255, 255, 0.018), transparent 45%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 8px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

button:active {
    transform: scale(0.96);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-menu {
    position: fixed;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 2px;
    margin: 0;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    width: calc(100% - 90px);
    max-width: 280px;
    z-index: 1100;
}

.main-menu button {
    flex: 1;
    border-radius: 10px;
    font-size: 10px;
    padding: 3px 2px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        linear-gradient(145deg, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.02));
    background-color: rgba(21, 38, 66, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 8px 18px rgba(0, 0, 0, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.main-menu button[disabled] {
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.08)),
        linear-gradient(145deg, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.02));
    border-color: rgba(59, 130, 246, 0.5);
    color: #dbeafe;
    transform: none;
}

.main-menu button:active {
    transform: scale(0.98);
}

.nav-btn-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    font-size: 18px;
}

.main-menu button[disabled] .nav-btn-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
}

.nav-btn-label {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
    white-space: nowrap;
}

.main-menu button[disabled] .nav-btn-label {
    color: #dbeafe;
}

.main-menu .admin-only {
    display: none;
}

main {
    padding-bottom: 16px;
    flex: 1;
}

.view.hidden {
    display: none;
}

.view {
    margin-bottom: 16px;
}

/* Игровое меню визуально тянется почти до нижних кнопок */
#lobby.view {
    margin-bottom: 4px;
}

.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-group select {
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
}

.settings-hint {
    font-size: 12px;
    color: #9ca3af;
}

.coin-packs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.coin-pack {
    flex: 1 1 30%;
    font-size: 13px;
    padding-inline: 8px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.profile-avatar {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, #4f46e5, #22c55e);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.profile-rank {
    margin: 0;
    font-size: 13px;
    color: #a5b4fc;
}

.profile-xp {
    margin: 0;
    font-size: 13px;
    color: #e5e7eb;
}

.profile-coins {
    margin: 0;
    font-size: 13px;
    color: #facc15;
}

.xp-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.95);
    color: #022c22;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.lobby-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0 16px;
}

#lobby>h2 {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 4px 0 8px;
}

#lobby {
    background: rgba(2, 6, 23, 0.015);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-radius: 16px;
    padding: 0 8px 16px;
}

.lobby-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.015);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

.lobby-card {
    padding: 10px 16px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.lobby-card:last-child {
    border-bottom: none;
}

.lobby-card-main {
    display: flex;
    flex-direction: column;
}

.lobby-card-title {
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: 0.04em;
}

.lobby-card-meta {
    font-size: 12px;
    color: #9ca3af;
}

.lobby-card-join button {
    padding-inline: 10px;
    font-size: 13px;
    border-radius: 999px;
}

.lobby-search-container {
    margin-bottom: 8px;
}

.lobby-search-container input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(2, 6, 23, 0.015);
    color: #e5e7eb;
    font-size: 14px;
    box-sizing: border-box;
}

.lobby-search-container input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

.lobby-filters {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.filter-group select {
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(2, 6, 23, 0.015);
    color: #e5e7eb;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.lobby-create-button {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 15px;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    width: 100%;
    max-width: 360px;
    margin: 0 16px;
    padding: 16px 16px 12px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.015);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-content input[type="tel"],
.modal-content input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(2, 6, 23, 0.015);
    color: #e5e7eb;
}

.status {
    margin-bottom: 12px;
    font-size: 14px;
    color: #a5b4fc;
}

.players {
    margin-bottom: 12px;
    font-size: 13px;
}

#room .players {
    margin-top: 8px;
}

#room .actions {
    margin-top: 12px;
}

.player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    background: #020617;
    margin-bottom: 4px;
}

.player.me {
    background: #1e293b;
}

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

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    font-weight: 500;
}

.player-cards {
    font-size: 12px;
    color: #9ca3af;
}

.player-backs {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.card-back {
    width: 20px;
    height: 28px;
    border-radius: 4px;
    background-image: var(--card-back-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.table {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #1f2937;
    background-color: #1f2937;
    background-image: var(--table-bg);
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 2;
}

.deck-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
}

.deck-stack {
    position: relative;
    /* Горизонтальная стопка колоды */
    width: 94px;
    height: 72px;
}

.deck-pile-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 64px;
    height: 94px;
    border-radius: 8px;
    /* Используем ту же рубашку, что и для карт игроков */
    background-color: #020617;
    background-image: var(--card-back-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Лежащая горизонтально колода */
    transform: rotate(-90deg);
    transform-origin: center center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    /* Стопка колоды лежит сверху */
    z-index: 2;
}

.deck-trump-card {
    position: absolute;
    /* Вертикальная козырная карта, выглядывает снизу из-под стопки */
    bottom: -40px;
    left: 26px;
    transform: rotate(-4deg);
    z-index: 1;
}

.deck-trump-suit {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.85);
    color: #fecaca;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.deck-count {
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    padding-left: 2px;
}

/* В полноэкранном режиме колода всегда в левом верхнем углу стола */
body.game-mode #game .deck-area {
    position: absolute;
    top: 12px;
    left: 12px;
    margin-bottom: 0;
    z-index: 5;
}

.table-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 72px;
    position: relative;
    z-index: 3;
}

.table-pair {
    position: relative;
    width: 64px;
    height: 112px;
}

.table-pair .card {
    position: absolute;
    left: 0;
    top: 0;
}

.table-pair .table-card-attack {
    z-index: 1;
}

.table-pair .table-card-defense {
    top: 14px;
    left: 10px;
    z-index: 2;
}

.table-drop-zone {
    display: none;
}

.table-drop-zone.drop-over {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.actions {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.actions button {
    flex: 1;
}

.hand-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card {
    width: 64px;
    height: 94px;
    border-radius: 8px;
    background-color: #f9fafb;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.7);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.card--selected {
    transform: translateY(-8px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.8);
}

/* Компоновка стола и руки в полноэкранном режиме */
body.game-mode #game .table {
    position: relative;
    flex: 1;
    margin: 0;
    border-radius: 0;
    border: none;
    padding: 0;
    background-color: #254463;
    background-image: var(--table-bg);
}

body.game-mode #game .table h2 {
    display: none;
}

body.game-mode #game #deck-area {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: top 0.3s ease, transform 0.3s ease;
}

body.game-mode.more-than-2-players #game #deck-area {
    top: 80px;
    transform: none;
}

body.game-mode #game #table-cards {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    min-height: 96px;
}

body.game-mode #game .hand {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 70px;
    /* Lowered significantly */
    /* Moved up to make room for avatar and button */
    padding: 0 16px 8px;
    z-index: 5;
}

body.game-mode #game .hand h2 {
    display: none;
}

body.game-mode #game .hand-cards {
    justify-content: center;
    gap: 0;
}

body.game-mode #game .hand-cards .card {
    margin-left: -32px;
}

body.game-mode #game .hand-cards .card:first-child {
    margin-left: 0;
}

/* Нижняя панель действий */
#game .game-actions {
    position: absolute;
    left: 16px;
    /* Bottom left */
    right: auto;
    transform: none;
    bottom: 16px;
    /* Lowered slightly */
    width: auto;
    max-width: 140px;
    /* Decreased width */
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    pointer-events: auto;
}

/* Self Profile (Avatar) */
.self-profile {
    position: absolute;
    bottom: 10px;
    /* Moved up slightly to increase gap from buttons */
    /* Between hand and button */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 10;
    pointer-events: none;
}

.self-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #1e293b;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.self-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.self-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.self-profile.attacker .self-avatar {
    border-color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

.self-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 10px;
}

.self-role-text {
    display: none;
    /* Hide text role, rely on visual cue */
}

/* Action Buttons */
.action-btn {
    /* background: #1f3b59; - Removed to use global/table-bg */
    background-image: var(--table-bg);
    background-size: cover;
    background-position: center;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 8px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    width: 100%;
    z-index: 101;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn:disabled {
    background: #0f172a;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    border-color: transparent;
}

/* Specific colors removed to match menu style */

#btn-surrender {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, background 0.2s;
}

#btn-surrender:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#btn-surrender:active {
    transform: scale(0.95);
}

#game .game-actions #btn-exit-game {
    width: auto;
    align-self: flex-start;
    padding: 6px 12px;
    font-size: 12px;
    min-height: 30px;
    margin-top: 4px;
    /* background: rgba(239, 68, 68, 0.8); - Removed to use table-bg */
    background-image: var(--table-bg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    margin-top: 8px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Profile Customization */
.profile-customization {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customization-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.tab-btn.active {
    background-image: var(--table-bg);
    background-size: cover;
    background-position: center;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.shop-item {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.shop-item:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(99, 102, 241, 0.5);
}

.shop-item.owned {
    border-color: #22c55e;
}

.shop-item.selected {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
}

.shop-item-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-item-info {
    text-align: center;
    width: 100%;
}

.shop-item-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-item-price {
    font-size: 11px;
    color: #facc15;
    font-weight: 600;
}

/* Settings Controls */
.settings-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.setting-toggle-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-toggle-btn.active {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

.setting-toggle-btn:not(.active) {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.shop-item-btn {
    width: 100%;
    padding: 6px;
    font-size: 11px;
    min-height: 28px;
}

.shop-item-btn.selected-btn {
    background: transparent;
    background-image: none;
    border: 1px solid #facc15;
    color: #facc15;
    box-shadow: none;
    cursor: default;
}
