/* ==========================================
   POKER EV ANALYZER
   style.css
   1080p Tek Ekran Dashboard
========================================== */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    padding: 10px;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(
            circle at top,
            #176b3a 0%,
            #0a351e 48%,
            #04180e 100%
        );
}

/* ==========================================
   ANA KABUK
========================================== */

.app-shell {
    width: 100%;
    height: 100vh;
    padding: 6px;
    overflow: hidden;
}

.app-header {
    width: min(1500px, 98vw);
    height: 82px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border: 3px solid #d4af37;
    border-radius: 17px;
    background:
        linear-gradient(
            180deg,
            rgba(22, 101, 52, 0.98),
            rgba(8, 67, 36, 0.98)
        );
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.32),
        inset 0 0 35px rgba(255, 255, 255, 0.025);
}

.app-header h1 {
    margin: 0;
    color: #ffd700;
    font-size: clamp(22px, 2.6vw, 40px);
    line-height: 1;
    letter-spacing: 2px;
    text-align: left;
    text-shadow:
        0 3px 0 #7a5a00,
        0 0 20px rgba(255, 215, 0, 0.4);
}

.header-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.header-balance-label {
    font-size: 12px;
    color: #c8e6c9;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-balance-value {
    font-size: clamp(20px, 2.2vw, 28px);
    color: #ffd700;
    line-height: 1.1;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

/* Bahis bilgi çubuğu — otomatik ante */
.bet-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
    margin: 8px 0 4px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.bet-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.bet-info-item strong {
    font-size: 16px;
    color: #ffd700;
}

.bet-info-label {
    font-size: 11px;
    color: #a5d6a7;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.bet-info-hint {
    font-size: 10px;
    color: #81c784;
}

.bet-info-cost strong {
    color: #fff;
}


/* ==========================================
   İKİ SÜTUNLU DASHBOARD
========================================== */

.dashboard {
    width: min(1500px, 98vw);
    height: calc(100vh - 106px);
    margin: 0 auto;
    display: grid;
    grid-template-columns:
        minmax(680px, 2.15fr)
        minmax(350px, 0.95fr);
    gap: 12px;
    overflow: hidden;
}

.game-column,
.sidebar {
    min-width: 0;
    height: 100%;
}

/* ==========================================
   SOL OYUN ALANI
========================================== */

.game-column .table {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 16px 20px;
    overflow: hidden;
    border: 3px solid #d4af37;
    border-radius: 20px;
    background:
        linear-gradient(
            180deg,
            rgba(22, 101, 52, 0.98),
            rgba(8, 78, 42, 0.98)
        );
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.38),
        inset 0 0 40px rgba(255, 255, 255, 0.03);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h2 {
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 22px;
}

h3 {
    margin-bottom: 8px;
}

/* ==========================================
   KASA VE OYUNCU
========================================== */

.dealer,
.player {
    margin-bottom: 10px;
}

.cards {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    min-height: 106px;
}

/* ==========================================
   KARTLAR
========================================== */

.card {
    position: relative;
    width: 78px;
    height: 106px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid #111827;
    border-radius: 10px;
    background: #ffffff;
    color: #111111;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    box-shadow:
        0 8px 15px rgba(0, 0, 0, 0.34),
        inset 0 0 0 2px rgba(255, 255, 255, 0.85);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

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

.card.back {
    background:
        repeating-linear-gradient(
            45deg,
            #2563eb,
            #2563eb 7px,
            #1e3a8a 7px,
            #1e3a8a 14px
        );
    color: #ffffff;
    border-color: #dbeafe;
}

.card.red-suit {
    color: #c81e1e;
}

.card-rank {
    font-size: 27px;
    line-height: 1;
}

.card-suit {
    margin-top: 7px;
    font-size: 37px;
    line-height: 1;
}

.card-back-symbol {
    font-size: 48px;
}

.held {
    transform: translateY(-11px);
    border-color: #ffd700;
    box-shadow:
        0 0 0 3px rgba(255, 215, 0, 0.25),
        0 0 20px rgba(255, 215, 0, 0.9);
}

.hold-label {
    position: absolute;
    top: -11px;
    left: 50%;
    min-width: 42px;
    padding: 3px 7px;
    transform: translateX(-50%);
    border-radius: 6px;
    background: #111827;
    color: #ffd700;
    font-size: 11px;
    text-align: center;
    box-shadow: 0 4px 9px rgba(0, 0, 0, 0.35);
}

.winning-card {
    box-shadow:
        0 0 0 3px rgba(74, 222, 128, 0.35),
        0 0 24px rgba(74, 222, 128, 0.9);
}

/* ==========================================
   OYUN BUTONLARI
========================================== */

.buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 7px;
    margin: 8px 0 0;
}

button {
    padding: 10px 15px;
    border: 0;
    border-radius: 9px;
    background:
        linear-gradient(
            180deg,
            #ffd84d,
            #e6b900
        );
    color: #171717;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transition:
        transform 0.16s ease,
        filter 0.16s ease,
        box-shadow 0.16s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    filter: grayscale(1);
}

/* ==========================================
   OYUNCU FİŞLERİ
========================================== */

.chip-section {
    margin: 8px 0;
    padding: 10px 12px;
    border: 2px solid #d4af37;
    border-radius: 14px;
    background: rgba(4, 36, 22, 0.88);
    text-align: center;
}

.chip-section h3 {
    margin-bottom: 5px;
    font-size: 15px;
}

.chip-bank {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 7px;
    margin: 5px 0 8px;
}

.casino-chip,
.table-chip {
    width: 58px;
    height: 58px;
    padding: 0;
    flex: 0 0 auto;
    border: 5px dashed rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    box-shadow:
        0 7px 13px rgba(0, 0, 0, 0.45),
        inset 0 0 0 4px rgba(255, 255, 255, 0.18);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.casino-chip:hover,
.table-chip:hover {
    transform:
        translateY(-5px)
        rotate(5deg);
}

.selected-chip {
    transform:
        translateY(-7px)
        scale(1.06);
    box-shadow:
        0 0 0 4px #ffd700,
        0 0 22px rgba(255, 215, 0, 0.85);
}

.chip-green {
    background:
        radial-gradient(
            circle,
            #22c55e,
            #166534
        );
}

.chip-blue {
    background:
        radial-gradient(
            circle,
            #3b82f6,
            #1e3a8a
        );
}

.chip-black {
    background:
        radial-gradient(
            circle,
            #4b5563,
            #030712
        );
}

.chip-purple {
    background:
        radial-gradient(
            circle,
            #a855f7,
            #581c87
        );
}

.chip-orange {
    background:
        radial-gradient(
            circle,
            #f97316,
            #9a3412
        );
}

.chip-gold {
    background:
        radial-gradient(
            circle,
            #fde047,
            #a16207
        );
    color: #111827;
}

.chip-controls {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.chip-controls p {
    margin: 0;
    font-size: 13px;
}

.chip-controls button {
    padding: 8px 12px;
    font-size: 13px;
}

/* ==========================================
   BAHİS ALANI
========================================== */

.bet-circle {
    width: min(380px, 100%);
    min-height: 105px;
    margin: 7px auto;
    padding: 8px 12px;
    border: 4px double #facc15;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(22, 101, 52, 0.98),
            rgba(4, 75, 40, 0.98)
        );
    text-align: center;
    box-shadow:
        inset 0 0 28px rgba(0, 0, 0, 0.35),
        0 8px 18px rgba(0, 0, 0, 0.3);
}

.bet-circle h3 {
    margin-bottom: 1px;
    font-size: 14px;
}

.bet-circle p {
    margin: 2px 0 0;
    font-size: 13px;
}

.table-chip-area {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    min-height: 55px;
    gap: 3px;
}

.table-chip {
    width: 44px;
    height: 44px;
    margin-left: -14px;
    border-width: 4px;
    font-size: 10px;
    animation: chipDrop 0.32s ease both;
}

.table-chip:first-child {
    margin-left: 0;
}

/* ==========================================
   SAĞ PANEL
========================================== */

.sidebar {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows:
        repeat(7, auto)
        minmax(70px, 1fr);
    gap: 6px;
    overflow: hidden;
    padding: 0;
}

.panel {
    margin: 0;
    padding: 8px 11px;
    overflow: hidden;
    border-left: 6px solid #38bdf8;
    border-radius: 10px;
    background: rgba(7, 29, 23, 0.94);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.22);
}

.panel h3 {
    margin: 0 0 5px;
    font-size: 14px;
    line-height: 1.1;
}

.panel p {
    margin: 3px 0;
    font-size: 12px;
    line-height: 1.25;
}

.green {
    border-left-color: #22c55e;
    background: rgba(20, 83, 45, 0.94);
}

.yellow {
    border-left-color: #facc15;
    background: rgba(92, 73, 0, 0.94);
}

.red {
    border-left-color: #ef4444;
    background: rgba(91, 0, 0, 0.94);
}

.stats {
    border-left-color: #38bdf8;
}

span {
    color: #ffd700;
    font-weight: 800;
}

.sidebar #bestAction {
    font-size: 14px;
}

