body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.deck-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #666;
}

.deck-info p {
    margin: 5px 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #2196F3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976D2;
}

.result {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.stats-section {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.stats-section h4 {
    margin-top: 0;
    color: #333;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    padding: 5px;
    background-color: #fff;
    border-radius: 3px;
}

.stat-label {
    font-weight: bold;
}

.stat-value {
    color: #666;
}

.percentage {
    color: #2196F3;
    font-weight: bold;
}

.error {
    color: #d32f2f;
    padding: 10px;
    background-color: #ffebee;
    border-radius: 4px;
    margin: 10px 0;
}

.deck-controls, .hand-controls, .sim-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.deck-input, .hand-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin: 10px 0;
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px;
}

.card {
    width: 80px;
    height: 112px;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px;
    position: relative;
    background: white;
    margin: 0;
    box-sizing: border-box;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.card .rank {
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1;
    margin-bottom: -4px;
    text-align: center;
    width: 100%;
}

.card .suit {
    font-size: 1.5em;
    line-height: 1;
    text-align: center;
    width: 100%;
}

.card .quantity {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #666;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    z-index: 2;
    padding: 0 4px;
}

.card-controls {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    z-index: 1;
}

.card-controls button {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E6E6FA;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-controls button:hover {
    background: #FF6B6B;
    color: white;
    transform: scale(1.1);
}

.card.selected-for-discard .card-controls button {
    background: #FF6B6B;
    color: white;
}

.card.selected-for-discard .card-controls button:hover {
    background: #FF5252;
}

input[type="number"] {
    width: 100px;
    padding: 8px;
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

input[type="number"]#num-sims {
    width: 150px;
}

input[type="number"]#hand-fs-sz {
    width: 60px;
}

input[type="number"]#hand-dist {
    width: 60px;
}

.hand-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.hand-controls.button-row {
    justify-content: center;
    margin-top: -5px;
    margin-bottom: 20px;
}

.hand-controls.button-row button {
    min-width: 100px;
}

.hand-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.hand-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    margin: 0;
}

.hand-controls input[type="number"] {
    width: 60px;
    margin: 0;
}

.hand-controls button {
    margin: 0;
}

h2 {
    margin-bottom: 15px;
}

h3 {
    margin: 15px 0;
}

.error-message {
    color: red;
    margin: 10px 0;
}

.deck-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    width: 100%;
}

.deck-input-group input {
    flex: 0.8;
    min-width: 0;
    height: 38px;
    padding: 8px;
    box-sizing: border-box;
}

.deck-input-group .button-container {
    flex: 0.2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.deck-input-group button {
    width: 100%;
    max-width: 100px;
    height: 38px;
    padding: 8px 15px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.deck-controls {
    display: flex;
    gap: 10px;
    margin: 0 auto 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.deck-controls button {
    padding: 10px 15px;
}

.card.stone {
    background-image: repeating-linear-gradient(
        45deg,
        #808080,
        #808080 2px,
        #909090 2px,
        #909090 4px
    );
    position: relative;
    background-color: #808080;
}

.card.stone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(0, 0, 0, 0.2) 100%
    );
    border-radius: 8px;
    pointer-events: none;
}

.card.stone .card-content {
    display: none;
}

.card.stone .edition {
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.card.stone .seal {
    z-index: 2;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.card.stone .enhancement {
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.card.stone .quantity {
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
}

/* Edition indicators (top left) */
.edition {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 16px;
    height: 16px;
    overflow: hidden;
    z-index: 1;
}

.edition::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        currentColor 2px,
        currentColor 4px
    );
}

.edition.foil {
    color: #87CEEB;
}

.edition.holographic {
    color: #FF6B6B;
}

.edition.polychrome {
    color: #4CAF50;
}

/* Seal indicators (bottom right) */
.seal {
    position: absolute;
    bottom: 24px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 1;
}

.seal.gold { background: #FFD700; }
.seal.red { background: #FF6B6B; }
.seal.blue { background: #87CEEB; }
.seal.purple { background: #9370DB; }

/* Enhancement indicators (bottom left) */
.enhancement {
    position: absolute;
    bottom: 24px;
    left: 6px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.enhancement::before,
.enhancement::after {
    content: '';
    position: absolute;
    background: currentColor;
}

.enhancement::before {
    width: 2px;
    height: 12px;
}

.enhancement::after {
    width: 12px;
    height: 2px;
}

.enhancement.gold { color: #FFD700; }
.enhancement.bonus { color: #4d74d6; }
.enhancement.mult { color: #FF6B6B; }
.enhancement.wild { color: #4CAF50; }
.enhancement.glass { color: #D3D3D3; }
.enhancement.steel { color: #708090; }
.enhancement.lucky { color: #eb87cd; }

@media (max-width: 768px) {
    .top-sections {
        flex-direction: column;
    }
    
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }
    
    .deck-controls, .hand-controls, .sim-controls {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }

    .card {
        width: 60px;
        height: 84px;
        padding: 4px;
    }

    .card .rank {
        font-size: 1em;
    }

    .card .suit {
        font-size: 1.3em;
    }

    .card-controls button {
        width: 14px;
        height: 14px;
        font-size: 0.6em;
    }

    .card .quantity {
        min-width: 14px;
        height: 14px;
        font-size: 0.6em;
        padding: 0 3px;
    }

    .enhancement,
    .edition,
    .seal {
        width: 12px;
        height: 12px;
    }
}

/* Statistics styles */
.sim-stats {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stats-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.stats-table th,
.stats-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.stats-table th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table tr:hover td {
    background-color: #f5f5f5;
}

@media (max-width: 768px) {
    .sim-stats {
        grid-template-columns: 1fr;
    }
    
    .stats-table {
        font-size: 0.8em;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 6px;
    }
}

.card.selected-for-discard {
    opacity: 0.7;
    border: 2px solid #FF6B6B;
}

.card.selected-for-discard::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    pointer-events: none;
}

.game-state-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.game-state-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.player-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.button-row {
    display: flex;
    gap: 10px;
}

.message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
} 