/**
 * Games Page Styles
 * Table Tennis Pro Analyzer - Game History
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
    color: #333;
    /* PWA full-screen support for notch/safe areas */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* =============================================================================
   HEADER
   ========================================================================== */

header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

h1 {
    font-size: 1.5rem;
    color: #667eea;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    max-width: 50%;
}

.user-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    flex-shrink: 1;
    min-width: 0;
}

.user-info .btn-secondary {
    flex-shrink: 0;
    white-space: nowrap;
}

/* =============================================================================
   NAVIGATION
   ========================================================================== */

.main-nav {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    background: #f0f4ff;
}

.main-nav a.active {
    background: #667eea;
    color: white;
}

/* =============================================================================
   CONTAINER
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* =============================================================================
   STATISTICS SECTION
   ========================================================================== */

.stats-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
}

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

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
}

/* Desktop - stat cards more compact */
@media (min-width: 768px) {
    .stat-card {
        padding: 0.8rem;
    }

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

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* =============================================================================
   ACTIONS SECTION
   ========================================================================== */

.actions-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* =============================================================================
   GAMES TABLE
   ========================================================================== */

.games-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.games-section h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
}

.table-container {
    overflow-x: auto;
}

.games-table {
    width: 100%;
    border-collapse: collapse;
}

.games-table thead {
    background: #667eea;
    color: white;
}

.games-table th,
.games-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.games-table tbody tr:hover {
    background: #f5f7fa;
}

.games-table .actions-cell {
    display: flex;
    gap: 0.5rem;
}

.result-win {
    background: #d4edda;
    color: #155724;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold;
}

.result-loss {
    background: #f8d7da;
    color: #721c24;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold;
}

.result-draw {
    background: #fff3cd;
    color: #856404;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold;
}

.loading,
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* =============================================================================
   BUTTONS
   ========================================================================== */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small,
