:root {
    --bg-color: #1a1a1a;
    --table-felt: #35654d;
    --table-border: #1e3a2e;
    --accent-color: #4caf50;
    --danger-color: #e53935;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --card-bg: #f0f0f0;
    --btn-primary: #2196f3;
    --btn-primary-hover: #1976d2;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 480px;
    height: 100%;
    position: relative;
    background: #121212;
    display: flex;
    flex-direction: column;
}

/* Telas */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.screen.active {
    display: flex;
    opacity: 1;
    z-index: 2;
}

/* Tela Inicial */
#start-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #000;
    background-image: url('bg.jpg');
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
}

.info-card ul {
    list-style: none;
    margin-top: 10px;
}

.info-card li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.legal {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 25%;
}

/* Botões */
button {
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s, box-shadow 0.1s;
    width: 100%;
}

#btn-start {
    background-image: url('bg-button.jpg');
    background-size: cover;
    background-position: center;
    border: none;
    border-top: 1px solid #FFD700;
    /* Thin light yellow border on top */
    color: #1a1a1a;
    /* Dark text */
    font-weight: 900;
    font-size: 1.3rem;
    /* Slightly decreased font size */
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;

    /* 3D Effect Initial State */
    box-shadow:
        0 6px 0 #5c450d,
        /* Darker gold shadow for depth */
        0 12px 10px rgba(0, 0, 0, 0.3);
    /* Drop shadow */

    /* Sunken Text Effect */
    text-shadow:
        0px 1px 0px rgba(255, 255, 255, 0.4),
        /* Highlight bottom */
        0px -1px 0px rgba(0, 0, 0, 0.2);
    /* Shadow top */

    transform: translateY(0);
}

#btn-start:active {
    transform: translateY(6px);
    /* Move down by shadow size */
    box-shadow:
        0 0 0 #5c450d,
        /* Shadow disappears */
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Inner shadow for pressed look */
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--btn-primary);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    margin-top: 10px;
}

.btn-coach-link {
    background-color: #673ab7;
    /* Roxo PokerCoach */
    color: white;
    margin-top: 10px;
}

/* Tela de Jogo */
#game-screen {
    padding-bottom: 50px;
    /* Reduced space at the bottom */
}

.game-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
}

.stats-box {
    display: flex;
    flex-direction: column;
}

.stats-box .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stats-box .value {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

/* MESA DE POKER */
.table-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 10px 0;
}

.poker-table {
    width: 75%;
    height: 85%;
    background-color: var(--table-border);
    border-radius: 150px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 8px solid #2c2c2c;
}

.table-felt {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background-color: var(--table-felt);
    border-radius: 140px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.table-logo {
    color: rgba(0, 0, 0, 0.2);
    font-weight: 900;
    text-align: center;
    font-size: 1.4rem;
    pointer-events: none;
    margin-bottom: 20px;
    line-height: 1.1;
}

.community-area {
    text-align: center;
    z-index: 10;
}

.pot-info {
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #ffd700;
    margin-bottom: 8px;
    display: inline-block;
}

.scenario-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 180px;
    margin: 0 auto;
    line-height: 1.2;
}

/* ASSENTOS */
.seat {
    position: absolute;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 
   POSIÇÕES SIMÉTRICAS (Relógio)
*/

/* 1 = Hero (6h) */
.seat[data-pos="0"] {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    z-index: 20;
}

/* 2 = SB (8h - Bottom Left) */
.seat[data-pos="1"] {
    bottom: 15%;
    left: 0;
    transform: translate(-50%, 0);
}

/* 3 = BB (9h - Middle Left) */
.seat[data-pos="2"] {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
}

/* 4 = UTG (10h - Top Left) */
.seat[data-pos="3"] {
    top: 15%;
    left: 0;
    transform: translate(-50%, 0);
}

/* 5 = UTG+1 (12h - Top Center) */
.seat[data-pos="4"] {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 6 = MP (2h - Top Right) */
.seat[data-pos="5"] {
    top: 15%;
    right: 0;
    transform: translate(50%, 0);
}

/* 7 = CO (3h - Middle Right) */
.seat[data-pos="6"] {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
}

/* 8 = BTN (4h - Bottom Right) */
.seat[data-pos="7"] {
    bottom: 15%;
    right: 0;
    transform: translate(50%, 0);
}

.player-avatar {
    width: 44px;
    height: 44px;
    background: #444;
    border-radius: 50%;
    border: 2px solid #666;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: bold;
    position: relative;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.seat.active .player-avatar {
    background: #222;
    border-color: #ffd700;
}

.seat.hero .player-avatar {
    width: 50px;
    height: 50px;
    border-color: var(--btn-primary);
    background: #0d47a1;
}

.seat.folded {
    opacity: 0.5;
}

.player-info {
    position: absolute;
    bottom: -10px;
    /* Ajustado para ficar mais colado */
    background: rgba(0, 0, 0, 0.85);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    white-space: nowrap;
    display: flex;
    gap: 4px;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-pos {
    font-weight: bold;
    color: #ddd;
}

.dealer-btn {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    color: black;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    top: -5px;
    right: -5px;
    z-index: 4;
    border: 1px solid #ccc;
}

.action-bubble {
    position: absolute;
    top: -25px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* CARTAS */
.cards-container {
    display: flex;
    gap: 2px;
    position: absolute;
    z-index: 1;
}

/* Cartas do Hero */
.seat.hero .cards-container {
    top: -40px;
    gap: 4px;
}

/* Cartas dos vilões */
.seat:not(.hero) .cards-container {
    top: -10px;
    z-index: 1;
}

.card {
    width: 28px;
    height: 40px;
    background: white;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
}

.seat.hero .card {
    width: 42px;
    height: 58px;
    border-radius: 4px;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2px 4px;
    line-height: 1;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
}

.card-content .suit {
    font-size: 1.2rem;
    margin-top: -2px;
}

.card.red {
    color: #d32f2f;
}

.card.black {
    color: #212121;
}

.card-back {
    background: repeating-linear-gradient(45deg,
            #b71c1c,
            #b71c1c 5px,
            #c62828 5px,
            #c62828 10px);
    border: 1px solid #fff;
}

/* CONTROLES */
.controls-area {
    padding: 10px 0;
    background: #121212;
}

.buttons-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.game-btn {
    flex: 1;
    padding: 16px 8px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: background 0.2s;
}

.game-btn:hover {
    background: #3a3a3a;
}

.game-btn.fold {
    border-bottom: 3px solid #e53935;
}

.game-btn.call {
    border-bottom: 3px solid #4caf50;
}

.game-btn.raise {
    border-bottom: 3px solid #ff9800;
}

.game-btn.allin {
    border-bottom: 3px solid #9c27b0;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e1e1e;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    border-radius: 16px;
    text-align: left;
    border: 1px solid #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.coach-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--btn-primary);
}

.coach-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
    font-weight: bold;
}

.coach-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #eee;
}

.user-choice-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: right;
}

.correct-text {
    color: var(--accent-color);
}

.incorrect-text {
    color: var(--danger-color);
}

/* Result Screen */
#result-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #121212;
}

.final-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}