.sidebar #bestEV {
    color: #4ade80;
    font-size: 16px;
}

.text-green {
    color: #4ade80 !important;
}

.text-yellow {
    color: #fde047 !important;
}

.text-red {
    color: #f87171 !important;
}

.status-green {
    border-left-color: #22c55e !important;
}

.status-yellow {
    border-left-color: #facc15 !important;
}

.status-red {
    border-left-color: #ef4444 !important;
}

/* ==========================================
   SON İŞLEM
========================================== */

.log-panel {
    min-height: 70px;
}

#gameLog {
    min-height: 45px;
    max-height: 75px;
    overflow: hidden;
    padding: 7px 9px;
    border-radius: 8px;
    background: #04140d;
    color: #f8fafc;
    font-size: 11px;
    line-height: 1.25;
}

/* ==========================================
   TOAST
========================================== */

.poker-toast {
    position: fixed;
    right: 20px;
    bottom: 18px;
    z-index: 9999;
    max-width: 340px;
    padding: 13px 18px;
    border-radius: 10px;
    opacity: 0;
    transform: translateY(22px);
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

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

.toast-green {
    background: #166534;
}

.toast-yellow {
    background: #854d0e;
}

.toast-red {
    background: #991b1b;
}

/* Bonus eli ekran uyarısı */
.bonus-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.bonus-alert-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.bonus-alert-box {
    min-width: 280px;
    max-width: 90vw;
    padding: 28px 36px;
    border-radius: 18px;
    text-align: center;
    border: 3px solid #ffd700;
    background:
        linear-gradient(
            160deg,
            rgba(22, 101, 52, 0.98),
            rgba(8, 40, 20, 0.98)
        );
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.45),
        0 20px 50px rgba(0, 0, 0, 0.5);
    animation: bonusPop 0.35s ease;
}

