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

.coin-icon {
    height: 1em;
    vertical-align: middle;
    margin-right: 2px;
}

.bonus-img {
    height: 2.5em;
    vertical-align: middle;
}

.cookie-consent {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 360px;
    background: rgba(15, 15, 35, 0.97);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px 20px;
    z-index: 9999;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.cookie-consent a {
    color: #e94560;
    text-decoration: none;
}
.cookie-consent a:hover {
    text-decoration: underline;
}
.cookie-consent button {
    display: block;
    margin-top: 12px;
    padding: 8px 22px;
    border: none;
    border-radius: 8px;
    background: #e94560;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.cookie-consent button:hover {
    background: #d63850;
}

.avatar-img {
    display: inline-block;
    vertical-align: middle;
    object-fit: cover;
}
.top-bar-avatar .avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
.player-slot-avatar .avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
#inviteAvatar .avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}
.sb-avatar .avatar-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}
.avatar-carousel-btn .avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
.admin-online-item .avatar-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}
.admin-game-player .avatar-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}
.admin-chat-author .avatar-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}
.player-card .player-avatar .avatar-img {
    width: 120px;
    height: auto;
}
.avatar-large .avatar-img {
    width: 120px;
    height: auto;
}
.avatar-section .avatar-large .avatar-img {
    width: 120px;
    height: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 70px 20px 20px;
}

.login-box, .register-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #e94560;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.form-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

input:focus {
    border-color: #e94560;
    background: rgba(255, 255, 255, 0.15);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

button[type="submit"], button[type="button"] {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.error {
    color: #ff6b6b;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.register-link a {
    color: #e94560;
    text-decoration: none;
    font-weight: bold;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Profile styles */
.profile-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.avatar-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.avatar-section .avatar-large {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.avatar-section .avatar-large.darkened {
    opacity: 0.3;
    filter: grayscale(0.6);
}

.premium-lock-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 14px;
    filter: none;
}

.premium-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
    font-weight: bold;
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.2);
    padding: 1px 4px;
    border-radius: 4px;
    filter: none;
}

.avatar-carousel-btn {
    position: relative;
}

.avatar-section .username-section {
    text-align: center;
}

.avatar-section .username-section span {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.avatar-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.carousel-viewport {
    position: relative;
    overflow: hidden;
    width: 240px;
    padding: 10px 0;
}

.carousel-track {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
}

.avatar-carousel-btn {
    width: 70px;
    height: 70px;
    border: 3px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.avatar-carousel-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.avatar-carousel-btn.active {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.2);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
}

.avatar-carousel-btn.locked {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

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

.avatar-tab {
    padding: 8px 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-tab:hover {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
}

.avatar-tab.active {
    border-color: #e94560;
    color: #fff;
    background: rgba(233, 69, 96, 0.2);
}

.premium-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.premium-lock-content {
    text-align: center;
    color: rgba(255,255,255,0.9);
}

.premium-lock-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.premium-lock-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.premium-lock-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.premium-lock-sub a {
    color: #e94560;
    text-decoration: none;
    font-weight: bold;
}

.premium-lock-sub a:hover {
    text-decoration: underline;
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #e94560;
}

.carousel-lock-notice {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    z-index: 10;
}

.carousel-lock-icon {
    font-size: 16px;
}

.carousel-lock-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.carousel-lock-link {
    font-size: 13px;
    color: #e94560;
    text-decoration: underline;
}

.avatar-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.avatar-select-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.profile-top {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    align-items: flex-start;
    overflow: hidden;
}

.profile-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 180px;
    min-width: 140px;
}


.avatar-large {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-select {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}

.profile-top .stats-section {
    flex: 1;
    margin: 0;
    min-width: 0;
}

.profile-top .stats-section h2 {
    display: none;
}

.avatar-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-btn:hover, .avatar-btn.active {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.2);
}

.username-section {
    text-align: center;
    margin-top: 8px;
    width: 100%;
    overflow: hidden;
}

#usernameDisplay {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    display: block;
    max-width: 100%;
}

#usernameInput {
    flex: 1;
}

.stats-section {
    margin-bottom: 30px;
    overflow: hidden;
}

.stats-section h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #e94560;
}

