* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background: #f5f0e6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Arial', 'PingFang SC', sans-serif;
    overflow: hidden;
    touch-action: manipulation;
}

.game-wrapper {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
}

.game-header {
    width: 100%;
    max-width: 350px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 15px;
}

.header-left {
    display: flex;
    gap: 8px;
    min-width: 80px;
}

.game-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.game-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    letter-spacing: 2px;
}

.mode-indicator {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    text-align: center;
}

.mode-indicator.online {
    background: #e8f5e9;
    color: #2e7d32;
}

.mode-indicator.local-pvp {
    background: #f3e5f5;
    color: #7b1fa2;
}

.online-btn {
    background: #27ae60;
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.online-btn:active {
    transform: scale(0.95);
    background: #1e8449;
}

.back-btn {
    background: #4a90d9;
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:active {
    transform: scale(0.95);
    background: #3a7bc8;
}

.game-info-bar {
    width: min(85vw, 320px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.turn-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.turn-label {
    font-size: 12px;
    color: #999;
}

.current-turn {
    font-size: 28px;
    font-weight: 900;
    color: #333;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f0f0f0;
    transition: all 0.3s ease;
}

.current-turn.x-turn {
    color: #e74c3c;
    background: #fdeaea;
}

.current-turn.o-turn {
    color: #3498db;
    background: #e8f4fc;
}

.score-display {
    display: flex;
    gap: 15px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-label {
    font-size: 11px;
    color: #999;
}

.score-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: min(85vw, 320px);
    height: min(85vw, 320px);
    padding: 15px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-board.four-four {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: min(90vw, 360px);
    height: min(90vw, 360px);
}

.online-turn-hint {
    display: none;
    position: absolute;
    top: calc(50% + min(42.5vw, 160px) + 9px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    color: #2196F3;
    white-space: nowrap;
}

.online-turn-hint.four-four {
    top: calc(50% + min(45vw, 180px) + 9px);
}

.cell {
    background: #f8f8f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cell:hover {
    background: #f0f0f0;
}

.cell:active {
    transform: scale(0.95);
}

.cell.x-cell {
    background: #fdeaea;
}

.cell.o-cell {
    background: #e8f4fc;
}

.cell.winning-cell {
    animation: pulse 0.5s ease-in-out infinite alternate;
}

.cell.selected-piece {
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.8);
    transform: scale(1.05);
}

.cell.valid-move {
    background: rgba(76, 175, 80, 0.3);
    cursor: pointer;
}

.cell.valid-move:hover {
    background: rgba(76, 175, 80, 0.5);
}

.cell-content.dragging {
    z-index: 100;
    opacity: 0.8;
    pointer-events: none;
    transition: none;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.cell-content {
    width: 60%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-mark {
    width: 100%;
    height: 100%;
    position: relative;
}

.x-mark::before,
.x-mark::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 8px;
    background: #e74c3c;
    border-radius: 4px;
    top: 50%;
    left: 0;
    transform: translateY(-50%) rotate(45deg);
}

.x-mark::after {
    transform: translateY(-50%) rotate(-45deg);
}

.o-mark {
    width: 100%;
    height: 100%;
    border: 8px solid #3498db;
    border-radius: 50%;
    box-sizing: border-box;
}

.win-line {
    position: absolute;
    background: #27ae60;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.win-line.show {
    opacity: 1;
}

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

.game-actions button {
    flex-shrink: 0;
}

.restart-btn {
    background: #4a90d9;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 15px rgba(74, 144, 217, 0.3);
}

.restart-btn:active {
    transform: scale(0.95);
    background: #3a7bc8;
}

.game-result-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.game-result-overlay.show {
    display: flex;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.result-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.result-icon.x-win {
    background: #fdeaea;
}

.result-icon.o-win {
    background: #e8f4fc;
}

.result-icon.draw {
    background: #f0f0f0;
}

.result-icon .x-mark {
    width: 50px;
    height: 50px;
}

.result-icon .x-mark::before,
.result-icon .x-mark::after {
    height: 6px;
}

.result-icon .o-mark {
    width: 50px;
    height: 50px;
    border-width: 6px;
}

.result-text {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.play-again-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border: none;
    color: #fff;
    padding: 14px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.play-again-btn:active {
    transform: scale(0.95);
}

.invalid-move {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.lobby-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.lobby-overlay.show {
    display: flex;
}

.lobby-content {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
}

.lobby-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.lobby-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    margin-top: 3px;
}

.lobby-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lobby-body {
    padding: 25px;
}

.lobby-section {
    text-align: center;
}

.lobby-section h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.lobby-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.lobby-divider::before,
.lobby-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.lobby-divider span {
    padding: 0 15px;
    color: #999;
    font-size: 12px;
}

.lobby-btn {
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-btn {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: #fff;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.create-btn:active {
    transform: scale(0.95);
}

.create-room-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mode-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 85px;
}

.mode-select:focus {
    border-color: #4a90d9;
}

.mode-select:hover {
    border-color: #4a90d9;
}

.join-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.join-input-group input {
    width: 140px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    outline: none;
    transition: border-color 0.2s;
}

.join-input-group input:focus {
    border-color: #4a90d9;
}

.join-btn {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}

.join-btn:active {
    transform: scale(0.95);
}

.cancel-btn {
    background: #e74c3c;
    color: #fff;
    margin-top: 15px;
}

.lobby-waiting {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px 25px;
    text-align: center;
}

.lobby-waiting.show {
    display: flex;
}

.waiting-spinner {
    display: none;
}

.spinner {
    width: 44px;
    height: 44px;
    animation: spinner-rotate 2s infinite ease;
    transform-style: preserve-3d;
    margin: 0 auto;
}

.spinner > div {
    background-color: rgba(0, 77, 255, 0.2);
    height: 100%;
    position: absolute;
    width: 100%;
    border: 2px solid #004dff;
}

.spinner div:nth-of-type(1) {
    transform: translateZ(-22px) rotateY(180deg);
}

.spinner div:nth-of-type(2) {
    transform: rotateY(-270deg) translateX(50%);
    transform-origin: top right;
}

.spinner div:nth-of-type(3) {
    transform: rotateY(270deg) translateX(-50%);
    transform-origin: center left;
}

.spinner div:nth-of-type(4) {
    transform: rotateX(90deg) translateY(-50%);
    transform-origin: top center;
}

.spinner div:nth-of-type(5) {
    transform: rotateX(-90deg) translateY(50%);
    transform-origin: bottom center;
}

.spinner div:nth-of-type(6) {
    transform: translateZ(22px);
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(45deg) rotateX(-25deg) rotateY(25deg);
    }
    50% {
        transform: rotate(45deg) rotateX(-385deg) rotateY(25deg);
    }
    100% {
        transform: rotate(45deg) rotateX(-385deg) rotateY(385deg);
    }
}

.lobby-waiting p {
    margin-top: 31px;
    color: #666;
    font-size: 14px;
}

.room-code-display {
    margin-top: 20px;
    padding: 15px 25px;
    background: #f5f5f5;
    border-radius: 10px;
}

.room-code-display span {
    color: #666;
    font-size: 14px;
}

.room-code {
    font-size: 24px;
    font-weight: 700;
    color: #4a90d9;
    letter-spacing: 3px;
    margin-left: 5px;
}

.opponent-info {
    display: none;
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 50;
    align-items: center;
    gap: 15px;
}

.opponent-info.show {
    display: flex;
}

.opponent-left,
.opponent-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-symbol {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.player-symbol.x {
    background: #fdeaea;
    color: #e74c3c;
}

.player-symbol.o {
    background: #e8f4fc;
    color: #3498db;
}

.player-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-text {
    font-size: 12px;
    color: #999;
    font-weight: 600;
}

.player-symbol.current {
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.3);
}

.online-players {
    display: none;
    width: 100%;
    max-width: 350px;
    padding: 0 15px;
}

.online-players.show {
    display: flex;
    justify-content: flex-end;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    width: min(85vw, 320px);
}

.top-player {
    margin-bottom: 8px;
}

.bottom-player {
    margin-top: 8px;
}

.player-spacer {
    flex: 1;
}

.player-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.player-avatar.default-avatar::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.player-avatar.default-avatar::after {
    content: '';
    position: absolute;
    width: 38px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50% 50% 0 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-symbol-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 20px;
}

.player-symbol-badge.x {
    background: #fdeaea;
    color: #e74c3c;
}

.player-symbol-badge.o {
    background: #e8f4fc;
    color: #3498db;
}

.player-symbol-badge.current {
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.4);
}

.player-username {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-turn-hint.show {
    display: block;
}

.online-mode-btn {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 15px rgba(39, 174, 96, 0.3);
}

.online-mode-btn:active {
    transform: scale(0.95);
}

.local-pvp-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 15px rgba(155, 89, 182, 0.3);
}

.local-pvp-btn:active {
    transform: scale(0.95);
}

.toast-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.toast-overlay.show {
    display: flex;
}

.toast-content {
    background: #fff;
    border-radius: 16px;
    padding: 25px 30px;
    min-width: 260px;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.2s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.toast-message {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
}

.toast-btn {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    border: none;
    color: #fff;
    padding: 10px 40px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-btn:active {
    transform: scale(0.95);
}

.create-room-section {
    position: relative;
}

.rules-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    background: none;
    border: none;
    color: #4a90d9;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: underline;
    transition: color 0.2s;
}

.rules-btn:hover {
    color: #357abd;
}

.rules-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 350;
}

.rules-overlay.show {
    display: flex;
}

.rules-content {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 380px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.2s ease;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
}

.rules-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.rules-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.rules-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rules-body {
    padding: 20px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.rule-section {
    margin-bottom: 20px;
}

.rule-section:last-child {
    margin-bottom: 0;
}

.rule-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.rule-section p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.rule-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-section li {
    font-size: 13px;
    color: #666;
    padding: 6px 0 6px 18px;
    position: relative;
    line-height: 1.5;
}

.rule-section li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: #4a90d9;
}

.rule-tip {
    background: #f0f7ff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #4a90d9;
    margin-top: 10px;
}

.invite-btn {
    background: #4a90d9;
    color: #fff;
    margin-top: 8px;
    margin-bottom: 8px;
}

.invite-btn:active {
    background: #3a7bc8;
    transform: scale(0.98);
}

.invite-friend-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 210;
}

.invite-friend-overlay.show {
    display: flex;
}

.invite-friend-content {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 340px;
    max-height: 70vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.invite-friend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.invite-friend-header h3 {
    font-size: 18px;
    color: #333;
}

.invite-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.invite-close:hover {
    color: #333;
}

.invite-friend-list {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
}

.invite-loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

.invite-empty {
    text-align: center;
    color: #999;
    padding: 20px;
}

.invite-friend-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.invite-friend-item:hover {
    background: #e9ecef;
}

.invite-friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
}

.invite-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.invite-friend-avatar.default-avatar::after {
    content: '';
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.invite-friend-info {
    flex: 1;
}

.invite-friend-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.invite-friend-status {
    font-size: 12px;
    color: #27ae60;
    margin-top: 2px;
}

.invite-friend-btn {
    background: #27ae60;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invite-friend-btn:active {
    background: #1e8449;
    transform: scale(0.95);
}

.invite-friend-btn.invited {
    background: #95a5a6;
    cursor: default;
}

.game-invite-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 220;
}

.game-invite-overlay.show {
    display: flex;
}

.game-invite-modal {
    background: linear-gradient(135deg, #2d3436 0%, #1a1a2e 100%);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-invite-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #00d4ff, #00ff88);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-invite-icon svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.game-invite-title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}

.game-invite-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.game-invite-from {
    color: #00d4ff;
    font-weight: 600;
}

.game-invite-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.game-invite-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.game-invite-btn.accept {
    background: linear-gradient(135deg, #00d4ff, #00ff88);
    color: #fff;
}

.game-invite-btn.decline {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-invite-btn:hover {
    transform: translateY(-2px);
}
