/* Same typeface as the landing site: Tinos, shipped with the app. */
@font-face{font-family:Tinos;src:url('assets/fonts/tinos-400.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Tinos;src:url('assets/fonts/tinos-700.woff2') format('woff2');font-weight:700 900;font-style:normal;font-display:swap}
:root{--green:#005c3e;--ink:#07151b;--paper:#fff;--soft:#f1f5f2;--line:#d6dfd9;--muted:#3d4a44;--on-green:#fff;--on-ink:#fff;--edge:var(--ink);--shadow:var(--ink);--mono:Tinos,'Times New Roman',Times,serif;font-family:Tinos,'Times New Roman',Times,serif;color:var(--ink);background:#e3e9e5;font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,a{-webkit-tap-highlight-color:transparent}button,input{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--green);outline-offset:4px}button:active{transform:translate(2px,2px);box-shadow:none!important}.phone-app{max-width:480px;min-height:100dvh;margin:auto;background:var(--paper);position:relative;padding-bottom:calc(100px + env(safe-area-inset-bottom))}.topbar{padding:16px 22px;display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid var(--edge);gap:12px}.brand{display:flex;align-items:center;gap:10px;font-size:32px;letter-spacing:-1.7px;font-weight:900}.brand-caption{display:block;font-family:var(--mono);font-size:14px;letter-spacing:1px;margin-top:3px}.logo{position:relative;display:block;width:38px;height:38px;overflow:hidden;flex-shrink:0}.logo img{display:block;width:100%;height:100%;object-fit:contain}.edition{font-family:var(--mono);font-size:14px;text-align:right;line-height:1.7;letter-spacing:1px}.edition b{font-weight:500;color:var(--muted)}.demo-strip{padding:9px 22px;background:var(--soft);font:14px var(--mono);letter-spacing:1.1px;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}.pixel-dot{height:7px;width:7px;background:var(--green)}main{padding:27px 22px 0;outline:none}.eyebrow{font:15px var(--mono);letter-spacing:1.6px;font-weight:700}h1,h2,h3,p{margin:0}h1{font-size:44px;line-height:1.02;letter-spacing:-2.5px;font-weight:900;margin:9px 0 12px}h2{font-size:30px;letter-spacing:-1.2px;line-height:1.15}h3{font-size:21px;letter-spacing:-.4px;line-height:1.3}.green{color:var(--green)}.muted{color:var(--muted);line-height:1.5;font-size:19px}.small{font-size:17px}.page-intro{margin-bottom:25px}.intro-line{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.pixel-mark{font:46px var(--mono);color:var(--green);line-height:1;padding-bottom:10px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:28px 0 14px}.section-heading h2{font-size:23px;letter-spacing:-.6px}.count{font:15px var(--mono);border:1px solid var(--line);padding:4px 7px;white-space:nowrap}.match-card{border:2px solid var(--edge);box-shadow:4px 4px 0 var(--shadow);margin:0 4px 21px 0}.match-banner{background:var(--green);color:var(--on-green);padding:13px 15px;display:flex;align-items:center;justify-content:space-between;gap:8px;font:15px var(--mono);letter-spacing:.5px}.match-banner .round{border:1px solid #ffffff70;padding:4px 6px;white-space:nowrap}.match-body{padding:18px 16px 16px}.piece{font-size:27px;line-height:1;width:39px;height:39px;display:inline-grid;place-items:center;border:1px solid var(--edge);background:var(--soft)}.piece.black{color:var(--on-ink);background:var(--ink)}.match-facts{display:grid;grid-template-columns:repeat(3,1fr);border-block:1px solid var(--line);margin-top:20px;padding:13px 0}.fact{border-right:1px solid var(--line);padding:0 10px}.fact:first-child{padding-left:0}.fact:last-child{border:0}.fact span{display:block;font:14px var(--mono);letter-spacing:.7px;color:var(--muted);margin-bottom:6px}.fact strong{font:700 24px var(--mono)}.text-button{background:none;border:0;padding:10px 0;min-height:44px;color:var(--green);font-size:17px;font-weight:700;text-align:left}.button{border:2px solid var(--edge);min-height:52px;padding:12px 17px;background:var(--green);color:var(--on-green);font-weight:700;font-size:19px;display:inline-flex;align-items:center;justify-content:center;gap:12px;box-shadow:3px 3px 0 var(--shadow)}.button.secondary{background:var(--paper);color:var(--ink);box-shadow:none}.full{width:100%}.button .plus{font:26px var(--mono);line-height:1}.player-row{display:flex;align-items:center;gap:12px;padding:17px 0;border-bottom:1px solid var(--line)}.avatar{flex:0 0 42px;height:46px;display:grid;place-items:center;background:var(--soft);border:1px solid var(--line);font:700 15px var(--mono);color:var(--green)}.player-info{min-width:0;flex:1}.player-info strong{display:block;font-size:19px;line-height:1.3}.player-info small{display:block;color:var(--muted);font-size:17px;line-height:1.5;margin-top:4px}.status-tag{font:14px var(--mono);text-transform:uppercase;color:var(--green);margin-top:6px;display:block}.row-action{min-width:44px;min-height:44px;border:1px solid var(--line);background:var(--paper);color:var(--green);padding:8px;font-size:17px;font-weight:700}.row-action[disabled]{color:var(--muted);background:var(--soft)}.footnote{margin-top:24px;padding-top:13px;border-top:1px dashed var(--line);font:14px var(--mono);line-height:1.6;color:var(--muted)}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;z-index:10;display:grid;grid-template-columns:repeat(4,1fr);background:var(--paper);border-top:2px solid var(--edge);padding:0 8px env(safe-area-inset-bottom);box-shadow:0 -6px 20px #07151b05}.bottom-nav a{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;min-height:76px;font-size:15px;color:var(--muted);font-weight:700}.bottom-nav a[aria-current=page]{color:var(--green);background:var(--soft)}.bottom-nav a[aria-current=page]:before{content:'';position:absolute;top:0;left:22%;right:22%;height:4px;background:var(--green)}.nav-icon{font:26px var(--mono);height:28px;line-height:28px}.empty{padding:28px 18px;border:1px dashed var(--line);text-align:center;margin:20px 0}.empty p{margin:10px 0 20px}.history-card{border:1px solid var(--edge);margin:16px 0;padding:18px}.history-card .eyebrow{color:var(--muted);font-size:14px}.history-card h3{margin:10px 0}.history-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:14px 0 16px}.history-stats span{font:10.5px var(--mono);color:var(--muted);letter-spacing:-0.2px;overflow-wrap:anywhere}.history-stats strong{display:block;font:700 20px var(--mono);color:var(--green);margin-bottom:2px}.filter-row{display:flex;gap:8px;margin:20px 0;flex-wrap:wrap}.filter-row button{border:1px solid var(--edge);padding:12px 15px;min-height:44px;font-size:17px;background:var(--paper)}.filter-row button[aria-pressed=true]{background:var(--ink);color:var(--on-ink)}dialog{border:2px solid var(--edge);padding:22px;width:calc(100% - 28px);max-width:440px;max-height:85dvh;overflow:auto;color:var(--ink);box-shadow:5px 5px 0 var(--green)}dialog::backdrop{background:#07151b99}dialog h2{margin:10px 0 23px}dialog label{display:block;font-size:17px;margin-bottom:9px}dialog .muted{margin:12px 0}.dialog-heading{display:flex;align-items:center;justify-content:space-between}.icon-button{width:44px;height:44px;border:1px solid var(--edge);background:var(--paper);font-size:28px}.search-field{display:flex;border:2px solid var(--edge);align-items:center;padding-left:12px;gap:10px}.search-field>span{font-size:26px;color:var(--green)}input{border:0;min-width:0;width:100%;padding:15px 8px;background:var(--paper);color:var(--ink);font-size:19px}.search-field:focus-within{outline:2px solid var(--green);outline-offset:3px}input:focus-visible{outline:none}#toast{position:fixed;bottom:calc(92px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px);background:var(--ink);color:var(--on-ink);padding:14px 18px;font-size:17px;z-index:30;pointer-events:none;opacity:0;transition:opacity .15s}#toast.visible{opacity:1}.detail-list{margin:18px 0 24px}.detail-list div{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line);padding:13px 0;font-size:18px}.detail-list dt{color:var(--muted)}.detail-list dd{margin:0;text-align:right;font-weight:700}.detail-note{font-size:17px;color:var(--muted);line-height:1.5;margin:18px 0}@media(max-width:360px){main{padding-inline:16px}.topbar{padding-inline:16px}h1{font-size:39px}.match-body{padding-inline:13px}.brand{font-size:29px}.bottom-nav a{font-size:14px}.row-action{font-size:15px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

body:has([data-page="home"][aria-current="page"]) .page-intro h1{font-size:40px;line-height:1.02}

.result-summary{font:16px var(--mono);margin:18px 0 2px;color:var(--muted)}.search-prompt{margin:24px 0;color:var(--muted);line-height:1.6;font-size:19px}.load-more{margin-top:20px}.player-info{overflow-wrap:anywhere}.player-row .row-action{flex-shrink:0}.demo-strip{line-height:1.5}

/* Keep typing controls anchored; result changes only affect the scrollable list. */
#search-dialog {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) 0 auto;
  margin: 0 auto;
  height: min(760px, calc(100dvh - 24px - env(safe-area-inset-top)));
  max-height: none;
  overflow: hidden;
  padding: 18px;
}
#search-dialog[open] { display: flex; flex-direction: column; }
#search-dialog > :not(#search-results) { flex-shrink: 0; }
#search-dialog h2 { margin: 8px 0 16px; }
#search-dialog #search-help { margin: 12px 0 0; }
#search-status { min-height: 36px; margin: 0; padding: 12px 0 8px; line-height: 16px; }
#search-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
  padding: 0 4px 8px;
}
html:has(#search-dialog[open]) { overflow: hidden; }
@media (max-height: 560px) {
  #search-dialog { padding: 12px; }
  #search-dialog .dialog-heading { min-height: 44px; }
  #search-dialog h2 { font-size: 25px; margin: 0 0 8px; }
  #search-dialog #search-help { display: none; }
  #search-dialog label { margin-bottom: 5px; }
  #search-status { min-height: 30px; padding-top: 7px; padding-bottom: 7px; }
}

[hidden]{display:none!important}.account-button{background:var(--paper);border:1px solid var(--line);padding:9px;min-height:44px;cursor:pointer}.role-choices{display:grid;gap:18px;margin:28px 4px 20px 0}.role-choice{padding:21px;text-align:left;border:2px solid var(--edge);box-shadow:4px 4px 0 var(--shadow);background:var(--paper);color:var(--ink);display:grid;gap:12px}.role-choice strong{font-size:30px;letter-spacing:-1px;display:flex;justify-content:space-between;color:var(--green)}.role-choice>span:last-child{font-size:19px;line-height:1.5;color:var(--muted)}.role-choice:focus-visible,.role-choice:hover{background:var(--soft)}.role-choice .eyebrow{font-size:15px}.toolbar,.player-links{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap}.player-links{border-bottom:1px solid var(--line);padding:0 0 8px}.player-name{border:0;background:transparent;color:var(--ink);font-weight:700;text-align:left;padding:5px 0;min-height:44px;width:100%;font-size:19px}.section-player{font-size:26px;margin:24px 0 16px;overflow-wrap:anywhere}.notice{margin:18px 0;border-left:3px solid var(--green);background:var(--soft);padding:14px;font-size:18px;line-height:1.55}.opponent-line{display:flex;align-items:center;gap:13px;margin:22px 0}.opponent-line .piece{flex-shrink:0}.rating-panel{border-top:1px solid var(--line);padding:15px 0;font-size:17px;line-height:1.6}.rating-panel small{display:block;color:var(--muted);margin-top:8px}.rating-options{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:9px;font-size:15px}.rating-options b{display:block;font:700 21px var(--mono);color:var(--green);margin-top:4px}.round-schedule{border:1px solid var(--line);padding:14px;margin:16px 0;font-size:17px;line-height:1.65}.round-schedule summary{cursor:pointer;font-weight:700;min-height:44px}.menu-list{display:grid;gap:13px;margin-top:20px}.help-steps{padding-left:22px;font-size:19px;line-height:1.7}.help-steps li{margin:12px 0}.bulk-row{padding:17px 0;border-bottom:1px solid var(--line);font-size:18px;line-height:1.6}textarea{width:100%;font:17px/1.6 Tinos,'Times New Roman',Times,serif;padding:13px;border:2px solid var(--edge);resize:vertical;color:var(--ink);background:var(--paper)}textarea:focus-visible{outline:2px solid var(--green);outline-offset:3px}.detail-list dd{overflow-wrap:anywhere;max-width:65%}#detail-dialog{overscroll-behavior:contain}.match-facts .fact strong{font-size:21px}.match-body>h3{overflow-wrap:anywhere}@media(max-width:360px){.role-choice{padding:17px}.role-choice strong{font-size:27px}.rating-options{font-size:14px;gap:4px}.fact{padding-inline:6px}}

.main-menu .button{justify-content:space-between;text-align:left}
#detail-content>.menu-list:last-child{margin-bottom:13px}
.soon-tag{border:2px solid var(--green);color:var(--green);font:700 13px var(--mono);letter-spacing:1.6px;padding:3px 7px;white-space:nowrap}.role-limit{font:16px var(--mono);color:var(--green);margin:-10px 0 22px;line-height:1.6}.intro-line h1{min-width:0}@media(max-width:390px){.intro-line .pixel-mark{display:none}.intro-line h1{font-size:38px;overflow-wrap:anywhere}}
.tournament-history-card .history-date {
  display: block;
  text-align: right;
  color: var(--ink);
  font-size: 15px;
}
.history-ratings { margin: 16px 0 14px; }
.history-ratings-heading { margin-bottom: 8px; font-size: 16px; font-weight: 700; }
.history-rating-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.history-rating-box { display: flex; flex-direction: column; min-width: 0; padding: 10px 10px; border: 1px solid var(--line); border-top: 3px solid var(--edge); background: var(--soft); }
.history-rating-label { font: 700 14px var(--mono); letter-spacing: 0.8px; }
.history-rating-change { margin: 6px 0 2px; font: 700 23px/1.1 var(--mono); overflow-wrap: anywhere; }
.history-rating-description { font-size: 15px; line-height: 1.35; font-weight: 600; }
.history-rating-start { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.history-rating-start b { display: block; font-size: 17px; }
.history-rating-box[data-direction="up"] { border-top-color: var(--green); }
.history-rating-box[data-direction="up"] .history-rating-change { color: var(--green); }
@media (max-width: 360px) {
  .history-stats { gap: 4px; }
  .history-stats span { font-size: 12px; }
  .history-stats strong { font-size: 18px; }
  .history-rating-box { padding: 8px 7px; }
  .history-rating-change { font-size: 21px; }
}
.tournament-history-card > .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 17px;
  border: 2px solid var(--edge);
  background: var(--green);
  color: var(--paper);
  font-size: 19px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.tournament-history-card > .text-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.history-player-picker { margin: 24px 0 20px; border: 2px solid var(--edge); background: var(--paper); }
.history-player-picker summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px; min-height: 60px; cursor: pointer; }
.history-player-picker summary::-webkit-details-marker { display: none; }
.history-player-picker summary small { display: block; margin-bottom: 6px; color: var(--green); font: 15px var(--mono); }
.history-player-picker summary strong { font-size: 25px; overflow-wrap: anywhere; }
.history-player-picker summary:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.history-player-picker .picker-arrow { font-size: 24px; color: var(--green); }
.history-player-picker[open] .picker-arrow { transform: rotate(180deg); }
/* Player picker list: every row ends in a box; the chosen row is a solid accent bar with the box ticked, so it cannot be mistaken for the others. */
.history-player-options { border-top: 2px solid var(--edge); }
.history-player-options button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 54px; padding: 12px 15px; text-align: left; background: var(--paper); border: 0; color: var(--ink); font-size: 20px; overflow-wrap: anywhere; cursor: pointer; }
.history-player-options button + button { border-top: 1px solid var(--line); }
.history-player-options button:hover, .history-player-options button:focus-visible { background: var(--soft); }
.history-player-options button:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.history-player-options button[aria-pressed="false"]::after { content: ""; flex: none; width: 24px; height: 24px; border: 2px solid var(--edge); background: var(--paper); }
.history-player-options button[aria-pressed="true"] { background: var(--green); color: var(--on-green); font-weight: 700; }
.history-player-options button[aria-pressed="true"]:focus-visible { outline-color: var(--ink); }
.history-player-options button[aria-pressed="true"] span:last-child { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid currentColor; font-size: 16px; line-height: 1; }

.follow-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 2px solid var(--edge);
  border-left: 6px solid var(--green);
  background: var(--soft);
  color: var(--ink);
  opacity: 1;
}
.follow-warning .warning-icon {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  height: 26px;
  background: var(--green);
  color: var(--on-green);
  font: 900 20px var(--mono);
}
.follow-warning strong { display: block; margin-bottom: 5px; font-size: 19px; font-weight: 800; }
.follow-warning p { font-size: 19px; font-weight: 700; line-height: 1.5; }

