/* play-friend.css — extracted from play-friend.html */

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

body {
    font-family: 'Nunito', 'Segoe UI', 'DejaVu Sans', Arial, sans-serif;
    background: linear-gradient(145deg, #0c1222 0%, #162040 40%, #1a2d5a 70%, #0c1222 100%);
    min-height: 100vh; padding: 0; position: relative;
}

.main-content-wrapper { padding: 20px; }
@media (max-width: 768px) { .main-content-wrapper { padding: 8px; } }

.background-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('/assets/images/pikts-fonas.jpg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    opacity: 0.08; z-index: -1;
}

.container {
    max-width: 1200px; margin: 0 auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px; padding: 16px 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.05);
}
@media (max-width: 768px) { .container { padding: 10px; border-radius: 12px; margin: 0; max-width: 100%; } }

/* Header */
.header-section {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px; flex-wrap: wrap; gap: 16px;
}
.logo { width: 120px; height: auto; border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); transition: transform 0.2s ease; }
.logo:hover { transform: scale(1.05); }
h1 {
    font-family: 'Inter', 'Segoe UI', 'DejaVu Sans', Arial, sans-serif;
    color: #fff; text-align: center; font-size: 2.2rem; font-weight: 900;
    margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,0.5); letter-spacing: -0.02em;
}
.page-subtitle { color: rgba(255,255,255,0.6); font-size: 0.95rem; text-align: center; margin: 0.2rem 0 0; letter-spacing: 0.01em; }
.back-link { display: inline-block; margin-bottom: 20px; color: #1e40af; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.back-link:hover { color: #3b82f6; }

/* Layout */
.game-container { display: grid; grid-template-columns: 1fr 340px; column-gap: 24px; margin-top: 0; }
.board-section { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; gap: 16px; }

/* Board */
#gameBoard, #waitingBoard, #playBoard {
    width: 600px; height: 600px; margin: 0; position: relative;
    border-radius: 4px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#playBoardWrap { position: relative; }
#gameBoard cg-wrap, #waitingBoard cg-wrap, #playBoard cg-wrap { width: 100%; height: 100%; }
.checkmate-shake { animation: checkmateShake 0.5s ease; }
@keyframes checkmateShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-8px); }
    20% { transform: translateX(8px); }
    30% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    50% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    70% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}
@media (max-width: 768px) {
    #gameBoard, #waitingBoard, #playBoard { width: calc(100vw - 20px); max-width: calc(100vw - 20px); height: calc(100vw - 20px); }
}

/* Moves Panel */
.moves-panel { margin-top: 12px; width: 100%; max-width: 600px; }

/* Panels */
.settings-panel, .info-panel, .moves-panel, .share-panel {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fc 100%);
    border-radius: 12px; padding: 18px;
    border: 1px solid rgba(0, 60, 120, 0.08);
}
.settings-panel h3, .info-panel h3, .moves-panel h3, .share-panel h3 {
    font-family: 'Inter', 'Segoe UI', 'DejaVu Sans', Arial, sans-serif;
    color: #1e3a5f; font-size: 1.15rem; font-weight: 800;
    margin-bottom: 14px; letter-spacing: -0.01em;
}

/* Buttons */
button {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: white; border: none;
    padding: 13px 28px; font-size: 1.05rem; font-weight: 700;
    border-radius: 10px; cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(30, 64, 175, 0.2);
    width: 100%; position: relative; overflow: hidden;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(30, 64, 175, 0.3); filter: brightness(1.08); }
button:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2); }
button:disabled { background: #c5cdd8; cursor: not-allowed; transform: none; opacity: 0.6; box-shadow: none; }

/* Select */
select {
    width: 100%; padding: 11px 14px; font-size: 0.95rem; font-weight: 600;
    font-family: 'Nunito', sans-serif; background: #fff; color: #333;
    border: 1.5px solid #d0daea; border-radius: 10px; cursor: pointer;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e40af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 35px;
    transition: all 0.2s ease;
}
select:hover { border-color: #3b82f6; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12); }
select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
select option { padding: 10px; font-weight: 600; color: #333; background: white; }

/* Action buttons */
#rematchBtn { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 3px 10px rgba(5,150,105,0.2); }
#rematchBtn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(5,150,105,0.3); }
#rematchBtn.rematch-offer-highlight { animation: rematch-pulse 1s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(16,185,129,0.6); }
@keyframes rematch-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.6); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.2); } }
.draw-btn { background: linear-gradient(135deg, #2563eb, #3b82f6); box-shadow: 0 3px 10px rgba(37,99,235,0.2); }
.draw-btn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(37,99,235,0.3); }
.resign-btn { background: linear-gradient(135deg, #b91c1c, #dc2626); box-shadow: 0 3px 10px rgba(185,28,28,0.2); }
.resign-btn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(185,28,28,0.3); }
.export-btn { background: linear-gradient(135deg, #7c3aed, #8b5cf6); box-shadow: 0 3px 10px rgba(124,58,237,0.2); }
.export-btn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(124,58,237,0.3); }
.analyze-btn { background: linear-gradient(135deg, #0d9488, #14b8a6); box-shadow: 0 3px 10px rgba(13,148,136,0.2); }
.analyze-btn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(13,148,136,0.3); }
.new-opponent-btn { background: linear-gradient(135deg, #7c3aed, #a855f7); box-shadow: 0 3px 10px rgba(124,58,237,0.2); }
.new-opponent-btn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(124,58,237,0.3); }
.cp-stop-btn { background: linear-gradient(135deg, #b45309, #d97706); box-shadow: 0 3px 10px rgba(180,83,9,0.2); }
.cp-stop-btn:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(180,83,9,0.3); }

/* Search overlay */
.search-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(12, 18, 34, 0.85); z-index: 10;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
}
.search-overlay.hidden { display: none; }
.search-overlay-content { text-align: center; color: #fff; }
.search-spinner {
    width: 48px; height: 48px; margin: 0 auto 16px;
    border: 4px solid rgba(255,255,255,0.2); border-top-color: #a855f7;
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.search-text { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.search-time { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin-bottom: 16px; }
.search-cancel-btn {
    background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 24px; font-size: 0.9rem; font-weight: 600; border-radius: 8px;
    cursor: pointer; width: auto; transition: background 0.2s;
}
.search-cancel-btn:hover { background: rgba(255,255,255,0.25); }

/* Input */
.input-group { margin-bottom: 14px; }
.input-group label { display: block; margin-bottom: 6px; color: #64748b; font-weight: 600; font-size: 0.9rem; }
.input-group input {
    width: 100%; padding: 11px 14px; border: 1.5px solid #d0daea;
    border-radius: 10px; font-size: 0.95rem; font-family: 'Nunito', sans-serif;
    transition: all 0.2s ease;
}
.input-group input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.input-group select { width: 100%; padding: 11px 14px; border: 1.5px solid #d0daea; border-radius: 10px; font-size: 0.95rem; font-family: 'Nunito', sans-serif; background: white; cursor: pointer; transition: all 0.2s ease; }
.input-group select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }

/* Status */
#status {
    text-align: center; font-size: 1.1rem; font-weight: 700;
    margin: 12px 0; padding: 10px 16px; border-radius: 10px;
    min-height: 44px; display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
#status.info { color: #2563eb; background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(37,99,235,0.04)); border: 1px solid rgba(59,130,246,0.12); }
#status.success { color: #059669; background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(5,150,105,0.04)); border: 1px solid rgba(16,185,129,0.12); }
#status.error { color: #dc2626; background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(220,38,38,0.04)); border: 1px solid rgba(239,68,68,0.12); }
#status.warning { color: #1e40af; background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.04)); border: 1px solid rgba(245,158,11,0.12); }

/* Info */
.info-item { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(0, 60, 120, 0.06); }
.info-item:last-child { border-bottom: none; }
.info-label { font-weight: 600; color: #64748b; font-size: 0.9rem; }
.info-value { font-weight: 700; color: #1e40af; font-size: 0.9rem; }

/* Moves */
.moves-list {
    max-height: 300px; overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem; line-height: 1.9; color: #374151;
    scrollbar-width: thin; scrollbar-color: #b0c4de transparent;
}
.moves-list::-webkit-scrollbar { width: 5px; }
.moves-list::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
.moves-list::-webkit-scrollbar-thumb { background: #b0c4de; border-radius: 3px; }
.move-pair { margin-bottom: 3px; padding: 2px 6px; border-radius: 4px; transition: background 0.15s; }
.move-pair:hover { background: rgba(59, 130, 246, 0.06); }
.move-san { cursor: pointer; padding: 1px 4px; border-radius: 3px; transition: background 0.15s; }
.move-san:hover { background: rgba(59, 130, 246, 0.15); }
.move-san.active { background: #3b82f6; color: #fff; border-radius: 3px; }
.moves-nav { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.moves-nav button { background: #e8eef6; border: none; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-size: 1rem; color: #374151; transition: background 0.15s; line-height: 1; }
.moves-nav button:hover { background: #d0daea; }
.moves-nav button:disabled { opacity: 0.3; cursor: default; }

/* Player info (avatar + name + flag) */
.player-info-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; margin: 4px 0;
}
.player-info-bar .player-avatar {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
    border: 2px solid #d0daea; flex-shrink: 0;
}
.player-info-bar .player-flag {
    width: 20px; height: 15px; border-radius: 2px; flex-shrink: 0;
    object-fit: cover; box-shadow: 0 0 2px rgba(0,0,0,0.2);
}
.player-info-bar .player-username {
    font-weight: 700; color: #1e3a5f; font-size: 0.92rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-info-bar.clickable { cursor: pointer; border-radius: 8px; transition: background 0.15s; }
.player-info-bar.clickable:hover { background: rgba(0,76,153,0.06); }
@media (max-width: 768px) {
    .player-info-bar { padding: 4px 6px; gap: 6px; }
    .player-info-bar .player-avatar { width: 26px; height: 26px; }
    .player-info-bar .player-flag { width: 18px; height: 13px; }
    .player-info-bar .player-username { font-size: 0.82rem; }
}

/* Timer */
.timer-display {
    font-size: 2rem; font-weight: 900; font-family: 'Inter', monospace;
    padding: 14px; border-radius: 10px; text-align: center; margin: 8px 0;
    background: linear-gradient(135deg, #f0f4ff, #e8ecf5);
    color: #1e3a5f; transition: all 0.3s ease;
}
.timer-display.active {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white; animation: pulse 1.5s ease-in-out infinite;
}
.timer-display.low-time {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    color: white; animation: pulse 0.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }

/* Chat */
.chat-panel {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fc 100%);
    border-radius: 12px; padding: 14px;
    border: 1px solid rgba(0, 60, 120, 0.08);
    display: flex; flex-direction: column; max-height: 300px;
}
.chat-panel h3 { font-family: 'Inter', sans-serif; color: #1e3a5f; font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.chat-messages { flex: 1; overflow-y: auto; margin-bottom: 8px; max-height: 200px; font-size: 0.88rem; }
.chat-message { margin-bottom: 6px; padding: 6px 10px; border-radius: 8px; background: white; border: 1px solid rgba(0,60,120,0.04); }
.chat-message.own { background: rgba(16, 185, 129, 0.08); text-align: right; border-color: rgba(16,185,129,0.1); }
.chat-message .sender { font-weight: 700; color: #1e40af; font-size: 0.82rem; }
.chat-message .text { color: #444; margin-top: 2px; }
.chat-input-group { display: flex; gap: 6px; }
.chat-input-group input { flex: 1; padding: 9px 12px; border: 1.5px solid #d0daea; border-radius: 8px; font-size: 0.88rem; transition: all 0.2s ease; }
.chat-input-group input:focus { border-color: #3b82f6; outline: none; }
.chat-input-group button { padding: 9px 16px; width: auto; font-size: 1rem; }

/* Sound toggle */
.sound-toggle { background: linear-gradient(135deg, #f0f4ff, #f8f9fc); border-radius: 12px; padding: 15px; text-align: center; border: 1px solid rgba(0,60,120,0.08); }
.sound-toggle button { background: #94a3b8; font-size: 1.5rem; padding: 10px 20px; }
.sound-toggle button.active { background: linear-gradient(135deg, #059669, #10b981); }

/* Spinner */
.loading-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2.5px solid rgba(30, 64, 175, 0.2); border-radius: 50%;
    border-top-color: #2563eb; animation: spin 0.8s linear infinite;
}

/* Controls */
.controls { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.controls button { margin: 0; }
#newGameBtn { margin-top: 12px; padding-top: 16px; border-top: 1.5px solid rgba(0, 60, 120, 0.08); }

/* Share */
.share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }

/* Theme selectors */
.theme-selector { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.theme-btn, .piece-btn {
    background: #f0f4ff; border: 1.5px solid #d0daea;
    padding: 8px 12px; font-size: 1.2rem; border-radius: 8px;
    cursor: pointer; transition: all 0.2s ease; min-width: 44px; text-align: center;
}
.theme-btn:hover, .piece-btn:hover { border-color: #3b82f6; background: #e8eeff; transform: scale(1.05); }
.theme-btn.active, .piece-btn.active { background: #1e40af; border-color: #1e40af; box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3); }

/* Share buttons */
.share-btn { padding: 11px; font-size: 0.92rem; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; }
.share-btn.whatsapp { background: linear-gradient(135deg, #22c55e, #16a34a); }
.share-btn.whatsapp:hover { filter: brightness(1.08); }
.share-btn.telegram { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.share-btn.telegram:hover { filter: brightness(1.08); }
.share-btn.email { background: linear-gradient(135deg, #ef4444, #dc2626); }
.share-btn.email:hover { filter: brightness(1.08); }
.share-btn.copy { background: linear-gradient(135deg, #64748b, #475569); }
.share-btn.copy:hover { filter: brightness(1.1); }
.share-btn.copy.copied { background: linear-gradient(135deg, #059669, #10b981); }
.game-link {
    background: #f0f4ff; padding: 11px 14px; border-radius: 8px;
    word-break: break-all; font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem; color: #64748b; margin-bottom: 10px;
    border: 1px solid rgba(0,60,120,0.06);
}

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog {
    background: white; border-radius: 16px; padding: 28px;
    max-width: 420px; width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { font-size: 1.25rem; font-weight: 800; color: #1e3a5f; margin-bottom: 10px; font-family: 'Inter', sans-serif; }
.modal-body { font-size: 0.95rem; color: #555; line-height: 1.6; margin-bottom: 20px; }
.modal-input {
    width: 100%; padding: 11px 14px; border: 1.5px solid #d0daea;
    border-radius: 10px; font-size: 0.95rem; font-family: 'Nunito', sans-serif;
    margin-bottom: 18px; transition: all 0.2s ease;
}
.modal-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-btn {
    padding: 11px 22px; border: none; border-radius: 10px;
    font-size: 0.95rem; font-weight: 700; font-family: 'Nunito', sans-serif;
    cursor: pointer; transition: all 0.2s ease;
}
.modal-btn.primary { background: linear-gradient(135deg, #1e40af, #2563eb); color: white; }
.modal-btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.modal-btn.secondary { background: #e8ecf1; color: #555; }
.modal-btn.secondary:hover { background: #dde2e8; }
@media (max-width: 768px) { .modal-dialog { padding: 20px; max-width: 95%; } .modal-header { font-size: 1.1rem; } .modal-body { font-size: 0.9rem; } .modal-btn { padding: 10px 18px; font-size: 0.9rem; } }

/* Online Users Panel */
.online-users-panel {
    background: linear-gradient(135deg, rgba(30,64,175,0.04), rgba(59,130,246,0.03));
    border-radius: 12px; padding: 14px 16px;
    border: 1px solid rgba(30, 64, 175, 0.1);
}
.online-users-panel h3 {
    font-family: 'Inter', 'Segoe UI', 'DejaVu Sans', Arial, sans-serif;
    color: #1e3a5f; font-size: 1.05rem; font-weight: 700;
    margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.online-dot-header { width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex-shrink: 0; box-shadow: 0 0 6px rgba(16,185,129,0.6); animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
.online-count-badge { margin-left: auto; background: rgba(30, 64, 175, 0.1); color: #1e40af; font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 8px; }
.online-search-wrap { margin-bottom: 8px; }
.online-search-input { width: 100%; padding: 7px 10px 7px 30px; border: 1px solid rgba(30,64,175,0.12); border-radius: 8px; font-size: 0.82rem; background: rgba(255,255,255,0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 9px center no-repeat; outline: none; transition: border-color 0.15s; color: #374151; }
.online-search-input:focus { border-color: rgba(37,99,235,0.4); }
.online-search-input::placeholder { color: #94a3b8; }
.online-users-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b0c4de transparent; }
.online-user-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(255,255,255,0.8); border-radius: 8px; font-size: 0.88rem; transition: all 0.15s ease; border: 1px solid transparent; }
.online-user-item:hover { background: rgba(255,255,255,1); border-color: rgba(59,130,246,0.1); }
.online-user-item.is-you { background: rgba(16, 185, 129, 0.08); border-color: rgba(16,185,129,0.1); }
.online-user-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; flex-shrink: 0; }
.online-user-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; }
.online-user-badge { font-size: 0.68rem; padding: 1px 6px; border-radius: 6px; font-weight: 600; flex-shrink: 0; }
.badge-you { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-guest { background: rgba(148, 163, 184, 0.12); color: #64748b; }
.badge-reg { background: rgba(30, 64, 175, 0.08); color: #1e40af; }
.badge-ingame { background: transparent; font-size: 0.82rem; opacity: 0.6; }

.challenge-btn {
    padding: 4px 11px !important; font-size: 0.76rem !important; font-weight: 700 !important;
    background: linear-gradient(135deg, #1e40af, #2563eb) !important;
    color: #fff !important; border: none !important; border-radius: 6px !important;
    cursor: pointer !important; width: auto !important; min-width: 70px;
    transition: all 0.15s ease !important; box-shadow: 0 2px 6px rgba(30,64,175,0.2) !important; transform: none !important;
}
.challenge-btn:hover:not(:disabled) { filter: brightness(1.1) !important; transform: none !important; }
.challenge-btn.waiting { background: linear-gradient(135deg, #d97706, #f59e0b) !important; cursor: default !important; font-size: 0.7rem !important; }

.ready-checkbox-label { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.86rem; color: #64748b; cursor: pointer; user-select: none; }
.ready-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #10b981; cursor: pointer; }

.ready-play-btn {
    padding: 4px 11px !important; font-size: 0.76rem !important; font-weight: 700 !important;
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #fff !important; border: none !important; border-radius: 6px !important;
    cursor: pointer !important; width: auto !important; min-width: 70px;
    transition: all 0.15s ease !important; box-shadow: 0 2px 6px rgba(5,150,105,0.2) !important; transform: none !important;
}
.ready-play-btn:hover { filter: brightness(1.1) !important; }

.ready-tc-badge { font-size: 0.66rem; padding: 1px 5px; border-radius: 4px; background: rgba(16,185,129,0.12); color: #059669; font-weight: 600; white-space: nowrap; }
.online-no-users { color: #94a3b8; font-size: 0.84rem; text-align: center; padding: 10px 0; }

/* Challenge notification */
.challenge-notification {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #f59e0b; border-radius: 12px; padding: 14px;
    animation: challengePulse 2s ease-in-out infinite;
}
@keyframes challengePulse { 0%, 100% { border-color: #f59e0b; box-shadow: 0 0 0 0 rgba(245,158,11,0); } 50% { border-color: #d97706; box-shadow: 0 0 0 4px rgba(245,158,11,0.15); } }
.challenge-notification h4 { color: #b45309; font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.challenge-notification .challenge-info { color: #64748b; font-size: 0.86rem; margin-bottom: 10px; line-height: 1.5; }
.challenge-notification .challenge-actions { display: flex; gap: 6px; }
.challenge-notification .challenge-actions button { flex: 1; padding: 8px 0 !important; font-size: 0.86rem !important; font-weight: 700 !important; width: auto !important; }
.btn-accept { background: linear-gradient(135deg, #059669, #10b981) !important; }
.btn-accept:hover:not(:disabled) { filter: brightness(1.1) !important; }
.btn-decline { background: linear-gradient(135deg, #b91c1c, #dc2626) !important; }
.btn-decline:hover:not(:disabled) { filter: brightness(1.1) !important; }

.hidden { display: none !important; }
.lobby-screen, .waiting-screen, .game-screen { transition: opacity 0.25s ease; }

/* Premove */
cg-board square.premove-dest { background: radial-gradient(rgba(30, 64, 175, 0.45) 19%, rgba(0, 0, 0, 0) 20%) !important; }
cg-board square.current-premove { background-color: rgba(30, 64, 175, 0.25) !important; }

/* Mobile controls */
.mobile-controls { display: none; flex-direction: column; gap: 8px; width: 100%; max-width: 400px; margin: 12px auto; }
.mobile-controls button { padding: 12px 20px; font-size: 0.95rem; }

/* Responsive - tablet */
@media (max-width: 1024px) {
    .game-container { grid-template-columns: 1fr; display: flex; flex-direction: column; }
    .sidebar { display: flex; flex-direction: column; }
    .mobile-controls { display: flex; }
    .sidebar > .controls { display: none; }
    #timerSection { order: 5; margin-top: 16px; margin-bottom: 20px; }
    .chat-panel { order: 1; }
    .info-panel:not(#timerSection) { order: 2; }
    .board-section { order: 3; margin-bottom: 16px; }
}

/* Responsive - mobile */
@media (max-width: 768px) {
    .header-section { flex-direction: row; gap: 10px; margin-bottom: 10px; }
    .logo { width: 60px; }
    h1 { font-size: 1.3rem; }
    .page-subtitle { font-size: 0.85rem; }
    .back-link { font-size: 0.9rem; margin-bottom: 8px; }
    #status { font-size: 0.95rem; padding: 8px; margin: 8px 0; min-height: 38px; }
    button { padding: 12px 20px; font-size: 0.95rem; }
    .settings-panel, .info-panel, .moves-panel, .share-panel { padding: 14px; }
    .settings-panel h3, .info-panel h3, .moves-panel h3, .share-panel h3 { font-size: 1.05rem; margin-bottom: 10px; }
}

@media (max-width: 480px) {
    .page-subtitle { display: none; }
}

/* Landscape */
@media (max-width: 900px) and (max-height: 500px) {
    .game-container { display: grid !important; grid-template-columns: 1fr 240px !important; gap: 10px !important; flex-direction: unset !important; }
    .board-section { order: unset !important; margin-bottom: 0 !important; }
    .sidebar { order: unset !important; max-height: calc(100vh - 120px); overflow-y: auto; }
    .mobile-controls { display: none !important; }
    .sidebar > .controls { display: flex !important; }
    #playBoard { width: min(calc(100vh - 145px), calc(100vw - 270px)) !important; height: min(calc(100vh - 145px), calc(100vw - 270px)) !important; }
    .moves-panel { max-height: 80px; overflow-y: auto; }
    #status { padding: 4px 8px; font-size: 0.8rem; margin: 4px 0; min-height: 28px; }
}

/* XP toast */
.xp-toast {
    position: fixed; top: 80px; right: 20px; z-index: 9999;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff; border-radius: 12px; padding: 12px 20px;
    font-weight: 700; font-size: 1rem; box-shadow: 0 4px 20px rgba(245,158,11,.4);
    transform: translateX(calc(100% + 40px)); transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.xp-toast.show { transform: translateX(0); }

/* Login hint */
.login-hint {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fcd34d;
    border-radius: 12px; padding: 12px 16px;
    max-width: 1200px; margin: 0 auto 16px;
}
.login-hint-icon { font-size: 1.5rem; flex-shrink: 0; }
.login-hint-body { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; color: #92400e; }
.login-hint-body strong { font-size: 0.9rem; font-weight: 700; color: #78350f; }
.login-hint-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1.5px solid #fcd34d; border-radius: 8px;
    padding: 6px 14px; font-size: 0.82rem; font-weight: 600;
    color: #92400e; text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: all 0.2s ease;
}
.login-hint-btn:hover { background: #fef3c7; border-color: #f59e0b; transform: translateY(-1px); }

/* ===== Game Over Modal ===== */
.gameover-modal-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    animation: gameover-fadein 0.2s ease;
}
.gameover-modal-overlay.hidden { display: none; }
@keyframes gameover-fadein { from { opacity: 0; } to { opacity: 1; } }

.gameover-modal-card {
    background: linear-gradient(160deg, #1a2540 0%, #0f1a30 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; padding: 2.5rem 2rem 2rem;
    max-width: 380px; width: 90%; text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    animation: gameover-slidein 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes gameover-slidein { from { transform: scale(0.8) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.gameover-modal-icon { font-size: 4rem; line-height: 1; margin-bottom: 0.75rem; }

.gameover-modal-title {
    font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}
.gameover-modal-title.win  { color: #10b981; }
.gameover-modal-title.lose { color: #ef4444; }
.gameover-modal-title.draw { color: #f59e0b; }

.gameover-modal-reason {
    font-size: 0.95rem; color: #94a3b8; margin-bottom: 1.75rem;
    min-height: 1.2em;
}

.gameover-modal-actions { display: flex; flex-direction: column; gap: 0.6rem; }

.gameover-btn {
    width: 100%; padding: 0.7rem 1rem; border-radius: 10px; border: none;
    font-family: inherit; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all 0.18s ease;
}
.gameover-btn-primary {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff; box-shadow: 0 3px 12px rgba(5,150,105,0.35);
}
.gameover-btn-primary:hover { box-shadow: 0 5px 18px rgba(5,150,105,0.5); transform: translateY(-1px); }

.gameover-btn-secondary {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: #fff; box-shadow: 0 3px 12px rgba(29,78,216,0.3);
}
.gameover-btn-secondary:hover { box-shadow: 0 5px 18px rgba(29,78,216,0.5); transform: translateY(-1px); }

.gameover-btn-analyze {
    background: rgba(255,255,255,0.08); color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.12);
}
.gameover-btn-analyze:hover { background: rgba(255,255,255,0.14); color: #fff; }

.gameover-btn-newgame {
    background: rgba(255,255,255,0.08); color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.12);
}
.gameover-btn-newgame:hover { background: rgba(255,255,255,0.14); color: #fff; }

.gameover-btn-close {
    background: transparent; color: #64748b; font-size: 0.85rem; font-weight: 600;
    padding: 0.4rem;
}
.gameover-btn-close:hover { color: #94a3b8; }
