* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    padding: 40px 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(75, 0, 130, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 20px;
    box-shadow: 
        0 0 60px rgba(138, 43, 226, 0.3),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    backdrop-filter: blur(10px);
    z-index: 1;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 
        0 0 10px rgba(138, 43, 226, 0.8),
        0 0 20px rgba(138, 43, 226, 0.6),
        0 0 30px rgba(138, 43, 226, 0.4);
    font-weight: bold;
    letter-spacing: 3px;
}

.subtitle {
    text-align: center;
    color: #b19cd9;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-style: italic;
    letter-spacing: 2px;
}

.story-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.story-box p {
    color: #d1c4e9;
    line-height: 1.8;
    margin: 8px 0;
}

.story-warning {
    color: #ff6b6b !important;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 15px !important;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.win-streak {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #ffd700;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(75, 0, 130, 0.3) 100%);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 0 20px rgba(138, 43, 226, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.win-streak span {
    color: #ff6b6b;
    font-size: 1.3em;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.setup-screen, .game-screen, .gameover-screen {
    display: none;
}

.setup-screen.active, .game-screen.active, .gameover-screen.active {
    display: block;
}

.rules {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 30px rgba(138, 43, 226, 0.2);
}

.rules h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ffd700;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rules ul {
    list-style: none;
    color: #d1c4e9;
}

.rules li {
    margin: 12px 0;
    padding-left: 10px;
    line-height: 1.6;
}

.rules strong {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.button {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    font-size: 1.2em;
    font-weight: bold;
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.6) 0%, rgba(75, 0, 130, 0.6) 100%);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 15px rgba(138, 43, 226, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    font-family: 'Georgia', serif;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 6px 25px rgba(138, 43, 226, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

.button:active {
    transform: translateY(-1px);
}

.btn-first {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.7) 0%, rgba(75, 0, 130, 0.7) 100%);
}

.btn-restart {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.7) 0%, rgba(75, 0, 130, 0.7) 100%);
}

.players {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.player-box {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(138, 43, 226, 0.3);
    transition: all 0.3s;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.player-box.active {
    border: 3px solid;
    transform: scale(1.02);
    box-shadow: 
        0 0 30px rgba(138, 43, 226, 0.6),
        inset 0 0 30px rgba(138, 43, 226, 0.2);
}

.player-box.player.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

.player-box.computer.active {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

.player-box h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.player-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.number-chip {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1em;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.number-chip.player {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
}

.number-chip.computer {
    background: linear-gradient(135deg, #f44336, #e57373);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.6);
}

.number-chip.losing {
    background: linear-gradient(135deg, #d32f2f, #c62828);
    animation: pulse 0.5s;
    box-shadow: 0 0 25px rgba(211, 47, 47, 0.9);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.vs {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #b19cd9;
    text-shadow: 0 0 10px rgba(177, 156, 217, 0.5);
}

.board {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(138, 43, 226, 0.4);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 30px rgba(138, 43, 226, 0.2);
}

.board-title {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.turn-info {
    text-align: center;
    font-size: 1.1em;
    color: #d1c4e9;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    font-weight: bold;
}

.number-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.number-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.number-row .number-btn {
    flex: 0 0 70px;
}

.number-btn {
    width: 70px;
    height: 70px;
    font-size: 1.8em;
    font-weight: bold;
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.4) 0%, rgba(75, 0, 130, 0.4) 100%);
    color: #ffd700;
    box-shadow: 
        0 4px 15px rgba(138, 43, 226, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Georgia', serif;
}

.number-btn:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.7) 0%, rgba(75, 0, 130, 0.7) 100%);
    color: white;
    transform: scale(1.1) translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(138, 43, 226, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.7);
}

.number-btn:disabled {
    background: rgba(0, 0, 0, 0.5);
    color: #555;
    border-color: rgba(138, 43, 226, 0.2);
    cursor: not-allowed;
    box-shadow: none;
}

.result-box {
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    border: 3px solid;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.result-box.win {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(102, 187, 106, 0.3) 100%);
    border-color: #4caf50;
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.6);
}

.result-box.lose {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.3) 0%, rgba(229, 115, 115, 0.3) 100%);
    border-color: #f44336;
    box-shadow: 0 0 40px rgba(244, 67, 54, 0.6);
}

.result-box.draw {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 235, 59, 0.3) 100%);
    border-color: #ffc107;
    box-shadow: 0 0 40px rgba(255, 193, 7, 0.6);
}

.result-box.gameclear {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.5) 0%, rgba(255, 235, 59, 0.5) 100%);
    border: 4px solid #ffd700;
    animation: celebrate 1s ease-in-out;
    box-shadow: 
        0 0 60px rgba(255, 215, 0, 0.8),
        inset 0 0 60px rgba(255, 215, 0, 0.3);
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(2deg); }
    75% { transform: scale(1.05) rotate(-2deg); }
}

.result-box h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.result-box p {
    font-size: 1.1em;
    color: #d1c4e9;
    font-weight: bold;
}

.final-numbers {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(138, 43, 226, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.final-numbers div {
    flex: 1;
}

.final-numbers p {
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.final-numbers span {
    color: #b19cd9;
    font-size: 1em;
}

.final-numbers div:last-child {
    text-align: right;
}
