:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --accent-color: #38bdf8;
    --text-color: #f8fafc;
    --glass-border: rgba(255, 255, 255, 0.1);
    --gold: #fbbf24;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
}

#app {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    opacity: 0.7;
    margin-bottom: 2rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.info-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.chip-counter.cpu {
    border-color: #94a3b8;
    color: #f8fafc;
}

.message-area {
    font-size: 0.9rem;
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.05);
    padding: 0.4rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    min-width: 250px;
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.step-counter {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-color);
}

.stats-counter {
    display: flex;
    gap: 1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stat-win {
    color: var(--accent-color);
}

.stat-lose {
    color: #ef4444;
}

.stat-draw {
    color: #94a3b8;
}

.choices-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.card {
    width: 120px;
    height: 180px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
    position: relative;
    user-select: none;
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.3);
}

.card.red {
    color: #ef4444;
}

.card.black {
    color: #f8fafc;
}

.card .rank {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.25rem;
    font-weight: 700;
}

.card .suit-bottom {
    position: absolute;
    bottom: 10px;
    right: 10px;
    transform: rotate(180deg);
    font-size: 1.25rem;
}

.hands-layout {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.hand-wrapper {
    flex: 1;
}

.hand-wrapper h3 {
    font-size: 1rem;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.hand-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.hand-container .card {
    width: 70px;
    height: 105px;
    font-size: 1.25rem;
    cursor: default;
}

.hand-container .card .rank,
.hand-container .card .suit-bottom {
    font-size: 0.9rem;
}

.hand-container .card:hover {
    transform: none;
    box-shadow: none;
}

#result-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.result-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

#win-loss-text {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.result-hands {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.res-hand p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.res-hand .hand-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-hands span {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.25rem;
}

.chip-counter {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pot-display {
    background: rgba(251, 191, 36, 0.1);
    border: 1px dashed var(--gold);
    color: var(--gold);
    padding: 0.25rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pot-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chip-diff {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chip-diff.plus {
    color: var(--gold);
}

.chip-diff.minus {
    color: #ef4444;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#betting-area {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin: 2rem 0;
    padding: 2rem;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bet-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.bet-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

input[type="range"] {
    accent-color: var(--accent-color);
    cursor: pointer;
}

button.secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #94a3b8;
}

button.secondary:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

#game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

button#reset-full-btn {
    background: #ef4444;
}

button {
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

#instruction {
    font-size: 1.1rem;
    opacity: 0.8;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animate {
    animation: fadeInCard 0.5s ease-out forwards;
}

/* Winner Highlight Style */
.res-hand .hand-container.winner {
    border: 2px solid #fbbf24 !important;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.4) !important;
    background: rgba(251, 191, 36, 0.08) !important;
    transform: scale(1.02);
    position: relative;
    transition: all 0.5s ease;
}

.res-hand .hand-container.winner::after {
    content: "WINNER";
    position: absolute;
    top: -12px;
    right: 15px;
    background: #fbbf24;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}