.bonus-alert-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 8px;
}

.bonus-alert-title {
    font-size: 30px;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 2px;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.85),
        0 0 40px rgba(255, 100, 0, 0.5);
    animation: bonusTitlePulse 0.6s ease infinite alternate;
}

@keyframes bonusTitlePulse {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

.bonus-alert-hand {
    margin-top: 12px;
    font-size: 20px;
    color: #ffffff;
}

.bonus-alert-mult {
    margin-top: 8px;
    font-size: 18px;
    color: #81c784;
    font-weight: 600;
}

@keyframes bonusPop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    60% {
        transform: scale(1.06);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   ANİMASYONLAR
========================================== */

.card-deal-animation {
    animation: dealCard 0.42s ease both;
}

@keyframes dealCard {

    from {
        opacity: 0;
        transform:
            translateY(-28px)
            rotate(-4deg);
    }

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

}

@keyframes chipDrop {

    from {
        opacity: 0;
        transform:
            translateY(-55px)
            rotate(-150deg)
            scale(0.65);
    }

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

}

/* ==========================================
   DAHA KISA 1080P EKRANLAR
========================================== */

@media (max-height: 900px) {

    .app-header {
        height: 68px;
    }

    .app-header h1 {
        font-size: 34px;
    }

    .dashboard {
        height: calc(100vh - 91px);
    }

    .game-column .table {
        padding: 11px 16px;
    }

    .cards {
        min-height: 92px;
    }

    .card {
        width: 68px;
        height: 92px;
    }

    .card-rank {
        font-size: 23px;
    }

    .card-suit {
        font-size: 31px;
    }

    .dealer,
    .player {
        margin-bottom: 7px;
    }

    h2 {
        margin-bottom: 5px;
        font-size: 18px;
    }

    .chip-section {
        padding: 7px 10px;
    }

    .casino-chip {
        width: 50px;
        height: 50px;
        font-size: 10px;
    }

    .bet-circle {
        min-height: 86px;
    }

    .table-chip-area {
        min-height: 40px;
    }

    .sidebar {
        gap: 4px;
    }

    .panel {
        padding: 6px 9px;
    }

    .panel h3 {
        margin-bottom: 3px;
        font-size: 12px;
    }

    .panel p {
        margin: 2px 0;
        font-size: 10.5px;
        line-height: 1.15;
    }

    #gameLog {
        min-height: 35px;
        max-height: 52px;
        font-size: 10px;
    }

}

/* ==========================================
   TABLET
========================================== */

@media (max-width: 1100px) {

    html,
    body {
        height: auto;
    }

    body {
        overflow: auto;
    }

    .app-shell {
        height: auto;
        min-height: 100vh;
    }

    .dashboard {
        height: auto;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .game-column,
    .sidebar {
        height: auto;
        overflow: visible;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
    }

    .game-column .table {
        height: auto;
        overflow: visible;
    }

}

/* ==========================================
   MOBİL
========================================== */

@media (max-width: 760px) {

    body {
        padding: 4px;
    }

    .app-shell {
        padding: 3px;
    }

    .app-header,
    .dashboard {
        width: 100%;
    }

    .app-header {
        height: 62px;
        margin-bottom: 6px;
    }

    .app-header h1 {
        font-size: 24px;
    }

    .game-column .table {
        padding: 12px;
    }

    .cards {
        flex-wrap: wrap;
    }

    .card {
        width: 62px;
        height: 88px;
    }

    .card-rank {
        font-size: 21px;
    }

    .card-suit {
        font-size: 29px;
    }

    .chip-bank,
    .chip-controls,
    .buttons {
        flex-wrap: wrap;
    }

    .casino-chip {
        width: 48px;
        height: 48px;
    }

    .buttons button,
    .chip-controls button {
        width: auto;
    }

}

.held-section,
.discard-section{

    margin-top:18px;

}

.hold-title{

    color:#ffd54a;

    font-size:18px;

    font-weight:bold;

    margin-bottom:8px;

}

.cards-row{

    display:flex;

    gap:12px;

    flex-wrap:wrap;

    min-height:150px;

}

/* ==========================================
   Oyuncu Kartlarını TUT / AT Gruplarına Ayır
========================================== */

#playerCards {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 12px;
    min-height: 150px;
    align-items: stretch;
}

.player-card-group {
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
}

.held-group {
    border: 2px solid #facc15;
    background:
        linear-gradient(
            180deg,
            rgba(133, 77, 14, 0.48),
            rgba(69, 43, 8, 0.34)
        );
    box-shadow:
        inset 0 0 24px
        rgba(250, 204, 21, 0.08);
}

.discard-group {
    border: 2px solid #38bdf8;
    background:
        linear-gradient(
            180deg,
            rgba(7, 89, 133, 0.38),
            rgba(8, 47, 73, 0.28)
        );
}

.player-group-title {
    margin-bottom: 9px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.4px;
    text-align: center;
}

.held-group .player-group-title {
    color: #fde047;
}

.discard-group .player-group-title {
    color: #7dd3fc;
}

.player-card-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 0;
}

