:root {
    --app-max-width: 560px;
    --app-side-padding: 10px;
    --screen-gap: 6px;

    --menu-height: 64px;
    --menu-gap: 4px;
    --menu-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px));

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-left: env(safe-area-inset-left, 0px);

    --app-height: 100dvh;
    --content-bottom-space: calc(var(--menu-height) + 8px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

html,
body {
    width: 100%;
    min-height: 100%;
    padding-bottom: 0;
}

html {
    height: 100%;
}

body {
    min-height: 100vh;
    min-height: var(--app-height);
    color: #ffffff;
    overflow-x: hidden;
    background:
        linear-gradient(rgba(5, 10, 18, 0.50), rgba(5, 10, 18, 0.72)),
        url("../assets/backgrounds/background_main.png") center center / cover no-repeat fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(120, 220, 255, 0.16), transparent 28%),
        radial-gradient(circle at 78% 18%, rgba(255, 235, 140, 0.12), transparent 14%),
        radial-gradient(circle at 50% 70%, rgba(0, 255, 170, 0.08), transparent 34%);
}

body.telegram-webapp {
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(12px, var(--safe-top))
        max(12px, var(--safe-right))
        max(12px, var(--menu-safe-bottom))
        max(12px, var(--safe-left));
    background:
        linear-gradient(rgba(5, 10, 18, 0.20), rgba(5, 10, 18, 0.40)),
        url("../assets/backgrounds/background_main.png") center center / cover no-repeat;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loading-screen.loading-hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-visual {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
}

.loading-image-wrap {
    position: relative;
    width: 100%;
}

.loading-image {
    width: 100%;
    display: block;
    border-radius: 26px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.loading-progress-overlay {
    position: absolute;
    left: 50%;
    bottom: 11.5%;
    transform: translateX(-50%);
    width: 72%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-progress-bar {
    flex: 1;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(10, 18, 30, 0.40);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.25),
        0 0 16px rgba(94, 255, 105, 0.12);
}

.loading-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #32d9ff 0%, #43ff7e 45%, #d8ff3c 100%);
    box-shadow: 0 0 16px rgba(67, 255, 126, 0.34);
    transition: width 0.28s ease;
}

.loading-progress-text {
    min-width: 54px;
    text-align: right;
    font-size: 28px;
    font-weight: 900;
    color: #ffd95f;
    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.36),
        0 0 10px rgba(255, 221, 95, 0.18);
}

#app {
    position: relative;
    z-index: 1;
    width: min(100%, var(--app-max-width));
    min-height: var(--app-height);
    margin: 0 auto;
    padding:
        max(8px, var(--safe-top))
        max(var(--app-side-padding), var(--safe-right))
        var(--content-bottom-space)
        max(var(--app-side-padding), var(--safe-left));
    display: flex;
    flex-direction: column;
    gap: var(--screen-gap);
}

main,
#game,
main#game {
    width: 100%;
}

#game,
main#game {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.app,
.main-content,
.screen,
section,
.container,
.content {
    padding-bottom: 0;
    min-height: 0;
}

.screen {
    display: none;
    width: 100%;
    min-width: 0;
}

.screen:not(.hidden),
.screen.active-screen {
    display: block;
}

.hidden {
    display: none !important;
}

#screen-game,
#screen-zoo,
#screen-shop,
#screen-missions,
#screen-minigames,
#screen-ranking,
.game-main-card {
    width: 100%;
    min-width: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    min-height: 0 !important;
    height: auto !important;
}

.panel.card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        rgba(14, 24, 44, 0.58) 0%,
        rgba(10, 18, 34, 0.72) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    padding: 14px;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
}

.panel.card h2 {
    margin-bottom: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
}

button {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

#zooList,
#shopList,
#boxesList,
#missionsList,
#rankingList {
    width: 100%;
    min-width: 0;
}

/* ===== MENU ===== */

