.account-link {padding:7px 12px;font-size:12px;border:1px solid var(--line);border-radius:8px;white-space:nowrap;}
.records-page main {padding-top:28px;}
.records-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0 0 16px;}
.records-heading p {margin:0;font-size:15px;}
.records-heading span {font-size:12px;color:var(--muted);}
.loading-records {padding:36px 0;color:var(--muted);}
.empty-records {text-align:center;padding:44px 24px;}
.empty-records .primary-button {display:block;width:max-content;max-width:100%;margin:24px auto 0;text-decoration:none;padding:12px 20px;}
.length-statistics {min-width:0;max-width:100%;margin:0 0 24px;padding:16px 18px;}
.length-statistics summary {cursor:pointer;font-size:14px;font-weight:650;}
.length-statistics summary:focus-visible {outline:3px solid #a5b89a;outline-offset:4px;}
.length-statistics-note,.length-statistics-empty {font-size:12px;color:var(--muted);line-height:1.7;margin:12px 0;overflow-wrap:anywhere;}
.length-statistics-wrap {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;}
.length-statistics-wrap:focus-visible {outline:2px solid #a5b89a;outline-offset:2px;}
.length-statistics-table {width:100%;min-width:300px;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums;}
.length-statistics-table caption {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
.length-statistics-table th,.length-statistics-table td {padding:10px 8px;border-bottom:1px solid var(--line);text-align:right;}
.length-statistics-table thead th {font-size:11px;line-height:1.5;font-weight:500;color:var(--muted);background:var(--soft);}
.length-statistics-table th:first-child {text-align:left;white-space:nowrap;}
.length-statistics-table td {white-space:nowrap;}
.length-statistics-table tbody th {font-weight:500;}
.length-statistics-table tfoot {font-weight:650;color:var(--green);background:var(--soft);}
.length-statistics-table tfoot th,.length-statistics-table tfoot td {border-bottom:0;}
.history-layout {display:grid;grid-template-columns:minmax(250px,320px) minmax(360px,1fr);gap:28px;align-items:start;}
.history-list {display:grid;gap:10px;max-height:680px;overflow-y:auto;padding:3px;}
.history-card {display:block;width:100%;padding:16px;text-align:left;border:1px solid var(--line);background:var(--paper);border-radius:10px;}
.history-card[aria-pressed="true"] {border-color:var(--green);background:var(--soft);box-shadow:inset 3px 0 var(--green);}
.history-card strong {display:block;font-size:14px;margin-bottom:6px;}
.history-card[data-status="failed"] strong {color:#a94838;}
.history-entry {position:relative;}
.history-entry .history-card strong {padding-right:76px;}
.history-retry {position:absolute;top:11px;right:12px;padding:6px 10px;font-size:12px;color:var(--green);background:var(--soft);}
.history-card .history-date {display:block;font-size:11px;color:var(--muted);}
.history-card .history-result {display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;}
.history-card .history-points {font-weight:650;color:var(--green);white-space:nowrap;}
.record-pagination {display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:18px;font-size:12px;}
.record-pagination button {padding:8px 14px;}
.replay-panel {padding:24px;min-width:0;}
.replay-panel h2 {font-size:22px;margin:0 0 8px;}
.replay-attempts {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin:16px 0;}
.replay-attempts>span {font-size:12px;color:var(--muted);}
.replay-attempts>div {display:flex;flex-wrap:wrap;gap:8px;}
.replay-attempts button {padding:8px 10px;font-size:12px;}
.replay-meta {font-size:12px;color:var(--muted);margin:0;}
.replay-score {font-size:13px;color:var(--green);margin:8px 0 18px;}
.replay-retry-actions {margin:0 0 18px;}
.replay-retry-actions .primary-button {width:auto;display:inline-block;padding:10px 22px;font-size:14px;}
#history-retry-dialog .failure-actions {display:flex;flex-wrap:wrap;gap:10px;}
#history-retry-dialog .failure-actions button {padding:10px 16px;}
#history-retry-confirm {background:var(--green);border-color:var(--green);color:#fff;}
.replay-panel .board-frame {width:100%;}
#replay-board {display:block;user-select:none;}
.replay-controls {display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:18px;}
.replay-controls button {padding:8px 10px;font-size:12px;white-space:nowrap;}
#replay-position {font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums;}
.replay-slider-label {display:block;font-size:11px;color:var(--muted);margin:16px 0 4px;}
#replay-slider {width:100%;accent-color:var(--green);}
.replay-current {text-align:center;font-size:13px;min-height:22px;}
.replay-moves {display:flex;flex-wrap:wrap;gap:6px;max-height:150px;overflow:auto;}
.replay-moves button {padding:5px 8px;font-size:11px;font-variant-numeric:tabular-nums;}
.replay-moves button[aria-current="step"] {background:var(--green);color:#fff;}
.replay-note {font-size:11px;color:var(--muted);margin:18px 0 0;}
.my-ranking {display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;padding:24px 28px;margin-bottom:28px;background:var(--soft);}
.my-ranking h2 {margin:0;font-size:27px;}
.my-ranking p:not(.eyebrow) {margin:6px 0 0;color:var(--muted);font-size:13px;overflow-wrap:anywhere;}
.my-ranking .ranking-stat {display:flex;flex-direction:column;text-align:right;gap:2px;}
.my-ranking strong {font-size:32px;font-variant-numeric:tabular-nums;}
.my-ranking span {font-size:11px;color:var(--muted);}
.ranking-guest {padding:16px 0;color:var(--muted);}
.ranking-guest a {color:var(--green);text-decoration:underline;}
.ranking-toolbar {display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-bottom:16px;font-size:13px;}
.ranking-toolbar select {width:auto;max-width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:inherit;font:inherit;}
#ranking-members-label {font-size:inherit;color:inherit;}
.ranking-note {font-size:12px;color:var(--muted);margin:12px 0 0;}
.ranking-table-wrap {padding:0;overflow:hidden;}
.ranking-table {width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;}
.ranking-table caption {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
.ranking-table th,.ranking-table td {padding:18px 24px;text-align:left;border-bottom:1px solid var(--line);}
.ranking-table th {font-size:12px;font-weight:500;color:var(--muted);background:#f0f3ed;}
.ranking-table td:first-child {width:60px;font-weight:650;color:var(--green);}
.ranking-table th:first-child,.ranking-table td:first-child {white-space:nowrap;}
.ranking-table td:nth-child(2) {overflow-wrap:anywhere;}
.ranking-table td:nth-child(n+3),.ranking-table th:nth-child(n+3) {text-align:right;}
.ranking-table td:nth-child(n+3) {white-space:nowrap;}
.ranking-table tr:last-child td {border-bottom:0;}
.ranking-table tr.is-me {background:var(--soft);}
.ranking-table .me-label {font-size:10px;margin-left:8px;color:var(--green);}
.records-reload {display:block;padding:9px 20px;margin:28px auto 0;font-size:12px;}
@media(max-width:800px){
  .history-layout {grid-template-columns:1fr;gap:24px;}
  .history-list {max-height:340px;}
  .replay-panel {padding:18px;}
}
@media(max-width:480px){
  .records-heading {align-items:flex-start;flex-direction:column;gap:5px;}
  .replay-controls button {padding:8px 7px;font-size:11px;}
  .my-ranking {display:grid;grid-template-columns:minmax(0,1fr) auto auto;padding:20px;gap:16px;}
  .my-ranking h2,.my-ranking strong {font-size:24px;}
  .ranking-table th,.ranking-table td {padding:15px 8px;}
  .ranking-table td {font-size:13px;}
  .ranking-table td:first-child {width:32px;}
}
