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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.5s ease;
}

/* Danger level backgrounds */
body.danger-low {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.danger-medium {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

body.danger-high {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

body.danger-critical {
    background: linear-gradient(135deg, #c0392b 0%, #8e44ad 100%);
    animation: pulse 0.5s infinite;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 500px;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

/* Screen management */
.players-screen, .settings-screen, .game-screen {
    display: none;
}

.players-screen.active, .settings-screen.active, .game-screen.active {
    display: block;
}

/* Screen titles */
h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Player header with remove button */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.remove-player {
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-player:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* Navigation buttons */
.navigation-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.back-button {
    background: #6c757d;
}

.back-button:hover {
    background: #5a6268;
}

.next-button {
    background: #48bb78;
}

.next-button:hover {
    background: #38a169;
}

.start-button {
    background: #667eea;
    font-weight: bold;
}

.start-button:hover {
    background: #5a6fd8;
}

/* Player summary in settings */
.player-summary {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.player-summary h3 {
    margin-bottom: 0.5rem;
}

#player-names-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.player-tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Player setup */
.player-setup {
    margin: 0.25rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Form elements */
input {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin: 0.5rem;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    background: #5a6fd8;
}

button:active {
    transform: translateY(0) scale(0.95);
    background: #4c5ed1;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
    transition: all 0.1s ease;
}

#roll-button {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

#roll-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

#roll-button:active {
    transform: translateY(1px) scale(0.96);
    background: linear-gradient(135deg, #4c5ed1 0%, #5d3a7e 100%);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.7);
}

#roll-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#roll-button:active::before {
    width: 300px;
    height: 300px;
}

.quick-start {
    background: #48bb78;
}

.randomize {
    background: #ed8936;
}

/* Bomb styling */
.bomb-container {
    position: relative;
    margin: 2rem 0;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bomb {
    width: 150px;
    height: 150px;
    background: #2d3436;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fuse {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 40px;
    background: #8b6914;
}

.spark {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ff6b6b 0%, #feca57 50%, transparent 70%);
    border-radius: 50%;
    animation: flicker 0.2s infinite;
}

/* Game display */
.current-number {
    font-size: 3rem;
    font-weight: bold;
    color: #2d3436;
    margin: 1rem 0;
}

.player-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.high-roll {
    color: #48bb78;
}

.low-roll {
    color: #e53e3e;
}

.explosion {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ff6b6b 0%, #ee5a24 30%, #c0392b 60%, transparent 70%);
    border-radius: 50%;
    animation: explode 1s ease-out forwards;
    z-index: 10;
    pointer-events: none;
}

.game-over {
    display: none;
    margin: 2rem 0;
    height: 200px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 20;
}

.game-over.active {
    display: flex;
}

.game-over-text {
    display: none;
    margin-top: 2rem;
    position: relative;
    z-index: 20;
}

.game-over-text.active {
    display: block;
}

.game-over-text h2 {
    color: #e53e3e;
    margin-bottom: 1rem;
}

.skull {
    font-size: 150px;
    line-height: 1;
    margin: 0;
    display: block;
}

/* Bomb face styling */
.bomb-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.bomb-eyes {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
}

.eye {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pupil {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

/* Mouth expressions */
.mouth {
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    border: 3px solid white;
    border-radius: 0 0 30px 30px;
    border-top: none;
    transition: all 0.3s ease;
}

.mouth.smile {
    border-color: white;
    transform: translateX(-50%) rotate(0deg);
}

.mouth.neutral {
    border-radius: 0;
    height: 3px;
    border-top: 3px solid white;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.mouth.worried {
    border-radius: 30px 30px 0 0;
    border-bottom: none;
    border-top: 3px solid white;
    transform: translateX(-50%) rotate(0deg);
}

.mouth.terrified {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    background: #333;
}

/* Sweat drop */
.sweat {
    position: absolute;
    top: 25%;
    right: 20%;
    width: 8px;
    height: 12px;
    background: #87ceeb;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show sweat when worried or terrified */
.bomb:has(.mouth.worried) .sweat,
.bomb:has(.mouth.terrified) .sweat {
    opacity: 1;
}