.menu {
    position: fixed;
    left: 6px;
    right: 6px;
    bottom: 0;
    z-index: 1000;

    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;

    padding: 4px;
    min-height: var(--menu-height);

    background: linear-gradient(180deg, rgba(10, 18, 34, 0.98) 0%, rgba(6, 11, 24, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px 16px 0 0;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.menu-btn {
    position: relative;
    min-width: 0;
    height: 48px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
    cursor: pointer;

    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease,
        opacity 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.menu-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.05), transparent 56%);
    opacity: 0.7;
}

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

.menu-btn:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.menu-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
    image-rendering: auto;
    filter: none;
    transition:
        transform 0.12s ease,
        opacity 0.12s ease;
    opacity: 0.96;
}

.menu-btn.active-nav {
    border-color: rgba(255, 213, 79, 0.18);
    background:
        radial-gradient(circle at 50% 22%, rgba(255, 220, 110, 0.10), transparent 52%),
        linear-gradient(180deg, rgba(255, 214, 82, 0.14) 0%, rgba(255, 190, 40, 0.08) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.menu-btn.active-nav .menu-icon {
    opacity: 1;
    transform: scale(1.04);
    filter: none;
}

.menu-btn:not(.active-nav) .menu-icon {
    transform: scale(1);
}

/* ===== TOP BAR ===== */

.top-bar {
    width: 100%;
    margin: 0 0 6px;
}

.top-bar-shell {
    width: 100%;
    min-height: 84px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 20% 30%, rgba(66, 220, 255, 0.12) 0%, rgba(66, 220, 255, 0) 28%),
        radial-gradient(circle at 72% 20%, rgba(255, 214, 102, 0.10) 0%, rgba(255, 214, 102, 0) 24%),
        linear-gradient(180deg, rgba(20, 31, 56, 0.98) 0%, rgba(10, 17, 32, 0.98) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    overflow: hidden;
    position: relative;
}

.top-bar-shell::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 9px;
    bottom: 9px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.04);
    pointer-events: none;
}

.top-bar-main {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 84px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.top-profile-trigger {
    position: relative;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
}

.top-profile-trigger:active {
    transform: scale(0.97);
}

.top-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex: 0 0 auto;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.03) 26%, rgba(255,255,255,0) 27%),
        linear-gradient(180deg, rgba(49, 72, 110, 0.95) 0%, rgba(30, 46, 72, 0.98) 100%);
    border: 2px solid rgba(255,255,255,0.14);
    box-shadow:
        0 8px 18px rgba(0,0,0,0.24),
        0 0 0 4px rgba(88, 219, 255, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.top-profile-ring {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(180deg, #6dff8b 0%, #29cb5a 100%);
    border: 2px solid rgba(9, 17, 32, 0.95);
    box-shadow: 0 0 10px rgba(89, 255, 124, 0.45);
    pointer-events: none;
}

.top-user-meta {
    min-width: 0;
}

.top-user-name {
    font-size: 20px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
}

.top-user-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #8af7a5;
    line-height: 1;
    white-space: nowrap;
    background: rgba(8, 17, 30, 0.34);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.top-bar-overlay-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.top-icon-chip {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    background: rgba(10, 18, 35, 0.52);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 8px 18px rgba(0, 0, 0, 0.20);
    backdrop-filter: blur(10px);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
    animation: topIconFloat 2.8s ease-in-out infinite;
}

.top-icon-chip:active {
    transform: scale(0.94);
}

.top-icon-chip:hover {
    filter: brightness(1.06);
}

.top-icon-chip-star {
    animation-delay: 0s;
}

.top-icon-chip-settings {
    animation-delay: 0.2s;
}

.stats-panel {
    display: none;
}

/* ===== HOME ===== */

.game-main-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-stats-panel {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}

.home-stat-box {
    position: relative;
    min-width: 0;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(
        180deg,
        rgba(24, 33, 58, 0.96) 0%,
        rgba(13, 20, 37, 0.94) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 10px 11px;
    box-shadow:
        0 14px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.home-stat-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 42%);
    pointer-events: none;
}

.home-stat-box-wide {
    grid-column: auto;
}

.home-stat-title {
    font-size: 10px;
    color: rgba(255,255,255,0.68);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-stat-value {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.05;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tap-area {
    position: relative;
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 8px 0 12px;
}

.tap-glow {
    position: absolute;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(58, 210, 255, 0.22) 0%, rgba(58, 210, 255, 0.10) 36%, rgba(58, 210, 255, 0) 70%);
    filter: blur(10px);
    pointer-events: none;
}

.tap-button {
    position: relative;
    z-index: 1;
    width: 196px;
    height: 196px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.06) 22%, rgba(255,255,255,0) 24%),
        linear-gradient(180deg, rgba(54, 111, 255, 0.96) 0%, rgba(36, 78, 209, 0.98) 100%);
    box-shadow:
        0 24px 44px rgba(8, 20, 48, 0.34),
        inset 0 3px 12px rgba(255,255,255,0.16),
        inset 0 -10px 18px rgba(7, 18, 48, 0.24);
}

.tap-button::before {
    content: "";
    position: absolute;
    top: -30px;
    right: -30px;
    bottom: -30px;
    left: -30px;
    border-radius: 50%;
    background: transparent;
}

.tap-button:active {
    transform: scale(0.97);
}

.home-tap-caption {
    text-align: center;
    margin-top: -4px;
}

.home-tap-title {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.6px;
}

.home-tap-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.74);
}

