/**
 * Va Banque Host Screen Styles
 */

/* Reset & Base */
.vb-host-app {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: #333;
    background: #fff;
    min-height: 100vh;
}

/* Dark Theme */
.vb-host-app.vb-theme-dark {
    color: #fff;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.vb-host-app * {
    box-sizing: border-box;
}

/* Screens */
.vb-screen {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

/* Center screens only in fullscreen mode */
.vb-host-app.vb-fullscreen .vb-screen {
    align-items: center;
}

/* Buttons */
.vb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.vb-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

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

.vb-btn-secondary {
    background: #4a4a6a;
    color: #fff;
}

.vb-btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.vb-btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: #fff;
}

.vb-btn-link {
    background: none;
    color: #667eea;
    padding: 8px;
}

.vb-btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(0,0,0,0.08);
    color: #333;
    border-radius: 50%;
}

.vb-btn-icon:hover {
    background: rgba(0,0,0,0.15);
}

.vb-host-app.vb-theme-dark .vb-btn-icon {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.vb-host-app.vb-theme-dark .vb-btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

.vb-btn-large {
    padding: 16px 32px;
    font-size: 20px;
}

/* Start Screen */
.vb-start-content {
    text-align: center;
    max-width: 600px;
    color: #333;
}

.vb-host-app.vb-theme-dark .vb-start-content {
    color: #fff;
}

.vb-game-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 8px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.vb-game-subtitle {
    font-size: 24px;
    opacity: 0.8;
    margin: 0 0 40px;
}

.vb-teams-config {
    background: rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.vb-host-app.vb-theme-dark .vb-teams-config {
    background: rgba(255,255,255,0.1);
}

.vb-teams-config h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.vb-teams-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vb-team-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.05);
    padding: 12px 16px;
    border-radius: 8px;
}

.vb-host-app.vb-theme-dark .vb-team-item {
    background: rgba(255,255,255,0.1);
}

.vb-team-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vb-team-name-input {
    flex: 1;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    color: #333;
    font-size: 16px;
}

.vb-host-app.vb-theme-dark .vb-team-name-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}

.vb-team-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.vb-start-actions {
    margin-top: 24px;
}

/* Game Screen */
.vb-game-screen {
    flex-direction: column;
    padding: 16px;
}

.vb-game-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    margin-bottom: 16px;
}

.vb-header-left {
    width: 100px;
}

