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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.landing {
    text-align: center;
}

h1 {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 10px;
}

.tagline {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.game-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

.game-info h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.game-info ul {
    list-style: none;
    padding-left: 0;
}

.game-info li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.game-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.auth-section {
    margin-top: 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.signup-bonus {
    margin-top: 15px;
    color: #48bb78;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.user-info {
    margin-top: 20px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 10px;
}

.user-info p {
    margin: 10px 0;
    font-size: 1.1em;
}

.game-menu {
    text-align: center;
}

.board-size-selector {
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.board-size-selector label {
    font-weight: 600;
    margin-right: 10px;
}

.board-size-selector select {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #667eea;
    font-size: 1em;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.menu-buttons .btn {
    width: 100%;
}

.room-code {
    background: #fff3cd;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.room-code strong {
    font-size: 2em;
    color: #667eea;
    letter-spacing: 3px;
}

.room-info {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

.join-room {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.join-room input {
    width: 100%;
    padding: 15px;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1.1em;
    text-align: center;
    text-transform: uppercase;
    margin: 15px 0;
}

/* Game Page Styles */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 20px;
}

.user-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.points-badge {
    background: #48bb78;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.room-info {
    font-size: 1.1em;
}

.waiting-room, .game-active {
    text-align: center;
    padding: 30px;
    background: #f0f7ff;
    border-radius: 10px;
    margin-bottom: 20px;
}

#playersList {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.turn-indicator {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

.dice-area {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 15px;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.dice {
    width: 80px;
    height: 80px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dice-total {
    font-size: 1.5em;
    font-weight: 600;
    margin: 15px 0;
    color: #333;
}

.game-boards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.board-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.number-tile {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #667eea;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.number-tile:hover:not(.marked):not(.disabled) {
    background: #e0e7ff;
    transform: scale(1.05);
}

.number-tile.marked {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
    cursor: not-allowed;
}

.number-tile.selected {
    background: #fbbf24;
    border-color: #f59e0b;
    transform: scale(1.05);
}

.number-tile.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.opponents-section {
    grid-column: 1 / -1;
}

#opponentsBoards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.opponent-board {
    padding: 15px;
    background: #f9fafb;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
}

.opponent-board h4 {
    margin-bottom: 10px;
    color: #666;
}

.game-log {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.game-log h4 {
    margin-bottom: 15px;
    color: #667eea;
}

.log-entry {
    padding: 8px;
    background: white;
    border-radius: 5px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.points-change {
    font-size: 2em;
    font-weight: bold;
    margin: 20px 0;
}

.points-change.positive {
    color: #48bb78;
}

.points-change.negative {
    color: #f56565;
}

@media (max-width: 768px) {
    .game-boards {
        grid-template-columns: 1fr;
    }
    
    .game-board {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }
    
    .number-tile {
        font-size: 1.2em;
    }
    
    .dice {
        width: 60px;
        height: 60px;
        font-size: 2em;
    }
}