.home-income-strip {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    margin-top: 2px;
}

.home-income-left,
.home-boost-right {
    min-width: 0;
    border-radius: 16px;
    padding: 11px 12px;
    background: linear-gradient(
        180deg,
        rgba(20, 29, 49, 0.92) 0%,
        rgba(11, 18, 34, 0.94) 100%
    );
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.home-income-label,
.home-boost-title {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,0.72);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.home-income-value {
    margin-top: 5px;
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.05;
    word-break: break-word;
}

.home-boost-right {
    min-width: 132px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-boost-button {
    margin-top: 8px;
    border: none;
    border-radius: 12px;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffe27a 0%, #ffbf00 100%);
    box-shadow: 0 8px 16px rgba(255, 191, 0, 0.18);
}

.home-boost-button:active {
    transform: scale(0.985);
}

.home-boost-status {
    margin-top: 7px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.78);
    line-height: 1.3;
}

.home-zoo-preview {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 8px;
    background: linear-gradient(
        180deg,
        rgba(20, 29, 49, 0.92) 0%,
        rgba(11, 18, 34, 0.94) 100%
    );
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 12px;
    box-shadow:
        0 14px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(8px);
}

.home-zoo-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    min-width: 0;
}

.home-zoo-preview-title {
    font-size: 17px;
    font-weight: 900;
    color: #ffffff;
    min-width: 0;
}

.home-zoo-preview-button {
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 800;
    cursor: pointer;
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffe27a 0%, #ffbf00 100%);
    box-shadow: 0 8px 16px rgba(255, 191, 0, 0.16);
    flex: 0 0 auto;
}

.home-zoo-preview-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.home-zoo-preview-card {
    min-width: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 9px 7px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.home-zoo-preview-card img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 7px;
}

.home-zoo-preview-name {
    font-size: 12px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 4px;
}

.home-zoo-preview-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.78);
    line-height: 1.35;
    margin-bottom: 7px;
    word-break: break-word;
}

.home-zoo-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.home-zoo-preview-actions button {
    border: none;
    border-radius: 10px;
    padding: 7px 5px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    min-width: 0;
}

.home-zoo-preview-actions button:first-child {
    color: #ffffff;
    background: linear-gradient(180deg, #41cf88 0%, #23a86b 100%);
}

.home-zoo-preview-actions button:last-child {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(73, 91, 138, 0.95) 0%, rgba(56, 71, 110, 0.95) 100%);
}

.home-quick-panel {
    width: 100%;
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.home-quick-card {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    color: #ffffff;
    background: linear-gradient(
        180deg,
        rgba(18, 28, 48, 0.96) 0%,
        rgba(10, 17, 31, 0.95) 100%
    );
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.home-quick-card:active {
    transform: scale(0.985);
}

.home-quick-card:hover {
    filter: brightness(1.03);
}

.home-quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    background: rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.home-quick-text {
    min-width: 0;
    flex: 1 1 auto;
}

.home-quick-title {
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
}

.home-quick-subtitle {
    margin-top: 3px;
    font-size: 10px;
    color: rgba(255,255,255,0.72);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#homeDailyBtn {
    position: relative;
    border-color: rgba(255, 214, 102, 0.20);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 221, 120, 0.14) 0%, rgba(255, 221, 120, 0) 30%),
        linear-gradient(
            180deg,
            rgba(28, 36, 58, 0.98) 0%,
            rgba(14, 21, 37, 0.98) 100%
        );
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.20),
        0 0 0 1px rgba(255, 214, 102, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

#homeDailyBtn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 42%);
}