.held-separated {
    border-color: #facc15;
    transform: none;
    box-shadow:
        0 0 0 2px
        rgba(250, 204, 21, 0.35),
        0 0 12px
        rgba(250, 204, 21, 0.45);
}

.discard-separated {
    opacity: 0.92;
    border-color: #38bdf8;
}

.discard-separated:hover {
    opacity: 1;
    border-color: #7dd3fc;
}

.empty-card-group {
    width: 100%;
    padding: 18px 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

@media (max-width: 900px) {

    #playerCards {
        grid-template-columns: 1fr;
    }

}

/* ==========================================
   Açık Kart Giriş Danışmanı
========================================== */

.open-card-advisor {
    border-left-width: 7px;
}

.advisor-green {
    border-left-color: #22c55e;
    background:
        linear-gradient(
            180deg,
            rgba(20, 83, 45, 0.96),
            rgba(8, 56, 31, 0.96)
        );
}

.advisor-yellow {
    border-left-color: #facc15;
    background:
        linear-gradient(
            180deg,
            rgba(92, 73, 0, 0.96),
            rgba(59, 47, 0, 0.96)
        );
}

.advisor-red {
    border-left-color: #ef4444;
    background:
        linear-gradient(
            180deg,
            rgba(91, 0, 0, 0.96),
            rgba(55, 0, 0, 0.96)
        );
}

.advisor-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11px;
}

.advisor-decision {
    display: inline-block;
    margin-left: 5px;
    font-size: 16px;
    font-weight: 900;
}

.advisor-reason {
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid
        rgba(255, 255, 255, 0.2);
    font-size: 10px;
    line-height: 1.25;
}

/* ==========================================
   Kalan Deste Görüntüleyici
========================================== */

.remaining-deck-panel {
    border-left-color: #a855f7;
    background:
        linear-gradient(
            180deg,
            rgba(62, 20, 91, 0.96),
            rgba(28, 10, 46, 0.96)
        );
}

.remaining-deck-panel h3 {
    display: flex;
    align-items: center;
    gap: 5px;
}

.remaining-deck-panel h4 {
    margin: 7px 0 4px;
    color: #fde047;
    font-size: 10px;
}

.next-card-line {
    margin-bottom: 6px;
    padding: 5px 7px;
    border: 1px solid
        rgba(250, 204, 21, 0.5);
    border-radius: 6px;
    background:
        rgba(0, 0, 0, 0.25);
    font-size: 10px;
}

#nextCardPreview {
    margin-left: 4px;
    color: #4ade80;
    font-size: 14px;
}

.remaining-deck-cards {
    display: grid;
    grid-template-columns:
        repeat(10, minmax(0, 1fr));
    gap: 3px;
    max-height: 118px;
    overflow: hidden;
}

.remaining-mini-card {
    position: relative;
    min-width: 0;
    height: 34px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #64748b;
    border-radius: 4px;
    background: #ffffff;
    color: #111827;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.35);
}

.remaining-mini-card:hover {
    z-index: 5;
    transform: scale(1.35);
}

.unicode-playing-card {
    display: block;
    font-size: 23px;
    line-height: 25px;
}

.remaining-card-text {
    position: absolute;
    right: 1px;
    bottom: 0;
    font-size: 7px;
    font-weight: 900;
}

