/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background-color: #1a1a1a;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.05) 35px, rgba(255,255,255,.05) 70px),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0 0h100v100H0z" fill="%23222"/><path d="M0 50h50v50H0zM50 0h50v50H50z" fill="%23333" opacity="0.3"/></svg>');
    color: #333;
    min-height: 100vh;
}

/* Pirate Header */
.pirate-header {
    background: linear-gradient(135deg, #8B4513 0%, #654321 50%, #8B4513 100%);
    border-bottom: 8px solid #2c1810;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    padding: 1.5rem 1rem;
    position: relative;
    overflow: hidden;
}

.pirate-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.1) 10px,
        rgba(0,0,0,0.1) 20px
    );
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.header-content {
    position: relative;
    text-align: center;
}

/* Language selector styles */
.language-selector {
    background: rgba(212, 175, 55, 0.9);
    color: #2c1810;
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    outline: none;
}

.language-selector:hover {
    background: rgba(244, 228, 193, 0.95);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.language-selector:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.5);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header-content {
        padding-right: 4rem; /* Make room for install button */
    }
}

.pirate-header h1 {
    font-size: 2.5rem;
    color: #f4e4c1;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.7);
    margin-bottom: 0.5rem;
}

.tagline {
    font-style: italic;
    color: #d4af37;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Container */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Desktop optimizations */
@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
    }
    
    .score-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .player-score {
        padding: 1.5rem;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .round-inputs {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .round-input-row {
        gap: 1rem;
    }
}

/* Parchment Style */
.parchment {
    background: #f4e4c1;
    border: 2px solid #8B4513;
    border-radius: 5px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    position: relative;
}


/* Typography */
h2 {
    color: #654321;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

h3 {
    color: #8B4513;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Forms and Inputs */
label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #654321;
}

input[type="number"],
input[type="text"] {
    padding: 0.4rem;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    font-size: 0.9rem;
    background: rgba(255, 248, 220, 0.7);
    width: 100%;
    margin-bottom: 1rem;
    color: #000;
}

input[type="number"]::placeholder,
input[type="text"]::placeholder {
    color: #999;
    opacity: 1;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 3px rgba(212, 175, 55, 0.2);
    background: rgba(255, 248, 220, 0.9);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #8B4513;
    color: #f4e4c1;
    box-shadow: 0 3px 0 #654321;
}

.btn-primary:hover {
    background: #654321;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #4a3018;
}

.btn-secondary {
    background: #708090;
    color: white;
    box-shadow: 0 3px 0 #4a5568;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #2d3748;
}

.btn-danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 3px 0 #a02833;
}

.btn-danger:hover {
    background: #a02833;
    transform: translateY(-2px);
}

/* Player Setup */
.player-setup {
    text-align: center;
}

.player-setup label {
    margin-right: 1rem;
}

.player-setup input[type="number"] {
    width: 80px;
    display: inline-block;
    margin-right: 1rem;
}

/* Player Names */
.player-name-input {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.player-name-input input {
    flex: 1;
    margin-bottom: 0; /* Remove default margin when inside player-name-input */
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-left: 1rem;
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-remove:hover {
    color: #a02833;
    transform: scale(1.1);
}

/* Reorder controls */
.reorder-controls {
    display: flex;
    flex-direction: row;
    gap: 0.2rem;
    margin-right: 0.5rem;
}

.btn-reorder {
    background: #8B4513;
    color: #f4e4c1;
    border: 1px solid #654321;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    min-width: 24px;
}

.btn-reorder:hover:not(:disabled) {
    background: #654321;
    transform: scale(1.1);
}

.btn-reorder:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-reorder:disabled:hover {
    background: #8B4513;
    transform: none;
}

/* Smooth reordering animation - removed to prevent flash */


/* Close button for panels */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #2c1810;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(44, 24, 16, 0.1);
    transform: scale(1.1);
}

/* All player buttons container */
.all-player-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

/* Make the primary button more prominent */
.all-player-buttons .btn-primary {
    font-weight: bold;
    font-size: 1.1rem;
    flex: 1 1 150px;
    min-width: 150px;
    max-width: 200px;
}

.all-player-buttons .btn-secondary {
    flex: 1 1 150px;
    min-width: 150px;
    max-width: 200px;
}

@media (max-width: 480px) {
    .all-player-buttons {
        gap: 0.5rem;
    }
    
    .all-player-buttons .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .all-player-buttons .btn-primary {
        font-size: 1rem;
    }
}

/* Scoring Mode Selection */
.scoring-mode-section {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.scoring-mode-section h3 {
    font-size: 1.3rem;
    color: #2c1810;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(212, 175, 55, 0.3);
}

.scoring-mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scoring-mode-option {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    background: rgba(244, 228, 193, 0.9);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scoring-mode-option:hover {
    background: rgba(244, 228, 193, 0.95);
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.scoring-mode-option input[type="radio"] {
    margin-right: 0.75rem;
    margin-top: 0.2rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.scoring-mode-option input[type="radio"]:checked + .scoring-mode-content {
    font-weight: bold;
}

.scoring-mode-option:has(input[type="radio"]:checked) {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.scoring-mode-content {
    flex: 1;
}

.scoring-mode-content strong {
    display: block;
    font-size: 1.1rem;
    color: #2c1810;
    margin-bottom: 0.25rem;
}

.scoring-mode-content p {
    font-size: 0.9rem;
    color: #4a4a4a;
    margin: 0;
    line-height: 1.4;
}

/* Global Actions */
.global-actions {
    text-align: center;
    margin-bottom: 0;
}

.new-game-section {
    margin-bottom: 1rem;
}

.new-game-section .parchment {
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Score Display */
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.speed-link {
    color: #f4e4c1;
    text-decoration: underline;
    font-weight: normal;
    transition: color 0.2s;
}

.speed-link:hover {
    color: #fff;
    text-decoration: underline;
}

.speed-link:active {
    color: #d4c4a1;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Pirate Commentary */
.pirate-commentary {
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #2c1810 0%, #3d2418 50%, #2c1810 100%);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.pirate-commentary::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #d4af37, #f4e871, #d4af37, #f4e871);
    border-radius: 8px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.commentary-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.commentary-icon {
    font-size: 1.5rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.commentary-text {
    color: #f4e871;
    font-style: italic;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    line-height: 1.4;
    flex: 1;
}


.player-score {
    background: rgba(139, 69, 19, 0.1);
    border: 2px solid #8B4513;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
}

.player-score h4 {
    color: #654321;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #8B4513;
}

/* Round Inputs */
.round-inputs {
    display: grid;
    gap: 1.5rem;
}

/* Expansion Cards */
.expansion-indicators {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.expansion-checkbox {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: #8B4513;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.expansion-checkbox input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
    cursor: pointer;
    accent-color: #8B4513;
}

.expansion-checkbox span {
    user-select: none;
}

.round-expansion-icons {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.9em;
}

.record-round-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}


.player-round-input {
    background: rgba(139, 69, 19, 0.05);
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 1rem;
}

.player-round-input h4 {
    color: #654321;
    margin-bottom: 0.5rem;
}

.round-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.round-input-row input {
    margin-bottom: 0;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    text-align: center;
    color: #8B4513;
}

/* Computed Score Display */
.computed-score {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    padding: 0.5rem;
    background: rgba(139, 69, 19, 0.1);
    border: 2px solid #d4af37;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    color: #8B4513;
    min-width: 0;
    width: 100%;
}

.computed-score.positive {
    color: #228B22;
    background: rgba(34, 139, 34, 0.1);
    border: 2px solid #228B22;
    font-weight: bold;
}

.computed-score.negative {
    color: #DC143C;
    background: rgba(220, 20, 60, 0.1);
    border: 2px solid #DC143C;
    font-weight: bold;
}

.computed-score.zero {
    color: #708090;
    background: rgba(112, 128, 144, 0.1);
    border: 2px solid #708090;
    font-weight: bold;
}

.computed-score.invalid {
    color: #999;
    background: rgba(153, 153, 153, 0.05);
    border: 1px dashed rgba(153, 153, 153, 0.4);
    font-weight: normal;
}

/* Previous Rounds */
.round-display {
    margin-bottom: 1.5rem;
}

.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.round-data {
    display: grid;
    gap: 0.25rem;
}

.round-data-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: rgba(139, 69, 19, 0.15);
    border-radius: 4px;
    font-weight: bold;
    color: #8B4513;
    font-size: 0.9rem;
}

.player-round-data {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.5rem;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 4px;
    font-size: 0.9rem;
}

.player-round-data strong {
    color: #654321;
}

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

.modal-content {
    max-width: 500px;
    width: 90%;
    padding: 2rem;
}

.modal-content p {
    white-space: pre-line;
}

.modal-buttons {
    text-align: center;
    margin-top: 1.5rem;
}

.modal-options {
    margin-top: 1rem;
}

.modal-options button {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: left;
    padding: 1rem;
}

.new-game-options {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.new-game-options button {
    width: 100%;
    margin: 0;
}

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

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .pirate-header h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.85rem;
    }
    
    .container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .parchment {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .parchment::before,
    .parchment::after {
        width: 30px;
        height: 30px;
    }
    
    .parchment::before {
        top: -15px;
        left: -15px;
    }
    
    .parchment::after {
        bottom: -15px;
        right: -15px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .round-input-row {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 0.25rem;
    }
    
    .round-input-row input {
        margin-bottom: 0;
        padding: 0.5rem;
        font-size: 16px;
        width: 100%;
        max-width: 60px;
        text-align: center;
        height: 2.5rem;
    }
    
    .bonus-button {
        padding: 0.5rem;
        font-size: 16px;
        max-width: 60px;
        height: 2.5rem;
    }
    
    .input-label {
        font-size: 0.75rem;
        margin-bottom: 0.15rem;
    }
    
    .input-group {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .computed-score {
        padding: 0.5rem;
        font-size: 16px;
        max-width: 60px;
        height: 2.5rem;
    }
    
    .player-round-input {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .round-data-header {
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .player-round-data {
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
        text-align: center;
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .player-round-data strong {
        text-align: left;
        font-size: 0.85rem;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        padding: 0.75rem 1rem;
    }
    
    .btn-small {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        width: auto;
        margin: 0;
    }
    
    .score-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .score-header h2 {
        margin-bottom: 0.5rem;
    }

    .score-header .btn {
        width: 100%;
        margin: 0;
    }

    .score-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .player-score {
        padding: 0.75rem;
    }
    
    .player-score h4 {
        font-size: 0.9rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .round-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .round-header .btn {
        width: 100%;
        margin: 0;
    }
    
    .player-name-input {
        flex-wrap: nowrap;
        gap: 0.25rem;
    }
    
    .player-name-input input {
        flex: 1;
        margin-bottom: 0;
    }
    
    .btn-remove {
        font-size: 1.25rem;
        padding: 0.25rem;
    }
    
    .drag-handle {
        font-size: 1rem;
        padding: 0.25rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    input[type="number"],
    input[type="text"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
}

/* SEO Content Styling */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    color: #654321;
    line-height: 1.4;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list strong {
    color: #8B4513;
}

.seo-content {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #d4af37;
}

.seo-content h4 {
    color: #654321;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.seo-content p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Mobile adjustments for SEO content */
@media (max-width: 600px) {
    .feature-list li {
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }
    
    .seo-content {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .seo-content h4 {
        font-size: 1rem;
    }
    
    .seo-content p {
        font-size: 0.85rem;
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
}

.faq-section h2 {
    color: #8B4513;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.faq-item {
    margin-bottom: 2rem;
}

.faq-item h3 {
    color: #654321;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.faq-item p {
    color: #2c1810;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Hide landing-only content during gameplay */
.landing-only {
    display: block;
}

body.game-active .landing-only {
    display: none;
}

/* Game Info Section */
.game-info {
    margin-top: 2rem;
}

.game-info h2 {
    color: #8B4513;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.game-info h3 {
    color: #654321;
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.game-info p {
    color: #2c1810;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Footer Disclaimer */
.disclaimer-footer {
    background: #2c1810;
    border-top: 3px solid #d4af37;
    margin-top: 3rem;
    padding: 2rem 0;
    color: #f4e4c1;
}

.language-selector-container {
    margin-top: 1.5rem;
    text-align: center;
}

.disclaimer-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
    font-style: italic;
    opacity: 0.8;
}

.disclaimer-content strong {
    color: #d4af37;
}

.feedback-link {
    color: #d4af37;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.feedback-link:hover {
    color: #f4e871;
}

/* Mobile adjustments for footer */
@media (max-width: 600px) {
    .disclaimer-footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    .disclaimer-content p {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
}

/* Winner Announcement */
.winner-announcement {
    margin-bottom: 2rem;
    text-align: center;
    animation: celebration 2s ease-in-out infinite alternate;
}

.winner-header h2 {
    color: #8B4513;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.winner-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #654321;
    line-height: 1.6;
    padding: 1rem;
    background: linear-gradient(135deg, #f4e4c1 0%, #e6d7b8 100%);
    border: 3px solid #d4af37;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

@keyframes celebration {
    0% { transform: scale(1); }
    100% { transform: scale(1.02); }
}

/* Mobile adjustments for winner announcement */
@media (max-width: 600px) {
    .winner-header h2 {
        font-size: 1.5rem;
    }
    
    .winner-text {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* Install App Button in Header - Mobile Only */
.install-app-btn-header {
    display: none; /* Hidden by default on desktop */
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(212, 175, 55, 0.9);
    color: #2c1810;
    border: 2px solid rgba(44, 24, 16, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 100;
    font-family: 'Georgia', serif;
}

.install-app-btn-header:hover {
    background: rgba(244, 228, 193, 0.95);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.install-app-btn-header:active {
    transform: scale(0.95);
}

/* Show install button only on mobile */
@media (max-width: 768px) {
    .install-app-btn-header {
        display: block;
    }
}

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

.install-modal-content {
    background: linear-gradient(135deg, #f4e4c1 0%, #e6d7b8 100%);
    border: 3px solid #8B4513;
    border-radius: 15px;
    padding: 2rem;
    max-width: 400px;
    margin: 1rem;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.install-modal-content h3 {
    color: #2c1810;
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Georgia', serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.install-instructions {
    color: #2c1810;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.install-instructions p {
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.install-instructions ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.install-instructions li {
    margin-bottom: 0.5rem;
}

.install-modal-close {
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
    color: #f4e4c1;
    border: 2px solid #2c1810;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.install-modal-close:hover {
    background: linear-gradient(135deg, #654321 0%, #8B4513 100%);
    transform: scale(1.05);
}

/* Mobile styles for scoring mode */
@media (max-width: 600px) {
    .scoring-mode-section {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        padding: 0.75rem;
    }
    
    .scoring-mode-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .scoring-mode-options {
        gap: 0.5rem;
    }
    
    .scoring-mode-option {
        padding: 0.5rem;
    }
    
    .scoring-mode-option input[type="radio"] {
        width: 18px;
        height: 18px;
        margin-right: 0.5rem;
    }
    
    .scoring-mode-content strong {
        font-size: 1rem;
    }
    
    .scoring-mode-content p {
        font-size: 0.85rem;
    }
}

/* Bonus Calculator Modal */
.modal-overlay {
    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;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bonus-modal {
    background: #f4e4c1;
    border: 2px solid #8B4513;
    border-radius: 5px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .bonus-modal {
    transform: scale(1);
}

.bonus-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(139, 69, 19, 0.1);
    border-bottom: 1px solid #d4af37;
}

.bonus-modal-header h3 {
    color: #654321;
    font-size: 1.5rem;
    margin: 0;
}

.bonus-modal .close-button {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #2c1810;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.bonus-modal .close-button:hover {
    background: rgba(44, 24, 16, 0.1);
    transform: scale(1.1);
}

.bonus-modal-content {
    padding: 1.5rem;
}

.bonus-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(139, 69, 19, 0.05);
    border: 1px solid #d4af37;
    border-radius: 4px;
}

.bonus-category h4 {
    color: #654321;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

.bonus-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 248, 220, 0.7);
    border-radius: 4px;
}

.bonus-item:last-child {
    margin-bottom: 0;
}

.bonus-item-label {
    color: #654321;
    font-weight: bold;
    flex: 1;
    font-size: 0.9rem;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bonus-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.counter-btn {
    background: #8B4513;
    color: #f4e4c1;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-btn:hover:not(:disabled) {
    background: #654321;
    transform: scale(1.1);
}

.counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.counter-value {
    font-size: 1rem;
    font-weight: bold;
    color: #2c1810;
    min-width: 30px;
    text-align: center;
}

.bonus-points {
    color: #8B4513;
    font-weight: bold;
    min-width: 60px;
    text-align: right;
    font-size: 0.9rem;
}

.bonus-total {
    margin: 0;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(139, 69, 19, 0.1);
    border: 2px solid #8B4513;
    border-radius: 4px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bonus-total-label {
    font-size: 1.1rem;
    color: #654321;
    font-weight: bold;
}

.bonus-total-value {
    font-size: 1.5rem;
    color: #8B4513;
    font-weight: bold;
    margin-left: 0.5rem;
}

.bonus-modal-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(139, 69, 19, 0.05);
    border-top: 1px solid #d4af37;
}

.bonus-modal-footer .btn {
    min-width: 100px;
}

/* Bonus button styles */
.bonus-button {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    background: rgba(255, 248, 220, 0.7);
    font-size: 0.85rem;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    /* Match the computed score height */
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.bonus-button:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: #8B4513;
}

.bonus-button:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 3px rgba(212, 175, 55, 0.2);
    background: rgba(255, 248, 220, 0.9);
}

.bonus-icon {
    display: none;
}

.bonus-text {
    display: none;
}

.bonus-value {
    font-weight: normal;
    color: #000;
    text-align: center;
    display: block;
    font-size: 0.85rem;
}

.bonus-value.no-bonus {
    color: #999;
    opacity: 1;
}

/* Mobile adjustments for bonus value text */
@media (max-width: 600px) {
    .bonus-value {
        font-size: 16px;
    }
}

/* Mobile adjustments for bonus modal */
@media (max-width: 600px) {
    .bonus-modal {
        padding: 0;
        max-width: 100%;
    }
    
    .bonus-modal-content {
        padding: 0.5rem;
    }
    
    .bonus-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .bonus-modal-header {
        padding: 0.75rem;
    }
    
    .bonus-category {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .bonus-category h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .bonus-item {
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .bonus-item-label {
        font-size: 0.85rem;
    }
    
    .counter-btn {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }
    
    .counter-value {
        font-size: 0.9rem;
        min-width: 24px;
    }
    
    .bonus-points {
        font-size: 0.85rem;
        min-width: 45px;
    }
    
    .bonus-total {
        padding: 0.75rem;
        margin-top: 1rem;
    }
    
    .bonus-total-label {
        font-size: 1rem;
    }
    
    .bonus-total-value {
        font-size: 1.25rem;
    }
    
    .bonus-modal-footer {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .bonus-modal-footer .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        min-width: 70px;
    }
}