#homeDailyBtn:active {
    transform: scale(0.982);
}

#homeDailyBtn .home-quick-icon {
    background: linear-gradient(180deg, rgba(255, 227, 122, 0.22) 0%, rgba(255, 191, 0, 0.10) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        0 0 16px rgba(255, 196, 0, 0.10);
}

#homeDailyBtn .home-quick-title {
    color: #fff4c4;
}

#homeDailyBtn .home-quick-subtitle {
    color: rgba(255,255,255,0.80);
}

/* ===== PROFILE MODAL ===== */

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.profile-modal.hidden {
    display: none;
}

.profile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
    z-index: 0;
}

.profile-card {
    position: relative;
    z-index: 1;
    width: min(calc(100vw - 24px), 420px);
    max-width: calc(100vw - 24px);
    max-height: min(90vh, calc(var(--app-height) - 24px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(
        180deg,
        rgba(16, 25, 45, 0.98) 0%,
        rgba(10, 16, 30, 0.98) 100%
    );
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.profile-card::-webkit-scrollbar {
    width: 6px;
}

.profile-card::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
}

#settingsModal .profile-card {
    max-height: min(84vh, calc(var(--app-height) - 24px));
    overflow-y: auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: linear-gradient(180deg, #31486e 0%, #1e2e48 100%);
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow:
        0 10px 20px rgba(0,0,0,0.20),
        inset 0 1px 0 rgba(255,255,255,0.06);
}

.profile-user-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.profile-name {
    font-size: 21px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    word-break: break-word;
}

.profile-subtitle {
    margin-top: 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.68);
    line-height: 1.2;
    word-break: break-word;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.profile-box {
    min-width: 0;
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.06) 0%,
        rgba(255,255,255,0.03) 100%
    );
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.profile-box-label {
    font-size: 11px;
    color: rgba(255,255,255,0.66);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-box-value {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    word-break: break-word;
}

.profile-boost-row {
    margin-bottom: 16px;
    border-radius: 18px;
    padding: 12px 14px;
    background: linear-gradient(
        180deg,
        rgba(24, 33, 58, 0.90) 0%,
        rgba(13, 20, 37, 0.92) 100%
    );
    border: 1px solid rgba(255,255,255,0.08);
}

.profile-boost-left {
    min-width: 0;
}

.profile-boost-label {
    font-size: 11px;
    color: rgba(255,255,255,0.66);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-boost-value {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    word-break: break-word;
}

.profile-boost-value.active {
    color: #ffd86b;
}

.profile-close-btn {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffe27a 0%, #ffbf00 100%);
    box-shadow: 0 8px 16px rgba(255, 191, 0, 0.18);
}

.profile-close-btn:active {
    transform: scale(0.985);
}

#closeProfileBtn,
#closeSettingsBtn,
#closeDailyRewardBtn {
    display: block;
    margin-top: 18px;
}

@keyframes topIconFloat {
    0% {
        transform: translateY(0);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.08),
            0 8px 18px rgba(0, 0, 0, 0.20);
    }
    50% {
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.08),
            0 12px 22px rgba(0, 0, 0, 0.24);
    }
    100% {
        transform: translateY(0);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.08),
            0 8px 18px rgba(0, 0, 0, 0.20);
    }
}

/* ===== MOCNY FIX ZOO / SHOP / LIST ===== */

#screen-zoo,
#screen-shop,
#screen-missions,
#screen-minigames,
#screen-ranking {
    min-height: 0 !important;
    height: auto !important;
}

#screen-zoo .panel.card,
#screen-shop .panel.card,
#screen-missions .panel.card,
#screen-minigames .panel.card,
#screen-ranking .panel.card {
    min-height: unset !important;
    height: fit-content !important;
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    padding-bottom: 6px !important;
    margin-bottom: 0 !important;
}