.deck-position {
    position: absolute;
    top: 0;
    left: 1px;
    color: #64748b;
    font-size: 6px;
}

.remaining-red-card {
    color: #dc2626;
}

.next-draw-card {
    border: 2px solid #4ade80;
    box-shadow:
        0 0 8px rgba(74, 222, 128, 0.9);
    animation:
        nextCardPulse 1.1s infinite alternate;
}

.remaining-rank-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 10px;
}

.remaining-rank-row {
    display: grid;
    grid-template-columns:
        38px 1fr 13px;
    gap: 4px;
    align-items: center;
    font-size: 8px;
}

.remaining-rank-name {
    color: #f8fafc;
}

.remaining-rank-bar {
    color: #a78bfa;
    letter-spacing: 1px;
    white-space: nowrap;
}

.remaining-rank-count {
    color: #fde047;
    text-align: right;
}

@keyframes nextCardPulse {

    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }

}

@media (max-height: 900px) {

    .remaining-deck-cards {
        grid-template-columns:
            repeat(11, minmax(0, 1fr));
        max-height: 74px;
    }

    .remaining-mini-card {
        height: 23px;
    }

    .unicode-playing-card {
        font-size: 17px;
        line-height: 18px;
    }

    .remaining-rank-row {
        font-size: 7px;
    }

}

/* ==========================================
   Kalan Deste Büyük Popup
========================================== */

/* ==========================================
   Kalan Deste Küçük Sağ Panel
========================================== */

.remaining-deck-panel {
    padding: 8px 10px !important;
    overflow: hidden;
    border-left-color: #a855f7;
    background:
        linear-gradient(
            180deg,
            rgba(66, 24, 92, 0.97),
            rgba(30, 10, 48, 0.97)
        );
}

.remaining-deck-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.remaining-deck-summary-header h3 {
    margin: 0;
}

.remaining-deck-count-badge {
    padding: 3px 7px;
    border-radius: 999px;
    background: #6d28d9;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
}

.remaining-next-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    padding: 5px 7px;
    border: 1px solid rgba(74, 222, 128, 0.65);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.26);
}

.remaining-next-title {
    color: #d1fae5;
    font-size: 9px;
    font-weight: 800;
}

.compact-next-card {
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 9px;
    border: 2px solid #4ade80;
    border-radius: 7px;
    background: #ffffff;
    box-shadow:
        0 0 10px rgba(74, 222, 128, 0.65);
}

.compact-next-rank {
    font-size: 16px;
    font-weight: 900;
}

.compact-next-suit {
    font-size: 19px;
    line-height: 1;
}

.next-card-red {
    color: #dc2626;
}

.next-card-black {
    color: #111827;
}

.open-deck-popup-btn {
    width: 100%;
    margin-top: 6px;
    padding: 7px 9px;
    font-size: 10px;
}

/* ==========================================
   Büyük Kalan Deste Popup
========================================== */

.deck-popup {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.deck-popup-open {
    display: flex;
}

.deck-popup-body-lock {
    overflow: hidden !important;
}

.deck-popup-backdrop {
    position: absolute;
    inset: 0;
    background:
        rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(7px);
}

.deck-popup-window {
    position: relative;
    z-index: 1;
    width: min(1380px, 97vw);
    max-height: 94vh;
    overflow-y: auto;
    padding: 22px;
    border: 4px solid #d4af37;
    border-radius: 22px;
    background:
        linear-gradient(
            160deg,
            #116336,
            #062c1a 60%,
            #041b11
        );
    box-shadow:
        0 35px 120px rgba(0, 0, 0, 0.85),
        inset 0 0 45px rgba(255, 255, 255, 0.025);
}

.deck-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.deck-popup-header h2 {
    margin: 0 0 5px;
    color: #fde047;
    font-size: 29px;
}

.deck-popup-header p {
    margin: 0;
    color: #cbd5e1;
    font-size: 12px;
}

.deck-popup-close {
    width: 43px;
    height: 43px;
    padding: 0;
    flex: 0 0 auto;
    border-radius: 50%;
    background:
        linear-gradient(
            180deg,
            #ef4444,
            #991b1b
        );
    color: #ffffff;
    font-size: 19px;
}

/* ==========================================
   Sıradaki Kart
========================================== */

.popup-next-section {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 17px;
    padding: 12px 16px;
    border: 2px solid #4ade80;
    border-radius: 13px;
    background:
        linear-gradient(
            90deg,
            rgba(20, 83, 45, 0.92),
            rgba(0, 0, 0, 0.28)
        );
    box-shadow:
        0 0 18px rgba(74, 222, 128, 0.18);
}

.popup-next-section-title {
    color: #bbf7d0;
    font-size: 13px;
    font-weight: 900;
}

#popupNextCard {
    display: flex;
    align-items: center;
}

