body {
    background-color: #1a1a1a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background-color: #1c1c1e;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    text-align: center;
}

.game-icon-body {
    text-align: center;
    margin-bottom: 20px;
}

.game-icon-body .fas {
    font-size: 60px;
    color: #007bff;
    /* Синій колір для іконки */
}

.main-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.description {
    font-size: 16px;
    color: #b0b0b0;
    margin-bottom: 30px;
}

.wallet-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.coin-balance,
.ton-balance {
    background-color: #2c2c2e;
    border-radius: 12px;
    padding: 15px 25px;
    text-align: center;
}

.balance-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
}

.balance-label {
    display: block;
    font-size: 14px;
    color: #8e8e93;
    margin-top: 5px;
}

.game-modes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-card {
    background-color: #2c2c2e;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.2s ease;
}

.mode-card:hover {
    background-color: #3a3a3c;
}

.mode-icon {
    font-size: 24px;
    margin-right: 15px;
}

.mode-text {
    font-size: 18px;
    font-weight: 500;
}

.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    /* Це головна зміна */
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #8e8e93;
    font-size: 12px;
    transition: color 0.2s ease;
}

.nav-item.active,
.nav-item:hover {
    color: #007bff;
    /* Синій колір для активних елементів */
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 11px;
}

.mode-card {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.mode-card:not(.disabled):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Стиль для активного (вибраного) режиму */
.mode-card.active {
    border: 2px solid #007bff;
    /* Яскрава рамка для виділення */
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
}

/* Стилі для неактивних режимів */
.mode-card.disabled {
    filter: grayscale(80%);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Напис "В розробці" */
.mode-card.disabled::after {
    content: 'В розробці';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
}

.launch-button,
#launch-game-btn {
    background: linear-gradient(90deg, #007bff 0%, #00c3ff 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 36px;
    font-size: 1.15rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin: 24px auto 0 auto;
    display: block;
    outline: none;
}

.launch-button:hover,
#launch-game-btn:hover,
.launch-button:focus,
#launch-game-btn:focus {
    background: linear-gradient(90deg, #0056b3 0%, #0099cc 100%);
    transform: translateY(-2px) scale(1.03);
}

/* --- КНОПКА "НАЗАД" ДЛЯ UNITY --- */
#close-unity-btn {
    position: absolute;
    top: 18px;
    right: 24px;
    z-index: 1001;
    padding: 12px 28px;
    font-size: 1rem;
    background: linear-gradient(90deg, #222 0%, #444 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    outline: none;
}

#close-unity-btn:hover,
#close-unity-btn:focus {
    background: linear-gradient(90deg, #333 0%, #666 100%);
    transform: translateY(-2px) scale(1.03);
}

/* --- UNITY GAME FULLSCREEN CONTAINER --- */
#unity-game-container {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: #111;
}

#unity-game-frame {
    width: 100vw;
    height: 100vh;
    border: none;
    background: #111;
}


/* --- PROFILE PAGE STYLES --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    justify-content: center;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #007bff;
    background: #222;
}
.profile-info h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}
.profile-username {
    color: #8e8e93;
    font-size: 1rem;
}
.wallet-section {
    background: #23232a;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}
.wallet-address {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.wallet-label {
    color: #b0b0b0;
    font-size: 1rem;
}
.wallet-btn {
    background: linear-gradient(90deg, #007bff 0%, #00c3ff 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.wallet-btn:hover, .wallet-btn:focus {
    background: linear-gradient(90deg, #0056b3 0%, #0099cc 100%);
}
.logout-btn {
    background: linear-gradient(90deg, #ff3b3b 0%, #ff7b7b 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-left: 8px;
    display: inline-block;
}
.logout-btn:hover, .logout-btn:focus {
    background: linear-gradient(90deg, #b30000 0%, #ff3b3b 100%);
    transform: translateY(-2px) scale(1.03);
}
.wallet-balances {
    display: flex;
    gap: 30px;
    font-size: 1.1rem;
}
.balance-label {
    color: #b0b0b0;
    margin-right: 6px;
}
.achievements-section, .history-section {
    background: #23232a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    text-align: left;
}
.achievements-section h3, .history-section h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #00c3ff;
}
.achievements-list, .games-history {
    list-style: none;
    padding: 0;
    margin: 0;
}
.achievements-list li, .games-history li {
    padding: 6px 0;
    border-bottom: 1px solid #292929;
    font-size: 1rem;
}
.achievements-list li:last-child, .games-history li:last-child {
    border-bottom: none;
}
.achievement.locked {
    color: #888;
    opacity: 0.7;
}
.achievement.unlocked {
    color: #fff;
    font-weight: 600;
    opacity: 1;
}
.ach-status {
    margin-left: 8px;
    font-size: 1.1em;
}
.empty-message {
    color: #888;
    font-size: 1rem;
    padding: 10px 0 0 0;
    text-align: center;
}
/* --- End of Profile Page Styles --- */

/* --- STATS --- */
.stats-section, .leaderboard-section {
    background: #23232a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    text-align: left;
}
.stats-section h3, .leaderboard-section h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #00c3ff;
}
.personal-stats-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
}
.personal-stats-list li {
    padding: 6px 0;
    border-bottom: 1px solid #292929;
    font-size: 1rem;
}
.personal-stats-list li:last-child {
    border-bottom: none;
}
.stat-placeholder {
    color: #888;
    font-style: italic;
}
.leaderboard-section .empty-message {
    margin-top: 8px;
    font-size: 1rem;
    color: #888;
    text-align: center;
}
/* --- End of Stats Styles --- */

/* --- Settings Page Styles --- */
.settings-section {
    margin: 18px 0;
    background: #23232a;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 1.1rem;
}
.settings-select {
    border-radius: 8px;
    border: 1px solid #444;
    background: #18181e;
    color: #fff;
    padding: 7px 18px;
    font-size: 1rem;
    margin-left: 12px;
}
.settings-select:focus {
    outline: 2px solid #00c3ff;
}
/* --- End of Settings Page Styles --- */

/* --- News Page Styles --- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}
.news-card {
    background: #23232a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 12px 16px;
}
.news-card:hover {
    box-shadow: 0 4px 16px rgba(0,195,255,0.12);
    transform: translateY(-2px) scale(1.01);
}
.news-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: #18181e;
}
.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.news-info {
    flex: 1;
}
.empty-message {
    color: #888;
    font-size: 1rem;
    padding: 18px 0;
    text-align: center;
}

/* --- Модальне вікно --- */
.news-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.65);
    align-items: center;
    justify-content: center;
}
.news-modal-content {
    background: #23232a;
    border-radius: 16px;
    padding: 24px 18px 18px 18px;
    max-width: 420px;
    width: 95vw;
    position: relative;
    text-align: center;
}
.news-modal-close {
    position: absolute;
    top: 12px; right: 18px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}
.news-modal-image {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 14px;
}
.news-modal-link {
    display: inline-block;
    margin-top: 18px;
    color: #00c3ff;
    text-decoration: underline;
    font-weight: 600;
}
/* --- End of News Page Styles --- */