#zooList,
.zoo-list,
.animal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

#zooList > *:last-child,
.zoo-list > *:last-child,
.animal-list > *:last-child {
    margin-bottom: 0 !important;
}

#screen-zoo .panel.card::after,
#screen-shop .panel.card::after,
#screen-missions .panel.card::after,
#screen-minigames .panel.card::after,
#screen-ranking .panel.card::after {
    content: none !important;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 560px) {
    :root {
        --app-side-padding: 8px;
        --screen-gap: 6px;
        --menu-height: 60px;
        --menu-gap: 4px;
        --content-bottom-space: calc(var(--menu-height) + 8px);
    }

    .menu {
        left: 5px;
        right: 5px;
        bottom: 0;
        gap: 4px;
        padding: 4px;
        border-radius: 15px 15px 0 0;
    }

    .menu-btn {
        height: 46px;
        border-radius: 11px;
    }

    .menu-icon {
        width: 32px;
        height: 32px;
    }

    .top-bar {
        margin-bottom: 6px;
    }

    .top-bar-shell {
        min-height: 76px;
        border-radius: 18px;
    }

    .top-bar-shell::before {
        left: 10px;
        right: 10px;
        top: 8px;
        bottom: 8px;
        border-radius: 14px;
    }

    .top-bar-main {
        min-height: 76px;
        padding: 8px 10px;
        gap: 8px;
    }

    .top-bar-left {
        gap: 8px;
    }

    .top-profile-trigger {
        width: 46px;
        height: 46px;
    }

    .top-avatar {
        width: 46px;
        height: 46px;
    }

    .top-profile-ring {
        width: 11px;
        height: 11px;
        right: 1px;
        bottom: 1px;
    }

    .top-user-name {
        font-size: 18px;
    }

    .top-user-status {
        font-size: 9px;
        margin-top: 4px;
        padding: 3px 7px;
    }

    .top-bar-overlay-actions {
        gap: 5px;
    }

    .top-icon-chip {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .home-stats-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 7px;
    }

    .home-stat-box {
        min-height: 66px;
        padding: 9px;
        border-radius: 14px;
    }

    .home-stat-title {
        font-size: 9px;
    }

    .home-stat-value {
        font-size: 16px;
    }

    .tap-area {
        min-height: 244px;
        padding: 8px 0 12px;
    }

    .tap-glow {
        width: 235px;
        height: 235px;
    }

    .tap-button {
        width: 176px;
        height: 176px;
    }

    .tap-button::before {
        top: -26px;
        right: -26px;
        bottom: -26px;
        left: -26px;
    }

    .home-tap-title {
        font-size: 17px;
    }

    .home-tap-subtitle {
        font-size: 11px;
    }

    .home-income-strip {
        grid-template-columns: 1fr;
    }

    .home-income-value {
        font-size: 19px;
    }

    .home-boost-right {
        min-width: 0;
    }

    .home-zoo-preview {
        margin-top: 6px;
        margin-bottom: 6px;
        padding: 10px;
        border-radius: 18px;
    }

    .home-zoo-preview-head {
        flex-wrap: wrap;
        margin-bottom: 8px;
    }

    .home-zoo-preview-title {
        font-size: 14px;
    }

    .home-zoo-preview-button {
        width: 100%;
        padding: 8px 10px;
        font-size: 11px;
    }

    .home-zoo-preview-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .home-zoo-preview-card {
        padding: 8px 6px;
        border-radius: 14px;
    }

    .home-zoo-preview-card img {
        width: 40px;
        height: 40px;
        margin-bottom: 5px;
    }

    .home-zoo-preview-name {
        font-size: 11px;
    }

    .home-zoo-preview-meta {
        font-size: 9px;
        margin-bottom: 5px;
    }

    .home-zoo-preview-actions button {
        padding: 6px 4px;
        font-size: 8px;
        border-radius: 8px;
    }

    .home-quick-panel {
        gap: 7px;
    }

    .home-quick-card {
        padding: 10px;
        border-radius: 14px;
        gap: 9px;
    }

    .home-quick-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
        border-radius: 11px;
    }

    .home-quick-title {
        font-size: 12px;
    }

    .home-quick-subtitle {
        font-size: 9px;
    }

    #homeDailyBtn::after {
        border-radius: 14px;
    }

    .profile-modal {
        padding: 8px;
        align-items: flex-start;
    }

    .profile-card {
        width: min(calc(100vw - 16px), 420px);
        max-width: calc(100vw - 16px);
        max-height: min(92vh, calc(var(--app-height) - 16px));
        padding: 16px;
        border-radius: 20px;
        margin: 8px auto;
    }

    .profile-name {
        font-size: 18px;
    }

    .profile-grid {
        gap: 8px;
    }

    .profile-box {
        padding: 10px;
        border-radius: 16px;
    }

    .profile-box-value {
        font-size: 16px;
    }

    .profile-close-btn {
        padding: 11px 12px;
        border-radius: 14px;
    }

    #closeProfileBtn,
    #closeSettingsBtn,
    #closeDailyRewardBtn {
        margin-top: 16px;
    }

    #settingsModal .profile-card {
        max-height: min(92vh, calc(var(--app-height) - 16px));
    }

    .loading-visual {
        max-width: 360px;
    }

    .loading-progress-overlay {
        width: 73%;
        bottom: 11%;
        gap: 8px;
    }

    .loading-progress-bar {
        height: 13px;
    }

    .loading-progress-text {
        min-width: 44px;
        font-size: 22px;
    }

    .panel.card {
        border-radius: 18px;
        padding: 12px;
    }

    .panel.card h2 {
        font-size: 21px;
    }
}

