/* A viewport rail: deliberately outside the app's fitted geometry. */
.shot-history { position:fixed; z-index:12; display:flex; flex-direction:column; gap:8px; padding:9px 7px; box-sizing:border-box; border:0; border-radius:0; color:#e7edff; background:transparent; box-shadow:none; }
.shot-history.hidden, .shot-history-toggle.hidden { display:none; }
.shot-history > header { display:flex; justify-content:space-between; align-items:center; gap:4px; padding:2px 3px 5px; border-bottom:0; font-size:11px; font-weight:800; letter-spacing:1px; color:#f3dca5; }
.shot-history:not(:has(.shot-history-tile)) > header { visibility:hidden; }
.shot-history-grid { display:grid; grid-template-rows:repeat(12,minmax(0,1fr)); gap:5px; flex:1; min-height:0; overflow:hidden; }
.shot-history-tile { position:relative; min-height:0; min-width:0; display:grid; container-type:size; grid-template-columns:auto minmax(0,1fr); grid-template-rows:minmax(0,.85fr) minmax(0,1.15fr) auto; align-content:stretch; gap:3px 7px; padding:6px 8px; border:1px solid #6f86ab44; border-left:2px solid #6e91b6; border-radius:7px; background:linear-gradient(#08101e33,#08101e33),var(--shot-owner-fill,linear-gradient(125deg,#263c56,#192940 80%)); box-shadow:inset 0 1px #d7e9ff20,0 2px 3px #0004; text-align:left; font:inherit; line-height:1.1; color:inherit; cursor:pointer; overflow:hidden; }
.shot-history-tile, .shot-history-tile * { caret-color:transparent; -webkit-user-select:none; user-select:none; }
.shot-history-tile:hover { border-color:#e5c782; filter:brightness(1.12); }
.shot-history-tile:focus-visible { outline:2px solid #ffe19a; outline-offset:-3px; }
.shot-history-identity { display:contents; }
.shot-history-number { position:absolute; top:6px; right:7px; color:#a3b4c8; font-size:clamp(8px,10cqh,10px); font-weight:400; font-variant-numeric:tabular-nums; }
.shot-history-name { grid-column:2; grid-row:1; align-self:end; min-width:0; padding-right:17px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:clamp(11px,17cqh,15px); line-height:1.1; font-weight:600; color:#e0e8f2; }
.shot-history-avatar { grid-column:1; grid-row:1 / 3; align-self:center; position:relative; display:grid; place-items:center; box-sizing:border-box; width:clamp(28px,56cqh,50px); height:clamp(28px,56cqh,50px); border-radius:50%; background:#3b4d68; border:1px solid #8ca4bd77; overflow:hidden; color:#c9d7e8; font-size:14px; font-weight:600; }
.shot-history-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.shot-history-score { grid-column:2; grid-row:2; align-self:start; font-size:clamp(16px,31cqh,24px); font-weight:600; line-height:1; color:#d5dfeb; font-variant-numeric:tabular-nums; text-shadow:none; }
.shot-history-pegs { grid-column:1 / -1; grid-row:3; display:flex; align-items:center; gap:clamp(3px,2cqw,6px); font-size:clamp(9px,15cqh,12px); font-weight:400; line-height:1.1; color:#c2d0e0; }
.shot-history-total { margin-left:auto; color:#a9b9cc; white-space:nowrap; }
.shot-history-peg { display:inline-flex; align-items:center; gap:2px; }
.shot-history-peg::before { content:""; width:clamp(6px,9cqh,9px); height:clamp(6px,9cqh,9px); border-radius:50%; border:1px solid #ffffff88; box-shadow:inset 0 1px 2px #fff8,0 1px 3px #000a; background:#4097f6; }
.shot-history-peg.orange::before { background:#ff842d; }
.shot-history-peg.purple::before { background:#d85cff; }
.shot-history-peg.green::before { background:#7ae653; }
.shot-history-play { display:none; }
.shot-history-tile.has-green { border-left-color:#8bd16c; }
.has-green .shot-history-play { color:#b8ff83; }
.shot-history.is-narrow { padding:7px 5px; gap:5px; }
.shot-history.is-narrow > header { font-size:9px; letter-spacing:.5px; }
.shot-history-toggle { position:fixed; bottom:12px; right:12px; z-index:14; border:1px solid #bda775; border-radius:8px; padding:9px 13px; background:#243656; color:#ffe5b3; font:inherit; cursor:pointer; }
.shot-history-toggle.in-hud { position:static; width:100%; min-width:0; padding:7px 3px; font-size:10px; }
.shot-history.is-drawer { z-index:15; }
.shot-history-panel-close { display:none; }
.shot-history.is-flyout { border:1px solid #728bb0; border-radius:10px; background:#111c31; box-shadow:0 12px 35px #0009; }
.shot-history.is-flyout > header { visibility:visible; }
.shot-history.is-flyout .shot-history-panel-close { display:block; border:0; padding:0 5px; background:transparent; color:#f3dca5; font-size:22px; cursor:pointer; }
.shot-history.is-flyout .shot-history-grid { grid-template-rows:repeat(12,minmax(64px,1fr)); overflow-y:auto; }
.shot-history-toggle.in-hud.is-flyout-toggle { flex-shrink:0; padding:7px; font-size:12px; }
.shot-history-tile.is-new { animation:shot-tile-land .52s cubic-bezier(.2,.9,.25,1.15) both; }
.shot-history-tile.is-new .shot-history-peg { animation:shot-peg-pop .35s .14s both; }
.shot-history-tile.is-new .shot-history-peg:nth-child(2) { animation-delay:.20s; }
.shot-history-tile.is-new .shot-history-peg:nth-child(3) { animation-delay:.26s; }
.shot-history-tile.is-new .shot-history-peg:nth-child(4) { animation-delay:.32s; }
.shot-history-tile.has-green.is-new::after { content:"✦"; position:absolute; right:18px; top:0; color:#ddffae; font-size:30px; pointer-events:none; animation:shot-green-spark .5s both; }
@keyframes shot-tile-land { 0% { transform:translateX(30px) scale(.94); opacity:0; filter:brightness(1.8); } 65% { transform:translateX(-3px) scale(1.02); opacity:1; } 100% { transform:none; opacity:1; filter:brightness(1); } }
@keyframes shot-peg-pop { 0% { transform:scale(.3); opacity:0; } 65% { transform:scale(1.25); opacity:1; } 100% { transform:scale(1); opacity:1; } }
@keyframes shot-green-spark { 0% { transform:scale(.2) rotate(-40deg); opacity:0; } 45% { transform:scale(1.2) rotate(20deg); opacity:1; } 100% { transform:scale(1.5) rotate(45deg); opacity:0; } }
.shot-history-replay { width:min(820px,92vw); padding:0; border:2px solid #97accd; border-radius:15px; background:#111c31; color:#edf3ff; box-shadow:0 18px 80px #000a; overflow:hidden; }
.shot-history-replay::backdrop { background:#02091566; }
.shot-history-replay > header { display:flex; align-items:center; gap:16px; padding:14px 18px; border-bottom:1px solid #7088aa66; background:linear-gradient(110deg,#3e4267,#182b45); }
.shot-history-replay > header > div { flex:1; min-width:0; }
.shot-history-replay small { font-size:9px; letter-spacing:2px; color:#d3be8b; }
.shot-history-replay h2 { margin:3px 0 0; font-size:18px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shot-history-replay-score { color:#ffe4a3; font-size:24px; }
.shot-history-replay button { cursor:pointer; border:1px solid #728bb0; border-radius:7px; padding:7px 10px; background:#293e60; color:#f2f5ff; font:inherit; font-size:12px; }
.shot-history-replay button:focus-visible { outline:2px solid #ffe4a3; }
.shot-history-replay button:disabled { opacity:.4; cursor:default; }
.shot-history-replay .shot-history-close { font-size:24px; padding:0 9px; }
.shot-history-replay-view { height:min(480px,54vw,58vh); min-height:200px; background:#070e20; }
.shot-history-replay iframe { display:block; width:100%; height:100%; border:0; pointer-events:none; }
.level-entry:has(.rush-leader-play) { position:relative; }
.rush-leader-play {
  position:absolute; top:6px; right:6px; z-index:3; display:grid; place-items:center;
  width:32px; height:32px; padding:0 0 0 2px; color:#ffe4a3; background:#172338;
  border:1px solid #e2bd71; border-radius:50%; cursor:pointer;
}
.rush-leader-play:hover, .rush-leader-play:focus-visible { background:#34445a; outline:2px solid #ffe4a3; }
.rush-pace {
  flex:0 0 auto; min-width:0; padding:10px 12px; border:1px solid #5b7790; border-radius:9px;
  background:linear-gradient(145deg,#1a2d42,#111a2c); color:#f8f0e0; font-size:12px;
}
.rush-pace header, .rush-pace-key { display:flex; align-items:baseline; justify-content:space-between; gap:5px; }
.rush-pace header strong { font-size:14px; }
.rush-pace header span, .rush-pace small { color:#b9c9d6; }
.rush-pace svg { display:block; width:100%; max-height:136px; margin:5px 0; fill:none; }
.rush-pace svg .grid { stroke:#61798f; opacity:.4; }
.rush-pace svg .runner { stroke:#69e5ff; stroke-width:2.5; }
.rush-pace svg .leader { stroke:#f8ca78; stroke-width:2; stroke-dasharray:4 3; }
.rush-pace-key { color:#69e5ff; }
.rush-pace-key.leader { color:#f8ca78; }
.rush-pace-axis { display:flex; justify-content:space-between; margin-bottom:6px; font-size:10px; color:#b9c9d6; }
.rush-pace-key span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rush-pace small { display:block; margin-top:4px; }
.rush-pace-difference {
  display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:2px 6px;
  margin-top:8px; padding-top:7px; border-top:1px solid #587084; color:#d4dfe8;
}
.rush-pace-difference strong { font-size:16px; font-variant-numeric:tabular-nums; }
.rush-pace-difference[data-pace="ahead"] strong { color:#86edac; }
.rush-pace-difference[data-pace="behind"] strong { color:#ff999d; }
.shot-history-replay footer { display:flex; justify-content:flex-end; gap:8px; align-items:center; padding:12px 16px; }
.shot-history-replay footer span { flex:1; font-size:12px; color:#a8bbd8; }
.shot-history-replay footer [role="status"]:empty { display:none; }
.shot-history-replay #replayModal { position:absolute; inset:0; z-index:3; padding:12px; }
html[data-game-ui="modern"] .shot-history-replay .replay-modal-title::before { content:"REPLAY ARCHIVE  /  SELECTED SHOT"; }
.shot-history-replay .replay-modal-card { width:min(520px,100%); max-height:100%; overflow:auto; }
#replaySaveStatus { margin:0; color:#ffc4a9; font-size:13px; }
#replaySaveStatus:empty { display:none; }
.shot-replay-embed #accountDock, .shot-replay-embed .replay-controls, .shot-replay-embed .fullscreen-toggle { display:none !important; }
.shot-replay-embed body { pointer-events:none; }
@media (prefers-reduced-motion:reduce) { .shot-history-tile, .shot-history-tile *, .shot-history-tile::after { animation:none !important; } }

.shot-history.is-compact .shot-history-tile { padding:2px 5px; gap:1px 5px; }
.shot-history.is-compact .shot-history-number { top:3px; right:5px; }

.shot-history-drinks { display:inline-flex; align-items:center; gap:2px; margin-left:4px; white-space:nowrap; color:#f1d89e; }
.shot-history-drinks > span { font-size:1.15em; line-height:1; }
@container (max-width:180px) {
  .shot-history-pegs:has(.shot-history-drinks) .shot-history-total { display:none; }
  .shot-history-drinks { margin-left:auto; }
}
