:root {
    --bg-color: #2c3e50;
    --table-color: #35654d;
    --card-bg: #fff;
    --primary-color: #3498db;
    --danger-color: #e74c3c;
    --secondary-color: #f39c12;
    --text-color: #ecf0f1;
    --card-width: 80px;
    --card-height: 112px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    user-select: none;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--table-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(0,0,0,0.3);
}

.stats-box, .hand-info {
    font-size: 0.9rem;
}

.score-box {
    text-align: center;
    background-color: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 8px;
    min-width: 200px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
}

#current-score { color: #f1c40f; }
#target-score { color: #e74c3c; }

/* Main Area */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px;
}

.card-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: var(--card-height);
}

/* Jokers */
.jokers-area h3 {
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 1rem;
    opacity: 0.8;
}

/* Mult Display */
.mult-area {
    text-align: center;
    margin: 10px 0;
}

.mult-display {
    display: inline-flex;
    align-items: center;
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.chip-value { color: #3498db; }
.mult-value { color: #e74c3c; }
.x { margin: 0 10px; color: #aaa; font-size: 1rem; }

.hand-name {
    margin-top: 5px;
    font-size: 1.2rem;
    color: #f39c12;
    height: 1.5rem;
}

/* Cards */
.card {
    width: var(--card-width);
    height: var(--card-height);
    background-color: var(--card-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    box-sizing: border-box;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #333;
    font-weight: bold;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.card.red { color: #c0392b; }
.card.black { color: #2c3e50; }

.card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.card.selected {
    transform: translateY(-20px);
    box-shadow: 0 0 10px #f1c40f;
    border: 2px solid #f39c12;
}

.card-top, .card-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

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

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

.joker-card {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: white;
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 10px;
    font-size: 0.8rem;
    border: 2px solid #f1c40f;
}

.joker-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #f1c40f;
}

.joker-desc {
    font-size: 0.7rem;
}

/* Actions */
.actions-area {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 10px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    font-weight: bold;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary { background-color: var(--primary-color); }
.primary:hover:not(:disabled) { background-color: #2980b9; }

.danger { background-color: var(--danger-color); }
.danger:hover:not(:disabled) { background-color: #c0392b; }

.secondary { background-color: var(--secondary-color); font-size: 0.9rem; padding: 5px 15px; }
.secondary:hover:not(:disabled) { background-color: #d35400; }

/* Modals */
.modal, .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content, .shop-content {
    background-color: #fff;
    color: #333;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content.small {
    max-width: 400px;
    text-align: center;
}

.hidden {
    display: none;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.shop-items {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.shop-item {
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    width: 120px;
    cursor: pointer;
    transition: transform 0.2s;
}

.shop-item:hover {
    transform: scale(1.05);
    background-color: #f0f8ff;
}

.shop-item h4 { margin: 5px 0; font-size: 0.9rem; }
.shop-item p { font-size: 0.8rem; margin: 5px 0; color: #666; }
.price { font-weight: bold; color: #e67e22; }

/* Utility */
.red-text { color: red; }