.matches-header-actions { margin-bottom: 22px; }
.live-refresh-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 14px var(--mono);
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  width: fit-content;
}
.share-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--green);
}


/* WhatsApp account connection */
.account-card { padding: 18px; border: 2px solid var(--green); background: var(--soft); margin: 18px 0; }
.account-status { display: flex; align-items: center; gap: 8px; font: 14px/1.5 var(--mono); color: var(--green); letter-spacing: .4px; }
.account-phone { display: block; margin: 14px 0 10px; font: 700 26px var(--mono); overflow-wrap: anywhere; }
.account-card p { font-size: 17px; line-height: 1.6; color: var(--muted); }
.account-error { padding: 14px; margin: 18px 0; border-left: 3px solid #9a3d21; background: #fff3ed; color: #70301c; font-size: 17px; line-height: 1.6; }
.account-links { display: flex; flex-direction: column; align-items: flex-start; margin: 14px 0; }
.text-button.danger { color: #9a3d21; }
html[data-appearance="dark"] .text-button.danger { color: #e07a55; }

.button:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); box-shadow: none; }
/* A text button that waits reads as waiting, in either theme and also when it is the red one. */
.text-button:disabled, html[data-appearance="dark"] .text-button.danger:disabled { color: var(--muted); }
/* The mode under "HESABIM" in the header, once one is chosen. */
#role-label { display: block; }

.plain-list { margin: 12px 0 18px; padding-left: 22px; font-size: 18px; line-height: 1.6; }
.plain-list li { margin: 6px 0; }


/* The closed page: all that a browser which is not signed in gets. One centred column that fits a small phone
   (360 x 640) without scrolling; the room the app keeps for its bottom bar is given back while it is shown. */
.phone-app:has(#closed:not([hidden])) { padding-bottom: env(safe-area-inset-bottom); }
.closed, #closed-body { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.closed { padding: 28px 16px 16px; text-align: center; }
#closed-body { width: 100%; }
.closed .logo { width: 64px; height: 64px; }
.closed h1 { margin: 0; font-size: 34px; letter-spacing: -1.4px; }
.closed p { font-size: 18px; line-height: 1.5; color: var(--muted); }
/* The name of the button in WhatsApp is read as one name: it is not broken over two lines. */
.closed p b { white-space: nowrap; }
.closed .notice { width: 100%; margin: 0; padding: 12px 14px; text-align: left; color: var(--ink); }
.closed .button { margin-top: 4px; }

/* Keep the unavailable mode visible without inviting a selection. */
.role-choice-soon,
.role-choice-soon:hover {
  background: #f1f3f1;
  border-color: #aeb8b2;
  box-shadow: none;
  color: #59635e;
  cursor: default;
}
.role-choice-soon strong,
.role-choice-soon > span:last-child {
  color: #59635e;
}

/* History needs the same legible typeface and weight on desktop and phones. */
.tournament-history-card {
  font-family: inherit;
  font-synthesis: weight;
}
.tournament-history-card .history-date {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
}
.tournament-history-card h3 {
  font-size: 23px;
  line-height: 1.3;
  font-weight: 700;
}
.tournament-history-card .history-stats span {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0;
  overflow-wrap: normal;
}
.tournament-history-card .history-stats strong {
  font-family: inherit;
  font-size: 23px;
  font-weight: 700;
}
.tournament-history-card .history-ratings-heading {
  font-size: 18px;
}
.tournament-history-card .history-rating-label {
  font: 700 16px Tinos,'Times New Roman',Times,serif;
  letter-spacing: .3px;
}
.tournament-history-card .history-rating-change {
  font: 700 25px/1.15 Tinos,'Times New Roman',Times,serif;
}
.tournament-history-card .history-rating-description {
  font-size: 17px;
  font-weight: 600;
}
.tournament-history-card .history-rating-start {
  font-size: 16px;
}
.tournament-history-card .history-rating-start b {
  font-size: 19px;
}
.history-player-picker summary small {
  font: 700 16px Tinos,'Times New Roman',Times,serif;
  letter-spacing: .2px;
}
@media (max-width: 420px) {
  .tournament-history-card .history-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .tournament-history-card .history-stats span {
    font-size: 15px;
  }
  .tournament-history-card .history-stats strong {
    font-size: 23px;
  }
  .tournament-history-card .history-rating-box {
    padding: 10px;
  }
  .tournament-history-card .history-rating-change {
    font-size: 25px;
  }
}

/* Tournament stats: three columns on phone widths; PERFORMANS, the longest label, takes two so it cannot run into MAÇ. */
@media (max-width: 640px) {
  .tournament-history-card .history-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .tournament-history-card .history-stats span:nth-child(4) {
    grid-column: span 2;
  }
}
@media (max-width: 360px) {
  .tournament-history-card .history-stats span {
    font-size: 14px;
  }
}

/* Dialogs take the app's surface and text colours instead of the browser's defaults, so they follow the appearance. */
dialog{background:var(--paper);color:var(--ink)}

/* The tagline stays on one line beside the two header buttons; on the narrowest phones it may wrap. */
.brand-caption{font-size:13px;letter-spacing:.8px}
@media(min-width:385px){.brand-caption{white-space:nowrap}}
@media(max-width:400px){.topbar{padding-inline:16px;gap:8px}}

/* Header actions: the appearance button sits next to HESABIM. */
.topbar-actions{display:flex;align-items:stretch;gap:8px;flex-shrink:0}
.appearance-button{display:grid;place-items:center;width:46px;min-height:44px;padding:0;background:var(--paper);border:1px solid var(--line);color:var(--ink);font-size:21px;line-height:1;cursor:pointer}
.appearance-button:hover,.account-button:hover{background:var(--soft)}
/* Changing appearance: the old page stays still while the new one opens over it (theme.js draws the panel); without view transitions the colours fade. */
html.appearance-shifting::view-transition-old(root),html.appearance-shifting::view-transition-new(root){animation:none;mix-blend-mode:normal}
html.appearance-fading *,html.appearance-fading *::before,html.appearance-fading *::after{transition:background-color .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease!important}

/* Dark appearance: the landing site's dark palette. Light is the stylesheet's default, so the page still reads without JavaScript. */
html[data-appearance="dark"]{color-scheme:dark;--green:#73dab0;--ink:#edf5f1;--paper:#142128;--soft:#0d171d;--line:#34464f;--muted:#b7c8c0;--on-green:#07151b;--on-ink:#07151b;--edge:#52676f;--shadow:#060c10;background:#080f14}
html[data-appearance="dark"] .topbar{border-bottom-color:var(--ink)}
html[data-appearance="dark"] .match-banner .round{border-color:#07151b70}
html[data-appearance="dark"] .bottom-nav{box-shadow:0 -6px 20px #00000040}
html[data-appearance="dark"] dialog::backdrop{background:#000000b3}
html[data-appearance="dark"] .account-error{border-left-color:#e07a55;background:#3a1f17;color:#ffc9b5}
html[data-appearance="dark"] .role-choice-soon,html[data-appearance="dark"] .role-choice-soon:hover{background:#18262c;border-color:#34464f;color:#8fa39b}
html[data-appearance="dark"] .role-choice-soon strong,html[data-appearance="dark"] .role-choice-soon>span:last-child{color:#8fa39b}
/* A black piece stays black and a white piece stays white in both appearances. */
.piece.black{background:#07151b;color:#fff}
html[data-appearance="dark"] .piece:not(.black){background:#edf5f1;color:#07151b}
/* Dark logo: the mark's shape filled with the accent colour, as on the landing site. */
html[data-appearance="dark"] .logo img{display:none}
html[data-appearance="dark"] .logo{background:var(--green);-webkit-mask:url('assets/masa-logo-mark.png') center/contain no-repeat;mask:url('assets/masa-logo-mark.png') center/contain no-repeat}

/* Standing in a finished tournament: place in the field and the move from the starting rank. */
.standing{margin:14px 0 6px;padding:14px 14px 12px;background:var(--soft);border:1px solid var(--line);border-left:3px solid var(--edge)}
.standing[data-direction="up"]{border-left-color:var(--green)}
.standing-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.standing-label{font:700 15px var(--mono);letter-spacing:.8px;color:var(--muted)}
.standing-value{font-size:21px;line-height:1}
.standing-value strong{margin-right:3px;font-size:32px;font-weight:700}
.standing-move{margin-left:auto;padding:4px 10px;border:2px solid var(--edge);font:700 18px/1.1 var(--mono);white-space:nowrap}
.standing[data-direction="up"] .standing-move{background:var(--green);border-color:var(--green);color:var(--on-green)}
.standing-track{display:block;width:100%;height:14px;margin-top:14px;overflow:visible}
.standing-track line{vector-effect:non-scaling-stroke}
.st-rail{stroke:var(--muted);stroke-width:2;opacity:.55}
.st-start{stroke:var(--ink);stroke-width:2}
.st-move{stroke:var(--ink);stroke-width:2}
.st-rank{stroke:var(--ink);stroke-width:5}
.standing[data-direction="up"] .st-move,.standing[data-direction="up"] .st-rank{stroke:var(--green)}
.standing-scale{display:flex;justify-content:space-between;margin-top:5px;font:15px var(--mono);color:var(--muted)}
.standing-note{margin:8px 0 0;font-size:17px;line-height:1.4;color:var(--muted)}

/* Rating chart above the tournament cards. ELO is a solid line with filled squares, UKD a dashed line with hollow squares, so the two never depend on colour alone. */
masa-rating-chart{display:block;margin:18px 4px 22px 0;padding:18px 16px 14px;background:var(--paper);border:2px solid var(--edge);box-shadow:4px 4px 0 var(--shadow)}
masa-rating-chart[hidden]{display:none}
.rating-chart-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px 14px;flex-wrap:wrap}
.rating-chart-head h3{margin:0;font-size:22px}
.rating-chart-legend{display:flex;gap:16px;margin:0;padding:0;list-style:none;font:700 15px var(--mono);letter-spacing:.8px}
.rating-chart-legend li{display:flex;align-items:center;gap:7px}
.rc-key{width:30px;height:12px;overflow:visible}
.rating-chart-plot{margin-top:14px;touch-action:pan-y;cursor:crosshair}
.rating-chart-plot:focus-visible{outline:3px solid var(--green);outline-offset:4px}
.rating-chart-plot svg{display:block;overflow:visible}
.rc-grid{stroke:var(--muted);stroke-width:1;opacity:.35}
.rc-cross{stroke:var(--muted);stroke-width:1}
.rc-tick,.rc-x{fill:var(--muted);font:15px var(--mono)}
.rc-line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.rc-elo{stroke:var(--green)}
.rc-ukd{stroke:var(--ink);stroke-dasharray:5 4}
.rc-dot-elo{fill:var(--green);stroke:var(--paper);stroke-width:2}
.rc-dot-ukd{fill:var(--paper);stroke:var(--ink);stroke-width:2}
.rc-end{fill:var(--ink);font:700 16px var(--mono)}
.rating-chart-readout{margin:10px 0 0;padding-top:10px;border-top:1px dashed var(--line);font-size:17px;line-height:1.45}
.rating-chart-readout small{display:block;margin-top:2px;font-size:15px;color:var(--muted)}

/* Round buttons on the match card. Fill shows the outcome, the thick outline is the round being played, and the ring marks the round whose details are open. */
masa-rounds{display:block;margin:18px 0 6px;padding-top:16px;border-top:1px solid var(--line)}
masa-rounds[hidden]{display:none}
.rounds-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.rounds-label{font:700 15px var(--mono);letter-spacing:.8px;color:var(--muted)}
.rounds-count{font:700 17px var(--mono)}
.rounds-track{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
/* Seven rounds to a row (six on the narrowest phones), so a typical tournament sits on one line. */
.round-button{display:grid;place-items:center;width:calc((100% - 36px)/7);max-width:46px;aspect-ratio:1;padding:0;background:var(--paper);border:2px solid var(--line);color:var(--muted);font:700 18px/1 var(--mono);cursor:pointer}
.round-button[data-state="played"]{background:var(--soft);border-color:var(--edge);color:var(--ink)}
.round-button[data-state="now"]{border:3px solid var(--green);color:var(--green)}
.round-button[data-state="win"]{background:var(--green);border-color:var(--green);color:var(--on-green)}
.round-button[data-state="draw"]{background:linear-gradient(135deg,var(--green) 34%,var(--paper) 34%);border-color:var(--green);color:var(--ink)}
.round-button[data-state="loss"]{background:var(--ink);border-color:var(--ink);color:var(--on-ink)}
.round-button[aria-pressed="true"]{outline:2px solid var(--ink);outline-offset:2px}
.round-button:focus-visible{outline:3px solid var(--green);outline-offset:3px}
.rounds-detail{margin:14px 0 0;padding:12px 14px;background:var(--soft);border-left:3px solid var(--green);font-size:17px;line-height:1.45}
.rounds-detail span{display:block;margin-top:3px;color:var(--muted)}
@media(max-width:360px){.round-button{width:calc((100% - 30px)/6)}}
/* 007 E: "Bu sporcu mu?" on a followed sporcu */
.kid-question{margin:4px 0 16px;border:2px solid var(--edge);box-shadow:4px 4px 0 var(--shadow);background:var(--soft);padding:14px;display:grid;gap:8px;font-size:18px;line-height:1.5}.kid-question small{color:var(--muted)}.kid-question p{margin:0;overflow-wrap:anywhere}.kid-question-row{text-align:left;overflow-wrap:anywhere}
/* Phase 2 test: the code box on the closed page and in Hesabım, the device code, and the device part of Bildirimler. Sharp corners like the rest. */
.code-input { width: 100%; border: 2px solid var(--edge); padding: 14px 12px; font: 700 21px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; text-align: center; }
.code-input:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.code-input::placeholder { color: var(--muted); font-weight: 400; letter-spacing: 1px; }
.closed label { align-self: stretch; text-align: left; font-size: 17px; }
.device-code { margin: 6px 0 4px; padding: 16px 12px; border: 2px solid var(--edge); background: var(--soft); text-align: center; font: 700 34px var(--mono); letter-spacing: 4px; }
.push-section { margin: 20px 0; padding: 16px; border: 1px solid var(--edge); }
.push-section h3 { margin-bottom: 8px; }
.push-section .account-status { margin: 4px 0 12px; }
/* Phase 2 test: the home page's notification card. Sharp corners and the hard shadow, like the follow question. */
.setup-card { margin: 0 0 22px; padding: 18px; border: 2px solid var(--edge); border-left: 6px solid var(--green); box-shadow: 4px 4px 0 var(--shadow); background: var(--soft); display: grid; gap: 10px; }
.setup-card h3 { margin: 0; font-size: 23px; line-height: 1.25; }
.setup-card p { margin: 0; font-size: 18px; line-height: 1.5; }
.setup-card .setup-note { font-size: 16px; color: var(--muted); }
.setup-card .text-button { justify-self: start; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setup-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; line-height: 1.45; }
.setup-steps li > b { flex: 0 0 30px; height: 30px; display: grid; place-items: center; background: var(--green); color: var(--on-green); font: 700 18px var(--mono); }
.share-icon { width: 22px; height: 22px; vertical-align: -4px; color: var(--green); }
/* The bottom buttons' background reaches the screen's bottom edge: on Android, Chrome may draw the page under the
   gesture bar, and a gap there showed a white strip under the dark buttons (18 Oct 2026). */
.bottom-nav::after{content:'';position:absolute;left:0;right:0;top:100%;height:120px;background:var(--paper)}
/* Phase 2 test: invite and device codes under the WhatsApp sign-in, one tap away. */
.closed .other-way{margin:22px 0 8px;border-top:1px solid var(--line);padding-top:8px;text-align:left;width:100%}.closed .other-way summary{cursor:pointer;font-weight:700;min-height:44px;display:flex;align-items:center;color:var(--green)}.closed .other-way[open] summary{margin-bottom:12px}