#gamesPlayed { color: #fff; }
#winsCount { color: #2ecc71; }
#lossesCount { color: #e74c3c; }
#drawsCount { color: #00d9ff; }
#neededPoints { color: #f39c12; }
.stats-needed { color: #f39c12; font-size: 14px; margin-top: 4px; margin-bottom: 20px; text-align: center; }

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.score-card {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 15px;
}

.score-card .stat-value {
    color: #fff;
    font-size: 32px;
}

.avatar-preview {
    font-size: 80px;
    margin: 20px 0;
    text-align: center;
}

.avatar-modal-content {
    max-width: 380px;
}

#avatarSelectModal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    justify-items: center;
}

#avatarSelectModal .avatar-btn {
    width: 60px;
    height: 60px;
    padding: 0;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

#avatarSelectModal .avatar-btn:hover, #avatarSelectModal .avatar-btn.active {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.2);
    transform: scale(1.1);
}

.avatar-close-btn {
    width: auto;
    padding: 10px 30px;
}

.play-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.logout-link {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin-top: 15px;
    font-size: 13px;
}

.logout-link:hover {
    color: #fff;
}

/* Lobby styles */
.online-sidebar {
    margin-top: 20px;
}

.container.with-sidebar {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    padding: 90px 20px 20px;
}

.container.with-sidebar .main-content {
    width: 700px;
    max-width: 100%;
    flex-shrink: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.container.admin-container .main-content {
    width: 100%;
    max-width: 100%;
}

.lobby-bottom {
    display: flex;
    gap: 15px;
}

.lobby-bottom .online-sidebar {
    width: 160px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.lobby-bottom .chat-section {
    flex: 1;
    min-width: 0;
    margin-top: 10px;
}

.chat-section {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

.chat-section h2 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-messages {
    height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    padding-right: 4px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.chat-msg {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    word-break: break-word;
}

.chat-msg .chat-author {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 4px;
}

.chat-msg.me {
    border: 1px solid rgba(128, 128, 128, 0.4);
    background: rgba(128, 128, 128, 0.08);
}

.chat-msg.me .chat-author {
    color: #fff;
}

.chat-input {
    display: flex;
    gap: 6px;
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input input:focus {
    border-color: #e94560;
}

.chat-input button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #e94560;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input button:hover {
    background: #d63850;
}

.online-sidebar {
    width: 160px;
    flex-shrink: 0;
}

.lobby-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.daily-stats {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    flex-wrap: wrap;
    gap: 8px;
}

.daily-stats span {
    white-space: nowrap;
}

.daily-stats strong {
    color: #e94560;
}

.back-link {
    color: #e94560;
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid #e94560;
    border-radius: 10px;
    transition: all 0.3s;
}

.back-link:hover {
    background: #e94560;
    color: #fff;
}

button.back-link {
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
}

#acceptBtn {
    background: transparent;
    color: #4caf50;
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#acceptBtn:hover {
    background: #4caf50;
    color: #fff;
}

#declineBtn {
    background: transparent;
    color: #e94560;
    border: 2px solid #e94560;
    border-radius: 10px;
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#declineBtn:hover {
    background: #e94560;
    color: #fff;
}

.sidebars-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
}

.sb-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sb-header {
    font-size: 16px;
    font-weight: bold;
    color: #e94560;
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sb-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.sb-list::-webkit-scrollbar {
    width: 4px;
}

.sb-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.sb-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sb-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    padding: 20px 0;
}

.sb-sep {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    padding: 4px 0;
    letter-spacing: 2px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.sb-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sb-item.me {
    background: rgba(128, 128, 128, 0.2);
    border: 1px solid rgba(128, 128, 128, 0.35);
}

.sb-rank {
    font-weight: bold;
    font-size: 14px;
    min-width: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.sb-avatar {
    font-size: 18px;
    flex-shrink: 0;
}

.sb-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.sb-score {
    font-size: 12px;
    font-weight: bold;
    color: #e94560;
    flex-shrink: 0;
}

.online-sidebar h2 {
    margin-bottom: 12px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.online-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 370px;
    overflow-y: auto;
    padding-right: 4px;
}

.online-list::-webkit-scrollbar {
    width: 4px;
}

.online-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.online-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.online-item {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.05);
}

.online-item::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    background: #4caf50;
    flex-shrink: 0;
}

.online-item.in-game::before {
    background: #e94560;
}

.online-item.dnd::before {
    background: #f1c40f;
}

.online-item.me {
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(128, 128, 128, 0.5);
    background: rgba(128, 128, 128, 0.1);
}

.players-section {
    flex: 1;
    min-width: 0;
}

.players-section h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.player-slot {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.player-slot:hover {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.2);
    transform: scale(1.05);
}

.player-slot.disabled {
    cursor: default;
    opacity: 0.6;
}

.player-slot.disabled:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.player-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-slot-avatar {
    font-size: 28px;
    flex-shrink: 0;
}

.player-slot-info {
    flex: 1;
    min-width: 0;
}

.player-slot-name {
    font-size: 13px;
    word-break: break-word;
    margin-top: 6px;
    text-align: center;
}

.player-slot.me {
    border-color: #888;
    background: rgba(128, 128, 128, 0.25);
}

.player-slot-level {
    font-size: 10px;
    color: #e94560;
    font-weight: bold;
    margin-top: 4px;
}

.lobby-exp-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.lobby-exp-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dnd-toggle {
    margin: 15px 0 5px;
    display: flex;
    justify-content: center;
}

.dnd-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    user-select: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.2s;
}

