* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
}

/* Комната */
.room {
    width: 500px;
    height: 400px;
    background: linear-gradient(180deg, #87ceeb 0%, #b0e0e6 50%, #deb887 50%, #d2691e 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 8px solid #8b4513;
}

.wall {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, #fff8dc 0%, #faebd7 100%);
}

.floor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: 
        repeating-linear-gradient(
            90deg,
            #deb887 0px,
            #deb887 50px,
            #d2b48c 50px,
            #d2b48c 100px
        );
}

/* Окно */
.window {
    position: absolute;
    top: 20px;
    left: 30px;
    width: 100px;
    height: 80px;
}

.window-frame {
    width: 100%;
    height: 100%;
    background: #8b4513;
    border-radius: 5px;
    position: relative;
    padding: 5px;
}

.window-glass {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #87ceeb 0%, #add8e6 50%, #b0e0e6 100%);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.window-glass::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
}

.window-cross {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 4px;
    height: calc(100% - 10px);
    background: #8b4513;
    transform: translateX(-50%);
}

.window-cross::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -40px;
    width: calc(100% + 80px);
    height: 4px;
    background: #8b4513;
    transform: translateY(-50%);
}

.curtain {
    position: absolute;
    top: 0;
    width: 25px;
    height: 100px;
    background: #dc143c;
    border-radius: 0 0 10px 10px;
}

.curtain.left {
    left: -15px;
}

.curtain.right {
    right: -15px;
}

/* Кошка */
.cat-container {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

#catCanvas {
    display: block;
    margin: 0 auto;
}

