:root{--color-primary: #45ada8;--color-primary-dark: #3a9490;--color-primary-light: #6bc5c1;--color-accent: #fadd60;--color-accent-dark: #e8c94e;--color-bg: #f0f7e6;--color-bg-card: #ffffff;--color-text: #594f4f;--color-text-light: #8a8585;--color-text-inverse: #ffffff;--color-border: #d6e3e7;--color-highlight: #fff89c;--color-win: #4caf50;--color-loss: #e57373;--color-seed: #45ada8;--font-body: "Roboto", sans-serif;--font-display: "Open Sans", sans-serif;--radius: 6px;--shadow: 0 2px 8px rgba(0,0,0,.1);--shadow-lg: 0 4px 16px rgba(0,0,0,.15)}*,*:before,*:after{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;font-family:var(--font-body);font-size:14px;color:var(--color-text);background-color:var(--color-bg)}body{display:flex;flex-direction:column;min-height:100vh}#app{flex:1;display:flex;flex-direction:column;overflow-y:auto;padding-bottom:60px}.view{display:none;flex:1;overflow-y:auto}.view.active{display:flex;flex-direction:column}#start-screen{align-items:center;justify-content:center;background:linear-gradient(135deg,var(--color-primary) 0%,#2c7873 100%);color:var(--color-text-inverse);min-height:100vh}.start-container{text-align:center;padding:2rem}.start-hero{margin-bottom:3rem}.start-title{font-family:var(--font-display);font-size:3rem;font-weight:800;margin:0 0 .5rem;text-shadow:0 2px 4px rgba(0,0,0,.2)}.start-subtitle{font-size:1.2rem;opacity:.9;margin:0}.start-buttons{display:flex;flex-direction:column;gap:1rem;align-items:center}.btn{font-family:var(--font-body);font-size:.875rem;font-weight:500;border:none;border-radius:var(--radius);cursor:pointer;padding:.5rem 1.25rem;transition:background-color .15s,opacity .15s,transform .1s;text-transform:uppercase;letter-spacing:.5px}.btn:active{transform:scale(.97)}.btn:disabled{opacity:.4;cursor:not-allowed;transform:none}.btn-primary{background:var(--color-bg-card);color:var(--color-primary-dark)}.btn-primary:hover:not(:disabled){background:#eef5f5}.btn-secondary{background:transparent;color:var(--color-text-inverse);border:2px solid rgba(255,255,255,.6)}.btn-secondary:hover:not(:disabled){border-color:#fff;background:#ffffff1a}.btn-large{padding:.9rem 2.5rem;font-size:1rem;min-width:300px}.btn-small{padding:.3rem .75rem;font-size:.75rem}.btn-accent{background:var(--color-primary);color:var(--color-text-inverse)}.btn-accent:hover:not(:disabled){background:var(--color-primary-dark)}.btn-footer{background:#333;color:#eee;font-size:.72rem;padding:.35rem .7rem;letter-spacing:.3px}.btn-footer:hover:not(:disabled){background:#444}.btn-footer.btn-accent{background:var(--color-primary);color:#fff}.btn-footer.btn-accent:hover:not(:disabled){background:var(--color-primary-dark)}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem;gap:1rem}.spinner{width:40px;height:40px;border:4px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.top-bar{position:sticky;top:0;z-index:50;display:flex;align-items:center;justify-content:space-between;padding:.75rem 1.25rem;background:var(--color-primary);color:var(--color-text-inverse);min-height:52px;gap:1rem}.top-bar-left,.top-bar-right{display:flex;align-items:center;gap:.75rem;white-space:nowrap}.tournament-title{font-family:var(--font-display);font-size:1.15rem;font-weight:700;margin:0;text-align:center;flex:1}.season-label,.week-label{font-size:.8rem;opacity:.9;background:#00000026;padding:.2rem .6rem;border-radius:3px}.season-label.editable-year{cursor:pointer;border-bottom:1px dashed rgba(255,255,255,.5)}.tour-badge{font-size:.75rem;font-weight:700;background:var(--color-accent);color:#333;padding:.2rem .6rem;border-radius:3px}.defending-champ{display:flex;align-items:center;gap:1rem;padding:.5rem 1.25rem;background:var(--color-bg-card);border-bottom:1px solid var(--color-border);font-size:.85rem}.history-banner{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.5rem 1.25rem;background:#fff3cd;border-bottom:1px solid #ffc107;font-size:.85rem;color:#664d03}.history-banner a{color:var(--color-primary);font-weight:600;text-decoration:underline}.draw-container{flex:1;padding:1rem;overflow-x:auto;overflow-y:auto}.bracket-view-toggle{padding:.3rem .5rem;font-size:.75rem}.bracket-view-toggle a{color:var(--color-primary);text-decoration:none;cursor:pointer;font-weight:600}.bracket-view-toggle a:hover{text-decoration:underline}.bracket{display:flex;gap:0;min-width:max-content}.round{display:flex;flex-direction:column;justify-content:space-around;min-width:180px;gap:0}.round-header{text-align:center;font-size:.7rem;font-weight:700;text-transform:uppercase;color:var(--color-text-light);padding:.4rem 0;letter-spacing:1px}.match-slot{display:flex;flex-direction:column;margin:2px 0;flex:1;justify-content:center}.match-player{display:flex;align-items:center;padding:3px 8px;font-size:.78rem;min-height:24px;gap:6px;background:var(--color-bg-card);border:1px solid var(--color-border);position:relative}.match-player:first-child{border-bottom:none;border-radius:var(--radius) var(--radius) 0 0}.match-player:last-child{border-radius:0 0 var(--radius) var(--radius)}.match-player.winner{font-weight:700}.match-player.loser{color:var(--color-text-light)}.match-player.followed{background:var(--color-highlight)}.match-player.bye{color:var(--color-text-light);font-style:italic}.player-rank-label{font-size:.62rem;color:var(--color-text-light);min-width:22px;text-align:right;flex-shrink:0}.player-seed{font-size:.65rem;color:var(--color-seed);font-weight:700;min-width:24px;text-align:center;flex-shrink:0}.player-flag{width:18px;height:13px;object-fit:contain;flex-shrink:0}.player-name{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.match-score{font-size:.65rem;color:var(--color-text-light);margin-left:auto;white-space:nowrap;padding-left:6px}.connector{min-width:16px;display:flex;flex-direction:column;justify-content:space-around}.rankings-container{padding:1rem;overflow-x:auto}.rankings-table{width:100%;border-collapse:collapse;font-size:.8rem;background:var(--color-bg-card);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}.rankings-table th{background:var(--color-primary);color:var(--color-text-inverse);padding:.5rem .4rem;text-align:center;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;white-space:nowrap;position:sticky;top:0;z-index:1}.rankings-table th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s}.rankings-table th.sortable:hover{background:color-mix(in srgb,var(--color-primary) 80%,white)}.rankings-table th.sort-active{background:color-mix(in srgb,var(--color-primary) 70%,white)}.sort-arrow{font-size:.6rem}.rankings-table td{padding:.35rem .4rem;text-align:center;border-bottom:1px solid var(--color-border);white-space:nowrap}.rankings-table .col-player{text-align:left;min-width:160px}.rankings-table .col-country{min-width:50px}.rankings-table tr:hover{background:#f5f9ff}.rankings-table tr.followed{background:var(--color-highlight)}.rankings-table tr.followed:hover{background:#fff3a0}.rank-change{font-size:.7rem;font-weight:700}.rank-up{color:var(--color-win)}.rank-down{color:var(--color-loss)}.rank-same{color:var(--color-text-light)}.rankings-table .editable-field{cursor:pointer;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}.rankings-table .editable-field:hover{background:color-mix(in srgb,var(--color-accent) 12%,transparent)}.player-data-table .player-data-country-code{margin-left:.35rem}.footer{position:fixed;bottom:0;left:0;right:0;background:#1a1a1a;z-index:100;box-shadow:0 -2px 8px #0003}.footer-menu{display:flex;align-items:center;justify-content:center;gap:.4rem;padding:.5rem 1rem;flex-wrap:wrap}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:200}.modal-overlay[hidden]{display:none}.modal{background:var(--color-bg-card);border-radius:var(--radius);box-shadow:var(--shadow-lg);min-width:360px;max-width:600px;max-height:80vh;display:flex;flex-direction:column;overflow:hidden}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.25rem;background:var(--color-primary);color:var(--color-text-inverse)}.modal-header h3{margin:0;font-size:1.1rem}.modal-close{background:none;border:none;color:var(--color-text-inverse);font-size:1.5rem;cursor:pointer;padding:0;line-height:1;opacity:.8}.modal-close:hover{opacity:1}.modal-content{padding:1.25rem;overflow-y:auto;flex:1}.modal-content label{display:block;font-size:.85rem;font-weight:500;margin-bottom:.25rem;color:var(--color-text)}.modal-content input,.modal-content select{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:var(--radius);font-family:var(--font-body);font-size:.875rem;margin-bottom:.75rem}.modal-actions{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem}[hidden]{display:none!important}.text-muted{color:var(--color-text-light)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.champs-list{list-style:none;padding:0;margin:0}.champs-list li{padding:.4rem 0;border-bottom:1px solid var(--color-border);font-size:.85rem}.champs-list li:last-child{border:none}.calendar-btn{background:none;border:none;cursor:pointer;font-size:1.1rem;padding:.15rem .4rem;line-height:1;border-radius:3px;opacity:.85;transition:opacity .15s}.calendar-btn:hover{opacity:1;background:#ffffff26}.calendar-modal{max-height:70vh;overflow-y:auto}.calendar-table{width:100%;border-collapse:collapse;font-size:.82rem}.calendar-table th{text-align:left;padding:.4rem .6rem;border-bottom:2px solid var(--color-border);font-size:.75rem;text-transform:uppercase;color:var(--color-text-muted)}.calendar-table td{padding:.35rem .6rem;border-bottom:1px solid var(--color-border);vertical-align:middle}.calendar-table tr:last-child td{border-bottom:none}.calendar-table tr[data-cal-idx]:hover{background:#0000000a}.cal-week{white-space:nowrap;color:var(--color-text-muted);width:3.5rem}.cal-name{font-weight:500}.cal-category{white-space:nowrap;font-size:.75rem;color:var(--color-text-muted)}.cal-result{font-size:.8rem}.cal-current{background:#2196f31f!important;font-weight:600}.cal-current td{border-bottom-color:#2196f34d}.cal-future{opacity:.45}.cal-sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.cal-sortable:hover{background:#0000000a}.cal-tier-1 td.cal-name{color:#b8860b;font-weight:600}.cal-tier-2 td.cal-name{color:#1565c0}.cal-tier-6 td.cal-name{color:#999}.help-section h4{margin:1rem 0 .25rem;color:var(--color-primary-dark)}.help-section p,.help-section ul{font-size:.85rem;margin:.25rem 0}.help-section kbd{background:#eee;border:1px solid #ccc;border-radius:3px;padding:.1rem .4rem;font-size:.8rem}.save-slot{display:flex;align-items:center;justify-content:space-between;padding:.6rem;border:1px solid var(--color-border);border-radius:var(--radius);margin-bottom:.5rem}.save-slot-info{font-size:.85rem}.save-slot-actions{display:flex;gap:.3rem}.player-profile h4{margin:.75rem 0 .35rem;font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:#777}.profile-header{display:flex;align-items:center;gap:1rem;padding-bottom:.75rem;border-bottom:1px solid #e0e0e0}.profile-flag{width:48px;border-radius:3px;box-shadow:0 1px 3px #00000026}.profile-info{flex:1}.profile-country{font-size:.8rem;color:#888}.profile-rank{font-size:.95rem;margin-top:.15rem}.profile-skill{font-size:.8rem;color:#666;margin-top:.1rem}.btn-unfollow{background:#e57373;color:#fff}.btn-unfollow:hover{background:#ef5350}.profile-stats{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:.25rem}.stat-group{min-width:0}.stat-table{width:100%;font-size:.85rem;border-collapse:collapse}.stat-table td{padding:.2rem 0;border-bottom:1px solid #f0f0f0}.stat-table td:last-child{text-align:right}.profile-year-end{margin-top:.25rem}.year-end-list{display:flex;flex-wrap:wrap;gap:.35rem}.year-end-rank{background:#f5f5f5;padding:.15rem .5rem;border-radius:3px;font-size:.8rem;font-weight:500}.profile-results{margin-top:.25rem}.results-table{width:100%;font-size:.82rem;border-collapse:collapse}.results-table th{padding:.35rem .4rem;text-align:left;font-weight:500;border-bottom:2px solid #e0e0e0;font-size:.75rem;text-transform:uppercase;letter-spacing:.03em;color:#777}.results-table td{padding:.3rem .4rem;border-bottom:1px solid #f0f0f0}.results-table .result-won td{font-weight:600}.results-table .result-gs td:first-child{font-weight:500}.text-center{text-align:center}.text-right{text-align:right}.text-muted{color:#999}.gs-badge{display:inline-block;background:#ffd54f;color:#5d4037;font-size:.65rem;font-weight:700;padding:.05rem .3rem;border-radius:2px;vertical-align:middle;margin-left:.2rem}.player-profile-container{padding:1rem 1.5rem 2rem;flex:1;overflow-y:auto}.player-profile-full{max-width:100%}.profile-header-full{display:flex;align-items:center;gap:1rem;padding-bottom:.75rem;border-bottom:1px solid #e0e0e0;margin-bottom:.75rem}.profile-flag-full{width:56px;border-radius:3px;box-shadow:0 1px 3px #00000026}.profile-info-full{flex:1}.profile-stats-full{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}.career-grid-title{margin:.25rem 0 .5rem;font-size:1rem}.career-grid-wrapper{overflow-x:auto;max-width:100%;border:1px solid #e0e0e0;border-radius:4px}.career-grid{border-collapse:separate;border-spacing:0;font-size:.78rem;width:auto}.career-grid thead th{position:sticky;top:0;z-index:2;background:var(--color-primary, #5f9ea0);color:#fff;padding:.4rem .6rem;text-align:center;font-weight:600;font-size:.72rem;white-space:nowrap;border-bottom:2px solid #457e80}.career-event-header{position:sticky;left:0;z-index:3!important;text-align:left!important;min-width:160px}.career-event-name{position:sticky;left:0;z-index:1;background:#fff;font-weight:500;text-align:left;padding:.3rem .6rem;white-space:nowrap;border-right:1px solid #e8e8e8}.career-pts-header{position:sticky;left:160px;z-index:3!important;min-width:48px;text-align:center!important}.career-pts-cell{position:sticky;left:160px;z-index:1;background:#fff;text-align:center;padding:.3rem .4rem;font-size:.7rem;color:#888;border-right:1px solid #e8e8e8;white-space:nowrap}.career-cur-pts-header{position:sticky;left:208px;z-index:3!important;min-width:42px;text-align:center!important}.career-cur-pts-cell{position:sticky;left:208px;z-index:1;background:#fff;text-align:center;padding:.3rem .4rem;font-size:.7rem;color:#555;font-weight:500;border-right:2px solid #ccc;white-space:nowrap}.career-rank-row,.career-rank-row .career-event-name,.career-rank-row .career-pts-cell,.career-rank-row .career-cur-pts-cell{background:#f5f5f5}.career-rank-label{font-weight:700!important;font-style:italic}.career-cell{text-align:center;padding:.3rem .5rem;border-bottom:1px solid #f0f0f0;border-right:1px solid #f5f5f5;white-space:nowrap}.career-cell-rank{font-size:.72rem;color:#555;font-weight:500}.career-cell-rank-click{cursor:pointer;transition:background .12s}.career-cell-rank-click:hover{background:#e3f2fd!important}.career-cell-clickable{cursor:pointer;transition:background .12s}.career-cell-clickable:hover{background:#e3f2fd!important}.career-cell-W{background:#c8e6c9;font-weight:700;color:#2e7d32}.career-cell-F{background:#fff9c4;font-weight:600;color:#f57f17}.career-tier-1,td.career-tier-1{background:#ffd7001a}.career-tier-1.career-event-name,.career-tier-1.career-pts-cell,.career-tier-1.career-cur-pts-cell{background:#ffd7002e;font-weight:600}.career-tier-2,td.career-tier-2{background:#2196f30f}.career-tier-2.career-event-name,.career-tier-2.career-pts-cell,.career-tier-2.career-cur-pts-cell{background:#2196f31f}.career-tier-3,td.career-tier-3{background:#4caf500d}.career-tier-3.career-event-name,.career-tier-3.career-pts-cell,.career-tier-3.career-cur-pts-cell{background:#4caf501a}.career-tier-4,td.career-tier-4{background:#9c27b00a}.career-tier-4.career-event-name,.career-tier-4.career-pts-cell,.career-tier-4.career-cur-pts-cell{background:#9c27b014}.career-tier-5,td.career-tier-5{background:#00000004}.career-tier-5.career-event-name,.career-tier-5.career-pts-cell,.career-tier-5.career-cur-pts-cell{background:#00000008}.career-tier-6,td.career-tier-6{background:#00000003}.career-tier-6.career-event-name,.career-tier-6.career-pts-cell,.career-tier-6.career-cur-pts-cell{background:#00000006;color:#aaa}.match-popup-table .match-win td{color:#2e7d32}.match-popup-table .match-loss td{color:#c62828}.year-rankings-popup{max-height:60vh;overflow-y:auto}.year-rankings-popup .results-table{font-size:.78rem}.ranking-popup-flag{width:16px;height:12px;vertical-align:middle;margin-right:.3rem;border-radius:1px}.rr-bracket{padding:.5rem}.rr-groups{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:1.5rem}@media(max-width:700px){.rr-groups{grid-template-columns:1fr}}.rr-group{background:var(--color-bg-card);border-radius:var(--radius);box-shadow:var(--shadow);padding:.75rem}.rr-group-heading{font-size:.95rem;font-weight:700;color:var(--color-primary-dark);margin:0 0 .5rem}.rr-standings-table{width:100%;border-collapse:collapse;font-size:.82rem;margin-bottom:.75rem}.rr-standings-table th{background:var(--color-primary);color:#fff;padding:.35rem .5rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;text-align:center}.rr-standings-table th.rr-col-player{text-align:left}.rr-standings-table th.rr-col-rank,.rr-standings-table td.rr-col-rank{text-align:center;width:30px;font-size:.72rem;color:var(--color-text-light)}.rr-standings-table td{padding:.3rem .5rem;border-bottom:1px solid var(--color-border)}.rr-standings-table td.rr-col-player{display:flex;align-items:center;gap:.4rem}.rr-standings-table td.rr-col-num{text-align:center}.rr-standings-table td.rr-col-pts{font-weight:600}.rr-standings-table tr.followed{background:var(--color-highlight)}.rr-matches{border-top:1px solid var(--color-border);padding-top:.5rem}.rr-match-result{font-size:.78rem;padding:.2rem 0;border-bottom:1px solid #f5f5f5}.rr-match-result:last-child{border-bottom:none}.rr-round-label{display:inline-block;font-size:.65rem;font-weight:700;color:var(--color-text-light);min-width:28px;text-transform:uppercase}.rr-knockout{background:var(--color-bg-card);border-radius:var(--radius);box-shadow:var(--shadow);padding:.75rem}.rr-knockout-round{margin-bottom:.75rem}.rr-knockout-round .match-slot{margin:.4rem 0;max-width:320px}.sim-to-menu{display:flex;flex-direction:column;gap:.5rem}.sim-to-option{width:100%;padding:.6rem 1rem;font-size:.9rem;text-align:left}.match-slot{position:relative}.match-play-btn,.match-replay-btn{position:absolute;right:3px;top:50%;transform:translateY(-50%);padding:0;border-radius:50%;text-align:center;cursor:pointer;z-index:1}.match-play-btn{width:22px;height:22px;border:1.5px solid var(--color-accent);background:#fff;color:var(--color-accent);font-size:.55rem;line-height:20px;transition:background .15s,color .15s}.match-play-btn:hover{background:var(--color-accent);color:#fff}.match-replay-btn{width:18px;height:18px;border:none;background:#00000014;color:var(--color-text-light);font-size:.45rem;line-height:18px;opacity:0;transition:opacity .15s,background .15s}.match-slot:hover .match-replay-btn{opacity:1}.match-replay-btn:hover{background:var(--color-accent);color:#fff}.scoreboard{background:#1a1a2e;border-radius:8px;padding:1rem 1.25rem;color:#e0e0e0;font-family:SF Mono,Menlo,Consolas,monospace;min-width:340px}.sb-header{text-align:center;margin-bottom:.75rem}.sb-tournament{font-size:.85rem;font-weight:700;color:#fff;text-transform:uppercase;letter-spacing:.04em}.sb-round{font-size:.7rem;color:#88a;margin-top:.15rem}.sb-table{width:100%;border-collapse:collapse;margin-bottom:.75rem;table-layout:fixed}.sb-table th{font-size:.6rem;font-weight:600;color:#66a;text-transform:uppercase;padding:.25rem .35rem;text-align:center;border-bottom:1px solid #2a2a4a}.sb-table th.sb-player-col{text-align:left;padding-left:.5rem;width:auto}.sb-table th.sb-serve-col{width:22px}.sb-table th.sb-set-hdr{width:36px}.sb-table th.sb-pts-hdr{width:40px}.sb-row td{padding:.4rem .35rem;text-align:center;border-bottom:1px solid #2a2a4a;transition:background .15s}.sb-row .sb-serve{width:22px;font-size:.6rem;color:#4caf50}.sb-row .sb-player{text-align:left;white-space:nowrap;padding-left:.5rem;overflow:hidden;text-overflow:ellipsis}.sb-flag{width:18px;height:13px;vertical-align:middle;margin-right:.3rem}.sb-seed{display:inline-block;min-width:24px;font-size:.65rem;color:#88a;text-align:right;margin-right:.2rem}.sb-name{font-size:.85rem;font-weight:600;color:#fff}.sb-set{width:36px;font-size:.95rem;font-weight:700;color:#ccc}.sb-set sup{font-size:.55rem;color:#88a}.sb-set-won{color:#fff}.sb-set-active{color:#64b5f6}.sb-pts{width:40px;font-size:.95rem;font-weight:700;color:#ffd54f}.sb-row.sb-winner{background:#4caf5033}.sb-row.sb-winner .sb-name{color:#4caf50}.sb-controls{display:flex;justify-content:center;gap:.5rem;margin-bottom:.5rem}.sb-btn{background:#2a2a4a;color:#e0e0e0;border:1px solid #3a3a5a;border-radius:4px;padding:.35rem .75rem;font-size:.75rem;cursor:pointer;transition:background .15s}.sb-btn:hover{background:#3a3a5a}.sb-status{text-align:center;font-size:.7rem;color:#88a;min-height:1rem}
