:root {
    --bg-0: #05050b;
    --bg-1: #0c0c1a;
    --panel: rgba(20, 12, 40, 0.55);
    --pink: #ff2d7d;
    --pink-2: #ff6ac2;
    --pink-soft: #ff8fc7;
    --cyan: #18f0ff;
    --cyan-2: #22b7ff;
    --purple: #b061ff;
    --purple-2: #7a2bff;
    --yellow: #f2e8ff;
    --white: #e9e4ff;
    --text: #c9c0e8;
    --text-dim: #8a7fa0;
    --danger: #ff385f;
    --ok: #18f0ff;
    --warn: #ffcf3d;
    --font-display: 'Orbitron', 'Inter', sans-serif;
    --font-body: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background:
        linear-gradient(180deg, #05050b 0%, #0b0917 50%, #140a23 100%);
    background-attachment: fixed;
    font-family: var(--font-body);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ---- HUD grid overlay ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 45, 125, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 240, 255, 0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    pointer-events: none;
    z-index: 0;
}

/* ---- neon glows ---- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(255, 45, 125, 0.22) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 85%, rgba(24, 240, 255, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(122, 43, 255, 0.10) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: cyberPulse 8s ease-in-out infinite;
}

@keyframes cyberPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.game-container {
    width: 95%;
    max-width: 900px;
    background:
        linear-gradient(160deg, rgba(24, 16, 40, 0.85) 0%, rgba(12, 8, 24, 0.9) 100%);
    padding: 34px 30px 28px;
    border-radius: 18px;
    border: 1px solid rgba(255, 45, 125, 0.35);
    box-shadow:
        0 0 0 1px rgba(255, 45, 125, 0.25),
        0 0 30px rgba(255, 45, 125, 0.15),
        0 0 60px rgba(24, 240, 255, 0.12),
        inset 0 0 60px rgba(122, 43, 255, 0.10);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0%, transparent 70%, rgba(24, 240, 255, 0.3) 100%);
    clip-path: polygon(0 0, 18% 0, 14% 100%, 0 100%);
    opacity: 0.35;
}

.game-container::after {
    content: '';
    position: absolute;
    width: 38px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #18f0ff, transparent);
    top: 12px;
    left: 24px;
    right: auto;
    filter: drop-shadow(0 0 6px #18f0ff);
    animation: scanline 4s ease-in-out infinite;
}

@keyframes scanline {
    0%, 100% { left: 24px; width: 38px; opacity: 0.6; }
    50% { left: calc(100% - 62px); width: 38px; opacity: 1; }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.pulse-text {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.06); filter: brightness(1.4); }
}

#game-status {
    margin-top: 26px;
    font-size: 1.1em;
    color: var(--white);
    transition: all 0.5s ease;
    min-height: 3em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.45;
    text-align: center;
    text-shadow: 0 0 12px rgba(24, 240, 255, 0.4);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.confetti {
    position: absolute;
    width: 10px; height: 10px;
    background: var(--cyan);
    z-index: 2000;
    pointer-events: none;
}

.info-panel {
    text-align: center;
    margin-bottom: 0px;
}

.info-panel h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 2.2em;
    background: linear-gradient(180deg, #ffffff 0%, #ff2d7d 55%, #ff6ac2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(255, 45, 125, 0.6));
    animation: holoGlow 3s ease-in-out infinite;
}

@keyframes holoGlow {
    0%, 100% { filter: drop-shadow(0 0 14px rgba(255, 45, 125, 0.55)); }
    50% { filter: drop-shadow(0 0 26px rgba(24, 240, 255, 0.6)); }
}

.tagline {
    font-size: 0.62em;
    text-transform: uppercase;
    letter-spacing: 0.42em;
    color: var(--text-dim);
    margin-bottom: 20px;
    text-shadow: 0 0 8px rgba(255, 45, 125, 0.4);
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    font-size: 1.15em;
    font-weight: 600;
    flex-wrap: wrap;
}

.stat-item {
    padding: 10px 18px;
    background: rgba(15, 9, 30, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 45, 125, 0.45);
    box-shadow: inset 0 0 14px rgba(255, 45, 125, 0.12), 0 0 0 1px rgba(255, 45, 125, 0.1);
    transition: var(--transition);
    text-shadow: 0 0 6px rgba(232, 228, 255, 0.4);
}

.stat-round {
    border-color: rgba(24, 240, 255, 0.5);
    background: rgba(8, 25, 40, 0.55);
    box-shadow: inset 0 0 14px rgba(24, 240, 255, 0.14);
}

.stat-player {
    border-color: rgba(255, 45, 125, 0.55);
    background: rgba(40, 8, 22, 0.55);
    box-shadow: inset 0 0 14px rgba(255, 45, 125, 0.18);
}

.cpu-avatar-wrapper {
    background: rgba(122, 43, 255, 0.14);
    border-color: rgba(176, 97, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 15px;
}

#cpu-avatar {
    font-size: 1.8em;
    width: 46px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 35% 30%, rgba(24, 240, 255, 0.15), rgba(0, 0, 0, 0.6));
    border-radius: 50%;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--cyan);
    box-shadow: 0 0 12px rgba(24, 240, 255, 0.55);
    filter: drop-shadow(0 0 6px rgba(24, 240, 255, 0.6));
}

.cpu-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cpu-info .label {
    font-size: 0.7em;
    opacity: 0.8;
    text-shadow: 0 0 6px rgba(24, 240, 255, 0.4);
}

.emotion-normal { }

.emotion-confident {
    transform: scale(1.2);
    border-color: #18f0ff !important;
    box-shadow: 0 0 15px #18f0ff;
    background: rgba(24, 240, 255, 0.2) !important;
}

.emotion-bluffing {
    animation: sweat 1s infinite alternate;
    border-color: #ffcf3d !important;
    background: rgba(255, 207, 61, 0.2) !important;
}

@keyframes sweat {
    from { box-shadow: 0 0 5px #ffcf3d; }
    to { box-shadow: 0 5px 15px #ffcf3d; }
}

.emotion-tense {
    animation: tremble 0.1s infinite;
    border-color: #ff385f !important;
    background: rgba(255, 56, 95, 0.3) !important;
}

.emotion-nervous {
    opacity: 0.7;
    filter: saturate(0.5) brightness(0.8);
    transform: translateY(5px);
}

.emotion-smug {
    transform: rotate(15deg) scale(1.1);
    border-color: #ff2d7d !important;
    box-shadow: 0 0 20px #ff2d7d;
}

.emotion-cautious {
    border-color: #22b7ff !important;
    background: rgba(34, 183, 255, 0.2) !important;
}

.emotion-skeptical {
    border-color: #b061ff !important;
    background: rgba(176, 97, 255, 0.2) !important;
}

.emotion-chill {
    border-color: #18f0ff !important;
    background: rgba(24, 240, 255, 0.1) !important;
    filter: drop-shadow(0 0 5px #18f0ff);
}

.emotion-zen {
    box-shadow: 0 0 25px #fff, 0 0 40px #ff2d7d !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1);
}

@keyframes pulse-purple {
    0% { box-shadow: 0 0 5px #b061ff; }
    50% { box-shadow: 0 0 25px #b061ff; }
    100% { box-shadow: 0 0 5px #b061ff; }
}

@keyframes shake-fast {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
}

.emotion-desperate {
    animation: shake-fast 0.4s infinite;
    border-color: #ff385f !important;
    background: rgba(255, 56, 95, 0.28) !important;
    box-shadow: 0 0 18px rgba(255, 56, 95, 0.7);
}

.stat-pot {
    background: linear-gradient(180deg, rgba(255, 45, 125, 0.2) 0%, rgba(255, 45, 125, 0.1) 100%);
    border: 1px solid #ff2d7d;
    color: var(--white);
    box-shadow: 0 0 14px rgba(255, 45, 125, 0.5), inset 0 0 14px rgba(255, 45, 125, 0.3);
    text-shadow: 0 0 8px rgba(255, 45, 125, 0.5);
}

.hand-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

.hand {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.card {
    width: 92px;
    height: 132px;
    background: linear-gradient(160deg, #1a1430 0%, #101024 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    color: var(--white);
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 0 1px rgba(24, 240, 255, 0.35), 0 0 14px rgba(24, 240, 255, 0.25);
    position: relative;
    user-select: none;
    border: 1px solid rgba(24, 240, 255, 0.45);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 0 1px rgba(255, 45, 125, 0.7), 0 0 22px rgba(255, 45, 125, 0.55);
    border-color: rgba(255, 45, 125, 0.8);
}

.card .top-left, .card .bottom-right {
    font-size: 1.2em;
    line-height: 1;
    z-index: 1;
    text-shadow: 0 0 8px currentColor;
}

.card .bottom-right {
    transform: rotate(180deg);
}

.card .center-symbol {
    font-size: 2.5em;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-shadow: 0 0 10px currentColor;
}

.card.red { color: #ff385f; }
.card.black { color: #18f0ff; }

.card.hidden {
    background:
        repeating-linear-gradient(45deg, rgba(24, 240, 255, 0.08) 0 8px, transparent 8px 16px),
        linear-gradient(160deg, #150d2c 0%, #0c0820 100%);
    border: 1px solid rgba(255, 45, 125, 0.6);
    box-shadow: 0 0 14px rgba(255, 45, 125, 0.45);
}

.card.hidden::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(24, 240, 255, 0.35);
    border-radius: 6px;
    box-shadow: inset 0 0 12px rgba(24, 240, 255, 0.25);
}

.card.hidden .top-left,
.card.hidden .center-symbol,
.card.hidden .bottom-right {
    display: none;
}

.card.selected-discard {
    transform: translateY(-18px);
    border: 2px solid #ff2d7d;
    box-shadow: 0 0 24px rgba(255, 45, 125, 0.8), 0 0 40px rgba(255, 45, 125, 0.4);
    filter: brightness(1.05);
}

.card.dealing {
    animation: dealIn 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.18) backwards;
}

@keyframes dealIn {
    from {
        opacity: 0;
        transform: translateY(-46px) rotate(-8deg) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

.card.discarding {
    animation: discardFly 0.5s ease-in;
}

@keyframes discardFly {
    to {
        transform: translateY(46px) rotate(14deg) scale(0.85);
        opacity: 0.15;
    }
}

.discarding-cpu {
    animation: discardCPU 0.6s ease-in forwards;
}

@keyframes discardCPU {
    to { transform: translateY(-50px) rotate(10deg); opacity: 0; }
}

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

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

button {
    background: linear-gradient(180deg, rgba(20, 12, 40, 0.7) 0%, rgba(12, 8, 24, 0.85) 100%);
    color: var(--white);
    border: 1px solid rgba(24, 240, 255, 0.5);
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 14px rgba(24, 240, 255, 0.25), inset 0 0 14px rgba(24, 240, 255, 0.12);
    letter-spacing: 0.06em;
    font-family: var(--font-body);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(24, 240, 255, 0.5);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    background-clip: padding-box;
}

button:hover {
    background: linear-gradient(180deg, rgba(30, 16, 52, 0.9) 0%, rgba(18, 10, 32, 0.9) 100%);
    box-shadow: 0 0 22px rgba(255, 45, 125, 0.5), inset 0 0 20px rgba(255, 45, 125, 0.2);
    border-color: rgba(255, 45, 125, 0.8);
    color: #fff;
}

button:disabled {
    background: rgba(12, 12, 20, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    opacity: 0.5;
    box-shadow: none;
    color: #6b6484;
    text-shadow: none;
    cursor: not-allowed;
}

.bet-input-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

#bet-input {
    width: 60px;
    padding: 10px;
    margin: 0 8px;
    border-radius: 4px;
    border: 1px solid rgba(24, 240, 255, 0.5);
    background: rgba(0, 0, 0, 0.55);
    color: #18f0ff;
    text-align: center;
    font-weight: bold;
    transition: var(--transition);
    font-family: var(--font-body);
}

#btn-bet-all {
    background: linear-gradient(180deg, rgba(255, 56, 95, 0.95) 0%, rgba(180, 20, 50, 0.95) 100%);
    border-color: #ff2d7d;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 56, 95, 0.6);
    white-space: nowrap;
    margin-left: 6px;
}

#btn-bet-all:hover {
    background: linear-gradient(180deg, rgba(255, 100, 130, 0.95) 0%, rgba(220, 30, 60, 0.95) 100%);
    box-shadow: 0 0 24px rgba(255, 56, 95, 0.7);
}

#btn-reset {
    background: linear-gradient(180deg, rgba(176, 97, 255, 0.9) 0%, rgba(100, 30, 180, 0.9) 100%);
    border-color: #b061ff;
    color: #fff;
    text-shadow: 0 0 8px rgba(176, 97, 255, 0.6);
}

#btn-reset:hover {
    background: linear-gradient(180deg, rgba(190, 120, 255, 0.95) 0%, rgba(140, 40, 200, 0.95) 100%);
    box-shadow: 0 0 24px rgba(176, 97, 255, 0.7);
}

#bet-input:focus {
    outline: none;
    border-color: #18f0ff;
    box-shadow: 0 0 14px rgba(24, 240, 255, 0.6);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(20, 8, 40, 0.6) 0%, rgba(4, 2, 10, 0.9) 100%);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background:
        linear-gradient(160deg, rgba(24, 12, 40, 0.95) 0%, rgba(10, 8, 22, 0.95) 100%);
    padding: 30px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(255, 45, 125, 0.5);
    box-shadow:
        0 0 0 1px rgba(255, 45, 125, 0.25),
        0 0 40px rgba(255, 45, 125, 0.35),
        inset 0 0 40px rgba(122, 43, 255, 0.15);
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 400px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.bankrupt-mode {
    background: linear-gradient(160deg, rgba(40, 5, 15, 0.95) 0%, rgba(15, 4, 10, 0.95) 100%) !important;
    border: 2px solid #ff385f !important;
    box-shadow: 0 0 60px rgba(255, 56, 95, 0.7) !important;
    animation: bankruptPulse 1.5s infinite !important;
}

@keyframes bankruptPulse {
    0% { box-shadow: 0 0 20px rgba(255, 56, 95, 0.4); border-color: #ff385f; }
    50% { box-shadow: 0 0 60px rgba(255, 56, 95, 0.9); border-color: #ff2d7d; }
    100% { box-shadow: 0 0 20px rgba(255, 56, 95, 0.4); border-color: #ff385f; }
}

.fail-mode {
    border: 2px solid #ffcf3d !important;
    box-shadow: 0 0 40px rgba(255, 207, 61, 0.4) !important;
    background: linear-gradient(160deg, rgba(40, 30, 10, 0.95) 0%, rgba(18, 14, 8, 0.95) 100%) !important;
}

.fail-mode #ranking-title {
    color: #ffcf3d !important;
    animation: glitch 1.5s infinite linear;
    text-shadow: 0 0 12px rgba(255, 207, 61, 0.6);
}

@keyframes glitch {
    0% { transform: skew(0deg); }
    20% { transform: skew(2deg) translateX(-2px); }
    40% { transform: skew(-2deg) translateX(2px); }
    60% { transform: skew(1deg); }
    100% { transform: skew(0deg); }
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 25px;
    background: linear-gradient(180deg, transparent 0%, #18f0ff 100%);
    pointer-events: none;
    z-index: 2000;
    animation: fall 1s linear infinite;
    filter: drop-shadow(0 0 6px #18f0ff);
}

@keyframes fall {
    from { transform: translateY(-100px); }
    to { transform: translateY(500px); opacity: 0; }
}

.bankrupt-mode #ranking-title {
    color: #ff385f !important;
    text-shadow: 0 0 12px rgba(255, 56, 95, 0.8);
}

.chip-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    position: relative;
    height: 100px;
}

.chip-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.chip-side i { font-size: 2em; margin-bottom: 5px; }
.chip-side .label { font-weight: bold; font-size: 0.9em; color: var(--white); text-shadow: 0 0 6px rgba(24, 240, 255, 0.5); }

.pot-area {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 35% 30%, #ff2d7d 0%, #b0225c 55%, #5a0d36 100%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 0 24px rgba(255, 45, 125, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.35);
    z-index: 5;
}

.visual-chip {
    position: absolute;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #18f0ff, #ff2d7d);
    border-radius: 50%;
    border: 1px solid #000;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 0 6px #18f0ff);
}

#modal-title {
    font-family: var(--font-display);
    font-size: 2.1em;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-shadow: 0 0 12px rgba(255, 45, 125, 0.55);
    margin: 0 0 15px 0;
}

#modal-message {
    font-size: 1.1em;
    color: var(--text);
    line-height: 1.5;
    text-shadow: 0 0 6px rgba(232, 228, 255, 0.3);
}

.main-buttons {
    display: flex;
    gap: 15px;
}


.btn-bet-1 {
    background: linear-gradient(180deg, rgba(24, 240, 255, 0.95) 0%, rgba(20, 90, 130, 0.95) 100%) !important;
    border-color: #18f0ff !important;
    color: #051015 !important;
    text-shadow: 0 0 8px rgba(5, 16, 21, 0.6) !important;
}
.btn-bet-1:hover {
    background: linear-gradient(180deg, rgba(160, 240, 255, 0.95) 0%, rgba(24, 240, 255, 0.95) 100%) !important;
}

.btn-bet-2 {
    background: linear-gradient(180deg, rgba(255, 45, 125, 0.95) 0%, rgba(120, 10, 60, 0.95) 100%) !important;
    box-shadow: 0 0 26px rgba(255, 45, 125, 0.6) !important;
    border: 1px solid #ff2d7d !important;
    transform: scale(1.02);
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 45, 125, 0.6);
}
.btn-bet-2:hover {
    background: linear-gradient(180deg, rgba(255, 120, 180, 0.95) 0%, rgba(255, 45, 125, 0.95) 100%) !important;
    box-shadow: 0 0 40px rgba(255, 45, 125, 0.8) !important;
}

.secondary-btn {
    background: linear-gradient(180deg, rgba(24, 12, 40, 0.7) 0%, rgba(12, 8, 24, 0.9) 100%);
    border-color: rgba(24, 240, 255, 0.35);
    color: var(--text);
}

.secondary-btn:hover {
    background: linear-gradient(180deg, rgba(34, 20, 54, 0.9) 0%, rgba(20, 12, 34, 0.9) 100%);
    color: #fff;
}

#ranking-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

#ranking-table th, #ranking-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 45, 125, 0.25);
    text-align: center;
}

#ranking-table th {
    color: #18f0ff;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 8px rgba(24, 240, 255, 0.5);
    font-family: var(--font-display);
}

.highlight-row {
    background: rgba(255, 45, 125, 0.18) !important;
    animation: highlight-pulse 1.5s infinite alternate;
    position: relative;
    z-index: 1;
}

@keyframes highlight-pulse {
    from { box-shadow: inset 0 0 5px rgba(255, 45, 125, 0.3); background: rgba(255, 45, 125, 0.1); }
    to { box-shadow: inset 0 0 15px rgba(255, 45, 125, 0.5); background: rgba(255, 45, 125, 0.25); }
}

.highlight-row td {
    color: #fff !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 45, 125, 0.7);
}

#ranking-input-section {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 45, 125, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.rank-status-msg {
    font-size: 1.5em;
    font-weight: bold;
    color: #18f0ff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(24, 240, 255, 0.6);
    font-family: var(--font-display);
}

.final-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    font-size: 2em;
    font-weight: bold;
}

.status-icon-large {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.chip-stack-anim {
    display: inline-block;
    animation: stackUp 0.5s ease-out forwards;
}

@keyframes stackUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.chip-icon {
    font-size: 1.5em;
    filter: drop-shadow(0 0 6px #18f0ff);
}

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

#ranking-list-section {
    margin-bottom: 25px;
}

#btn-close-ranking {
    margin-top: 10px;
    width: 100%;
}

#player-name-input {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(24, 240, 255, 0.5);
    background: rgba(0, 0, 0, 0.55);
    color: var(--white);
    width: 150px;
    transition: var(--transition);
    font-family: var(--font-body);
}

#player-name-input:focus {
    outline: none;
    border-color: #18f0ff;
    box-shadow: 0 0 14px rgba(24, 240, 255, 0.45);
}

.footer {
    margin-top: 30px;
    font-size: 0.85em;
    color: var(--text-dim);
    opacity: 0.75;
    text-align: center;
    width: 100%;
    z-index: 2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 6px rgba(255, 45, 125, 0.4);
}

.explosion-smoke {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 45, 125, 0.6) 0%, rgba(176, 97, 255, 0.25) 60%, rgba(0, 0, 0, 0) 100%);
    filter: blur(15px);
    pointer-events: none;
    z-index: 2005;
    transform: translate(-50%, -50%);
    animation: explode-smoke 1.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes explode-smoke {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    15% {
        opacity: 0.85;
    }
    100% {
        transform: translate(-50%, -50%) scale(var(--final-scale));
        opacity: 0;
        filter: blur(35px);
    }
}

.modal-content.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both !important;
}

@media (max-width: 600px) {
    body {
        overflow: auto;
        min-height: auto;
        padding: 10px 0;
    }
    .game-container {
        width: 96%;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 0 0 1px rgba(255, 45, 125, 0.25), 0 10px 25px rgba(0, 0, 0, 0.55);
    }
    .info-panel h1 {
        font-size: 1.4em;
        margin-bottom: 8px;
        letter-spacing: 0.25em;
    }
    .tagline {
        font-size: 0.5em;
        letter-spacing: 0.3em;
        margin-bottom: 14px;
    }
    .stats-row {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 1em;
    }
    .stat-item {
        padding: 6px 10px;
        font-size: 0.85em;
        border-radius: 4px;
        gap: 4px;
    }
    .cpu-avatar-wrapper {
        padding: 4px 10px;
        gap: 6px;
    }
    #cpu-avatar {
        font-size: 1.3em;
        width: 32px;
        height: 32px;
    }
    #game-status {
        margin-top: 15px;
        font-size: 0.95em;
        min-height: 2.5em;
    }
    .hand {
        gap: 5px;
        margin: 8px 0;
    }
    .card {
        width: 58px;
        height: 84px;
        padding: 4px;
        border-radius: 6px;
    }
    .card .top-left, .card .bottom-right {
        font-size: 0.85em;
    }
    .card .center-symbol {
        font-size: 1.5em;
    }
    .card.selected-discard {
        transform: translateY(-12px);
    }
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 10px;
    }
    .bet-input-wrapper {
        width: 100%;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    #bet-input {
        width: 50px;
        padding: 8px;
        font-size: 0.9em;
    }
    .main-buttons {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    button {
        padding: 10px 18px;
        font-size: 0.9em;
        border-radius: 4px;
    }
    .modal-content {
        min-width: 0;
        width: 90%;
        max-width: 360px;
        padding: 20px;
    }
    .chip-container {
        height: 70px;
        margin: 10px 0;
    }
    #modal-title {
        font-size: 1.8em;
    }
    #modal-message {
        font-size: 0.95em;
    }
    .footer {
        margin-top: 20px;
        font-size: 0.75em;
        padding: 0 10px;
    }
}

.card.combination-card-play {
    border: 2px solid #18f0ff;
    box-shadow: 0 0 14px rgba(24, 240, 255, 0.7);
}

.card.combination-card-showdown {
    transform: translateY(-25px);
    border: 2px solid #ff2d7d;
    box-shadow: 0 0 26px #ff2d7d, 0 0 40px rgba(24, 240, 255, 0.4);
    animation: combinationPulse 1.5s infinite alternate;
}

@keyframes combinationPulse {
    from { box-shadow: 0 0 15px #ff2d7d; }
    to { box-shadow: 0 0 30px #ff2d7d, 0 0 44px #18f0ff; }
}

.evaluation {
    font-size: 1.2em;
    font-weight: bold;
    margin: 5px 0 15px 0;
    text-align: center;
    min-height: 1.5em;
    transition: var(--transition);
    font-family: var(--font-display);
    letter-spacing: 0.05em;
}

.eval-winner {
    color: #18f0ff;
    text-shadow: 0 0 10px rgba(24, 240, 255, 0.7);
    transform: scale(1.1);
    animation: winnerTextPulse 1s infinite alternate;
}

.eval-loser {
    color: #ff385f;
    text-shadow: 0 0 5px rgba(255, 56, 95, 0.5);
    opacity: 0.6;
}

.eval-tie {
    color: #ffcf3d;
    text-shadow: 0 0 8px rgba(255, 207, 61, 0.6);
}

@keyframes winnerTextPulse {
    from {
        transform: scale(1.05);
        text-shadow: 0 0 10px rgba(24, 240, 255, 0.6);
    }
    to {
        transform: scale(1.15);
        text-shadow: 0 0 22px rgba(24, 240, 255, 0.95);
    }
}
