/* Основные стили для SMS.BY Games */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Загрузка */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading p {
    font-size: 18px;
    color: #FFD700;
    font-weight: 600;
    animation: pulse 2s infinite;
}

/* Основное приложение */
.app {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
}

.app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 165, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Секции */
.section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.section.active {
    display: block;
}

/* Экран никнейма */
.nickname-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 50px auto; /* Возвращаем нормальные отступы */
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.nickname-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.nickname-form h1 {
    font-size: 2.5rem;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite, pulse 2s infinite;
}

.nickname-form p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 30px;
}

.form-group {
        display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group label {
    font-size: 1.1rem;
    color: #FFD700;
    font-weight: 600;
}

.form-group input {
    padding: 15px 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    transform: scale(1.02);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Главное меню */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 4s infinite;
}

.header h1 {
    font-size: 2rem;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: pulse 3s infinite;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite, pulse 3s infinite;
}

.user-info {
        display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#user-nickname {
    font-size: 1.1rem;
    color: #FFD700;
    font-weight: 600;
}

.points {
    font-size: 1.2rem;
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: pulse 2s infinite;
}

/* Сетка меню */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.menu-item {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.menu-item:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #FFD700;
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.3);
    animation: glow 2s infinite;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s;
}

.menu-item:hover::before {
    left: 100%;
}

.menu-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.menu-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.5);
    animation: bounce 0.6s ease;
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #FFD700;
    border: 2px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: #FFD700;
    transform: translateY(-2px);
}

/* Меню игр */
.game-menu-header {
        display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.game-menu-header h2 {
    font-size: 2rem;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite;
}

.game-description {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.game-description p {
    color: #ccc;
    margin-bottom: 10px;
    line-height: 1.6;
}

.game-top {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.game-top h3 {
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.top-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

.top-item.top-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    animation: glow 2s infinite;
}

.top-item.top-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #000;
    font-weight: bold;
}

.top-item.top-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
    color: #000;
    font-weight: bold;
}

.top-rank {
    font-weight: bold;
    font-size: 1.2rem;
    padding: 5px 10px;
    border-radius: 50%;
    min-width: 30px;
    text-align: center;
}

.top-rank.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: glow 2s infinite;
}

.top-rank.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #000;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.top-rank.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
    color: #000;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.top-rank.rank-other {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.top-name {
    flex: 1;
    margin: 0 15px;
}

.top-score {
    font-weight: bold;
    color: #4CAF50;
}

.game-controls {
    text-align: center;
    margin-top: 30px;
}