.cat-mood {
    background: rgba(255,255,255,0.9);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Миска */
.bowl-area {
    position: absolute;
    bottom: 30px;
    left: 30px;
    text-align: center;
}

.bowl {
    width: 80px;
    height: 40px;
    position: relative;
    cursor: pointer;
}

.bowl-rim {
    width: 100%;
    height: 15px;
    background: linear-gradient(180deg, #ff6b6b 0%, #ee5a5a 100%);
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.bowl-food {
    width: 70%;
    height: 25px;
    background: linear-gradient(180deg, #8b4513 0%, #654321 100%);
    border-radius: 5px;
    position: absolute;
    bottom: 0;
    left: 15%;
    z-index: 1;
}

.bowl-shadow {
    width: 90%;
    height: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    position: absolute;
    bottom: -5px;
    left: 5%;
}

.bowl-type {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

/* Шкаф */
.wardrobe {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 80px;
    height: 120px;
    background: linear-gradient(180deg, #8b4513 0%, #654321 100%);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.wardrobe-door {
    width: 50%;
    height: 100%;
    background: linear-gradient(180deg, #a0522d 0%, #8b4513 100%);
    border: 2px solid #654321;
}

.left-door {
    border-radius: 5px 0 0 5px;
    border-right: 1px solid #654321;
}

.right-door {
    border-radius: 0 5px 5px 0;
    border-left: 1px solid #654321;
}

.wardrobe-handle {
    width: 8px;
    height: 20px;
    background: #ffd700;
    border-radius: 3px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.left-handle {
    left: 30%;
}

.right-handle {
    right: 30%;
}

/* Панель управления */
.controls {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 280px;
}

.status-bar {
    margin-bottom: 20px;
}

.status-item {
    margin-bottom: 10px;
}

.status-label {
    font-size: 14px;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.hunger {
    background: linear-gradient(90deg, #ff6b6b 0%, #feca57 100%);
    width: 50%;
}

.happy {
    background: linear-gradient(90deg, #54a0ff 0%, #5f27cd 100%);
    width: 70%;
}

.weight {
    background: linear-gradient(90deg, #1dd1a1 0%, #10ac84 100%);
    width: 30%;
}

.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.buttons .btn-reset {
    grid-column: 1 / -1;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-feed {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
}

.btn-bowl {
    background: linear-gradient(135deg, #feca57 0%, #f0932b 100%);
    color: white;
}

.btn-clean {
    background: linear-gradient(135deg, #54a0ff 0%, #2e86de 100%);
    color: white;
}

.btn-wardrobe {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: white;
}

.btn-reset {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    color: white;
    grid-column: 1 / -1;
}
.btn-lang {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s;
}
.btn-lang:hover { transform: scale(1.1); }
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}
.vol-control {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
}
.vol-control input[type=range] {
    width: 80px;
    accent-color: #6c5ce7;
    cursor: pointer;
}

/* Кликабельная зона окна */
.window-click {
    position: absolute;
    top: 20px;
    left: 30px;
    width: 100px;
    height: 80px;
    cursor: pointer;
    z-index: 10;
    border-radius: 5px;
    transition: background 0.3s;
}
.window-click:hover {
    background: rgba(255,255,255,0.15);
}
.window-click::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: rgba(255,255,255,0.6);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* Мини-игра */
.minigame-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #1a1a2e;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.minigame-overlay.active {
    display: flex;
}
.minigame-hud {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 0 0 15px 15px;
    color: white;
    font-size: 16px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    backdrop-filter: blur(5px);
}
.minigame-hud b {
    color: #ffd700;
    font-size: 18px;
}
.btn-minigame-exit {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%) !important;
    color: white;
    padding: 8px 20px !important;
    font-size: 14px !important;
}
.btn-minigame-select {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%) !important;
    color: white;
    padding: 14px 28px !important;
    font-size: 16px !important;
    width: 100%;
}
.minigame-select {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}
.minigame-select.active { display: flex; }
.minigame-select-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 380px;
    width: 90%;
}
.minigame-select-box h2 {
    margin-bottom: 20px;
    color: #333;
}
.minigame-select-box .btn {
    margin-bottom: 12px;
}
.minigame-select-box .btn-close {
    margin-top: 8px;
    margin-bottom: 0;
}
.btn-minigame-select {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%) !important;
    color: white;
    padding: 10px 24px !important;
    font-size: 15px !important;
}
.minigame-select {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}
.minigame-select.active { display: flex; }
.minigame-select-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 350px;
    width: 90%;
}
.minigame-select-box h2 { margin-bottom: 20px; color: #333; }
.minigame-select-box .btn { display: block; width: 100%; margin-bottom: 12px; }
.minigame-select-box .btn:last-child { margin-bottom: 0; }
#minigameCanvas {
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(255,255,255,0.1);
    margin-top: 10px;
}
/* Выбор мини-игры */
.minigame-select-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
}
.minigame-select-content h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
}
.mg-select-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.mg-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px !important;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a) !important;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
}
.mg-select-btn:hover {
    transform: scale(1.04);
}
.mg-select-run {
    background: linear-gradient(135deg, #00c853, #00897b) !important;
}
.mg-icon {
    font-size: 30px;
    margin-bottom: 4px;
}
.mg-select-btn span:nth-child(2) {
    font-size: 16px;
    font-weight: bold;
}
.mg-desc {
    font-size: 12px;
    opacity: 0.85;
}

.btn-close {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    margin-top: 20px;
    width: 100%;
}

.phase-display {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
}

/* Меню гардероба */
.wardrobe-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.wardrobe-menu.active {
    display: flex;
}

.wardrobe-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.wardrobe-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.outfit-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: thin;
    scrollbar-color: #e91e63 #fce4ec;
}
.outfit-options::-webkit-scrollbar { width: 8px; }
.outfit-options::-webkit-scrollbar-track { background: #fce4ec; border-radius: 4px; }
.outfit-options::-webkit-scrollbar-thumb { background: #e91e63; border-radius: 4px; }

.outfit-btn {
    padding: 8px 6px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.outfit-btn:hover {
    border-color: #6c5ce7;
    transform: scale(1.05);
}

.outfit-btn.selected {
    border-color: #6c5ce7;
    background: #f8f9fa;
}

.outfit-preview {
    width: 40px;
    height: 40px;
    margin: 0 auto 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.outfit-btn span {
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

/* Анимации */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.cat-happy #catCanvas {
    animation: bounce 0.5s ease infinite;
}

.cat-eating .bowl-food {
    animation: wiggle 0.3s ease infinite;
}