.popup-next-card-box {
    width: 94px;
    height: 120px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    padding: 8px;
    border: 3px solid #111827;
    border-radius: 11px;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(74, 222, 128, 0.28),
        0 0 28px rgba(74, 222, 128, 0.85);
}

.popup-next-card-rank {
    font-size: 25px;
    font-weight: 900;
}

.popup-next-card-suit {
    font-size: 46px;
    line-height: 1;
}

.popup-next-card-name {
    color: #475569;
    font-size: 9px;
    font-weight: 800;
}

.popup-next-red {
    color: #dc2626;
}

.popup-next-black {
    color: #111827;
}

/* ==========================================
   Kart Izgarası
========================================== */

.popup-card-section h3 {
    margin: 0 0 10px;
    color: #fde047;
    font-size: 13px;
}

.popup-deck-cards {
    display: grid;
    grid-template-columns:
        repeat(14, minmax(65px, 1fr));
    gap: 8px;
}

.popup-playing-card {
    position: relative;
    min-height: 91px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid #111827;
    border-radius: 9px;
    background: #ffffff;
    box-shadow:
        0 6px 13px rgba(0, 0, 0, 0.36);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.popup-playing-card:hover {
    z-index: 4;
    transform:
        translateY(-7px)
        scale(1.08);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.52);
}

.popup-card-red {
    color: #dc2626;
}

.popup-card-black {
    color: #111827;
}

.popup-card-next {
    border: 3px solid #4ade80;
    transform: translateY(-5px);
    box-shadow:
        0 0 0 3px rgba(74, 222, 128, 0.3),
        0 0 23px rgba(74, 222, 128, 0.9);
}

.popup-card-position {
    position: absolute;
    top: 3px;
    left: 5px;
    color: #64748b;
    font-size: 8px;
    font-weight: 900;
}

.popup-card-corner-rank {
    position: absolute;
    top: 11px;
    left: 8px;
    font-size: 17px;
    font-weight: 900;
}

.popup-card-corner-suit {
    position: absolute;
    top: 30px;
    left: 8px;
    font-size: 17px;
}

.popup-card-main-suit {
    font-size: 41px;
    line-height: 1;
}

.popup-next-label {
    position: absolute;
    right: 3px;
    bottom: 4px;
    left: 3px;
    padding: 2px 3px;
    border-radius: 3px;
    background: #16a34a;
    color: #ffffff;
    font-size: 7px;
    font-weight: 900;
    text-align: center;
}

/* ==========================================
   Popup İstatistikleri
========================================== */

.popup-stat-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.popup-rank-section,
.popup-suit-section {
    padding: 14px;
    border: 1px solid rgba(250, 204, 21, 0.45);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
}

.popup-rank-section h3,
.popup-suit-section h3 {
    margin: 0 0 10px;
    color: #fde047;
    font-size: 13px;
}

.popup-rank-stats {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 6px 14px;
}

.popup-rank-row {
    display: grid;
    grid-template-columns: 47px 1fr 17px;
    gap: 6px;
    align-items: center;
    font-size: 11px;
}

.popup-rank-name {
    color: #f8fafc;
}

.popup-rank-bar {
    color: #a78bfa;
    letter-spacing: 1px;
    white-space: nowrap;
}

.popup-rank-count {
    color: #fde047;
    text-align: right;
}

.popup-suit-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-suit-row {
    display: grid;
    grid-template-columns:
        25px 48px 1fr 22px;
    gap: 6px;
    align-items: center;
    font-size: 11px;
}

.popup-suit-symbol {
    font-size: 20px;
}

.popup-suit-name {
    color: #f8fafc;
}

.popup-suit-bar {
    overflow: hidden;
    color: #38bdf8;
    letter-spacing: 1px;
    white-space: nowrap;
}

.popup-suit-count {
    color: #fde047;
    text-align: right;
}

.popup-suit-red .popup-suit-symbol {
    color: #f87171;
}

/* ==========================================
   Responsive Popup
========================================== */

@media (max-width: 1150px) {

    .popup-deck-cards {
        grid-template-columns:
            repeat(10, minmax(62px, 1fr));
    }

    .popup-rank-stats {
        grid-template-columns:
            repeat(2, 1fr);
    }

}

@media (max-width: 760px) {

    .deck-popup {
        padding: 8px;
    }

    .deck-popup-window {
        padding: 14px;
    }

    .popup-next-section {
        grid-template-columns: 1fr;
    }

    .popup-deck-cards {
        grid-template-columns:
            repeat(5, minmax(55px, 1fr));
        gap: 6px;
    }

    .popup-playing-card {
        min-height: 82px;
    }

    .popup-stat-grid {
        grid-template-columns: 1fr;
    }

    .popup-rank-stats {
        grid-template-columns: 1fr;
    }

}

.cut-deck-section {
    margin: 8px 0;
    padding: 9px 12px;
    border: 2px solid #38bdf8;
    border-radius: 12px;
    background: rgba(7, 47, 73, 0.5);
}

