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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 20px 0;
}

header h1 {
    color: #6d4aff;
    font-size: 2rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

nav button {
    background: #2a2a4a;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

nav button.active {
    background: #6d4aff;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
}

.form-group select, .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: #6d4aff;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.hidden {
    display: none !important;
}

#rollingAnimation {
    text-align: center;
    padding: 40px;
    background: #2a2a4a;
    border-radius: 10px;
    margin-top: 20px;
}

.cooking {
    font-size: 1.5rem;
    color: #6d4aff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

#resultDisplay {
    text-align: center;
    padding: 30px;
    background: #2a2a4a;
    border-radius: 10px;
    margin-top: 20px;
}

#resultTitle {
    font-size: 2rem;
    margin-bottom: 15px;
}

.success-text { color: #4ade80; }
.fail-text { color: #f87171; }
.critical-success-text { color: #fbbf24; }
.critical-fail-text { color: #ef4444; }

#rollsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
}

#rollsTable th, #rollsTable td {
    padding: 10px;
    border: 1px solid #333;
    text-align: left;
}

#rollsTable th {
    background: #2a2a4a;
}

.filters {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.filters button {
    background: #2a2a4a;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.bookmark-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bookmark-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #1a1a2e;
    color: #fff;
}

#bookmarksList {
    list-style: none;
    margin-top: 15px;
}

#bookmarksList li {
    padding: 8px;
    background: #2a2a4a;
    margin-bottom: 5px;
    border-radius: 5px;
}

#charactersList .char-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #2a2a4a;
    margin-bottom: 5px;
    border-radius: 5px;
}

.btn-secondary {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

#loginSection {
    text-align: center;
    padding: 50px 20px;
}

#loginSection input {
    padding: 12px;
    width: 250px;
    margin-right: 10px;
    border-radius: 5px;
    border: 1px solid #333;
}

#resultDisplay p {
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.4;
}

.info-text {
    color: #60a5fa;
    font-style: italic;
    margin-top: 10px;
}

.warning-text {
    color: #fbbf24;
    font-style: italic;
    margin-top: 10px;
}

.danger-text {
    color: #ef4444;
    font-weight: bold;
    margin-top: 10px;
}

.slider-value {
    text-align: center;
    font-size: 1.2rem;
    color: #6d4aff;
    font-weight: bold;
    margin: 5px 0 15px 0;
}

#betSlider {
    accent-color: #6d4aff;
}

/* Ligne de marqueur temporel */
.marker-row td {
    background: #2a2a4a !important;
    border-top: 2px solid #6d4aff !important;
    border-bottom: 2px solid #6d4aff !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

#rollsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
}

#rollsTable th, #rollsTable td {
    padding: 10px;
    border: 1px solid #333;
    text-align: left;
}

#rollsTable th {
    background: #2a2a4a;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #6d4aff;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: opacity 0.3s;
}

/* Style identique pour les deux tableaux */
#statsSummaryTable, #rollsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--bg-card, #1a1a2e);
    border-radius: 8px;
    overflow: hidden;
}

#statsSummaryTable thead tr, #rollsTable thead tr {
    background: #2a2a4a;
    color: white;
    text-align: left;
}

#statsSummaryTable th, #statsSummaryTable td,
#rollsTable th, #rollsTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a4a;
}

#statsSummaryTable tbody tr:last-child td,
#rollsTable tbody tr:last-child td {
    border-bottom: none;
}

#statsSummaryTable tbody tr:hover,
#rollsTable tbody tr:hover {
    background: rgba(109, 74, 255, 0.1);
}

/* Lignes de marqueurs - toujours visibles */
.marker-row td {
    background: rgba(109, 74, 255, 0.2) !important;
    text-align: center !important;
    font-weight: bold !important;
    color: #6d4aff !important;
}

/* Cacher les flèches natives des inputs type="number" */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Alignement vertical des boutons +/− */
#betMinus, #betPlus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    height: 60px;
    touch-action: manipulation;
    min-width: 48px;
    min-height: 48px;
}

input[type="number"] {
    vertical-align: middle;
    height: 60px;
}

/* Conteneur flex - assurer l'alignement */
div[style*="display: flex; align-items: center; gap: 15px; justify-content: center;"] {
    align-items: center !important;
}