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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 0;
    color: #fff;
    margin: 0;
}

/* Navigation */
.navigation {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-brand h1 {
    color: #fff;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin: 0;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background: rgba(26, 26, 46, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

h1 {
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin: 0;
    font-weight: 700;
}

h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.3rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Setup Section */
.setup-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Game Mode Selection */
.game-mode-selection {
    margin-bottom: 30px;
    text-align: left;
}

.game-mode-selection h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option input[type="radio"]:checked + label {
    color: #ff6b6b;
}

.mode-option input[type="radio"]:checked + label .mode-title {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.mode-option label {
    display: block;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
}

.mode-title {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.mode-description {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* Game Options */
.game-options {
    margin-bottom: 25px;
    text-align: left;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff6b6b;
}

.option-group label {
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.player-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.input-group input {
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    width: 250px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

/* Game Section */
.game-section {
    margin-bottom: 40px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.current-player {
    text-align: left;
}

.game-status {
    text-align: right;
}

.game-status p {
    margin: 5px 0;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    aspect-ratio: 1;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card-front {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    transform: rotateY(0deg);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.card-back {
    background: white;
    color: #333;
    transform: rotateY(180deg);
    border: 3px solid;
}

.card-back.miss {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background-image: url('crying.png');
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
}

.card-back.drink {
    border-color: #333;
    color: #333;
    background-image: url('drink.png');
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
}

.card:hover .card-front {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.card.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.card.disabled:hover .card-front {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-label {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.8rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Game Controls */
.game-controls {
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Score Section */
.score-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.score-board {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.player-score {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-score h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.player-score p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
    padding-top: 50px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.modal-content p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.6;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.shot-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .card-front, .card-back {
        font-size: 1.5rem;
    }
    
    .score-board {
        flex-direction: row;
        gap: 10px;
    }
    
    .player-score {
        padding: 12px;
    }
    
    .player-score h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .player-score p {
        font-size: 0.9rem;
    }
    
    .score-section {
        padding: 15px;
    }
    
    .score-section h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    
    .shot-buttons {
        flex-direction: column;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-options {
        gap: 10px;
    }
    
    .mode-option {
        padding: 12px;
    }
    
    .mode-title {
        font-size: 1.1rem;
    }
    
    .mode-description {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .card-front, .card-back {
        font-size: 1.2rem;
    }
    
    .input-group input {
        width: 200px;
    }
    
    .score-board {
        gap: 8px;
    }
    
    .player-score {
        padding: 8px;
    }
    
    .player-score h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .player-score p {
        font-size: 0.8rem;
    }
    
    .score-section {
        padding: 12px;
    }
    
    .score-section h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
}

/* Tic Tac Toe Styles */
.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    max-width: 400px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.board-row {
    display: contents;
}

.cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.cell:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.cell.occupied {
    cursor: not-allowed;
}

.cell.occupied:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

.cell.winning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Tic Tac Toe */
@media (max-width: 768px) {
    .tic-tac-toe-board {
        max-width: 300px;
        gap: 3px;
        padding: 8px;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    .nav-brand h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tic-tac-toe-board {
        max-width: 250px;
        gap: 2px;
        padding: 5px;
    }
    
    .cell {
        font-size: 2rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}
