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

body {
    padding: 0;
    color: rgba(255, 255, 255, 0.87);
    background: rgb(7 11 35 / var(--tw-bg-opacity, 1));
    background-size: cover;
    background-position: center;
    font-family: Georgia, 'Times New Roman', serif;
    overflow: hidden;
}

#app {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

#game-container {
    min-width: 1280px;
    min-height: 956px;
    width: 1280px;
    height: 956px;
    max-width: 100%;
    max-height: 100%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.spritePosition {
    margin: 10px 0 0 10px;
    font-size: 0.8em;
}

.button {
    width: 140px;
    margin: 10px;
    padding: 10px;
    background-color: #000000;
    color: rgba(255, 255, 255, 0.87);
    border: 1px solid rgba(255, 255, 255, 0.87);
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
        border: 1px solid #0ec3c9;
        color: #0ec3c9;
    }

    &:active {
        background-color: #0ec3c9;
    }

    &:disabled {
        cursor: not-allowed;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: rgba(255, 255, 255, 0.3);
    }
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: rgb(12 16 43 / var(--tw-bg-opacity, 1));
}

.deck-decoration {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 50;
    margin-bottom: 180px;
}

.deck-card-left,
.deck-card-right {
    width: 120px;
    height: 160px;
    border-radius: 12px;
    background: transparent;
    position: relative;
    opacity: 0.8;
}

.deck-card-left {
    transform: rotate(-12deg);
}

.deck-card-right {
    transform: rotate(12deg);
}

.deck-container {
    width: 140px;
    height: 196px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.deck-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.screen-panel {
    width: 520px;
    padding: 36px;
    border-radius: 16px;
    background: rgba(12, 12, 12, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: center;
    position: relative;
    z-index: 6;
    margin-top: 100px;
}

.screen-title {
    font-size: 30px;
    letter-spacing: 1px;
    color: #f4d27a;
}

.screen-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.screen-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.phaser-button {
    height: 50px;
    border-radius: 8px;
    background: rgb(69 88 255 / var(--tw-bg-opacity, 1));
    color: #ffffff;
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 16px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
    border: none;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.phaser-button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.6);
    opacity: 0.5;
}

.phaser-button:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.01);
    filter: brightness(1.05);
}

.return-button {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 12;
    width: 140px;
}

.history-button {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 12;
    width: 140px;
}

.corner-panel {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 12px;
}

.corner-panel .bet-input {
    width: 110px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    outline: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.modal-box {
    width: 520px;
    padding: 24px;
    border-radius: 14px;
    background: rgba(14, 14, 14, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.history-modal {
    width: 680px;
}

.history-table-wrap {
    max-height: 320px;
    overflow-y: auto;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.history-table th,
.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-table th {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.95);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.loading-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
}