.cut-deck-section h3 {
    margin: 0 0 6px;
    color: #7dd3fc;
    font-size: 14px;
}

.cut-deck-controls {
    display: flex;
    align-items: center;
    gap: 9px;
}

.cut-deck-controls input {
    width: 80px;
    padding: 7px;
    border: 1px solid #38bdf8;
    border-radius: 7px;
    background: #061b12;
    color: #ffffff;
    font-weight: 800;
}

.cut-deck-section p {
    margin: 6px 0 0;
    color: #cbd5e1;
    font-size: 10px;
}

.hidden-deck-message {
    grid-column: 1 / -1;
    padding: 30px;
    border: 2px dashed #64748b;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
}

/* ==========================================
   Büyük Kazanç Göstergeleri
========================================== */

.profit-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.profit-display-box {
    position: relative;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 14px;
    border: 3px solid #d4af37;
    border-radius: 16px;
    background:
        linear-gradient(
            180deg,
            rgba(7, 38, 24, 0.98),
            rgba(2, 20, 12, 0.98)
        );
    box-shadow:
        inset 0 0 28px rgba(255, 255, 255, 0.025),
        0 10px 25px rgba(0, 0, 0, 0.35);
}

.total-profit-box {
    border-color: #38bdf8;
}

.profit-display-title {
    margin-bottom: 7px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1.2px;
}

.profit-display-value {
    font-size: clamp(30px, 3.2vw, 50px);
    font-weight: 1000;
    line-height: 1;
    letter-spacing: 1px;
    text-shadow:
        0 4px 12px rgba(0, 0, 0, 0.6);
}

.profit-positive {
    color: #4ade80 !important;
    text-shadow:
        0 0 14px rgba(74, 222, 128, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.6);
}

.profit-negative {
    color: #f87171 !important;
    text-shadow:
        0 0 14px rgba(248, 113, 113, 0.75),
        0 4px 12px rgba(0, 0, 0, 0.6);
}

.profit-neutral {
    color: #fde047 !important;
}

.profit-flash {
    animation:
        profitFlash 0.65s ease;
}

@keyframes profitFlash {

    0% {
        transform: scale(0.72);
        opacity: 0;
    }

    45% {
        transform: scale(1.14);
        opacity: 1;
    }

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

}

@media (max-width: 760px) {

    .profit-display {
        grid-template-columns: 1fr;
    }

    .profit-display-box {
        min-height: 88px;
    }

    .profit-display-value {
        font-size: 34px;
    }

}

/* 2. şans onay modalı */
.second-chance-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.second-chance-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.second-chance-box {
    min-width: 340px;
    max-width: 94vw;
    padding: 32px 36px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #ffd700;
    background: linear-gradient(165deg, rgba(25, 75, 40, 0.98) 0%, rgba(12, 40, 22, 0.99) 50%, rgba(6, 22, 14, 0.99) 100%);
    box-shadow: 0 0 0 1px rgba(255,215,0,0.25), 0 0 50px rgba(255, 215, 0, 0.45), 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.08);
    animation: bonusPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(8px);
}

.second-chance-icon {
    font-size: 40px;
    margin-bottom: 6px;
}

.second-chance-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.second-chance-body {
    font-size: 15px;
    color: #e8f5e9;
    line-height: 1.55;
    margin-bottom: 18px;
}

.second-chance-body strong {
    color: #ffd700;
}

.second-chance-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-btn {
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.sc-yes {
    background: linear-gradient(180deg, #2e7d32, #1b5e20);
    border-color: #ffd700;
    color: #fff;
}

.sc-yes:hover {
    background: linear-gradient(180deg, #43a047, #2e7d32);
}

.sc-no {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #cfd8dc;
}

.sc-no:hover {
    background: rgba(255, 255, 255, 0.14);
}


/* Kart dağıtma animasyonu — kadın/el */
.dealer-hand-anim {
    position: absolute;
    top: -20px;
    right: 8%;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
}

.dealer-hand-anim.playing {
    opacity: 1;
    animation: handEnter 1.5s ease forwards;
}

.anim-arm {
    position: relative;
    width: 80px;
    height: 100px;
}

.anim-hand {
    font-size: 42px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transform-origin: 70% 20%;
    animation: handDeal 1.5s ease;
}

.anim-card-fly {
    position: absolute;
    width: 28px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(145deg, #fff, #e8e0d5);
    border: 1px solid #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    top: 30px;
    left: 20px;
    opacity: 0;
}

.dealer-hand-anim.playing .anim-card-fly.c1 {
    animation: cardFly 0.55s ease 0.15s forwards;
}
.dealer-hand-anim.playing .anim-card-fly.c2 {
    animation: cardFly 0.55s ease 0.35s forwards;
}
.dealer-hand-anim.playing .anim-card-fly.c3 {
    animation: cardFly 0.55s ease 0.55s forwards;
}

@keyframes handEnter {
    0% { opacity: 0; transform: translate(40px, -30px) rotate(15deg); }
    20% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(30px, -20px); }
}

@keyframes handDeal {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(-18deg); }
    50% { transform: rotate(8deg); }
    70% { transform: rotate(-10deg); }
}

@keyframes cardFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-120px, 80px) rotate(-25deg) scale(0.7);
    }
}