.btn-voice {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* New color scheme for action buttons */
.btn-opponent-register {
    background: #60a5fa;  /* Azul céu claro */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
}

.btn-opponent-register:hover {
    background: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.btn-opponent-view {
    background: #3b82f6;  /* Azul médio */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
}

.btn-opponent-view:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-tactical-sheets {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
}

.btn-tactical-sheets:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.btn-analytics {
    background: #8b5cf6;  /* Roxo/Violeta vibrante */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
}

.btn-analytics:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

.btn-export {
    background: #22c55e;  /* Verde vibrante */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
}

.btn-export:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-achievements {
    background: #fbbf24;  /* Amarelo/creme vibrante */
    color: #78350f;  /* Texto marrom escuro */
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
}

.btn-achievements:hover {
    background: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

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

.btn-pregame:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Textarea with voice button container */
.textarea-with-voice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.textarea-with-voice textarea {
    flex: 1;
}

.textarea-with-voice .btn-voice {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-top: 0;
    height: fit-content;
}

.btn-voice {
    background: #28a745;
    color: white;
    margin-top: 0.5rem;
}

.btn-voice:hover {
    background: #218838;
}

.btn-voice.recording {
    background: #dc3545;
    animation: pulse 1s infinite;
}

/* Voice notification warning */
.voice-notification-warning {
    border-left: 4px solid #ffc107;
    background: #fff3cd;
}

.btn-icon {
    padding: 0.5rem 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
}

.btn-icon:hover {
    background: #5568d3;
    transform: scale(1.05);
}

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

/* =============================================================================
   MODALS
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 20px;
}

.modal-large {
    max-width: 900px;
    width: 90%;
}

/* Add spacing inside modal body */
.modal-content > div:not(.modal-header) {
    padding: 1.5rem;
}

.modal-header {
    background: #667eea;
    color: white;
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #f0f0f0;
}

.modal-body {
    padding: 2rem;
}

/* Opponent Modal Tabs */
.opponent-tabs {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 20px;
}

.opponent-tab {
    flex: 1;
    padding: 16px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.opponent-tab:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.opponent-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.opponent-tab-content {
    display: none;
    padding: 1.5rem 0;
}

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

.opponent-view-content {
    display: none;
}

.opponent-view-content.active {
    display: block;
}

/* Opponents Table */
.opponents-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.opponents-table thead {
    background: #667eea;
    color: white;
}

.opponents-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.opponents-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.opponents-table tbody tr:hover {
    background: #f8fafc;
}

.opponents-table td {
    padding: 12px;
    font-size: 14px;
    color: #475569;
}

.opponents-table td:first-child {
    font-weight: 600;
    color: #1e293b;
}

.opponents-table .table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.opponents-table .table-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.opponents-table .btn-table-pregame {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.opponents-table .btn-table-pregame:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
}

.opponents-table .btn-table-history {
    background: #667eea;
    color: white;
}

.opponents-table .btn-table-history:hover {
    background: #5568d3;
}

.opponents-table .btn-table-edit {
    background: #64748b;
    color: white;
}

.opponents-table .btn-table-edit:hover {
    background: #475569;
}

.opponents-table .btn-table-delete {
    background: #ef4444;
    color: white;
}

.opponents-table .btn-table-delete:hover {
    background: #dc2626;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* =============================================================================
   FORMS
   ========================================================================== */

form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* =============================================================================
   OPPONENTS
   ========================================================================== */

.opponents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.opponent-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.opponent-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.opponent-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.opponent-details p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.opponent-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.game-details p {
    margin-bottom: 1rem;
}

.game-analysis-details {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.game-analysis-details h4 {
    margin-bottom: 1rem;
    color: #4a5568;
}

.game-analysis-details p {
    margin-bottom: 0.75rem;
}

.analysis-tag {
    display: inline-block;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 16px;
    margin: 2px 4px 2px 0;
    font-size: 0.85rem;
    color: #4a5568;
}

.stats-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.stats-summary p {
    margin-bottom: 0.5rem;
}

/* =============================================================================
   NOTIFICATIONS
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.voice-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.voice-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.voice-notification-info {
    border-left: 4px solid #17a2b8;
}

.voice-notification-success {
    border-left: 4px solid #28a745;
}

.voice-notification-error {
    border-left: 4px solid #dc3545;
}

/* =============================================================================
   VOICE GAME ENTRY
   ========================================================================== */

.btn-voice-game {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-voice-game:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.voice-game-modal {
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
}

.voice-game-modal[style*="display: flex"] {
    display: flex !important;
}

.voice-game-modal .modal-content {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    top: 0;
    transform: none;
    box-sizing: border-box;
    overflow: auto;
    max-height: 90vh;
}

.voice-game-modal .modal-actions {
    gap: 0.5rem;
    padding: 0.6rem 1rem;
}

.voice-game-modal .modal-actions button {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

.voice-game-content {
    text-align: center;
}

.voice-game-body {
    padding: 0.5rem 0.8rem;
}

.voice-game-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.voice-game-step {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.voice-game-prompt {
    font-size: 0.85rem;
    line-height: 1.3;
    color: #333;
    white-space: pre-line;
    max-width: 400px;
}

/* Highlighted keywords in voice prompts */
.voice-highlight {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #4361ee;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hint text in voice prompts */
.voice-hint {
    display: block;
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
    margin-top: 10px;
    padding: 12px 18px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4361ee;
}

/* Keyword hints for voice commands */
.voice-keywords {
    display: block;
    font-size: 1.7rem;
    color: #333;
    font-weight: 500;
    margin-top: 14px;
    margin-left: -10px;
    margin-right: -10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
    border-radius: 8px;
    border: 1px solid #c8e6c9;
    white-space: pre-line;
    line-height: 1.7;
    text-align: left;
}

.voice-keywords-title {
    display: block;
    font-size: 1.55rem;
    font-weight: 700;
    color: #2e7d32;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

/* Recording state - more prominent */
.voice-recording-hint {
    display: block;
    font-size: 1rem;
    color: #d32f2f;
    font-weight: 600;
    margin-top: 8px;
    padding: 8px 12px;
    background: #ffebee;
    border-radius: 8px;
    border: 2px solid #d32f2f;
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.voice-game-indicator {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.voice-game-indicator.listening {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    animation: pulse-voice 1.5s infinite;
}

.voice-game-indicator .voice-wave {
    width: 28px;
    height: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z'/%3E%3Cpath d='M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.voice-game-indicator.listening .voice-wave {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z'/%3E%3Cpath d='M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z'/%3E%3C/svg%3E");
    animation: wave-animation 0.5s infinite alternate;
}

@keyframes pulse-voice {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    }
}

@keyframes wave-animation {
    0% { transform: scale(0.9); }
    100% { transform: scale(1.1); }
}

.voice-game-response {
    font-size: 0.9rem;
    color: #666;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    white-space: pre-line;
    padding: 0 0.8rem;
}

/* Manual input section */
.voice-game-manual-input {
    margin-top: 0.5rem;
    width: 100%;
    max-width: 300px;
}

.manual-buttons {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
}

.btn-yes {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-no {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-no:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-win {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-win:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-lose {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: white;
    border: none;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-lose:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-draw {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
    color: white;
    border: none;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-draw:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.manual-text-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.manual-text-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.manual-text-input input:focus {
    outline: none;
    border-color: #667eea;
}

/* Opponent selection buttons */
.btn-opponent-option {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 280px;
}

.btn-opponent-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.opponent-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
    align-items: center;
}

/* =============================================================================
   VOICE ANALYSIS SECTION (in voice modal step 6)
   ========================================================================== */

.voice-analysis-section {
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.voice-analysis-header {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.voice-analysis-hint {
    font-size: 11px;
    font-weight: 400;
    color: #6c757d;
}

.voice-analysis-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.voice-analysis-group {
    background: white;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e9ecef;
}

.voice-analysis-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.voice-analysis-row {
    margin-bottom: 6px;
}

.voice-analysis-row:last-child {
    margin-bottom: 0;
}

.voice-analysis-sublabel {
    font-size: 11px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.voice-analysis-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.voice-analysis-chip {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
}

.voice-analysis-chip:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.voice-analysis-chip.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* Mobile adjustments for voice analysis */
@media (max-width: 480px) {
    .voice-analysis-section {
        margin-top: 8px;
        padding: 8px;
        max-height: 250px;
    }

    .voice-analysis-header {
        font-size: 12px;
    }

    .voice-analysis-chip {
        font-size: 10px;
        padding: 3px 6px;
    }

    .voice-analysis-sublabel {
        font-size: 10px;
    }
}

/* =============================================================================
   JAPANESE/CJK TEXT SUPPORT
   ========================================================================== */

/* Prevent CJK (Chinese/Japanese/Korean) text from breaking in the middle of words */
h2, h3, h4, label, th, td, .stat-label, .card-title, option {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* =============================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.2rem;
    }

    /* Opponent Filter - Stack vertically on mobile */
    #opponentFilter {
        min-width: 100% !important;
        width: 100% !important;
    }

    /* Compact Stats Grid for Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.5rem;
        border-radius: 8px;
    }

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

    .stat-value {
        font-size: 1.3rem;
        margin-bottom: 0.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Compact Section Headers */
    section h2 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

    /* Compact Header */
    header {
        padding: 0.8rem 0;
    }

    .header-container {
        padding: 0 10px;
    }

    .logo-section {
        flex-shrink: 0;
        gap: 0.5rem;
    }

    .logo-section h1 {
        display: none; /* Hide title on very small screens */
    }

    .logo {
        width: 35px;
        height: 35px;
    }

    .user-info {
        gap: 0.3rem;
        max-width: 45%;
    }

    .user-info span {
        max-width: 80px;
        font-size: 0.75rem;
    }

    .user-info .btn-secondary {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Game Modals Mobile - Full width like voice modal */
    #newGameModal,
    #editGameModal {
        padding: 0;
        align-items: flex-start;
        padding-top: 5px;
    }

    #newGameModal .modal-content,
    #editGameModal .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 10px 10px 0 0;
        max-height: calc(100vh - 10px);
    }

    #newGameModal .modal-header,
    #editGameModal .modal-header {
        padding: 0.8rem 1rem;
        border-radius: 10px 10px 0 0;
    }

    #newGameModal .modal-content > div:not(.modal-header),
    #editGameModal .modal-content > div:not(.modal-header) {
        padding: 0.8rem;
    }

    /* Voice Game Modal Mobile - Compact layout to ensure buttons always visible */
    .voice-game-modal {
        padding: 0;
        align-items: flex-start;
        padding-top: 5px;
    }

    .voice-game-modal .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        height: calc(100vh - 10px);
        max-height: calc(100vh - 10px);
        display: flex;
        flex-direction: column;
        border-radius: 10px 10px 0 0;
    }

    .voice-game-modal .modal-header {
        padding: 0.4rem 0.8rem;
        flex-shrink: 0;
        border-radius: 10px 10px 0 0;
    }

    .voice-game-modal .modal-header h2 {
        font-size: 0.9rem;
    }

    .voice-game-modal .modal-header .close {
        font-size: 1.5rem;
    }

    .voice-game-body {
        padding: 0.4rem;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .voice-game-status {
        gap: 0.5rem;
    }

    .voice-game-step {
        padding: 0.15rem 0.5rem;
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
    }

    .voice-game-prompt {
        font-size: 0.85rem;
        max-width: 100%;
        padding: 0 0.2rem;
        margin-bottom: 0.3rem;
        line-height: 1.3;
    }

    .voice-highlight {
        font-size: 1.1rem;
        margin-bottom: 2px;
    }

    .voice-hint {
        font-size: 0.75rem;
        padding: 4px 6px;
        margin-top: 2px;
    }

    .voice-keywords {
        font-size: 0.75rem;
        padding: 6px 8px;
        margin-top: 6px;
        line-height: 1.4;
    }

    .voice-recording-hint {
        font-size: 0.8rem;
        padding: 6px 8px;
        margin-top: 4px;
    }

    .voice-game-indicator {
        width: 50px;
        height: 50px;
        margin: 0.3rem auto;
    }

    .voice-game-indicator .voice-wave {
        width: 30px;
        height: 30px;
    }

    .voice-game-response {
        font-size: 0.8rem;
        min-height: 30px;
        padding: 0.2rem;
    }

    /* Confirmation text styling */
    .voice-game-response .heard-text {
        font-size: 1.1rem;
        color: #4361ee;
        font-weight: 600;
    }

    .voice-game-modal .modal-actions {
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.4rem;
        flex-shrink: 0;
        border-top: 1px solid #eee;
        background: #f9f9f9;
        justify-content: center;
    }

    .voice-game-modal .modal-actions button {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
        min-width: auto;
    }

    /* Manual input area compact */
    .voice-game-manual-input {
        margin-top: 0.3rem;
    }

    .manual-buttons {
        gap: 0.5rem;
    }

    .manual-buttons button {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .manual-text-input {
        gap: 0.3rem;
    }

    .manual-text-input input {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .manual-text-input button {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Opponent options compact */
    .opponent-options {
        gap: 6px;
        margin-top: 8px;
    }

    .btn-opponent-option {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Compact Navigation */
    .main-nav {
        padding: 0.5rem;
        margin-bottom: 0.8rem;
    }

    /* Compact Sections */
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Compact Action Buttons */
    .actions-section {
        flex-direction: column;
        gap: 0.5rem;
    }

    .actions-section button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .games-table {
        font-size: 0.9rem;
    }

    .games-table th,
    .games-table td {
        padding: 0.5rem;
    }

    .opponent-card {
        padding: 1rem;
    }

    .main-nav {
        gap: 0.5rem;
    }

    .main-nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    /* Analytics Modal Responsive */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 1.2rem;
    }

    .modal-content h3 {
        font-size: 1rem;
        margin-top: 20px;
    }

    /* Period Selection Buttons */
    .btn-small {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Stats Card Grid */
    #opponentStatsCard {
        padding: 10px !important;
    }

    #opponentStatsCard > div {
        gap: 10px !important;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
    }

    #opponentStatsCard div > div:first-child {
        font-size: 18px !important;
    }

    #opponentStatsCard div > div:last-child {
        font-size: 10px !important;
    }

    /* Chart Containers */
    #temporalChart,
    #pieChart,
    #opponentChart {
        max-height: 250px !important;
    }

    /* Table Responsive */
    .games-table th,
    .games-table td {
        font-size: 0.75rem;
        padding: 0.4rem;
    }

    /* Select Dropdown */
    #opponentAnalysisSelect {
        font-size: 0.9rem;
        padding: 8px !important;
    }

    /* Opponent Modal Tabs - Mobile */
    .opponent-tabs {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .opponent-tab {
        padding: 12px 16px;
        font-size: 14px;
    }

    .opponent-tab-content {
        padding: 1rem 0;
    }

    /* Modal Body - Mobile */
    .modal-body {
        padding: 1rem;
    }

    .modal-content > div:not(.modal-header) {
        padding: 1rem;
    }

    /* Modal Actions - Mobile - Disabled for game modals (see games.html inline styles) */
    /* .modal-actions styles moved to games.html with !important for game modals */
}

/* Desktop-specific: Smaller voice modal */
@media (min-width: 769px) {
    .voice-game-modal .modal-content {
        max-width: 380px;
    }

    .voice-game-modal .modal-header h2 {
        font-size: 1rem;
    }

    .voice-game-body {
        padding: 0.4rem 0.6rem;
    }

    .voice-step-indicator {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .voice-prompt {
        font-size: 1rem;
        margin: 0.3rem 0;
    }

    .voice-highlight {
        font-size: 1.1rem;
    }

    .voice-response {
        font-size: 1.3rem;
        min-height: 50px;
        padding: 0.5rem;
        margin: 0.3rem 0;
    }

    .voice-hint {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .voice-keywords {
        font-size: 0.95rem;
        padding: 8px 12px;
    }

    .voice-keywords-title {
        font-size: 0.85rem;
    }

    .voice-mic-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* =============================================================================
   GAME ANALYSIS SECTION
   ========================================================================== */

.analysis-section {
    margin: 1.5rem 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fafafa;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-height: 48px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: background 0.3s ease;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
}

.analysis-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.analysis-header span:first-child {
    font-weight: 600;
    color: #333;
}

.analysis-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.analysis-toggle.expanded {
    transform: rotate(180deg);
}

.analysis-optional {
    color: #888;
    font-size: 0.85rem;
    margin-left: auto;
}

.analysis-content {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

/* Main analysis sections (What Worked / What to Improve) */
.analysis-main-section {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 10px;
    background: #f8f9fa;
}

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

.analysis-main-section h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
}

.analysis-main-section.about-me {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
}

.analysis-main-section.about-me h4 {
    color: #1565c0;
}

.analysis-main-section.about-opponent {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffcc80;
}

.analysis-main-section.about-opponent h4 {
    color: #e65100;
}

/* Legacy classes for backward compatibility */
.analysis-main-section.what-worked {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
}

.analysis-main-section.what-worked h4 {
    color: #2e7d32;
}

.analysis-main-section.what-to-improve {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #ef9a9a;
}

.analysis-main-section.what-to-improve h4 {
    color: #c62828;
}

.analysis-group {
    margin-bottom: 16px;
}

.analysis-group:last-child {
    margin-bottom: 0;
}

.analysis-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
}

/* Mobile compact analysis sections */
@media (max-width: 480px) {
    .analysis-main-section {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .analysis-main-section h4 {
        margin: 0 0 8px 0;
        font-size: 13px;
    }

    .analysis-group {
        margin-bottom: 10px;
    }

    .analysis-group label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .multi-select-hint {
        display: none;
    }
}

.multi-select-hint {
    font-weight: 400;
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

.analysis-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.analysis-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Chip-based Category Selector */
.chip-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.category-chip {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 18px;
    background: white;
    color: #444;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.category-chip:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.category-chip.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.category-chip.selected:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.category-chip:active {
    transform: scale(0.95);
}

/* Tablet - slightly smaller */
@media (max-width: 768px) {
    .chip-selector {
        gap: 8px;
        padding: 12px;
    }

    .category-chip {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 14px;
    }
}

/* Mobile compact chips - match voice assistant style */
@media (max-width: 480px) {
    .chip-selector {
        gap: 5px;
        padding: 10px;
        margin-top: 8px;
    }

    .category-chip {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 12px;
    }
}

/* Extra small screens - even more compact */
@media (max-width: 380px) {
    .chip-selector {
        gap: 4px;
        padding: 8px;
    }

    .category-chip {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Hide native select when using chips */
.analysis-group.use-custom-dropdown .analysis-select {
    display: none;
}


.analysis-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.analysis-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    animation: fadeIn 0.3s ease;
}

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

.analysis-item .item-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile portrait - make analysis items full width */
@media (max-width: 400px) {
    .analysis-items {
        flex-direction: column;
    }

    .analysis-item {
        width: 100%;
        padding: 8px 10px;
        gap: 8px;
    }

    .analysis-item .item-text {
        flex: 1;
        min-width: 0;
    }

    .analysis-item .remove-btn {
        order: 2;
    }
}

.analysis-item .remove-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.analysis-item .remove-btn:hover {
    opacity: 1;
}

/* Category groups in select */
.analysis-select optgroup {
    font-weight: 600;
    color: #333;
}

.analysis-select option {
    padding: 8px;
}

/* =============================================================================
   PRE-GAME MODAL
   ========================================================================== */

.pre-game-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.pre-game-stat {
    text-align: center;
}

.pre-game-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.pre-game-stat .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.pre-game-stat.wins .value {
    color: #28a745;
}

.pre-game-stat.losses .value {
    color: #dc3545;
}

.pre-game-stat.rate .value {
    color: #667eea;
}

.pre-game-section {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #fff;
    border-left: 4px solid #e0e0e0;
}

.pre-game-section h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pre-game-section.explore {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #dcfce7 100%);
}

.pre-game-section.explore h3 {
    color: #166534;
}

.pre-game-section.work {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.pre-game-section.work h3 {
    color: #b45309;
}

.pre-game-section.use {
    border-left-color: #667eea;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.pre-game-section.use h3 {
    color: #5b21b6;
}

/* Chips container */
.pre-game-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Individual chips */
.pre-game-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #374151;
}

.pre-game-chip .chip-count {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 8px;
}

/* Section-specific chip colors */
.pre-game-section.explore .pre-game-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(34, 197, 94, 0.3);
}

.pre-game-section.work .pre-game-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(245, 158, 11, 0.3);
}

.pre-game-section.use .pre-game-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(102, 126, 234, 0.3);
}

.pre-game-notes {
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #6c757d;
}

.pre-game-notes h4 {
    font-size: 13px;
    color: #495057;
    margin-bottom: 10px;
}

.pre-game-notes .note {
    font-size: 13px;
    color: #666;
    font-style: italic;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.pre-game-notes .note:last-child {
    border-bottom: none;
}

.pre-game-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.pre-game-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pre-game-empty p {
    font-size: 14px;
}

/* Pre-game Summary (narrative) */
.pre-game-summary {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-left: 4px solid #667eea;
}

.pre-game-summary h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #4a5568;
}

.pre-game-summary p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #2d3748;
}

.pre-game-summary strong {
    color: #667eea;
    font-weight: 600;
}

/* Pre-game Plan (table) */
.pre-game-plan {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.pre-game-plan h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #4a5568;
}

.game-plan-table {
    width: 100%;
    border-collapse: collapse;
}

.game-plan-row {
    border-bottom: 1px solid #f0f0f0;
}

.game-plan-row:last-child {
    border-bottom: none;
}

.game-plan-row td {
    padding: 10px 8px;
    vertical-align: middle;
}

.game-plan-icon {
    width: 30px;
    font-size: 16px;
    text-align: center;
}

.game-plan-action {
    font-size: 14px;
    color: #2d3748;
}

.game-plan-count {
    width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #718096;
}

/* Row type styles */
.game-plan-row.use {
    background: rgba(72, 187, 120, 0.08);
}

.game-plan-row.use .game-plan-action {
    color: #276749;
}

.game-plan-row.explore {
    background: rgba(102, 126, 234, 0.08);
}

.game-plan-row.explore .game-plan-action {
    color: #434190;
}

.game-plan-row.caution {
    background: rgba(237, 137, 54, 0.08);
}

.game-plan-row.caution .game-plan-action {
    color: #c05621;
}

.game-plan-row.work {
    background: rgba(236, 201, 75, 0.08);
}

.game-plan-row.work .game-plan-action {
    color: #975a16;
}

/* Game Plan Table V2 - Two columns layout */
.game-plan-table-v2 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
}

.game-plan-table-v2 thead th {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-align: left;
}

.gp-header-do {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.gp-header-watch {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
}

.game-plan-item {
    padding: 10px 12px;
    border-radius: 8px;
    vertical-align: top;
}

.game-plan-item.do {
    background: rgba(72, 187, 120, 0.1);
    border-left: 3px solid #48bb78;
}

.game-plan-item.watch {
    background: rgba(237, 137, 54, 0.1);
    border-left: 3px solid #ed8936;
}

.game-plan-item .gp-icon {
    font-size: 14px;
    margin-right: 6px;
}

.game-plan-item .gp-label {
    font-size: 13px;
    color: #2d3748;
}

.game-plan-item .gp-count {
    float: right;
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 10px;
}

.game-plan-empty {
    background: #f8f9fa;
    border-radius: 8px;
}

/* Game Plan V3 - 4 Quadrants Layout */
.pre-game-plan-v3 {
    margin-bottom: 16px;
}

.gp-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    margin-top: 12px;
}

.gp-row-header:first-child {
    margin-top: 0;
}

.gp-row-icon {
    font-size: 16px;
}

.gp-row-title {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.gp-quadrant {
    background: white;
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid #e2e8f0;
}

.gp-quadrant.explore {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
}

.gp-quadrant.caution {
    border-left-color: #ed8936;
    background: linear-gradient(135deg, #fffaf0 0%, #fff 100%);
}

.gp-quadrant.continue {
    border-left-color: #4299e1;
    background: linear-gradient(135deg, #ebf8ff 0%, #fff 100%);
}

.gp-quadrant.improve {
    border-left-color: #ecc94b;
    background: linear-gradient(135deg, #fefcbf 0%, #fff 100%);
}

.gp-quadrant-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.gp-quadrant-icon {
    font-size: 14px;
}

.gp-quadrant-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
}

.gp-quadrant-subtitle {
    font-size: 11px;
    color: #718096;
    margin-bottom: 8px;
}

.gp-quadrant-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    font-size: 12px;
}

.gp-item-label {
    color: #2d3748;
}

.gp-item-count {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 10px;
}

.gp-empty {
    font-size: 12px;
    color: #a0aec0;
    font-style: italic;
    padding: 8px 0;
}

/* Responsive for mobile */
@media (max-width: 480px) {
    .gp-row {
        grid-template-columns: 1fr;
    }
}

/* Tactical Sheets Intro - Powered by AI style */
.tactical-sheets-intro {
    padding: 0;
    border-bottom: 1px solid #e9ecef;
}

.tactical-intro-main {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-bottom: 1px solid #e9ecef;
}

.tactical-intro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.tactical-intro-text {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
}

.tactical-intro-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a40 100%);
    border-left: 3px solid #f59e0b;
}

.tactical-tip-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.tactical-tip-text {
    margin: 0;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.tactical-tip-text strong {
    color: #78350f;
}

/* Pre-game button on opponent cards */
.btn-pre-game {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-pre-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for analysis section */
@media (max-width: 768px) {
    .analysis-item {
        padding: 6px 10px;
        font-size: 12px;
    }

    .analysis-item .item-text {
        max-width: 100px;
    }

    .pre-game-stats {
        flex-wrap: wrap;
    }

    .pre-game-stat .value {
        font-size: 20px;
    }
}
