/* css/layout.css — SPLIT LAYOUT: игра слева, магазин справа */

/* === КОРНЕВОЙ КОНТЕЙНЕР (весь экран) === */
.screen-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* === ЛЕВАЯ ЧАСТЬ: ИГРОВАЯ ЗОНА === */
.game-container {
    display: flex;
    flex-direction: column;
    /* Занимает всё доступное место, магазин справа фиксирует свой max-width */
    flex: 1 1 0;
    min-width: 0;
    padding: 10px;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    transition: opacity 0.5s;
    opacity: 1;
    overflow: hidden;
}


.game-container.loading {
    opacity: 0;
    pointer-events: none;
}

/* Магазин заполняет всё оставшееся пространство */
.shop-sidebar {
    flex: 1 1 auto;
    /* Растёт чтобы заполнить всё справа */
    min-width: 160px;
    /* Минимальная ширина */
    max-width: 280px;
    /* Не слишком широкий */
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0c0c1a 0%, #12122a 100%);
    border-left: 1px solid rgba(255, 215, 0, 0.12);
    overflow: hidden;
}

.shop-sidebar-header {
    flex-shrink: 0;
    padding: 12px 10px 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.07), transparent);
}

.shop-sidebar-header h2 {
    font-size: 14px;
    font-weight: 900;
    color: var(--accent);
    margin: 0;
    letter-spacing: 0.5px;
}

.shop-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 7px;
    -webkit-overflow-scrolling: touch;
}

.shop-sidebar-body::-webkit-scrollbar {
    width: 3px;
}

.shop-sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.shop-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.25);
    border-radius: 2px;
}

/* === ПОРЯДОК ЭЛЕМЕНТОВ ВНУТРИ ИГРОВОЙ ЗОНЫ === */
.ui-sidebar {
    display: contents;
}

.top-info {
    order: 1;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 10;
    margin-bottom: 4px;
}

.click-area {
    order: 2;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5;
    min-height: 0;
}

.energy-group {
    order: 3;
    width: 100%;
    margin: 6px 0;
    z-index: 20;
}

.bottom-menu {
    order: 4;
    width: 100%;
    z-index: 20;
    margin-bottom: constant(safe-area-inset-bottom);
    margin-bottom: env(safe-area-inset-bottom);
}

/* === ВЕРХНЯЯ ПАНЕЛЬ: ИГРОК + СЧЁТ + РАНГ === */
#player-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

#current-nickname {
    color: var(--accent);
}

.rank-label {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 136, 0, 0.18));
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
}

.score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(22px, 5vh, 38px);
    font-weight: 900;
    margin-bottom: 4px;
    color: #fff;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
}

.coin-icon {
    width: 28px;
    height: 28px;
    margin-right: 6px;
    pointer-events: none;
}

.level-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.level-progress-container {
    width: 100%;
    max-width: 260px;
}

.level-bar-bg {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    height: 13px;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.level-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--progress-gradient);
    transition: width 0.4s ease-out;
    box-shadow: 0 0 6px rgba(255, 200, 0, 0.4);
}

.level-remains-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* === БЛОК ЭНЕРГИИ === */
.energy-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 11px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    backdrop-filter: blur(10px);
}

.energy-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.energy-icon {
    width: 20px;
    pointer-events: none;
}

.energy-info {
    display: flex;
    flex-direction: column;
}

#energy-display {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.daily-energy {
    font-size: 9px;
    color: #aaffaa;
    font-weight: 600;
}

.energy-boost-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ff8800 100%);
    color: #000;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 180, 0, 0.35);
    white-space: nowrap;
    transition: all 0.2s;
    pointer-events: auto;
}

.energy-boost-btn:active {
    transform: scale(0.95);
}

.energy-boost-btn.disabled {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #444;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

/* === НИЖНЕЕ МЕНЮ (3 кнопки) === */
.bottom-menu {
    display: flex;
    justify-content: space-around;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 4px;
    border-radius: 18px;
    backdrop-filter: blur(20px);
    pointer-events: auto;
}

.menu-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    color: #aaa;
    cursor: pointer;
    flex: 1;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
    gap: 2px;
}

.menu-btn img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    pointer-events: none;
}

.menu-btn span {
    color: #bbb;
}

.menu-btn:active {
    transform: scale(0.88);
    opacity: 0.7;
}

/* === КОТ === */
.cat-clicker {
    width: 100%;
    height: 55vh;
    max-height: 500px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.05s;
    pointer-events: none;
    touch-action: none;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.circle-bg {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* === УВЕДОМЛЕНИЯ === */
.notification {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 24, 0.97);
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: white;
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 6000;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    opacity: 1;
    width: max-content;
    max-width: 80vw;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.notification.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
}

/* === РУЛЕТКА === */
#roulette-msg {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    margin: 12px 0;
    min-height: 36px;
}

#spin-btn {
    display: block;
    width: 80%;
    margin: 0 auto 18px;
    padding: 14px;
    font-size: 17px;
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    letter-spacing: 1px;
    background: linear-gradient(to bottom, #ffca28, #ff6f00);
    border: none;
    border-radius: 50px;
    box-shadow: 0 5px 0 #b34700, 0 8px 18px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

#spin-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #b34700;
}

#spin-btn:disabled {
    background: #2a2a3a;
    box-shadow: none;
    color: #555;
    cursor: not-allowed;
}

/* === ВВОД НИКНЕЙМА === */
#player-name-input {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.25);
    border-radius: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-weight: 700;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

#player-name-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.2);
}

#player-name-input::placeholder {
    color: #444;
    font-weight: normal;
}

/* === ОФЛАЙН МОДАЛКА === */
.offline-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.18) !important;
    text-align: center;
}

.offline-cat-icon {
    font-size: 44px;
    margin-bottom: 4px;
}

/* === МОДАЛКА НИКНЕЙМА === */
#nickname-modal .modal-content {
    max-width: 290px;
    width: 90%;
    height: auto;
    margin: 0;
    padding: 22px 18px 18px;
    border-radius: 20px;
}

/* === БЕЙДЖ РАНГА В МАГАЗИНЕ === */
.rank-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 6px;
    padding: 1px 5px;
    font-size: 8px;
    color: var(--accent);
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

/* === СЖАТЫЕ КАРТОЧКИ МАГАЗИНА В САЙДБАРЕ === */
#boosts-container .boost-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 9px 8px;
    gap: 6px;
    margin-bottom: 7px;
    border-radius: 12px;
}

#boosts-container .boost-img {
    width: 36px;
    height: 36px;
    margin-right: 0;
    align-self: center;
}

#boosts-container .boost-item>* {
    width: 100%;
}

#boosts-container .boost-info {
    display: flex;
    flex-direction: column;
}

#boosts-container .boost-name {
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
}

#boosts-container .boost-desc {
    font-size: 9px;
    margin-top: 2px;
}

#boosts-container .buy-btn {
    width: 100%;
    padding: 7px 4px;
    font-size: 11px;
    border-radius: 9px;
    min-width: unset;
    text-align: center;
}

/* Горизонтальный блок: иконка + инфо */
#boosts-container .boost-row {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
}