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

body {
    font-family: 'Comic Sans MS', 'Trebuchet MS', 'Arial Black', sans-serif;
    background: 
        linear-gradient(rgba(76, 175, 80, 0.7), rgba(139, 195, 74, 0.7)),
        url('pickleballdads_background.png') center/cover no-repeat fixed;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    background: rgba(46, 125, 50, 0.9);
    padding: 20px;
    border-radius: 20px;
    border: 3px solid #ffeb3b;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    position: relative;
}

header::before {
    content: "🥒";
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 2rem;
}

header::after {
    content: "🥒";
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    color: #ffeb3b;
    font-weight: bold;
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 600;
}

.card {
    background: linear-gradient(145deg, #ffffff, #f0f4c3);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    border: 3px solid #4caf50;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "🥒";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    opacity: 0.6;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #4caf50;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff, #f1f8e9);
    font-family: inherit;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    transform: translateY(-1px);
}

.player-input {
    display: flex;
    gap: 10px;
}

.player-input input {
    flex: 1;
}

.player-input button {
    padding: 12px 20px;
    background: linear-gradient(45deg, #ff9800, #ffc107);
    color: white;
    border: 2px solid #f57c00;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.player-input button:hover {
    background: linear-gradient(45deg, #f57c00, #ffb300);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.players-list h3 {
    margin-bottom: 15px;
    color: #333;
}

.player-preview {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.player-preview h3 {
    color: #333;
    margin-bottom: 15px;
}

.player-preview p {
    margin-bottom: 10px;
    color: #666;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.player-tag {
    display: inline-block;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 15px;
    margin: 5px;
    position: relative;
    font-weight: 500;
}

.player-tag .remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.generate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #2e7d32;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: "🏓 ";
    font-size: 1.2em;
}

.generate-btn::after {
    content: " 🥒";
    font-size: 1.2em;
}

.generate-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #43a047, #7cb342);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.generate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

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

.action-buttons {
    display: flex;
    gap: 15px;
}

.back-btn, .print-btn {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.back-btn {
    background: #6c757d;
}

.back-btn:hover {
    background: #5a6268;
}

.print-btn {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    border-radius: 20px;
    border: 2px solid #2e7d32;
    font-weight: bold;
    transition: all 0.3s ease;
}

.print-btn::before {
    content: "🖨️ ";
}

.print-btn:hover {
    background: linear-gradient(45deg, #43a047, #5cb85c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.tournament-info {
    background: linear-gradient(145deg, #e8f5e8, #c8e6c9);
    border: 3px solid #4caf50;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    position: relative;
}

.tournament-info::before {
    content: "🏆🥒";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    background: white;
    padding: 0 10px;
}

.tournament-info p {
    margin: 5px 0;
    color: #155724;
    font-size: 16px;
}

.round-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.round-navigation button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.round-navigation button:hover:not(:disabled) {
    background: #5a6fd8;
}

.round-navigation button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.round-info {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.court {
    background: #e8f5e8;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.court h3 {
    color: #28a745;
    margin-bottom: 15px;
    text-align: center;
}

.match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.team {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #28a745;
    flex: 1;
    margin: 0 5px;
    text-align: center;
    font-weight: 600;
}

.vs {
    color: #28a745;
    font-weight: bold;
    font-size: 18px;
}

.sitting-out {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.sitting-out h3 {
    color: #856404;
    margin-bottom: 10px;
}

.sitting-player {
    display: inline-block;
    background: #ffc107;
    color: #856404;
    padding: 8px 15px;
    border-radius: 15px;
    margin: 5px;
    font-weight: 600;
}

/* Scorecard Styles */
.scorecard-container {
    background: white;
    padding: 30px;
    margin: 20px 0;
}

.scorecard-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #28a745;
    padding-bottom: 15px;
}

.scorecard-header h1 {
    color: #28a745;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.tournament-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.tournament-details p {
    margin: 2px 0;
    font-size: 14px;
    color: #333;
}

.round-schedule {
    margin-bottom: 25px;
}

.round-schedule h2 {
    color: #28a745;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.rounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.round-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
}

.round-header {
    font-weight: bold;
    color: #28a745;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid #28a745;
    padding-bottom: 4px;
}

.courts-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.court-match {
    background: white;
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 6px;
    font-size: 12px;
    text-align: center;
}

.court-title {
    font-weight: bold;
    color: #28a745;
    font-size: 11px;
    margin-bottom: 2px;
}

.match-teams {
    font-size: 11px;
    line-height: 1.2;
}

.sitting-out-text {
    color: #856404;
    font-style: italic;
    font-size: 11px;
    text-align: center;
    background: #fff3cd;
    padding: 4px;
    border-radius: 3px;
}

.score-table-container {
    margin-bottom: 25px;
}

.score-table-container h2 {
    color: #28a745;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #28a745;
    margin-bottom: 15px;
    font-size: 13px;
}

.score-table th,
.score-table td {
    border: 1px solid #28a745;
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.2;
}

.score-table th {
    background: #28a745;
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 8px;
}

.player-column {
    background: #e8f5e8 !important;
    color: #155724 !important;
    text-align: left !important;
    font-weight: bold;
    width: 120px;
    max-width: 120px;
    font-size: 12px;
    padding: 6px 10px !important;
}

.score-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.score-table tbody tr:nth-child(odd) {
    background: white;
}

.score-cell {
    height: 32px;
    width: 50px;
    min-width: 50px;
}

.rest-cell {
    background: #fff3cd !important;
    color: #856404;
    font-style: italic;
    font-size: 10px;
}

.instructions {
    border-top: 1px solid #28a745;
    padding-top: 15px;
    font-size: 11px;
}

.instructions h3 {
    color: #28a745;
    margin-bottom: 10px;
    font-size: 13px;
}

.instructions ul {
    list-style-type: disc;
    margin-left: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.instructions li {
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Print-Only Scorecard */
.print-only-scorecard {
    display: none;
    background: white;
    padding: 20px;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.print-only-scorecard .print-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #28a745;
    padding-bottom: 10px;
}

.print-only-scorecard .print-header h1 {
    color: #28a745;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.print-only-scorecard .print-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 5px;
}

.print-only-scorecard .print-score-table-container {
    margin-bottom: 20px;
}

.print-only-scorecard .print-score-table-container h2 {
    color: #28a745;
    margin-bottom: 12px;
    text-align: center;
    font-size: 1.2rem;
}

.print-only-scorecard .print-score-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #28a745;
    margin-bottom: 15px;
    font-size: 12px;
}

.print-only-scorecard .print-score-table th,
.print-only-scorecard .print-score-table td {
    border: 1px solid #28a745;
    padding: 6px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.1;
}

.print-only-scorecard .print-score-table th {
    background: #28a745;
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.print-only-scorecard .print-player-column {
    background: #e8f5e8 !important;
    color: #155724 !important;
    text-align: left !important;
    font-weight: bold;
    width: 100px;
    font-size: 11px;
    padding: 6px 8px !important;
}

.print-only-scorecard .print-score-cell {
    height: 28px;
    width: 40px;
    min-width: 40px;
    font-size: 11px;
}

.print-only-scorecard .print-rest-cell {
    background: #fff3cd !important;
    color: #856404;
    font-style: italic;
    font-size: 9px;
}

.print-only-scorecard .print-round-schedule h2 {
    color: #28a745;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.1rem;
}

.print-only-scorecard .print-rounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.print-only-scorecard .print-round-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px;
}

.print-only-scorecard .print-round-header {
    font-weight: bold;
    color: #28a745;
    font-size: 11px;
    margin-bottom: 6px;
    text-align: center;
    border-bottom: 1px solid #28a745;
    padding-bottom: 2px;
}

.print-only-scorecard .print-court-match {
    background: white;
    border: 1px solid #28a745;
    border-radius: 3px;
    padding: 4px;
    font-size: 9px;
    text-align: center;
    margin-bottom: 3px;
}

.print-only-scorecard .print-court-title {
    font-weight: bold;
    color: #28a745;
    font-size: 8px;
    margin-bottom: 1px;
}

.print-only-scorecard .print-match-teams {
    font-size: 8px;
    line-height: 1.1;
}

.print-only-scorecard .print-sitting-out-text {
    color: #856404;
    font-style: italic;
    font-size: 8px;
    text-align: center;
    background: #fff3cd;
    padding: 3px;
    border-radius: 2px;
}

/* Print Styles */
@media print {
    @page {
        size: portrait;
        margin: 0.4in;
    }
    
    /* Force single page and prevent page breaks */
    html, body {
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Hide everything by default */
    body * {
        visibility: hidden;
    }
    
    /* Explicitly hide problematic elements */
    .setup-section,
    .tournament-section .no-print,
    .scorecard-container,
    .seo-footer,
    header,
    footer {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    .print-only-scorecard,
    .print-only-scorecard * {
        visibility: visible;
    }
    
    .seo-footer,
    .seo-footer * {
        display: none !important;
        visibility: hidden !important;
    }
    
    .print-only-scorecard {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        display: block !important;
        padding: 0;
        margin: 0;
        background: white !important;
        color: black !important;
        font-size: 10pt;
        line-height: 1.1;
        overflow: visible;
        box-sizing: border-box;
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    .print-only-scorecard .print-header {
        margin-bottom: 4pt;
        padding-bottom: 2pt;
    }
    
    .print-only-scorecard .print-header h1 {
        font-size: var(--header-size, 11pt);
        margin-bottom: 1pt;
    }
    
    .print-only-scorecard .print-details {
        font-size: var(--details-size, 7pt);
    }
    
    .print-only-scorecard .print-score-table-container {
        margin-bottom: 4pt;
        height: auto;
        overflow: visible;
        page-break-inside: avoid;
    }
    
    .print-only-scorecard .print-score-table-container h2 {
        font-size: var(--sectionTitle-size, 9pt);
        margin-bottom: 3pt;
    }
    
    .print-only-scorecard .print-score-table {
        font-size: var(--table-size, 8pt);
    }
    
    .print-only-scorecard .print-score-table th,
    .print-only-scorecard .print-score-table td {
        padding: 1pt 2pt;
        line-height: 1;
    }
    
    .print-only-scorecard .print-score-table th {
        font-size: var(--tableHeader-size, 7pt);
    }
    
    .print-only-scorecard .print-player-column {
        font-size: var(--playerColumn-size, 7pt);
        width: var(--player-width, 60pt);
        padding: 2pt 4pt !important;
    }
    
    .print-only-scorecard .print-score-cell {
        height: var(--cell-height, 15pt);
        width: var(--cell-width, 24pt);
        min-width: var(--cell-width, 24pt);
        font-size: var(--scoreCell-size, 8pt);
    }
    
    .print-only-scorecard .print-rest-cell {
        font-size: var(--restCell-size, 7pt);
    }
    
    .print-only-scorecard .print-round-schedule {
        height: auto;
        overflow: visible;
        margin-top: 0;
        padding-top: 0;
        page-break-inside: avoid;
    }
    
    .print-only-scorecard .print-round-schedule h2 {
        font-size: var(--sectionTitle-size, 8pt);
        margin-bottom: 2pt;
        margin-top: 0;
        padding-top: 0;
    }
    
    .print-only-scorecard .print-rounds-grid {
        grid-template-columns: repeat(auto-fit, minmax(85pt, 1fr));
        gap: 2pt;
    }
    
    .print-only-scorecard .print-round-item {
        padding: 3pt;
    }
    
    .print-only-scorecard .print-round-header {
        font-size: var(--roundHeader-size, 6pt);
        margin-bottom: 2pt;
        padding-bottom: 1pt;
    }
    
    .print-only-scorecard .print-court-match {
        padding: 1pt;
        font-size: var(--courtMatch-size, 5pt);
        margin-bottom: 1pt;
    }
    
    .print-only-scorecard .print-court-title {
        font-size: var(--courtTitle-size, 4pt);
    }
    
    .print-only-scorecard .print-match-teams {
        font-size: var(--matchTeams-size, 4pt);
        line-height: 1;
    }
    
    .print-only-scorecard .print-sitting-out-text {
        font-size: 4pt;
        padding: 1pt;
    }


}

/* SEO Footer */
.seo-footer {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-top: 3px solid #4caf50;
    margin-top: 40px;
    padding: 40px 0;
}

.seo-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.seo-content h2 {
    color: #2e7d32;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.seo-content > p {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.feature-item {
    background: white;
    border: 2px solid #4caf50;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.feature-item h3 {
    color: #2e7d32;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-item p {
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}

.keywords-section {
    background: #e8f5e8;
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.keywords-section p {
    margin: 0;
    color: #2e7d32;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .tournament-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .courts-row {
        flex-direction: column;
    }
    
    .score-table {
        font-size: 12px;
    }
    
    .score-table th,
    .score-table td {
        padding: 6px;
    }
    
    .score-cell {
        width: 40px;
        min-width: 40px;
    }
    
    .seo-footer {
        padding: 20px 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature-item {
        padding: 15px;
    }
} 