.dnd-toggle label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dnd-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #e94560;
    cursor: pointer;
}

.no-players {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 370px;
    overflow-y: auto;
    padding-right: 5px;
}

.players-list::-webkit-scrollbar {
    width: 4px;
}

.players-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.players-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.player-row:hover {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.15);
}

.player-row.me {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.12);
}

.player-row-avatar {
    font-size: 28px;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.player-row-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-row-exp {
    flex: 0 0 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.player-row-exp-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.no-players {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
}

/* Game styles */
.game-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1000px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.timer-display {
    font-size: 24px;
    color: #00d9ff;
    font-weight: bold;
}

.timer-display.warning {
    color: #ff6b6b;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.exit-btn, .cancel-btn {
    color: #ff6b6b;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    transition: all 0.3s;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
}

.exit-btn:hover, .cancel-btn:hover {
    background: #ff6b6b;
    color: #fff;
}

.game-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.player-panel {
    flex: 1;
    min-width: 0;
}

.player-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.player-card .player-avatar {
    margin-bottom: 15px;
}

.player-card .player-name {
    font-size: 16px;
    margin-bottom: 10px;
}

.current-word {
    font-size: 24px;
    font-weight: bold;
    color: #00d9ff;
    min-height: 35px;
    margin-bottom: 10px;
    letter-spacing: 2px;
    white-space: nowrap;
}

.words-list {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    max-height: 60px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.words-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0;
    width: 140px;
    flex-shrink: 0;
}

#player1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#player1 .player-info {
    flex: 1;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

#player1 .words-grid {
    margin-left: 10px;
    align-items: flex-end;
}

#player2 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#player2 .player-info {
    flex: 1;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

#player2 .words-grid {
    margin-right: 10px;
    align-items: flex-start;
}