.fast-spin-btn {
    margin-top: 6px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid #c9a84c;
    background: linear-gradient(180deg, #5c4a2e, #2a2218);
    color: #f5f0e8;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.fast-spin-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #7a6238, #3a2e1c);
}
.fast-spin-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
#fastSpinResultBox {
    background: linear-gradient(180deg, #2a241c, #1a1510);
    border: 1px solid rgba(201,168,76,0.4);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 4px;
}
#fastSpinResultBox h3 {
    margin: 0 0 6px;
    color: #c9a84c;
    font-size: 14px;
}
.fs-note {
    font-size: 11px;
    color: #aaa;
    margin: 0 0 8px;
}
.fs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.fs-table td {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #e8e0d5;
}
.fs-table td:last-child {
    text-align: right;
}
.fs-win { color: #81c784; }
.fs-lose { color: #e57373; }

/* —— Money delta float (win/loss popup) —— */
.money-float {
    position: fixed;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) scale(0.6);
    z-index: 9999;
    pointer-events: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(36px, 8vw, 64px);
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0;
    text-shadow: 0 4px 24px rgba(0,0,0,0.65);
    transition: opacity 0.15s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.money-float.show {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1);
}
.money-float.hide {
    opacity: 0;
    transform: translate(-50%, -70%) scale(1.05);
}
.money-float.win { color: #66bb6a; }
.money-float.lose { color: #ef5350; }

/* Header balance pulse when float effect is off */
.hdr-val.money-pulse-win {
    color: #66bb6a !important;
    animation: moneyPulseWin 1s ease;
}
.hdr-val.money-pulse-lose {
    color: #ef5350 !important;
    animation: moneyPulseLose 1s ease;
}
@keyframes moneyPulseWin {
    0% { transform: scale(1); }
    25% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
@keyframes moneyPulseLose {
    0% { transform: scale(1); }
    25% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.header-delta {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85em;
    font-weight: 700;
    opacity: 0;
    vertical-align: middle;
    transition: opacity 0.2s ease;
}
.header-delta.show { opacity: 1; }
.header-delta.win { color: #66bb6a; }
.header-delta.lose { color: #ef5350; }

.money-fx-btn {
    background: transparent;
    border: 1px solid rgba(201,168,76,0.45);
    color: #e8e0d5;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.money-fx-btn[aria-pressed="false"] {
    opacity: 0.55;
}

/* ========== Mobile-first polish (phones & small tablets) ========== */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  .site-header, header.app-header, .header-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px !important;
  }

  .header-balance-value { font-size: 18px !important; }

  .live-table {
    min-height: 420px !important;
    border-width: 8px !important;
    border-radius: 40% 40% 10px 10px / 28% 28% 10px 10px !important;
  }

  #dealerCards.cards, #playerCards.cards {
    gap: 4px !important;
    min-height: 72px !important;
  }

  .card, .playing-card {
    width: min(52px, 16vw) !important;
    height: auto !important;
    font-size: 12px !important;
  }

  .table-controls, .controls-row, .bet-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px !important;
  }

  .table-controls button,
  .controls-row button,
  #drawBtn, #playBtn, #foldBtn, #dealBtn, #autoHoldBtn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px !important;
    font-size: 14px !important;
    touch-action: manipulation;
  }

  .dashboard {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 0 6px;
  }

  .sidebar, .side-panel, .stats-panel {
    order: 2;
    width: 100% !important;
    max-width: 100% !important;
  }

  .landing-hero, .landing-content {
    padding: 16px 12px !important;
  }

  .lobby-grid {
    grid-template-columns: 1fr !important;
  }

  .lang-menu-list {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .second-chance-box, .bonus-alert-box {
    min-width: 0 !important;
    width: calc(100vw - 24px) !important;
    max-width: 96vw !important;
    padding: 20px 16px !important;
  }

  .ad-slot {
    max-width: 100%;
    overflow: hidden;
    margin: 8px auto;
    text-align: center;
  }

  .ad-slot iframe, .ad-slot img {
    max-width: 100% !important;
    height: auto !important;
  }

  input, select, textarea, button {
    font-size: 16px !important; /* prevents iOS zoom on focus */
  }
}

@media (max-width: 400px) {
  .card, .playing-card {
    width: min(44px, 15vw) !important;
  }
  .seat-label { font-size: 10px !important; letter-spacing: 1px !important; }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}