/* Игровые секции */
.game-section {
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-canvas {
    border: 2px solid #FFD700;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    background: #1a1a2e;
    margin: 20px auto;
    display: block;
}

.game-info {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 600px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.game-stat {
    text-align: center;
    color: #FFD700;
    font-weight: 600;
}

.game-stat span {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

.game-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.modal h2 {
    color: #FFD700;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.modal p {
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Профиль */
.profile-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    border: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 4s infinite;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    animation: pulse 3s infinite;
    position: relative;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    border-radius: 50%;
    z-index: -1;
    animation: spin 3s linear infinite;
}

.profile-name {
    font-size: 1.5rem;
    color: #FFD700;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.profile-nickname {
    color: #ccc;
    margin-bottom: 15px;
}

.profile-points {
    font-size: 1.3rem;
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: pulse 2s infinite;
}

.profile-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.profile-stats h3 {
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    padding: 10px;
    margin: 0 -10px;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item span:first-child {
    color: #ccc;
}

.stat-item span:last-child {
    color: #FFD700;
    font-weight: bold;
}

/* Таблица лидеров */
.leaderboard-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.leaderboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 5s infinite;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.tab-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.tab-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    transform: translateY(-2px);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leaderboard-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s;
}

.leaderboard-item:hover::before {
    left: 100%;
}

.leaderboard-item:nth-child(1) {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    animation: glow 2s infinite;
}

.leaderboard-item:nth-child(2) {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #000;
    font-weight: bold;
}

.leaderboard-item:nth-child(3) {
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
    color: #000;
    font-weight: bold;
}

.leaderboard-rank {
    font-weight: bold;
    color: #FFD700;
    min-width: 40px;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 8px;
    text-align: center;
    }
    
.leaderboard-name {
    flex: 1;
    margin: 0 15px;
    font-weight: 500;
}

.leaderboard-score {
    font-weight: bold;
    color: #4CAF50;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(76, 175, 80, 0.2);
    padding: 5px 10px;
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
    }
    
/* Судоку */
.sudoku-info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #000;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.sudoku-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 1px solid #000;
}

.sudoku-label {
    font-weight: 700;
    font-size: 16px;
    color: #000;
}

.sudoku-value {
    background: #000;
    color: #FFD700;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    min-width: 60px;
    text-align: center;
    border: 2px solid #FFD700;
}

.pause-btn {
    background: #000;
    color: #FFD700;
    border: 2px solid #FFD700;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
}

.casino-info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.casino-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    padding: 15px 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.casino-info-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.casino-label {
    font-size: 1rem;
    color: #FFD700;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.5px;
}

.casino-value-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.casino-value {
    font-size: 1.4rem;
    color: #FFFFFF;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    background: linear-gradient(45deg, #FFFFFF, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s infinite;
    line-height: 1.2;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

.casino-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.bet-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.bet-presets-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.bet-presets-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.spin-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #000000;
    color: #000000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #FFFF00, #FFD700);
}

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

.casino-bet {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 100px;
        text-align: center;
    transition: all 0.3s ease;
}

.casino-bet:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.casino-points {
    background: rgba(76, 175, 80, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 100px;
    text-align: center;
    transition: all 0.3s ease;
}

.casino-points:hover {
    background: rgba(76, 175, 80, 0.2);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* Отсчет */
.countdown-content {
    text-align: center;
}

.countdown-number {
    font-size: 4rem;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: pulse 1s infinite;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s infinite, pulse 1s infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
    flex-direction: column;
    gap: 15px;
        text-align: center;
}

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    }
    
    .menu-item {
        padding: 20px 15px;
    }
    
    .menu-icon {
        font-size: 2.5rem;
    }
    
    .menu-text {
        font-size: 1rem;
    }
    
    .game-menu-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    }
    
    .casino-controls {
    flex-direction: column;
    }
    
    .modal-content {
    padding: 20px;
        margin: 20px;
    }
    
    .countdown-number {
        font-size: 3rem;
    }
    
    /* Адаптивность для игровых canvas */
    .game-canvas {
        max-width: 90vw;
        max-height: 60vh;
        width: auto;
        height: auto;
    }
    
    .game-info {
        flex-direction: column;
    align-items: center;
        gap: 10px;
    }
    
    .game-stat {
        padding: 8px 15px;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .nickname-form {
        margin: 20px;
    padding: 20px;
}

    .nickname-form h1 {
        font-size: 2rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    /* Адаптивность для игровых canvas на маленьких экранах */
    .game-canvas {
        max-width: 95vw;
        max-height: 50vh;
        width: auto;
        height: auto;
    }
    
    .game-info {
        flex-direction: column;
    align-items: center;
        gap: 8px;
    }
    
    .game-stat {
        padding: 6px 12px;
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .game-stat-label {
        font-size: 0.8rem;
    }
    
    .game-stat-value {
        font-size: 1rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .game-section {
    padding: 10px;
    }
    
    .game-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-controls {
        flex-direction: column;
    align-items: center;
    }
}

/* Стили для контейнера переключателя языка */
.language-switch-container {
    position: absolute;
    top: 20px; /* Возвращаем наверх для экрана никнейма */
    right: 20px;
    z-index: 1000;
}

/* Стили для кнопки переключения языка */
.language-switch {
    position: absolute;
    top: 20px; /* Возвращаем наверх для экрана никнейма */
    right: 20px;
}

.btn-language-switch {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid #FFD700;
    color: #FFD700;
    padding: 12px 20px; /* Увеличиваем размер для лучшего касания */
    border-radius: 30px; /* Более округлая форма */
    font-size: 1rem; /* Увеличиваем шрифт */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    min-width: 80px; /* Минимальная ширина для удобства */
    justify-content: center;
}

.btn-language-switch:hover {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.btn-language-switch:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.lang-icon {
    font-size: 1.2rem;
}

.lang-text {
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Стили для выбора языка на экране никнейма */
.language-selection {
    margin: 20px 0;
    text-align: center;
}

.language-selection h3 {
    margin-bottom: 15px;
    color: #fff;
        font-size: 1.2rem;
    }
    
.language-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-language {
    padding: 12px 24px;
    font-size: 1rem;
    border: 2px solid #FFD700;
    background: transparent;
    color: #FFD700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-language:hover {
    background: #FFD700;
    color: #1a1a2e;
    transform: translateY(-2px);
}

.btn-language.active {
    background: #FFD700;
    color: #1a1a2e;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

/* Адаптивность для кнопок языка */
@media (max-width: 480px) {
    .language-buttons {
        flex-direction: column;
        align-items: center;
    gap: 10px;
    }
    
    .btn-language {
        min-width: 150px;
        padding: 15px 20px;
    }
}

/* Стили для extra-large кнопок управления */
.control-btn.extra-large {
    width: 100px;
    height: 100px;
    font-size: 32px;
    margin: 15px; /* Увеличиваем отступы для iPhone */
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    touch-action: manipulation; /* Оптимизация для сенсорных экранов */
}

.control-btn.extra-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Увеличенные отступы для кнопок управления */
.control-row {
    gap: 20px; /* Увеличиваем расстояние между кнопками */
    margin: 15px 0; /* Увеличиваем вертикальные отступы */
    justify-content: center; /* Центрируем кнопки */
}

/* Адаптация для iPhone */
@media (max-width: 480px) {
    .control-btn.extra-large {
        width: 90px;
        height: 90px;
        font-size: 28px;
        margin: 12px;
    }
    
    .control-row {
        gap: 18px;
        margin: 12px 0;
    }
    
    .language-switch-container {
        top: 140px; /* Еще ниже на маленьких экранах */
    }
    
    .btn-language-switch {
        padding: 15px 24px; /* Больше размер на мобильных */
        font-size: 1.1rem;
        min-width: 90px;
    }
    
    .casino-info-panel {
        padding: 20px 15px;
        min-height: 120px;
    }
    
    .casino-info-item {
        min-width: 100px;
        padding: 12px 8px;
        gap: 10px;
    }
    
    .casino-value {
        font-size: 1.2rem;
    }
    
    .casino-value-container {
        min-height: 50px;
    }
}

/* Стили для кнопки языка под формой никнейма */
.language-switch-under-form {
        text-align: center;
    margin-top: 30px;
        padding: 20px;
    }
    
/* Стили для кнопки языка между заголовком и играми */
.language-switch-between {
    text-align: center;
    margin: 0; /* Без отступов */
    padding: 1px; /* Минимальный padding */
}

.language-switch-between .btn-language-switch {
    width: 100%; /* Полная ширина как у игр */
    max-width: none; /* Убираем ограничение ширины */
    justify-content: center;
    margin: 0 auto; /* Центрирование */
    height: 60px; /* Высота как у игр */
    display: flex;
    align-items: center;
    font-size: 16px;
}

/* Специальные стили для игровых экранов */
.game-section .language-switch-container {
    top: 120px; /* Кнопка языка ниже для игровых экранов */
}

/* Стили для профиля другого игрока */
#other-player-profile .profile-content {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-top: 20px;
}

.player-info {
        text-align: center;
    margin-bottom: 30px;
}

.player-info h3 {
    color: #FFD700;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.player-stats {
    display: flex;
        flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
        align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-label {
    color: #fff;
    font-weight: 500;
}

.stat-value {
    color: #FFD700;
    font-weight: bold;
    font-size: 1.2rem;
}

.game-stats h4 {
    color: #FFD700;
        text-align: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Стили для кликабельных элементов лидерборда */
.leaderboard-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.leaderboard-item:active {
    transform: translateY(0);
}

/* Адаптивные стили для кнопок управления тетриса */
#tetris-game .control-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

#tetris-game .control-btn.extra-large {
    flex: 0 0 auto;
    margin: 8px;
}

/* Адаптация для разных размеров экрана */
@media (max-width: 768px) {
    #tetris-game .control-row {
        gap: 12px;
        margin: 15px 0;
    }
    
    #tetris-game .control-btn.extra-large {
        width: 80px;
        height: 80px;
        font-size: 28px;
        margin: 6px;
    }
}

@media (max-width: 480px) {
    #tetris-game .control-row {
        gap: 10px;
        margin: 12px 0;
    }
    
    #tetris-game .control-btn.extra-large {
        width: 70px;
        height: 70px;
        font-size: 24px;
        margin: 5px;
    }
}

/* Стили для судоку в стиле SMS.by */
.sudoku-game {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Светлый фон только для контейнера сетки судоку */
.sudoku-grid-container {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 15px;
    margin: 20px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.sudoku-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-bottom: 2px solid #000;
    margin-bottom: 20px;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.difficulty-label {
    font-weight: bold;
    color: #000;
    font-size: 18px;
}

.difficulty-options {
    display: flex;
    gap: 10px;
}

.difficulty-option {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #000;
    border-radius: 20px;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.difficulty-option:hover {
    background: #FFD700;
}

.difficulty-option.active {
    background: #000;
    color: #FFD700;
}

.score-display {
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

/* Судоку использует стандартную структуру game-section */
    
.sudoku-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 0;
    background: #000;
    border: 4px solid #FFD700;
    border-radius: 15px;
    padding: 8px;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), inset 0 0 10px rgba(255, 215, 0, 0.1);
    width: 360px;
    height: 360px;
}

.sudoku-cell {
    width: 100%;
    height: 100%;
    background: #FFFFFF;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 35px;
    min-height: 35px;
    box-sizing: border-box;
}

.sudoku-cell:hover {
    background: #e8e8e8;
    color: #000;
    transform: scale(1.02);
}

.sudoku-cell.selected {
    background: #e6f3ff;
    color: #0066cc;
    box-shadow: 0 0 8px rgba(0, 102, 204, 0.5);
    border: 2px solid #0066cc;
}

.sudoku-cell.fixed {
    background: #f0f0f0;
    color: #000;
    cursor: not-allowed;
    font-weight: 900;
    border: 2px solid #666;
}

.sudoku-cell.error {
    background: #ffebee;
    color: #d32f2f;
    animation: shake 0.5s ease-in-out;
    border: 2px solid #d32f2f;
}

.sudoku-cell.hint {
    background: #e8f5e8;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

/* Подсветка строк и столбцов */
.sudoku-cell.row-highlight {
    background: #d0d0d0 !important;
    color: #000 !important;
    border: 2px solid #999 !important;
}

.sudoku-cell.column-highlight {
    background: #d0d0d0 !important;
    color: #000 !important;
    border: 2px solid #999 !important;
}

.sudoku-cell.selected.row-highlight,
.sudoku-cell.selected.column-highlight {
    background: #e6f3ff !important;
    color: #0066cc !important;
    box-shadow: 0 0 12px rgba(0, 102, 204, 0.7) !important;
    border: 3px solid #0066cc !important;
}

/* Выделение квадратов 3x3 - только границы блоков */
.sudoku-cell {
    border: 1px solid #ddd;
}

/* Правые границы квадратов 3x3 (столбцы 2, 5) */
.sudoku-cell[data-col="2"],
.sudoku-cell[data-col="5"] {
    border-right: 3px solid #333;
}

/* Нижние границы квадратов 3x3 (строки 2, 5) */
.sudoku-cell[data-row="2"],
.sudoku-cell[data-row="5"] {
    border-bottom: 3px solid #333;
}

/* Верхние границы квадратов 3x3 (строки 0, 3, 6) */
.sudoku-cell[data-row="0"],
.sudoku-cell[data-row="3"],
.sudoku-cell[data-row="6"] {
    border-top: 3px solid #333;
}

/* Левые границы квадратов 3x3 (столбцы 0, 3, 6) */
.sudoku-cell[data-col="0"],
.sudoku-cell[data-col="3"],
.sudoku-cell[data-col="6"] {
    border-left: 3px solid #333;
}

/* Подсветка завершенных блоков 3x3 */
.sudoku-cell.completed-block {
    background-color: #e8f5e8 !important;
    border-color: #2e7d32 !important;
    box-shadow: 0 0 5px #2e7d32 !important;
}

.sudoku-cell.completed-row {
    background-color: #e3f2fd !important;
    border-color: #1976d2 !important;
}

.sudoku-cell.completed-column {
    background-color: #f3e5f5 !important;
    border-color: #7b1fa2 !important;
}

/* Завершенные элементы в подсвеченных строках/столбцах - делаем их более заметными */
.sudoku-cell.row-highlight.completed-block,
.sudoku-cell.column-highlight.completed-block {
    background-color: #c8e6c9 !important;
    border-color: #1b5e20 !important;
    box-shadow: 0 0 8px #1b5e20 !important;
}

.sudoku-cell.row-highlight.completed-row,
.sudoku-cell.column-highlight.completed-row {
    background-color: #bbdefb !important;
    border-color: #0d47a1 !important;
    box-shadow: 0 0 8px #0d47a1 !important;
}

.sudoku-cell.row-highlight.completed-column,
.sudoku-cell.column-highlight.completed-column {
    background-color: #e1bee7 !important;
    border-color: #4a148c !important;
    box-shadow: 0 0 8px #4a148c !important;
}

/* Панель с цифрами в стиле SMS.by */
.sudoku-number-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.sudoku-number-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border: 2px solid #333;
    border-radius: 15px;
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sudoku-number-btn:hover {
    background: linear-gradient(135deg, #e6f3ff, #ffffff);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
    border-color: #0066cc;
    color: #0066cc;
}

.sudoku-number-btn:active {
    transform: translateY(-1px);
}

/* Кнопки управления судоку в стиле SMS.by */
.sudoku-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.sudoku-controls .btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 60px;
}
    
    .control-btn {
        width: 50px;
        height: 50px;
    background: #000;
    color: #FFD700;
    border: 2px solid #FFD700;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #FFD700;
    color: #000;
    transform: scale(1.1);
}

.control-btn.hint-btn {
    position: relative;
}

.control-btn.hint-btn::after {
    content: attr(data-hints);
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FFD700;
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Кнопки выбора уровня сложности в стиле SMS.by */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.difficulty-buttons .btn {
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #000;
    color: #000;
}

.difficulty-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #FFFF00, #FFD700);
}

.new-game-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #000;
    color: #000;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.new-game-btn:hover {
    background: linear-gradient(135deg, #FFFF00, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

/* Анимация встряхивания для ошибок */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Адаптивность для судоку */
@media (max-width: 768px) {
    .sudoku-grid {
        width: 300px;
        height: 300px;
    }
    
    .sudoku-cell {
        width: 100%;
        height: 100%;
        font-size: 0.9rem;
        min-width: 25px;
        min-height: 25px;
    }
    
    .sudoku-number-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .sudoku-grid {
        width: 270px;
        height: 270px;
    }
    
    .sudoku-cell {
        width: 100%;
        height: 100%;
        font-size: 0.8rem;
        min-width: 20px;
        min-height: 20px;
    }
    
    .sudoku-number-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}
