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

:root {
    --color-primary: #b71c1c; /* deep red */
    --color-accent: #e53935;  /* bright red */
    --color-bg: #0f0f12;      /* deep gray / almost black */
    --color-surface: #1e1e20; /* surface panels */
    --color-muted: #9e9e9e;   /* muted text */
    --color-white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-bg) 0%, rgba(181,28,28,0.04) 100%);
    min-height: 100vh;
    padding: 20px;
}

.app {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    overflow: hidden;
}

header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
}

.section {
    padding: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.section h2 {
    margin-bottom: 20px;
    color: var(--color-white);
}

.hidden {
    display: none !important;
}

/* Select y botones */
select, button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select {
    border: 2px solid #ddd;
    background: white;
    width: 200px;
}

button {
    background: #1a237e;
    color: white;
    font-weight: bold;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Estadísticas */
.stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.stat {
    text-align: center;
}

.label {
    display: block;
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 5px;
}

.stat span:last-child {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
}

/* Selector de posición */
.position-selector {
    margin: 20px 0;
    text-align: center;
}

.position-selector label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--color-white);
}

.position-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.position-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
    background: var(--color-surface);
    color: var(--color-white);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.position-btn:hover {
    background: rgba(255,255,255,0.03);
}

.position-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* Display de posición actual */
.position-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-surface);
    border-radius: 8px;
    font-weight: bold;
    color: var(--color-white);
}

.position-badge {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Botones de tiro */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.shot-btn {
    padding: 20px 40px;
    font-size: 1.2rem;
    min-width: 150px;
}

.success {
    background: #4caf50;
}

.danger {
    background: var(--color-accent);
}

.end-btn {
    background: #ff9800;
    display: block;
    margin: 20px auto;
    padding: 15px 30px;
}

/* Historial */
.session-item {
    background: var(--color-surface);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.session-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
}

.session-player {
    font-weight: bold;
    color: var(--color-primary);
}

.session-position {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    margin: 0 10px;
}

.session-date {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.session-stats {
    display: flex;
    gap: 20px;
}

.session-stat {
    text-align: center;
}

.session-stat .value {
    font-weight: bold;
    font-size: 1.1rem;
}

.session-stat .label {
    font-size: 0.8rem;
}

/* Estadísticas por posición */
.position-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem;
}

.position-stat-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--color-primary);
}

.position-stat-item {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
}

.pos-name {
    font-weight: bold;
    color: var(--color-primary);
}

/* Estilo para el botón de actualizar en el header */
.refresh-btn {
    background: var(--color-accent);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 12px;
    font-weight: bold;
}

.export-btn {
    background: #2e7d32;
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 8px;
    font-weight: bold;
}