:root {
  --black: #000000; --white: #ffffff; --yellow: #FFEA00;
  --surface: #0d0d0d; --surface-2: #161616; --border: rgba(255,255,255,0.09);
  --muted: rgba(255,255,255,0.42); --font: -apple-system,'Helvetica Neue',Arial,sans-serif; --radius: 5px;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }
body { font-family: var(--font); background: var(--black); color: var(--white); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
input,button,select,textarea { font-family: inherit; }
.app-nav { height: 54px; background: var(--black); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 200; }
.app-nav__logo { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.045em; }
.app-nav__logo span { color: var(--yellow); }
.app-nav__center { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.app-nav__right { display: flex; align-items: center; gap: 12px; }
.btn-ghost { background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.btn-ghost:hover { color: var(--white); }
.tab-bar { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; background: var(--black); position: sticky; top: 54px; z-index: 100; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item { padding: 13px 20px; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: none; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.tab-item.active { color: var(--white); border-bottom-color: var(--yellow); }
.tab-item:hover { color: var(--white); }
.content { padding: 28px 20px; max-width: 1080px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.sec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.sec-title { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 24px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-box__num { font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; color: var(--yellow); }
.stat-box__label { font-size: 11px; color: var(--muted); margin-top: 3px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; border-radius: var(--radius); border: none; cursor: pointer; transition: opacity 0.15s, transform 0.1s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.btn--yellow { background: var(--yellow); color: var(--black); }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--white); }
.btn--red { background: #c0392b; color: var(--white); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.form-control { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; color: var(--white); transition: border-color 0.15s; -webkit-appearance: none; }
.form-control:focus { outline: none; border-color: var(--yellow); }
.form-control::placeholder { color: rgba(255,255,255,0.18); }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='rgba(255,255,255,0.35)' d='M5 7L0 2h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 10px; }
.card__eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.card__title { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.card__sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.015); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge--yellow { background: rgba(255,234,0,0.14); color: var(--yellow); }
.badge--green { background: rgba(0,200,80,0.12); color: #00c850; }
.badge--grey { background: rgba(255,255,255,0.07); color: var(--muted); }
.badge--blue { background: rgba(50,130,255,0.12); color: #4a90ff; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; }
.modal__title { font-size: 1.1rem; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 18px; }
.modal__footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 360px; }
.login-logo { font-size: 2.4rem; font-weight: 900; letter-spacing: -0.05em; text-align: center; margin-bottom: 4px; }
.login-logo span { color: var(--yellow); }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 32px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.mode-toggle { display: flex; background: var(--black); border-radius: var(--radius); padding: 3px; gap: 0; margin-bottom: 20px; }
.mode-btn { flex: 1; padding: 8px; font-size: 13px; font-weight: 600; background: none; border: none; color: var(--muted); cursor: pointer; border-radius: 3px; transition: all 0.15s; }
.mode-btn.active { background: var(--surface-2); color: var(--white); }
.alert { padding: 10px 13px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert--error { background: rgba(200,40,40,0.12); border: 1px solid rgba(200,40,40,0.25); color: #e05050; }
.alert--success { background: rgba(0,180,70,0.1); border: 1px solid rgba(0,180,70,0.2); color: #00c850; }
.div-pill-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.div-pill { display: flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); padding: 5px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.div-pill__x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.div-pill__x:hover { color: #e05050; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 7px; max-height: 210px; overflow-y: auto; padding-bottom: 4px; }
.p-chip { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 600; background: var(--surface-2); transition: all 0.15s; }
.p-chip.selected { border-color: var(--yellow); background: rgba(255,234,0,0.09); color: var(--yellow); }
.p-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.p-chip.selected .p-chip__dot { background: var(--yellow); }
.lb-table { width: 100%; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.lb-row:last-child { border-bottom: none; }
.lb-pos { width: 26px; font-size: 12px; font-weight: 900; color: var(--muted); text-align: center; flex-shrink: 0; }
.lb-row:nth-child(1) .lb-pos { color: var(--yellow); }
.lb-row:nth-child(2) .lb-pos { color: rgba(255,234,0,0.55); }
.lb-row:nth-child(3) .lb-pos { color: rgba(255,234,0,0.3); }
.lb-name { flex: 1; font-size: 14px; font-weight: 600; }
.lb-name small { font-size: 11px; color: var(--muted); font-weight: 400; display: block; }
.lb-pts { font-size: 17px; font-weight: 900; letter-spacing: -0.03em; }
.lb-wins { font-size: 11px; color: var(--muted); text-align: right; }
.match-block { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 9px; border: 1px solid var(--border); }
.match-block__header { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.match-teams { display: flex; align-items: center; gap: 8px; }
.match-team { flex: 1; font-size: 13px; font-weight: 700; line-height: 1.3; }
.match-team--right { text-align: right; }
.match-vs { font-size: 10px; font-weight: 900; color: var(--muted); flex-shrink: 0; }
.score-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.score-input { width: 54px; height: 42px; text-align: center; font-size: 1.2rem; font-weight: 900; background: var(--black); border: 1px solid var(--border); border-radius: var(--radius); color: var(--white); -moz-appearance: textfield; -webkit-appearance: none; }
.score-input:focus { outline: none; border-color: var(--yellow); }
.score-input::-webkit-inner-spin-button, .score-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.score-display { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.04em; color: var(--white); min-width: 40px; text-align: center; }
.score-sep { font-size: 16px; font-weight: 900; color: var(--muted); }
.match-block.completed { border-color: rgba(0,200,80,0.2); }
.match-block.completed .match-block__header { color: #00c850; }
.round-pips { display: flex; gap: 5px; margin-bottom: 18px; }
.round-pip { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.round-pip.done { background: var(--yellow); }
.round-pip.active { background: rgba(255,234,0,0.38); }
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }
.live-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #00c850; }
.live-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.4s ease infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.empty { text-align: center; padding: 44px 20px; }
.empty__icon { font-size: 2.2rem; margin-bottom: 10px; }
.empty__text { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(70px); background: var(--white); color: var(--black); padding: 10px 18px; border-radius: 20px; font-size: 13px; font-weight: 700; z-index: 9999; transition: transform 0.22s ease; white-space: nowrap; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); }
.profile-header { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-avatar { width: 56px; height: 56px; background: var(--yellow); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 900; color: var(--black); flex-shrink: 0; }
.profile-name { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.03em; }
.profile-meta { font-size: 13px; color: var(--muted); }
.cort-rating { display: inline-flex; flex-direction: column; align-items: center; background: var(--yellow); color: var(--black); padding: 10px 14px; border-radius: 6px; }
.cort-rating__num { font-size: 1.8rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.cort-rating__label { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.muted { color: var(--muted); } .text-yellow { color: var(--yellow); }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.fw-700 { font-weight: 700; } .fw-900 { font-weight: 900; }
.text-center { text-align: center; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.loading { color: var(--muted); font-size: 13px; text-align: center; padding: 32px; }
.tv-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 0 16px; border-bottom:1px solid var(--border); margin-bottom:20px; }
.tv-header { text-align:center; padding:20px 0 12px; }
.tv-logo { font-family:'Space Grotesk',sans-serif; font-size:2.4rem; font-weight:900; letter-spacing:-0.04em; color:var(--white); }
.tv-logo span { color:var(--yellow); }
.tv-tour-name { font-size:1.6rem; font-weight:800; color:var(--white); margin:6px 0 4px; letter-spacing:-0.02em; }
.tv-meta { font-size:12px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); }
.tv-live-label { display:flex; align-items:center; gap:8px; font-size:11px; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--yellow); margin:16px 0 8px; }
.tv-matches { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:20px; }
.tv-match-card { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); padding:10px 16px; display:flex; align-items:center; gap:12px; font-size:14px; font-weight:600; }
.tv-vs { color:var(--muted); font-size:11px; font-weight:700; letter-spacing:0.08em; }
.tv-table { width:100%; border-collapse:collapse; margin-top:8px; }
.tv-table thead th { font-size:11px; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--muted); padding:8px 12px; text-align:left; border-bottom:1px solid var(--border); }
.tv-table thead th:nth-child(3), .tv-table thead th:nth-child(4), .tv-table thead th:nth-child(5) { text-align:center; }
.tv-lb-row td { padding:12px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.tv-lb-row--top td { background:rgba(255,234,0,0.04); }
.tv-lb-row--top .tv-pts { color:var(--yellow); }
.tv-rank { font-size:1.6rem; font-weight:900; color:var(--muted); width:48px; }
.tv-lb-row--top .tv-rank { color:var(--yellow); }
.tv-name { font-size:1.3rem; font-weight:700; letter-spacing:-0.01em; }
.tv-pts { font-size:1.6rem; font-weight:900; text-align:center; width:70px; }
.tv-wins { font-size:1.1rem; font-weight:600; text-align:center; color:var(--muted); width:50px; }
.tv-games { font-size:1.1rem; font-weight:600; text-align:center; color:var(--muted); width:50px; }
.tv-footer { font-size:11px; color:var(--muted); text-align:center; padding:20px 0 4px; }
.tv-fullscreen { padding:32px 48px; background:var(--black); }
.tv-fullscreen .tv-logo { font-size:3.2rem; }
.tv-fullscreen .tv-tour-name { font-size:2.2rem; }
.tv-fullscreen .tv-rank { font-size:2.4rem; }
.tv-fullscreen .tv-name { font-size:1.8rem; }
.tv-fullscreen .tv-pts { font-size:2.4rem; }
.tv-fullscreen .tv-wins, .tv-fullscreen .tv-games { font-size:1.5rem; }
.tv-fullscreen .tv-lb-row td { padding:16px 14px; }
@media print {
  .no-print, .app-nav, .tab-bar, .tv-toolbar, .tv-footer { display:none !important; }
  body { background:#fff; color:#000; }
  .content, .tab-panel { all:unset; display:block; padding:0; }
  .tab-panel { display:none !important; }
  #tab-tv { display:block !important; }
  .tv-header { padding:10px 0 8px; }
  .tv-logo { font-size:1.8rem; color:#000; }
  .tv-logo span { color:#000; }
  .tv-tour-name { font-size:1.2rem; color:#000; }
  .tv-meta { color:#555; }
  .tv-table { width:100%; }
  .tv-table thead th, .tv-lb-row td { color:#000; border-color:#ccc; padding:7px 10px; }
  .tv-lb-row--top td { background:#f5f5f5; }
  .tv-lb-row--top .tv-pts, .tv-lb-row--top .tv-rank { color:#000; }
  .tv-rank { font-size:1.2rem; color:#000; }
  .tv-name { font-size:1rem; }
  .tv-pts { font-size:1.2rem; color:#000; }
  .tv-wins, .tv-games { color:#444; }
}