@media (max-width: 400px) {
    :root {
        --menu-height: 56px;
        --content-bottom-space: calc(var(--menu-height) + 8px);
    }

    .menu {
        left: 4px;
        right: 4px;
        bottom: 0;
        gap: 4px;
        padding: 4px;
        border-radius: 14px 14px 0 0;
    }

    .menu-btn {
        height: 42px;
        border-radius: 10px;
    }

    .menu-icon {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 380px) {
    :root {
        --app-side-padding: 6px;
        --content-bottom-space: calc(var(--menu-height) + 8px);
    }

    .top-bar-shell {
        min-height: 70px;
        border-radius: 16px;
    }

    .top-bar-shell::before {
        left: 8px;
        right: 8px;
        top: 7px;
        bottom: 7px;
        border-radius: 12px;
    }

    .top-bar-main {
        min-height: 70px;
        padding: 8px;
        gap: 8px;
    }

    .top-bar-left {
        gap: 8px;
    }

    .top-profile-trigger {
        width: 40px;
        height: 40px;
    }

    .top-avatar {
        width: 40px;
        height: 40px;
    }

    .top-user-name {
        font-size: 15px;
    }

    .top-user-status {
        font-size: 8px;
        padding: 3px 6px;
    }

    .top-bar-overlay-actions {
        gap: 4px;
    }

    .top-icon-chip {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .home-stats-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tap-area {
        min-height: 224px;
        padding: 7px 0 10px;
    }

    .tap-glow {
        width: 205px;
        height: 205px;
    }

    .tap-button {
        width: 160px;
        height: 160px;
    }

    .tap-button::before {
        top: -24px;
        right: -24px;
        bottom: -24px;
        left: -24px;
    }

    .home-zoo-preview-list {
        grid-template-columns: 1fr;
    }

    .home-zoo-preview-card {
        padding: 9px;
    }

    .profile-modal {
        padding: 6px;
        align-items: flex-start;
    }

    .profile-card {
        max-height: min(94vh, calc(var(--app-height) - 12px));
        padding: 14px;
        border-radius: 18px;
        margin: 6px auto;
    }

    .profile-header {
        gap: 12px;
    }

    .profile-avatar {
        width: 54px;
        height: 54px;
    }

    .profile-name {
        font-size: 17px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    #closeProfileBtn,
    #closeSettingsBtn,
    #closeDailyRewardBtn {
        margin-top: 14px;
    }

    #settingsModal .profile-card {
        max-height: min(94vh, calc(var(--app-height) - 12px));
    }

    .panel.card {
        padding: 10px;
        border-radius: 16px;
    }

    .panel.card h2 {
        font-size: 19px;
    }
}