.vb-header-right {
    width: 100px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.vb-turn-indicator {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    padding: 8px 20px;
    border-radius: 24px;
    background: rgba(0,0,0,0.08);
}

.vb-host-app.vb-theme-dark .vb-turn-indicator {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* Game Board */
.vb-game-board-wrapper {
    width: 100%;
    max-width: 1200px;
    overflow-x: auto;
    margin: 0 auto;
}

.vb-game-board {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
    table-layout: fixed;
}

.vb-game-board th,
.vb-game-board td {
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.vb-game-board th {
    padding: 16px 8px;
    font-size: 18px;
    font-weight: 700;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    border-radius: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Dark theme - same white color */
.vb-host-app.vb-theme-dark .vb-game-board th {
    color: #fff !important;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.vb-board-cell {
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.vb-host-app.vb-theme-dark .vb-board-cell {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.vb-board-cell:hover:not(.vb-cell-played) {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.vb-board-cell.vb-cell-played {
    background: #94a3b8;
    cursor: default;
    opacity: 0.5;
}

.vb-host-app.vb-theme-dark .vb-board-cell.vb-cell-played {
    background: #2a2a4a;
}

.vb-board-cell.vb-cell-va-banque:not(.vb-cell-played) {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
}

.vb-cell-value-display {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.vb-cell-played .vb-cell-value-display {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Scoreboard */
.vb-scoreboard {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin: 24px 0;
    padding: 16px;
}

.vb-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0,0,0,0.08);
    border-radius: 12px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.vb-host-app.vb-theme-dark .vb-score-item {
    background: rgba(255,255,255,0.1);
}

.vb-score-item.vb-active-turn {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.vb-score-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.vb-score-name {
    font-size: 14px;
    color: rgba(0,0,0,0.7);
    margin-bottom: 4px;
}

.vb-host-app.vb-theme-dark .vb-score-name {
    color: rgba(255,255,255,0.8);
}

.vb-score-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}

.vb-host-app.vb-theme-dark .vb-score-value {
    color: #fff;
}

.vb-game-footer {
    margin-top: 16px;
}

/* Modals */
.vb-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vb-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
}

.vb-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    color: #fff;
}

.vb-host-app:not(.vb-theme-dark) .vb-modal-content {
    background: linear-gradient(135deg, #f8fbff 0%, #e8eefc 100%);
    box-shadow: 0 20px 60px rgba(15,23,42,0.22);
    color: #172033;
}

/* Cell Modal */
.vb-cell-modal-content {
    width: 700px;
    padding: 32px;
}

.vb-cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.vb-host-app:not(.vb-theme-dark) .vb-cell-header {
    border-bottom-color: rgba(15,23,42,0.12);
}

.vb-cell-category {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.vb-cell-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.vb-cell-team {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.vb-cell-body {
    min-height: 150px;
    margin-bottom: 24px;
}

.vb-cell-prompt {
    font-size: 28px;
    line-height: 1.4;
    text-align: center;
    padding: 24px 0;
}

.vb-cell-solution-wrapper {
    text-align: center;
    margin-top: 24px;
}

.vb-cell-solution {
    font-size: 22px;
    color: #38ef7d;
    padding: 16px;
    background: rgba(56, 239, 125, 0.1);
    border-radius: 8px;
    margin-top: 12px;
}

.vb-host-app:not(.vb-theme-dark) .vb-cell-solution {
    color: #166534;
}

.vb-cell-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.vb-cell-actions .vb-btn {
    flex: 1;
    max-width: 200px;
}

/* Wager Modal */
.vb-wager-modal-content {
    width: 400px;
    padding: 32px;
    text-align: center;
}

.vb-wager-header h2 {
    font-size: 32px;
    margin: 0 0 16px;
    animation: pulse 1s infinite;
}

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

.vb-wager-body {
    margin-bottom: 24px;
}

.vb-wager-input {
    width: 100%;
    padding: 16px;
    font-size: 32px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    margin: 16px 0;
}

.vb-host-app:not(.vb-theme-dark) .vb-wager-input {
    background: rgba(255,255,255,0.95);
    border-color: rgba(100,116,139,0.45);
    color: #172033;
}

.vb-wager-input:focus {
    outline: none;
    border-color: #667eea;
}

.vb-wager-limits {
    font-size: 14px;
    opacity: 0.7;
}

/* Final Modal */
.vb-final-modal-content {
    width: 800px;
    max-width: 95vw;
    padding: 32px;
}

.vb-host-app:not(.vb-theme-dark) .vb-final-modal-content {
    background: linear-gradient(135deg, #f8fbff 0%, #e8eefc 100%);
    color: #172033;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.vb-host-app.vb-theme-dark .vb-final-modal-content {
    background: linear-gradient(135deg, #1a1f3f 0%, #202b55 100%);
}

.vb-final-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.vb-host-app:not(.vb-theme-dark) .vb-final-header {
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.14) 0%, rgba(118, 75, 162, 0.18) 100%);
    border-color: rgba(103, 126, 234, 0.18);
}

.vb-final-header h2 {
    font-size: 34px;
    margin: 0 0 10px;
    color: #f8fafc !important;
    letter-spacing: 0.08em;
    text-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
}

.vb-host-app:not(.vb-theme-dark) .vb-final-header h2 {
    color: #18233a !important;
    text-shadow: none;
}

.vb-final-category {
    font-size: 18px;
    font-weight: 700;
    opacity: 0.92;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: inherit;
}

.vb-final-wagers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.vb-final-wager-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.vb-host-app:not(.vb-theme-dark) .vb-final-wager-item,
.vb-host-app:not(.vb-theme-dark) .vb-final-score-item {
    background: rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.vb-final-wager-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.vb-final-wager-name {
    flex: 1;
    font-weight: 600;
}

.vb-final-wager-points {
    opacity: 0.7;
}

.vb-final-wager-input {
    width: 100px;
    padding: 8px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
}

.vb-host-app:not(.vb-theme-dark) .vb-final-wager-input {
    background: rgba(255,255,255,0.9);
    border-color: rgba(100, 116, 139, 0.45);
    color: #172033;
}

.vb-final-wager-confirm {
    padding: 8px 16px;
}

.vb-final-wager-confirmed {
    color: #38ef7d;
}

.vb-final-question {
    text-align: center;
    padding: 32px 0;
}

.vb-final-prompt {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 24px;
    color: inherit;
}

.vb-final-solution {
    font-size: 22px;
    color: #166534;
    padding: 16px;
    background: rgba(56, 239, 125, 0.1);
    border-radius: 8px;
}

.vb-host-app.vb-theme-dark .vb-final-solution {
    color: #86efac;
}

.vb-final-scoring {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.vb-final-score-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.vb-final-score-btns {
    display: flex;
    gap: 8px;
}

.vb-final-score-btns .vb-btn {
    padding: 8px 16px;
    font-size: 14px;
}

.vb-final-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

/* End Screen */
.vb-end-content {
    text-align: center;
    max-width: 600px;
    color: #fff;
}

.vb-host-app:not(.vb-theme-dark) .vb-end-content {
    color: #1e293b;
}

.vb-end-title {
    font-size: 48px;
    margin: 0 0 32px;
}

.vb-final-results {
    margin-bottom: 32px;
}

.vb-result-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.vb-result-winner {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    transform: scale(1.1);
    color: #fff;
}

.vb-result-loser {
    transform: none;
}

.vb-host-app:not(.vb-theme-dark) .vb-result-loser {
    background: rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.vb-host-app.vb-theme-dark .vb-result-loser {
    background: rgba(255,255,255,0.12);
}

.vb-result-rank {
    font-size: 24px;
    font-weight: 700;
    width: 40px;
}

.vb-result-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.vb-result-name {
    flex: 1;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
}

.vb-result-score {
    font-size: 24px;
    font-weight: 700;
}

.vb-end-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Access Denied / Error */
.vb-access-denied,
.vb-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.vb-access-denied a,
.vb-error a {
    color: #667eea;
}

/* Fullscreen */
.vb-host-app.vb-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .vb-game-title {
        font-size: 32px;
    }
    
    .vb-game-board th {
        font-size: 12px;
        padding: 10px 4px;
    }
    
    .vb-board-cell {
        height: 60px;
    }
    
    .vb-cell-value-display {
        font-size: 20px;
    }
    
    .vb-scoreboard {
        gap: 12px;
    }
    
    .vb-score-item {
        padding: 12px 16px;
        min-width: 80px;
    }
    
    .vb-score-value {
        font-size: 24px;
    }
    
    .vb-cell-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .vb-cell-prompt {
        font-size: 22px;
    }
    
    .vb-cell-actions {
        flex-direction: column;
    }
    
    .vb-cell-actions .vb-btn {
        max-width: none;
    }
}

/* Keyboard shortcut hints */
.vb-btn[title]:after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.vb-btn[title]:hover:after {
    opacity: 0.7;
}
