* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e94560;
}

h1 { color: #e94560; font-size: 1.8em; }
h3 { color: #e94560; margin-bottom: 10px; }

#controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

select, input[type="number"] {
    background: #16213e;
    color: #eee;
    border: 1px solid #0f3460;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background: #e94560;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover { background: #c73650; }
button:disabled { background: #555; cursor: not-allowed; }

#game-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #16213e;
    border-radius: 8px;
    align-items: center;
    flex-wrap: wrap;
}

#scores {
    display: flex;
    gap: 15px;
}

.score-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

.player-0 { background: #e94560; }
.player-1 { background: #0f3460; }
.player-2 { background: #533483; }
.player-3 { background: #2b7a0b; }
.player-4 { background: #b8860b; }

#dice-roll {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #16213e;
    border-radius: 8px;
}

#roll-display {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.die {
    width: 40px;
    height: 40px;
    background: white;
    color: #1a1a2e;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

#board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.casino {
    background: #16213e;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #0f3460;
    cursor: pointer;
    transition: all 0.2s;
}

.casino:hover { border-color: #e94560; transform: translateY(-2px); }
.casino.legal { border-color: #4ecca3; box-shadow: 0 0 10px rgba(78, 204, 163, 0.3); }
.casino.selected { border-color: #e94560; box-shadow: 0 0 15px rgba(233, 69, 96, 0.5); }

.casino-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e94560;
}

.banknotes {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.banknote {
    padding: 3px 8px;
    background: #2d6a4f;
    color: #b7e4c7;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.dice-area {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 24px;
}

.placed-dice {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.neutral-die {
    background: #666;
}

#gto-panel {
    padding: 15px 20px;
    background: #16213e;
    border-radius: 8px;
    margin-bottom: 20px;
}

#gto-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gto-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gto-label {
    width: 120px;
    font-size: 14px;
    font-weight: 600;
}

.gto-bar-wrapper {
    flex: 1;
    background: #0a0a1a;
    border-radius: 4px;
    height: 28px;
    position: relative;
}

.gto-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 12px;
    font-weight: 600;
}

.gto-bar.best { background: #4ecca3; color: #1a1a2e; }
.gto-bar.other { background: #0f3460; }

.gto-value {
    width: 60px;
    text-align: right;
    font-size: 13px;
}

#simulator-panel {
    padding: 15px 20px;
    background: #16213e;
    border-radius: 8px;
    margin-bottom: 20px;
}

#sim-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

#sim-results table {
    width: 100%;
    border-collapse: collapse;
}

#sim-results th, #sim-results td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #0f3460;
}

#sim-results th { color: #e94560; font-size: 13px; }

#game-over {
    padding: 30px;
    background: #16213e;
    border-radius: 8px;
    text-align: center;
}

#game-over h2 { font-size: 2em; margin-bottom: 20px; }

.dice-edit {
    cursor: pointer;
    padding: 6px 10px;
    background: #0f3460;
    color: #8899aa;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.dice-edit:hover {
    background: #e94560;
    color: white;
}

.dice-editor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.dice-editor-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dice-editor-grid input[type="number"] {
    width: 50px;
    background: #0a0a1a;
    color: #eee;
    border: 1px solid #0f3460;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.dice-editor-grid input[type="number"]:focus {
    outline: none;
    border-color: #e94560;
}

.die-small {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.banknote-edit {
    cursor: pointer;
    padding: 2px 6px;
    background: #0f3460;
    color: #8899aa;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.banknote-edit:hover {
    background: #e94560;
    color: white;
}

/* Banknote editor modal */
#banknote-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: #16213e;
    border: 2px solid #e94560;
    border-radius: 12px;
    padding: 24px;
    min-width: 340px;
    z-index: 1001;
}

.modal-content h3 {
    margin-bottom: 8px;
}

.modal-hint {
    color: #8899aa;
    font-size: 13px;
    margin-bottom: 12px;
}

.modal-content input[type="text"] {
    width: 100%;
    background: #0a0a1a;
    color: #eee;
    border: 1px solid #0f3460;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 16px;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #e94560;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary {
    background: #0f3460 !important;
}

.btn-secondary:hover {
    background: #1a4a7a !important;
}

.hidden { display: none !important; }

@media (max-width: 768px) {
    #board { grid-template-columns: repeat(2, 1fr); }
    header { flex-direction: column; gap: 10px; }
}
