* {
    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;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: 500px;
}

.hidden {
    display: none;
}

h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

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

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
}

#new-game-btn {
    display: block;
    margin: 0 auto 40px;
    font-size: 18px;
    padding: 15px 30px;
}

#game-history {
    margin-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    margin-bottom: 0;
}

.btn.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.auto-save-indicator {
    color: #48bb78;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
}

.game-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.game-content {
    flex: 1;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-game-btn {
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-left: 10px;
    flex-shrink: 0;
}

.delete-game-btn:hover {
    background: #feb2b2;
    transform: scale(1.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.player-setup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.player-setup input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.player-setup input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.scoreboard {
    margin-bottom: 20px;
}

#score-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#score-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* Runde header - ikke klikkbar */
.round-header {
    cursor: default !important;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    text-align: center !important;
}

.round-header:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
    transform: none !important;
}

.round-header:hover::after {
    display: none !important;
}

#score-table th:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}

#score-table th:hover::after {
    content: "🏆 Klikk for å velge vinner";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Hover tekst når ingen dealer er satt */
#score-table th:not(.dealer):not(.winner):hover::after {
    content: "🃏 Klikk for å velge dealer";
}

/* Dealer indikator */
#score-table th.dealer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

#score-table th.dealer::before {
    content: "🃏";
    margin-right: 8px;
}

/* Winner indikator */
#score-table th.winner {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    position: relative;
}

#score-table th.winner::before {
    content: "🏆";
    margin-right: 8px;
}

/* Hover tekst for dealer */
#score-table th.dealer:hover::after {
    content: "🃏 Dealer satt - Klikk for å velge vinner";
}

/* Hover tekst for winner */
#score-table th.winner:hover::after {
    content: "🏆 Vinner valgt";
}

#score-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
}

/* Runde nummer styling */
.round-number {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    text-align: left !important;
    padding-left: 15px !important;
}

/* Dealer per runde styling */
.round-dealer {
    color: #667eea;
    font-weight: 500;
    font-size: 14px;
    margin-left: 8px;
}

/* Total label styling */
.total-label {
    background: #f7fafc;
    font-weight: bold;
    color: #2d3748;
    text-align: left !important;
    padding-left: 15px !important;
}

.total-row td {
    background: #f7fafc;
    font-weight: bold;
    font-size: 20px;
    color: #2d3748;
}

.score-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
}

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

#add-round-btn {
    display: block;
    margin: 20px auto 0;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-players {
    font-weight: 600;
    color: #4a5568;
}

.game-date {
    color: #718096;
    font-size: 14px;
}

.game-scores {
    font-size: 18px;
    font-weight: bold;
    color: #2d3748;
}

/* Låst spill styling */
.game-locked {
    position: relative;
}

.game-locked::before {
    content: "🔒 Spillet er låst";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fed7d7;
    color: #e53e3e;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
}

.lock-icon {
    font-size: 16px;
    margin-left: 5px;
}

/* Deaktiverte elementer */
.btn:disabled,
input:disabled {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

input:disabled {
    background-color: #f7fafc !important;
    color: #a0aec0 !important;
}

/* Låst spill indikator i spilloversikt */
.game-item.locked {
    background: #fef5e7;
    border-color: #f6e05e;
}

.game-item.locked .game-content {
    cursor: default;
}

.game-item.locked:hover {
    background: #fef5e7;
    transform: none;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .screen {
        padding: 20px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .player-setup {
        grid-template-columns: 1fr;
    }
}