.word-cell {
    width: 140px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.word-cell.green {
    background: rgba(46, 204, 113, 0.4);
    border-color: #2ecc71;
}

.word-cell.red {
    background: rgba(231, 76, 60, 0.4);
    border-color: #e74c3c;
}

.score {
    font-size: 18px;
    color: #e94560;
    font-weight: bold;
}

.vs {
    font-size: 24px;
    font-weight: bold;
    color: #e94560;
}

.keyboard-area {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.letter-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.letter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.letter-btn.used {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.letter-btn.used:hover {
    transform: none;
    box-shadow: none;
}

.game-action-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-action-btn.submit {
    background: linear-gradient(135deg, #00b85a 0%, #00ff88 100%);
}

.game-action-btn.clear {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
}

.game-action-btn:hover {
    transform: scale(1.1);
}

.game-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.actions-area {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.submit {
    background: linear-gradient(135deg, #00d9ff 0%, #00ff88 100%);
}

.action-btn.clear {
    background: rgba(255, 255, 255, 0.2);
}

.action-btn.next {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
}

.action-btn.auto {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-wrapper .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 220px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 100;
}

.tooltip-wrapper .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-wrapper.vocab-active .tooltip-text {
    display: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #e94560;
}

.modal-content button {
    margin: 10px;
    width: auto;
    padding: 15px 30px;
}

.exit-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.exit-modal-buttons button {
    flex: 1;
    max-width: 120px;
    margin: 0;
}

#exitBtn {
    cursor: pointer;
}

.timer {
    font-size: 48px;
    font-weight: bold;
    color: #00d9ff;
    margin-top: 20px;
}

.result {
    font-size: 24px;
    margin-bottom: 20px;
    color: #00ff88;
}

.final-scores {
    margin-bottom: 20px;
}

.final-scores p {
    font-size: 18px;
    margin: 10px 0;
}



.experience-section {
    margin: 20px 0;
}

.experience-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    text-align: center;
}

.experience-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.experience-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease, background 0.5s ease;
    min-width: 2px;
}

/* Top bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px max(20px, calc((100vw - 1200px) / 2));
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 50px;
}

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

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-bar-brand {
    font-size: 28px;
    font-weight: 800;
    color: #e94560;
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.top-bar-left a {
    text-decoration: none;
    color: inherit;
}
.top-bar-left a:hover {
    opacity: 0.85;
}

.top-bar-username {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.top-bar-level {
    font-size: 17px;
    color: #e94560;
    font-weight: bold;
    white-space: nowrap;
    padding: 2px 8px;
    background: rgba(233, 69, 96, 0.15);
    border-radius: 6px;
}

.top-bar-avatar {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-bar-score {
    font-size: 18px;
    font-weight: bold;
    color: #e94560;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(233, 69, 96, 0.15);
    border-radius: 8px;
}

.top-bar-coins {
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(241, 196, 15, 0.15);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.top-bar-coins:hover {
    background: rgba(241, 196, 15, 0.3);
}

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

.top-bar-exp-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    min-width: 40px;
}

.top-bar-exp-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.5s ease;
    min-width: 2px;
}

.top-bar-exp-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    text-align: right;
}

.admin-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 1400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.toolbar .action-btn {
    width: auto;
    padding: 12px 24px;
    font-size: 16px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
}

#playersTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#playersTable th,
#playersTable td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

#playersTable th {
    background: rgba(233, 69, 96, 0.3);
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#playersTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

#playersTable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.actions-cell {
    display: flex;
    gap: 6px;
}

.actions-cell .action-btn.small {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.loading-text {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

#passwordHint {
    margin-top: -10px;
    margin-bottom: 10px;
}

#playerModal .modal-content {
    max-width: 400px;
}

#deleteModal .modal-content {
    max-width: 400px;
}

#deleteModal .modal-content p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.history-section {
    margin: 20px 0;
}

.history-section h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-game-item,
.history-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    border-left: 4px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.stats-game-item:hover,
.history-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.stats-game-item.win,
.history-item.win {
    border-left-color: #2ecc71;
}

.stats-game-item.loss,
.history-item.loss {
    border-left-color: #e74c3c;
}

.stats-game-item.draw,
.history-item.draw {
    border-left-color: #00d9ff;
}

.stats-game-item .h-top,
.history-item .h-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stats-game-item .h-players,
.history-item .h-players {
    font-weight: bold;
}

.stats-game-item .h-result,
.history-item .h-result {
    font-weight: bold;
}

.h-exp {
    font-size: 12px;
    font-weight: normal;
    margin-left: 4px;
}

.stats-game-item .h-result.win-text,
.history-item .h-result.win-text {
    color: #2ecc71;
}

.stats-game-item .h-result.loss-text,
.history-item .h-result.loss-text {
    color: #e74c3c;
}

.stats-game-item .h-result.draw-text,
.history-item .h-result.draw-text {
    color: #00d9ff;
}

.stats-game-item .h-detail,
.history-item .h-detail {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.stats-game-item .h-detail.show,
.history-item .h-detail.show {
    display: block;
}

.stats-game-item .h-detail .h-round,
.history-item .h-detail .h-round {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-game-item .h-detail .h-round:last-child,
.history-item .h-detail .h-round:last-child {
    border-bottom: none;
}

.stats-game-item .h-detail .h-letters,
.history-item .h-detail .h-letters {
    margin-bottom: 6px;
    font-family: monospace;
    letter-spacing: 2px;
    color: #00d9ff;
}

.stats-game-item .h-date,
.history-item .h-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.profile-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    width: 100%;
}

.medals-section {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.medal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
}

.medal.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.medal.silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
    border: 1px solid rgba(192, 192, 192, 0.4);
}

.medal.bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(176, 109, 43, 0.1));
    border: 1px solid rgba(205, 127, 50, 0.4);
}

.medal.locked {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    opacity: 0.6;
}

.medal-icon {
    font-size: 32px;
    line-height: 1;
}

.medal-info {
    display: flex;
    flex-direction: column;
}

.medal-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}

.medal-tier {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.medal-next {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.profile-buttons .play-btn,
.profile-buttons .stats-btn {
    margin: 0;
}
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%) !important;
}

.avatar-change-btn:hover {
    box-shadow: 0 5px 20px rgba(0, 206, 201, 0.4) !important;
}

.stats-btn {
    display: block;
    text-align: center;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.stats-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.stats-page-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stats-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.stats-page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.stats-page-nav {
    display: flex;
    gap: 10px;
}

.days-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.day-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

.day-header {
    font-size: 18px;
    font-weight: bold;
    color: #e94560;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(233, 69, 96, 0.3);
}

.day-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.stats-game-item {
    margin-bottom: 8px;
}

.stats-game-item:last-child {
    margin-bottom: 0;
}

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.admin-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.admin-tab.active {
    color: #e94560;
    border-bottom-color: #e94560;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Admin lobby layout */
.admin-lobby-layout {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-online-section {
    flex: 0 0 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

.admin-online-section h3,
.admin-chat-section h3,
.admin-games-section h3 {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.admin-online-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.admin-online-item {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

.admin-chat-section {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

.admin-chat-messages {
    height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    padding-right: 4px;
}

.admin-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.admin-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.admin-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.admin-chat-msg {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    word-break: break-word;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.admin-chat-msg .admin-chat-author {
    flex-shrink: 0;
}

.admin-chat-msg .admin-chat-del {
    margin-left: auto;
    flex-shrink: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.25);
    font-size: 11px;
    padding: 0 2px;
    line-height: 1.4;
    transition: color 0.2s;
}

.admin-chat-msg .admin-chat-del:hover {
    color: #e74c3c;
}

.admin-chat-author {
    font-weight: bold;
    color: #e94560;
    margin-right: 4px;
}

.admin-chat-input {
    display: flex;
    gap: 6px;
}

.admin-chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    outline: none;
}

.admin-chat-input input:focus {
    border-color: #e94560;
}

.admin-chat-input button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #e94560;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.admin-chat-input button:hover {
    background: #d63850;
}

/* Admin games */
.admin-games-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

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

.admin-game-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-game-players {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.admin-game-player {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.admin-game-vs {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.admin-game-scores {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: bold;
    color: #e94560;
}

.admin-game-score {
    min-width: 20px;
    text-align: center;
}

.admin-game-rounds {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.admin-game-round {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-game-sq {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.admin-game-sq.green {
    background: #2ecc71;
}

.admin-game-sq.red {
    background: #e74c3c;
}

.admin-game-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
    white-space: nowrap;
}

.no-data {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    padding: 20px 0;
}

/* Admin data tab */
.admin-tables-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-table-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
}

.admin-table-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-table-name {
    font-size: 15px;
    font-weight: 600;
}

.admin-table-rows {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.admin-table-actions {
    display: flex;
    gap: 8px;
}

.admin-table-dl {
    width: auto !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    margin: 0 !important;
}

.admin-table-dl[data-fmt="sql"] {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

.admin-link {
    display: block;
    text-align: center;
    color: #e94560;
    text-decoration: none;
    padding: 10px;
    margin-top: 10px;
    border: 2px solid #e94560;
    border-radius: 10px;
    transition: all 0.3s;
}

.admin-link:hover {
    background: #e94560;
    color: #fff;
}

@media (max-width: 800px) {
    .container.with-sidebar {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .container.with-sidebar .main-content {
        width: 100%;
        max-width: 540px;
    }

    .sidebars-wrapper {
        position: static;
        align-self: center;
        width: 100%;
        max-width: 400px;
    }

    .sb-sidebar {
        width: 100%;
    }

    .sb-list {
        max-height: 250px;
    }

    .lobby-bottom {
        flex-direction: column;
    }

    .lobby-bottom .online-sidebar {
        width: 100%;
    }

    .admin-lobby-layout {
        flex-direction: column;
    }

    .admin-online-section {
        flex: none;
        width: 100%;
    }

    .admin-game-card {
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-game-status {
        margin-left: 0;
    }
}

@media (max-width: 790px) {
    .top-bar-exp {
        flex: 1;
        max-width: 400px;
    }
    .top-bar-coins,
    .top-bar-score {
        order: 1;
    }
    .top-bar-right::after {
        content: '';
        order: 0;
        flex-basis: 100%;
        height: 0;
    }
}

@media (max-width: 600px) {
    .login-box, .profile-box, .lobby-box, .game-box, .admin-box, .coins-box {
        padding: 20px;
    }
    
    .profile-top {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-header h1 {
        font-size: 18px;
    }
    .timer-display {
        font-size: 18px;
    }
    .letter-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .game-action-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .actions-area {
        flex-wrap: wrap;
    }

    .top-bar {
        position: relative;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 12px;
        min-height: auto;
        flex-direction: column;
        align-items: center;
    }

    .top-bar-left {
        flex-wrap: wrap;
        gap: 8px;
        flex: none;
        width: 100%;
        justify-content: center;
    }

    .top-bar-right {
        justify-content: center;
        flex: none;
    }

    .top-bar-exp {
        width: 100%;
        max-width: none;
    }

    .top-bar-brand {
        font-size: 24px;
    }

    .container,
    .container.with-sidebar {
        padding: 20px;
    }

    .bonus-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .bonus-card .bonus-icon {
        margin: 0 auto;
    }

    .bonus-card .bonus-info {
        text-align: center;
    }
}

@media (max-width: 800px) {
    .vs {
        display: none;
    }
    #player1, #player2 {
        flex-direction: column;
        align-items: center;
    }
    #player1 .words-grid {
        margin-left: 0;
        align-items: center;
    }
    #player2 .words-grid {
        margin-right: 0;
        align-items: center;
        order: 2;
    }
    #player2 .player-info {
        order: 1;
    }
    .words-grid {
        width: 100%;
        max-width: 140px;
        flex-shrink: 1;
    }
    .word-cell {
        width: 100%;
        font-size: 11px;
        height: 22px;
    }
    .player-card .player-avatar .avatar-img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
    }
    .current-word {
        font-size: 16px;
        letter-spacing: 1px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .letter-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    .game-action-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    .actions-area {
        flex-wrap: wrap;
    }
}

.ls-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.ls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ls-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.ls-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 16px;
}

.ls-attempts { color: #f39c12; }
.ls-found { color: #2ecc71; }

.ls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 360px;
    margin: 0 auto 20px;
}

.ls-cell {
    aspect-ratio: 1;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-cell:hover:not(.revealed):not(.disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.ls-cell.revealed { cursor: default; transform: none; background: rgba(255, 255, 255, 0.2); }
.ls-cell.coin { background: rgba(46, 204, 113, 0.3); border-color: #2ecc71; }
.ls-cell.cross { background: rgba(231, 76, 60, 0.3); border-color: #e74c3c; }
.ls-cell.disabled { opacity: 0.5; cursor: default; }

.ls-result {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    min-height: 30px;
}

.ls-result.win { color: #2ecc71; }
.ls-result.lose { color: #e74c3c; }

.ls-actions { min-height: 48px; display: flex; align-items: center; justify-content: center; }

/* Coins page */
.coins-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.coins-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.coins-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.coins-balance {
    font-size: 64px;
    font-weight: bold;
    color: #f1c40f;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.coins-balance-icon {
    font-size: 48px;
}

.coins-balance-amount {
    font-size: 64px;
}

.coins-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 24px;
}

.coin-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.coin-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    user-select: none;
}

.coin-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.coin-option input {
    display: none;
}

.coin-option-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.coin-option input:checked + .coin-option-check {
    background: #f1c40f;
    border-color: #f1c40f;
}

.coin-option input:checked + .coin-option-check::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-size: 14px;
    font-weight: bold;
}

.coin-option input:checked ~ .coin-option-label,
.coin-option input:checked ~ .coin-option-price {
    color: #f1c40f;
}

.coin-option input:checked ~ .coin-option-price {
    font-weight: bold;
}

.coin-option-label {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
}

.coin-option-price {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.coins-total {
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 20px;
}

.coins-pay-btn {
    padding: 16px 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.coins-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(241, 196, 15, 0.4);
}

.bonus-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.bonus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.bonus-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.bonus-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bonus-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.bonus-card:hover {
    background: rgba(255, 255, 255, 0.15);
}

.bonus-card.collected {
    opacity: 0.5;
    border-color: rgba(255, 255, 255, 0.1);
}

.bonus-card .bonus-icon {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.bonus-card .bonus-info {
    flex: 1;
    min-width: 0;
}

.bonus-card .bonus-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.bonus-card .bonus-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.bonus-card .bonus-reward {
    font-size: 13px;
    color: #f1c40f;
    margin-top: 4px;
}

.bonus-card .bonus-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.bonus-card .bonus-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
}

.bonus-card .bonus-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bonus-card .bonus-btn.collected {
    background: rgba(255, 255, 255, 0.2);
    cursor: default;
}

.bonus-card .bonus-streak {
    font-size: 12px;
    color: #e94560;
    margin-top: 2px;
}

.bonus-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f1c40f;
    cursor: pointer;
}

.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.site-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    margin: 0 15px;
}

.site-footer a:hover {
    color: #fff;
}

.contacts-text {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 10px;
}

.contacts-email {
    font-size: 20px;
    color: #f1c40f;
    font-weight: bold;
    margin-bottom: 20px;
}

.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00d9ff;
    cursor: pointer;
}

.top-table-wrapper {
    overflow-x: auto;
}

.top-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.top-table th,
.top-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.top-table th {
    background: rgba(233, 69, 96, 0.3);
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}

.top-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

.top-table tbody tr.me {
    background: rgba(128, 128, 128, 0.2);
    border-left: 3px solid #888;
}

.top-table tbody tr.me td:first-child {
    padding-left: 12px;
}

.top-rank {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    width: 40px;
}

.top-name {
    font-weight: 600;
}

.top-level {
    color: #e94560;
    font-weight: bold;
}

.top-games {
    color: rgba(255, 255, 255, 0.7);
}

.top-wins {
    color: #2ecc71;
    font-weight: bold;
}

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