:root{--bg:#f4f6f8;--card:#fff;--ink:#17212b;--muted:#68737f;--line:#dfe4e8;--primary:#1f6feb;--danger:#c62828;--success:#17823b}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.site-header{background:#111820;padding:14px 20px}.brand{color:#fff;text-decoration:none;font-weight:800}.container{width:min(1120px,calc(100% - 28px));margin:24px auto 60px}.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px;margin-bottom:18px;box-shadow:0 2px 10px rgba(0,0,0,.04)}.narrow{max-width:760px;margin-inline:auto}h1,h2,h3{margin-top:0}.page-head,.section-head,.game-actions,.page-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.button,button{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);padding:10px 14px;text-decoration:none;font-weight:700;cursor:pointer}.button.primary,button.primary{background:var(--primary);border-color:var(--primary);color:#fff}.button.danger{background:var(--danger);border-color:var(--danger);color:#fff}.form-grid{display:grid;gap:16px}label{display:grid;gap:7px;font-weight:700}input,textarea,select{width:100%;padding:11px 12px;border:1px solid #cbd3da;border-radius:9px;font:inherit;background:#fff}.two-col,.team-panels{display:grid;grid-template-columns:1fr 1fr;gap:18px}.score-line{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:18px;text-align:center;font-size:18px}.score-line strong{font-size:30px}.game-meta,.muted{color:var(--muted)}.status{padding:6px 10px;border-radius:999px;background:#edf1f5;font-size:13px}.status-playing{background:#fff0cc}.status-finished{background:#dff3e4}.alert{padding:12px;border-radius:9px;margin-bottom:14px}.alert.error{background:#ffe5e5}.alert.success{background:#e0f4e5}.scoreboard{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;text-align:center}.scoreboard strong{display:block;font-size:52px}.clock-box{display:grid;gap:7px;min-width:100px}.team-panel h2{text-align:center}.active-players,.shooter-buttons,.shot-types,.shot-results{display:flex;flex-wrap:wrap;gap:8px}.player-chip{padding:8px 10px;border-radius:999px;background:#edf3ff}.shooter-buttons button,.shot-types button,.shot-results button{flex:1;min-width:70px}.selected{outline:3px solid var(--primary);background:#e7f0ff!important}.made{background:#e5f6e9}.missed{background:#fde8e8}.selection-summary{margin-top:10px;color:var(--muted);font-size:13px}.hidden{display:none}.event-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.delete-event{padding:6px 10px;color:var(--danger)}dialog{border:0;border-radius:14px;padding:22px;width:min(560px,calc(100% - 28px))}dialog::backdrop{background:rgba(0,0,0,.45)}#lineup-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}.check-player{display:flex;align-items:center;gap:8px;border:1px solid var(--line);padding:10px;border-radius:9px}.check-player input{width:auto}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.result-hero{display:flex;align-items:center;justify-content:center;gap:30px;text-align:center}.result-hero strong{display:block;font-size:64px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{padding:11px;border-bottom:1px solid var(--line);text-align:center}th:first-child{text-align:left}.empty-state{text-align:center;padding:48px}
@media(max-width:767px){.container{width:min(100% - 16px,1120px);margin-top:12px}.card{padding:14px;border-radius:11px}.two-col,.team-panels{grid-template-columns:1fr}.scoreboard strong{font-size:42px}.scoreboard{position:sticky;top:0;z-index:5}.score-line{font-size:14px}.score-line strong{font-size:24px}.page-head{align-items:flex-start}.result-hero strong{font-size:48px}.team-panel{margin-bottom:12px}}
.lineup-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.lineup-actions .button{flex:1}

.site-header{display:flex;align-items:center;justify-content:space-between;gap:16px}.header-nav{display:flex;align-items:center;gap:10px}.header-nav>a{color:#fff;text-decoration:none;font-weight:700}.header-nav form{margin:0}.inline-form{display:inline-flex;margin:0}.button.public-on{background:var(--success);border-color:var(--success);color:#fff}

.event-team{display:inline-block;margin-right:.55rem;padding:.2rem .55rem;border-radius:999px;background:#eef2f7;font-size:.78rem;font-weight:700;line-height:1.3;vertical-align:middle}

.status-paused{background:#e7e2ff;color:#47309a}.score-save-actions{display:flex;gap:10px;flex-wrap:wrap}
.app-version{display:inline-block;margin-left:.45rem;padding:.18rem .48rem;border:1px solid rgba(255,255,255,.35);border-radius:999px;font-size:.68rem;font-weight:700;vertical-align:middle;color:#dbe7f5}.game-card>div:first-child h2{margin-bottom:6px}
@media(max-width:767px){.app-version{display:block;width:max-content;margin:.25rem 0 0}.header-nav{gap:7px;flex-wrap:wrap;justify-content:flex-end}.header-nav>a{font-size:.82rem}}

.team-name{display:inline-flex;align-items:center;justify-content:center;gap:.25rem}.winner-team{font-weight:800}.crown-icon{display:inline-block;line-height:1;font-size:1.15em;filter:drop-shadow(0 1px 1px rgba(0,0,0,.12))}.delete-game-form{margin-left:auto}@media(max-width:767px){.delete-game-form{margin-left:0}}

/* Version 1.1.1 roster editor */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.roster-editor{display:grid;gap:8px}.roster-head,.roster-row{display:grid;grid-template-columns:minmax(80px,110px) minmax(150px,1fr) auto;gap:10px;align-items:center}.roster-head{padding:0 2px;color:var(--muted);font-size:.82rem;font-weight:700}.roster-row label{display:block}.roster-row input{margin:0}.roster-remove{padding:10px 12px}.roster-team-card{border:1px solid var(--line);border-radius:12px;padding:14px}.roster-team-card h2{margin-bottom:12px}.roster-add-team{margin-top:12px;width:100%}.roster-columns{align-items:start}
@media(max-width:767px){.roster-head,.roster-row{grid-template-columns:74px minmax(0,1fr) auto;gap:7px}.roster-remove{padding:10px;font-size:.82rem}.roster-team-card{padding:11px}}

/* Version 1.2 */
.mode-picker{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:4px}.mode-card{display:flex;grid-template-columns:none;align-items:flex-start;gap:10px;border:2px solid var(--line);border-radius:12px;padding:14px;cursor:pointer;background:#fff}.mode-card:has(input:checked){border-color:var(--primary);background:#edf4ff}.mode-card input{width:auto;margin-top:4px}.mode-card span{display:grid;gap:4px}.mode-card strong{font-size:1.05rem}.mode-card small{color:var(--muted);font-weight:500;line-height:1.45}.mode-status{font-weight:800}
.jersey-columns{align-items:start}.jersey-picker{display:grid;gap:14px}.jersey-picker-meta{display:flex;justify-content:space-between;align-items:center;gap:10px}.button.small{padding:7px 10px;font-size:.82rem}.jersey-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px;max-height:340px;overflow:auto;padding:4px}.jersey-number{aspect-ratio:1/1;padding:0;min-width:0;font-size:.92rem;border-radius:9px}.jersey-number.selected{background:var(--primary)!important;color:#fff;border-color:var(--primary);outline:none}.optional-names{border-top:1px solid var(--line);padding-top:12px}.optional-names h3{display:flex;align-items:baseline;gap:8px;margin-bottom:10px}.optional-names h3 small{font-size:.75rem;color:var(--muted);font-weight:600}.selected-player-row{display:grid;grid-template-columns:60px 1fr;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid #eef1f4}.selected-player-row strong{text-align:center;font-size:1rem}.large-submit{min-height:52px;font-size:1.02rem}
.stat-controls{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}.stat-player-buttons,.stat-types{display:flex;flex-wrap:wrap;gap:8px}.stat-player-buttons button{flex:1;min-width:78px}.stat-types{margin-top:10px}.stat-types button{display:grid;gap:2px;flex:1;min-width:110px;padding:12px 8px;background:#f6f8fb}.stat-types button span{font-size:.68rem;color:var(--muted);font-weight:600}.stat-summary{margin-top:9px;color:var(--muted);font-size:.82rem}.stat-event{background:#fafbfc}
@media(max-width:767px){.mode-picker{grid-template-columns:1fr}.jersey-grid{grid-template-columns:repeat(8,minmax(0,1fr));max-height:none}.jersey-number{font-size:.86rem}.selected-player-row{grid-template-columns:52px 1fr}.stat-types button{min-width:calc(50% - 4px)}.jersey-columns{grid-template-columns:1fr}}

/* Version 1.2 record mode layout / event editor */
.mode-fieldset{border:0;padding:0;margin:0;min-width:0}.mode-fieldset>legend{font-weight:700;margin-bottom:8px}.mode-card{position:relative;display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:start!important;gap:10px!important;font-weight:400!important}.mode-card input[type="radio"]{width:20px!important;height:20px!important;margin:2px 0 0!important;align-self:start}.mode-copy{display:block!important;min-width:0}.mode-title{display:block;font-size:1.05rem;font-weight:700;line-height:1.35}.mode-description{display:block;margin-top:5px;color:var(--muted);font-size:.88rem;font-weight:400!important;line-height:1.55}
.event-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.edit-event{padding:6px 10px;color:var(--primary)}.event-row>span{min-width:0}.event-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.event-edit-grid .full{grid-column:1/-1}.event-shot-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.event-edit-help{margin:0;color:var(--muted);font-size:.82rem;line-height:1.5}
@media(max-width:767px){.event-row{align-items:flex-start;gap:8px}.event-actions{flex-direction:column;align-items:stretch}.event-actions button{padding:6px 9px}.event-edit-grid,.event-shot-fields{grid-template-columns:1fr}.event-edit-grid .full{grid-column:auto}}


/* Public result share */
.public-share-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.line-share{background:#06c755!important;border-color:#06c755!important;color:#fff!important;gap:8px}.line-share:hover{filter:brightness(.96)}.line-share-mark{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:22px;padding:0 5px;border-radius:5px;background:#fff;color:#06c755;font-size:.66rem;font-weight:900;letter-spacing:-.02em}
@media(max-width:767px){.public-share-actions{width:100%}.public-share-actions .button{flex:1;min-width:145px}}

/* Version 1.2: 記録モードのプルダウン */
.mode-select {
    width: 100%;
    max-width: 520px;
    min-height: 52px;
    padding: 10px 44px 10px 14px;
    font-size: 16px;
    font-weight: 700;
}
.mode-help {
    margin-top: 10px;
}
.mode-help p {
    margin: 0;
    font-weight: 400;
    line-height: 1.7;
}

/* Version 1.3 */
.user-password-form input[type="password"]{min-width:180px}
.public-video-action{margin:0 0 16px}
@media (max-width:767px){
  .user-password-form{display:flex;gap:8px;flex-wrap:wrap}
  .user-password-form input[type="password"]{min-width:0;width:100%}
}

/* Version 1.3: LINE share app/web switching */
.line-share-app { display: none; }
.line-share-web { display: inline-flex; }

@media (max-width: 767px) {
  .line-share-app { display: inline-flex; }
  .line-share-web { display: none; }
}

/* Version 1.3: optional player names accordion */
.name-accordion{
  margin-top:16px;
  border:1px solid #d9dde3;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
.name-accordion > summary{
  cursor:pointer;
  list-style:none;
  padding:14px 16px;
  font-weight:700;
  position:relative;
  user-select:none;
}
.name-accordion > summary::-webkit-details-marker{display:none;}
.name-accordion > summary::after{
  content:"＋";
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  font-size:20px;
  line-height:1;
}
.name-accordion[open] > summary::after{content:"−";}
.name-accordion-body{
  padding:0 16px 16px;
  border-top:1px solid #eef0f3;
}
.name-accordion-body h3{
  margin:14px 0 10px;
}

/* Version 1.3: smartphone score-entry player buttons = 5 columns */
@media (max-width: 767px) {
  .shooter-buttons,
  .stat-player-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .shooter-buttons button,
  .stat-player-buttons button {
    width: 100%;
    min-width: 0;
    padding-left: 4px;
    padding-right: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Version 1.3: YouTube embed on public result page */
.public-video-card h2 {
  margin-top: 0;
}
.youtube-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}
.youtube-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Version 1.3: YouTube player full-width responsive sizing */
.public-video-card {
  width: 100%;
}

.youtube-embed {
  width: 100%;
  max-width: none;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0;
  padding: 0;
}

.youtube-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Version 1.3: YouTube edge-to-edge inside the video card */
.public-video-card {
  overflow: hidden;
}

.public-video-card .youtube-embed {
  width: calc(100% + 48px);
  max-width: none;
  margin-left: -24px;
  margin-right: -24px;
  margin-bottom: -24px;
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

@media (max-width: 767px) {
  .public-video-card .youtube-embed {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
  }
}

/* Version 1.3: player names in result tables stay on one line */
table th:first-child,
table td:first-child {
  white-space: nowrap;
}

@media (max-width: 767px) {
  .table-wrap table th:first-child,
  .table-wrap table td:first-child {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    min-width: max-content;
  }
}

/* Version 1.3 hotfix: player name cells must NEVER wrap */
.table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: max-content !important;
  min-width: 100% !important;
}

.table-wrap table tbody tr > th:first-child,
.table-wrap table tbody tr > td:first-child,
.table-wrap table thead tr > th:first-child {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  hyphens: none !important;
  min-width: max-content !important;
  width: auto !important;
}

.table-wrap table tbody tr > th:first-child *,
.table-wrap table tbody tr > td:first-child * {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  hyphens: none !important;
}

/* Version 1.3 final hotfix: player number + name is one unbreakable unit */
.player-name-cell {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  width: 1% !important;
}

.player-name-nowrap {
  display: inline-block !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  hyphens: none !important;
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
}

@media (max-width: 767px) {
  .player-name-cell,
  .player-name-nowrap {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }

  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
  }
}

/* Version 1.4 AI bridge */
.ai-job-list{display:grid;gap:12px}
.ai-job{border:1px solid var(--line);border-radius:12px;padding:14px}
.ai-json{white-space:pre-wrap;word-break:break-word;background:#f6f8fa;padding:12px;border-radius:8px;overflow:auto}

/* =========================================================
   Version 1.5 - compact game input UI
   ========================================================= */
.game-input-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}
.game-quarter-title{
  text-align:center;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  font-weight:800;
}
.compact-back,.compact-history{min-height:42px}

.compact-scoreboard{
  display:grid;
  grid-template-columns:1fr minmax(150px,220px) 1fr;
  align-items:center;
  gap:12px;
  padding:14px 18px;
}
.compact-scoreboard > div:first-child{text-align:left}
.compact-scoreboard > div:last-child{text-align:right}
.compact-scoreboard small{
  display:block;
  font-weight:800;
  font-size:15px;
  line-height:1.25;
  min-height:38px;
}
.compact-scoreboard strong{
  display:block;
  font-size:54px;
  line-height:1;
  margin-top:6px;
}
.compact-scoreboard .clock-box{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}
.compact-scoreboard select,
.compact-scoreboard input{
  min-height:48px;
  font-size:20px;
  font-weight:800;
  text-align:center;
}

.mobile-team-switch{
  display:flex;
  gap:8px;
  margin:14px 0 10px;
}
.team-switch-button{
  flex:1;
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:12px 8px;
  font-weight:800;
  font-size:15px;
}
.team-switch-button.active{
  background:#111820;
  color:#fff;
  border-color:#111820;
}

.compact-team-panel{
  overflow:hidden;
}
.compact-team-panel > h2{
  margin:0 0 12px;
  font-size:22px;
}
.compact-lineup-box{
  background:#f6f7f9;
  border-radius:14px;
  padding:12px;
}
.compact-lineup-label{
  font-size:13px;
  font-weight:800;
  color:#66707a;
  margin-bottom:8px;
}
.compact-lineup-box .active-players{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
}
.compact-lineup-box .player-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:52px;
  padding:6px 3px;
  border-radius:10px;
  background:#111820;
  color:#fff;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.compact-lineup-box .lineup-actions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6px;
  margin-top:9px;
}
.compact-lineup-box .lineup-actions .button{
  padding:8px 4px;
  min-height:38px;
  font-size:12px;
}

.compact-control-title{
  margin:18px 0 9px;
  font-size:14px;
  font-weight:800;
}
.compact-team-panel .shooter-buttons,
.compact-team-panel .stat-player-buttons{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
}
.compact-team-panel .shooter-buttons button,
.compact-team-panel .stat-player-buttons button{
  min-width:0;
  min-height:52px;
  border:1px solid #d5dae0;
  border-radius:12px;
  background:#fff;
  padding:5px 2px;
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.compact-team-panel .shooter-buttons button.selected,
.compact-team-panel .stat-player-buttons button.selected{
  background:#111820;
  color:#fff;
  border-color:#111820;
}

.compact-shot-types{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
  margin-top:9px;
}
.compact-shot-types button{
  min-height:92px;
  border:0;
  border-radius:14px;
  background:linear-gradient(#20242a,#090b0e);
  color:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
}
.compact-shot-types button strong{font-size:34px;line-height:1}
.compact-shot-types button span{font-size:11px;font-weight:700}
.compact-shot-types button.selected{
  outline:3px solid #ff8a3d;
  outline-offset:-3px;
}
.compact-shot-results{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-top:7px;
}
.compact-shot-results button{
  min-height:72px;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.compact-shot-results button strong{font-size:20px}
.compact-shot-results button span{font-size:10px;margin-top:2px}
.compact-shot-results .made{background:#e1f4e8}
.compact-shot-results .missed{background:#fde6e6}
.compact-shot-results button.selected{outline:3px solid #ff8a3d;outline-offset:-3px}

.compact-team-panel .stat-controls{
  padding-top:14px;
  margin-top:14px;
}
.compact-team-panel .stat-types{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:7px;
}
.compact-team-panel .stat-types button{
  min-height:72px;
  border:1px solid #d6dbe0;
  border-radius:14px;
  background:linear-gradient(#fff,#eceff2);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.compact-team-panel .stat-types button strong{font-size:21px}
.compact-team-panel .stat-types button span{font-size:10px;margin-top:3px}
.compact-team-panel .substitution-controls{margin-top:10px}
.compact-team-panel .substitution-button{width:100%}

.play-history-card{scroll-margin-top:12px}

@media (min-width:768px){
  .mobile-team-switch{display:none}
  .compact-team-panels{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
    align-items:start;
  }
}

@media (max-width:767px){
  .container{padding-left:10px;padding-right:10px}
  .game-input-head{position:sticky;top:0;z-index:20;background:var(--bg);padding:8px 0;margin-bottom:4px}
  .game-quarter-title > span:first-child{display:none}
  .compact-scoreboard{
    grid-template-columns:1fr minmax(112px,145px) 1fr;
    gap:6px;
    padding:10px;
    border-radius:14px;
  }
  .compact-scoreboard small{font-size:12px;min-height:32px}
  .compact-scoreboard strong{font-size:48px}
  .compact-scoreboard select,
  .compact-scoreboard input{min-height:44px;font-size:18px;padding:6px}
  .compact-team-panels .team-panel{display:none}
  .compact-team-panels .team-panel.mobile-active{display:block}
  .compact-team-panel{padding:12px}
  .compact-team-panel > h2{font-size:18px;margin-bottom:8px}
  .compact-lineup-box{padding:9px}
  .compact-lineup-box .player-chip{min-height:48px;font-size:12px}
  .compact-team-panel .shooter-buttons button,
  .compact-team-panel .stat-player-buttons button{min-height:50px;font-size:12px}
  .compact-shot-types button{min-height:82px}
  .compact-shot-types button strong{font-size:31px}
  .selection-summary,.stat-summary{font-size:12px;margin-top:7px}
}

/* =========================================================
   Version 1.6 - Mobile fixed one-screen scorer UI
   ========================================================= */
.mobile-game-console{display:none}

@media (max-width:767px){
  html.score-page-html,
  body.score-page-body{
    height:100%;
    min-height:100%;
    overflow:hidden !important;
    overscroll-behavior:none;
    background:#ddd;
  }
  body.score-page-body .site-header{display:none !important}
  body.score-page-body > main.container{
    width:100%;
    max-width:none;
    height:100dvh;
    padding:0 !important;
    margin:0 !important;
    overflow:hidden !important;
  }
  body.score-page-body #score-app > :not(.mobile-game-console){display:none !important}
  body.score-page-body .mobile-game-console{
    display:grid;
    grid-template-rows:50px 96px minmax(0,1fr) 58px;
    width:100%;
    height:100dvh;
    background:#dedede;
    color:#111;
    overflow:hidden;
  }

  .mgc-topbar{
    display:grid;
    grid-template-columns:68px 1fr 82px;
    align-items:center;
    background:#ff9478;
    padding:5px 8px;
    gap:5px;
  }
  .mgc-back,.mgc-undo{
    border:0;background:transparent;color:#434343;font-weight:800;font-size:14px;text-decoration:none;text-align:center;padding:8px 2px
  }
  .mgc-quarter{
    margin:auto;
    display:grid;
    grid-template-columns:38px 58px 38px;
    align-items:center;
    background:#555;
    color:#fff;
    border-radius:28px;
    overflow:hidden;
  }
  .mgc-quarter strong{text-align:center;font-size:23px}
  .mgc-qbtn{
    height:40px;border:0;background:transparent;color:#fff;font-size:18px;font-weight:800;padding:0
  }

  .mgc-scorebar{
    display:grid;
    grid-template-columns:1fr 90px 1fr;
    align-items:center;
    background:#aaa;
    padding:5px 10px;
  }
  .mgc-team-score{text-align:center;min-width:0}
  .mgc-team-score span{
    display:block;font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .mgc-team-score strong{display:block;font-size:48px;line-height:1;margin-top:2px}
  .mgc-clock-wrap{display:flex;justify-content:center}
  .mgc-clock-wrap input{
    width:82px;height:38px;border:0;border-radius:8px;background:rgba(255,255,255,.7);
    text-align:center;font-size:17px;font-weight:800;padding:3px
  }

  .mgc-main{
    min-height:0;
    display:grid;
    grid-template-columns:82px minmax(0,1fr) 82px;
    gap:6px;
    padding:7px 7px 5px;
    background:#ddd;
    overflow:hidden;
  }
  .mgc-lineup{min-width:0;display:grid;grid-template-rows:22px minmax(0,1fr)}
  .mgc-lineup-title{
    font-size:9px;font-weight:800;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .mgc-player-stack{
    min-height:0;
    display:grid;
    grid-template-rows:repeat(5,minmax(0,1fr));
    gap:5px;
  }
  .mgc-player{
    min-height:0;
    width:100%;
    border:2px solid #555;
    border-radius:10px;
    background:#111;
    color:#fff;
    padding:2px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    overflow:hidden;
  }
  .mgc-away-lineup .mgc-player{background:#fff;color:#111}
  .mgc-player b{font-size:22px;line-height:1}
  .mgc-player span{
    width:100%;font-size:9px;font-weight:800;line-height:1.1;margin-top:3px;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .mgc-player.selected{outline:3px solid #ff7a00;outline-offset:-2px}

  .mgc-controls{
    min-height:0;
    display:grid;
    grid-template-rows:26px minmax(150px,1.25fr) minmax(120px,1fr) 35px;
    gap:5px;
    overflow:hidden;
  }
  .mgc-selected-player{
    display:flex;align-items:center;justify-content:center;
    min-width:0;border-radius:7px;background:#c8c8c8;
    font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .mgc-shot-grid{
    min-height:0;
    display:grid;
    grid-template-columns:1fr 1fr;
    grid-template-rows:1fr 1fr;
    gap:4px;
  }
  .mgc-action{
    border:1px solid #999;border-radius:8px;
    background:linear-gradient(#fff,#d6d6d6);
    color:#111;font-weight:800;min-width:0;min-height:0;padding:2px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;
  }
  .mgc-shot-grid .mgc-action.made{
    background:linear-gradient(#333,#050505);color:#fff;
  }
  .mgc-shot-grid .mgc-action b{font-size:42px;font-weight:400;line-height:1}
  .mgc-shot-grid .mgc-action span{font-size:10px;margin-top:3px}
  .mgc-shot-grid .mgc-action.missed b{font-size:36px}

  .mgc-stat-grid{
    min-height:0;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:4px;
  }
  .mgc-stat-grid .mgc-action{font-size:13px}
  .mgc-stat-grid .mgc-action span{font-size:8px;margin-top:1px}

  .mgc-bottom-actions{
    display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px
  }
  .mgc-bottom-actions button{
    border:1px solid #999;border-radius:7px;background:#f2f2f2;
    font-size:9px;font-weight:800;padding:2px
  }

  .mgc-points{
    display:grid;
    grid-template-columns:1fr 80px 1fr;
    align-items:center;
    border-top:1px solid #aaa;
    background:#ededed;
    padding:4px 12px;
  }
  .mgc-points > div:not(.mgc-points-center){
    display:flex;gap:6px;align-items:center;justify-content:center;min-width:0
  }
  .mgc-points strong{
    max-width:70px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .mgc-points > div > span{font-size:22px;font-weight:800}
  .mgc-points-center{text-align:center;display:flex;flex-direction:column}
  .mgc-points-center span{font-size:10px;font-weight:800}
  .mgc-points-center b{font-size:15px}

  /* dialogs remain usable over fixed screen */
  body.score-page-body dialog{
    max-height:88dvh;
    max-width:94vw;
    overflow:auto;
  }
}

/* =========================================================
   Version 1.7 - smartphone scroll scorer UI
   ========================================================= */
@media (max-width:767px){
  html.score-page-html,
  body.score-page-body{
    height:auto !important;
    min-height:100% !important;
    overflow:auto !important;
    background:var(--bg) !important;
  }
  body.score-page-body .site-header{display:flex !important}
  body.score-page-body > main.container{
    width:100% !important;
    max-width:1180px !important;
    height:auto !important;
    padding:14px 10px 40px !important;
    overflow:visible !important;
  }
  body.score-page-body #score-app > :not(.mobile-game-console){display:block !important}
  .mobile-game-console{display:none !important}
}

.v17-input-head{
  grid-template-columns:86px 1fr 86px;
  margin-bottom:14px;
}
.v17-input-head .game-quarter-title{justify-content:center}
.v17-input-head .mode-status{font-size:14px}

.v17-scoreboard{
  margin-bottom:16px;
}
.v17-scoreboard small{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.v17-team-panel{
  margin-bottom:16px;
}
.v17-team-panel > h2{
  text-align:center;
  font-size:24px;
  margin:0 0 14px;
}

.v17-lineup-box{
  padding:12px !important;
  margin-bottom:10px;
}
.v17-lineup-box .active-players{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:8px !important;
}
.v17-lineup-box .player-chip{
  display:flex !important;
  justify-content:center;
  align-items:center;
  min-height:56px !important;
  border-radius:12px !important;
  background:#111820 !important;
  color:#fff !important;
  font-size:13px !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.v17-player-select-label{
  font-size:12px;
  font-weight:700;
  color:#6b7480;
  margin:7px 0;
}
.v17-shooter-buttons{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:8px !important;
}
.v17-shooter-buttons button{
  min-width:0 !important;
  min-height:56px !important;
  border-radius:12px !important;
  font-size:13px !important;
  font-weight:800 !important;
  padding:6px 3px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.v17-shooter-buttons button.selected{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
  outline:3px solid #ff8a3d;
  outline-offset:-3px;
}

.v17-direct-shot-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:10px;
}
.v17-shot{
  min-height:74px;
  border:0;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  font-weight:800;
}
.v17-shot strong{
  font-size:38px;
  line-height:1;
}
.v17-shot span{
  margin-top:3px;
  font-size:12px;
}
.v17-shot.made{
  background:linear-gradient(#24282d,#080a0d);
  color:#fff;
}
.v17-shot.missed{
  background:linear-gradient(#fff,#e5e7e9);
  color:#111;
  border:1px solid #c9ced4;
}

.v17-hidden-stat-players{
  display:none !important;
}
.v17-stat-types{
  display:grid !important;
  grid-template-columns:repeat(4,1fr) !important;
  gap:8px !important;
  margin-top:8px !important;
}
.v17-stat-types button{
  min-height:82px !important;
  border-radius:0 !important;
  background:#050505 !important;
  color:#fff !important;
  border:0 !important;
  padding:5px 2px !important;
}
.v17-stat-types button strong{
  font-size:21px !important;
}
.v17-stat-types button span{
  font-size:8px !important;
  line-height:1.15 !important;
}

.v17-team-actions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:10px;
}
.v17-team-actions .button{
  min-height:52px;
  padding:8px 4px;
  font-size:13px;
}
.v17-team-panel .substitution-controls{
  margin-top:8px;
}
.v17-team-panel .substitution-button{
  width:100%;
}

@media (min-width:768px){
  .v17-direct-shot-grid{display:none}
  .v17-team-actions{display:none}
}

/* =========================================================
   Version 1.7 HOTFIX
   v1.6 mobile-only rule was still hiding both team panels.
   Version 1.7 must show both team cards vertically.
   ========================================================= */
@media (max-width: 767px) {
  .compact-team-panels,
  .team-panels.compact-team-panels {
    display: block !important;
  }

  .compact-team-panels .team-panel,
  .compact-team-panels .team-panel.mobile-active,
  .team-panels.compact-team-panels > .team-panel {
    display: block !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .v17-team-panel {
    margin-bottom: 16px !important;
  }

  .v17-input-head {
    display: grid !important;
    grid-template-columns: 86px 1fr 86px !important;
    align-items: center !important;
  }

  .v17-input-head .game-quarter-title {
    display: flex !important;
    min-height: 44px;
  }

  .v17-input-head .mode-status {
    display: inline-flex !important;
  }
}

/* Version 1.7: batch player registration */
.player-register-dialog {
  width: min(720px, 94vw);
}

.register-number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.register-number-button {
  min-width: 0;
  min-height: 46px;
  padding: 4px;
  border: 1px solid #cfd5dc;
  border-radius: 9px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.register-number-button.selected {
  background: #111820;
  color: #fff;
  border-color: #111820;
  box-shadow: inset 0 0 0 2px #ff8a3d;
}

.register-selection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.register-name-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.register-name-row > span {
  font-weight: 800;
  text-align: center;
}

@media (max-width: 767px) {
  .register-number-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
  }

  .register-number-button {
    min-height: 48px;
    font-size: 16px;
  }
}

/* Version 1.7: quarter-specific lineup setting */
.quarter-lineup-button {
  font-weight: 800;
}

.quarter-lineup-label {
  display: inline;
  font-weight: 900;
}

@media (max-width: 767px) {
  .v17-team-actions {
    grid-template-columns: 1.35fr 1fr 1fr !important;
  }

  .quarter-lineup-button {
    background: #111820 !important;
    color: #fff !important;
    border-color: #111820 !important;
    line-height: 1.25;
  }
}

/* =========================================================
   Version 1.8 - sequential quarter workflow
   ========================================================= */
.flow-steps{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:6px;
  margin-bottom:18px;
}
.flow-steps > span{
  background:#eef1f4;
  border-radius:999px;
  padding:8px 7px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#75808b;
}
.flow-steps > span.active{
  background:#111820;
  color:#fff;
}

.flow-current-title{
  gap:8px;
}
.flow-q-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:54px;
  min-height:40px;
  border-radius:999px;
  background:#111820;
  color:#fff;
  font-size:18px;
  font-weight:900;
}
.flow-quarter-select-hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}
.flow-quarter-display{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  font-size:20px;
}

.quarter-lineup-gate{
  margin-bottom:16px;
  border:2px solid #111820;
}
.quarter-lineup-gate h2{
  margin-top:0;
}
.quarter-lineup-gate.completed{
  border-color:#3d9d61;
  background:#f5fff8;
}
.quarter-lineup-gate-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.gate-lineup-button{
  min-height:72px;
  display:flex !important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.gate-lineup-button small{
  display:block;
  margin-top:4px;
  font-weight:700;
}
.gate-lineup-button.completed{
  background:#3d9d61 !important;
  border-color:#3d9d61 !important;
}
.quarter-lineup-status{
  display:flex;
  gap:14px;
  justify-content:center;
  margin-top:12px;
  font-size:13px;
  font-weight:800;
}

.flow-record-area.flow-locked,
.quarter-save-card.flow-locked{
  display:none !important;
}

.quarter-save-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
  border:2px solid #2874e8;
}
.quarter-save-copy h2{
  margin:0 0 4px;
}
.quarter-save-copy p{
  margin:0;
  color:#6c7580;
  font-size:13px;
}
.quarter-advance-button{
  min-width:250px;
  min-height:58px;
  font-size:17px;
  font-weight:900;
}

@media(max-width:767px){
  .flow-steps{
    gap:4px;
    margin-bottom:12px;
  }
  .flow-steps > span{
    padding:7px 3px;
    font-size:9px;
  }
  .score-flow-steps{
    margin-top:12px;
  }
  .quarter-lineup-gate-grid{
    grid-template-columns:1fr;
  }
  .quarter-lineup-status{
    flex-direction:column;
    gap:5px;
    align-items:center;
  }
  .quarter-save-card{
    display:block;
  }
  .quarter-save-copy{
    margin-bottom:12px;
  }
  .quarter-advance-button{
    width:100%;
    min-width:0;
  }
}

/* =========================================================
   Version 1.8 - Score mode approved UI
   ========================================================= */
#score-app[data-score-ui="1"] .score-mode-active-players{
  display:none !important;
}

#score-app[data-score-ui="1"] .v17-team-panel{
  padding-top:22px;
}

#score-app[data-score-ui="1"] .v17-team-panel > h2{
  text-align:left;
  font-size:26px;
  margin:0 0 18px;
  padding-bottom:12px;
  border-bottom:1px solid #e4e8ec;
}

#score-app[data-score-ui="1"] .v17-player-select-label{
  margin:0 0 10px;
  font-size:15px;
  font-weight:800;
  color:#68727d;
}

#score-app[data-score-ui="1"] .score-mode-player-buttons{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:10px !important;
}

#score-app[data-score-ui="1"] .score-mode-player-buttons button{
  min-height:58px !important;
  border:1px solid #ccd3da !important;
  border-radius:12px !important;
  background:#fff !important;
  color:#111820 !important;
  font-size:14px !important;
  font-weight:800 !important;
  padding:8px 4px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

#score-app[data-score-ui="1"] .score-mode-player-buttons button.selected{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
  outline:3px solid #ff8a3d !important;
  outline-offset:-3px !important;
}

/* 2成功 / 3成功 / FT成功 etc. on one line */
#score-app[data-score-ui="1"] .score-mode-shot-grid{
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:10px !important;
  margin-top:14px !important;
}

#score-app[data-score-ui="1"] .score-mode-shot-grid .v17-shot{
  min-height:54px !important;
  height:54px !important;
  padding:6px 4px !important;
  border-radius:12px !important;
}

#score-app[data-score-ui="1"] .score-mode-shot-grid .v17-shot strong{
  display:block !important;
  font-size:18px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  font-weight:800 !important;
}

/* roughly 1/3 of the previous giant typography, shorter buttons */
#score-app[data-score-ui="1"] .score-mode-shot-grid .made{
  background:linear-gradient(#24282d,#080a0d) !important;
  color:#fff !important;
}

#score-app[data-score-ui="1"] .score-mode-shot-grid .missed{
  background:linear-gradient(#fff,#e8eaed) !important;
  color:#111 !important;
  border:1px solid #cbd1d7 !important;
}

#score-app[data-score-ui="1"] .score-mode-guide{
  margin:14px 0 12px;
  font-size:13px;
  color:#68727d;
}

#score-app[data-score-ui="1"] .score-mode-team-actions{
  display:grid !important;
  grid-template-columns:1.4fr 1fr 1fr 1fr !important;
  gap:8px !important;
  margin-top:8px !important;
}

#score-app[data-score-ui="1"] .score-mode-team-actions .button{
  min-height:48px !important;
  padding:6px 5px !important;
  font-size:13px !important;
}

#score-app[data-score-ui="1"] .score-mode-team-actions .quarter-lineup-button{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
}

#score-app[data-score-ui="1"] .game-mode-substitution{
  display:none !important;
}

/* Game mode keeps previous interface */
#score-app[data-score-ui="0"] .score-mode-substitution{
  display:none !important;
}

@media(max-width:767px){
  #score-app[data-score-ui="1"] .v17-team-panel{
    padding:14px;
  }

  #score-app[data-score-ui="1"] .v17-team-panel > h2{
    font-size:22px;
    margin-bottom:14px;
  }

  #score-app[data-score-ui="1"] .score-mode-player-buttons{
    gap:6px !important;
  }

  #score-app[data-score-ui="1"] .score-mode-player-buttons button{
    min-height:52px !important;
    font-size:12px !important;
  }

  #score-app[data-score-ui="1"] .score-mode-shot-grid{
    gap:7px !important;
    margin-top:10px !important;
  }

  #score-app[data-score-ui="1"] .score-mode-shot-grid .v17-shot{
    min-height:48px !important;
    height:48px !important;
  }

  #score-app[data-score-ui="1"] .score-mode-shot-grid .v17-shot strong{
    font-size:16px !important;
  }

  #score-app[data-score-ui="1"] .score-mode-team-actions{
    grid-template-columns:1.4fr 1fr 1fr 1fr !important;
    gap:6px !important;
  }

  #score-app[data-score-ui="1"] .score-mode-team-actions .button{
    min-height:45px !important;
    font-size:11px !important;
  }
}

/* =========================================================
   Version 1.8 - Game mode approved UI
   ========================================================= */

/* Duplicate "出場5人" area is hidden in both score/game modes */
#score-app .game-mode-active-players,
#score-app .score-mode-active-players{
  display:none !important;
}

/* Game mode panel matches score mode spacing */
#score-app[data-score-ui="0"] .v17-team-panel{
  padding-top:22px;
}

#score-app[data-score-ui="0"] .v17-team-panel > h2{
  text-align:left;
  font-size:26px;
  margin:0 0 18px;
  padding-bottom:12px;
  border-bottom:1px solid #e4e8ec;
}

#score-app[data-score-ui="0"] .v17-player-select-label{
  margin:0 0 10px;
  font-size:15px;
  font-weight:800;
  color:#68727d;
}

/* The five selectable players */
#score-app[data-score-ui="0"] .v17-shooter-buttons{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:10px !important;
}

#score-app[data-score-ui="0"] .v17-shooter-buttons button{
  min-height:58px !important;
  border:1px solid #ccd3da !important;
  border-radius:12px !important;
  background:#fff !important;
  color:#111820 !important;
  font-size:14px !important;
  font-weight:800 !important;
  padding:8px 4px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

#score-app[data-score-ui="0"] .v17-shooter-buttons button.selected{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
  outline:3px solid #ff8a3d !important;
  outline-offset:-3px !important;
}

/* 2成功 / 3成功 / FT成功, failure row:
   same compact size as score mode */
#score-app .unified-shot-grid{
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:10px !important;
  margin-top:14px !important;
}

#score-app .unified-shot-grid .v17-shot{
  min-height:54px !important;
  height:54px !important;
  padding:6px 4px !important;
  border-radius:12px !important;
}

#score-app .unified-shot-grid .v17-shot strong{
  display:block !important;
  font-size:18px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  font-weight:800 !important;
}

#score-app .unified-shot-grid .made{
  background:linear-gradient(#24282d,#080a0d) !important;
  color:#fff !important;
}

#score-app .unified-shot-grid .missed{
  background:linear-gradient(#fff,#e8eaed) !important;
  color:#111 !important;
  border:1px solid #cbd1d7 !important;
}

#score-app .unified-record-guide{
  margin:14px 0 12px;
  font-size:13px;
  color:#68727d;
}

/* Game mode stats */
#score-app[data-score-ui="0"] .game-mode-stat-controls{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e2e6ea;
}

#score-app[data-score-ui="0"] .game-mode-stat-guide{
  margin:0 0 10px;
  font-size:13px;
  font-weight:700;
  color:#68727d;
}

#score-app[data-score-ui="0"] .game-mode-stat-types{
  display:grid !important;
  grid-template-columns:repeat(4,1fr) !important;
  gap:8px !important;
}

#score-app[data-score-ui="0"] .game-mode-stat-types button{
  min-height:74px !important;
  border:0 !important;
  border-radius:0 !important;
  background:#050505 !important;
  color:#fff !important;
  padding:6px 2px !important;
}

#score-app[data-score-ui="0"] .game-mode-stat-types button strong{
  font-size:19px !important;
  line-height:1 !important;
}

#score-app[data-score-ui="0"] .game-mode-stat-types button span{
  display:block !important;
  margin-top:5px !important;
  font-size:8px !important;
  line-height:1.15 !important;
  color:#9da5ad !important;
}

/* Bottom actions identical in score and game modes */
#score-app .unified-team-actions{
  display:grid !important;
  grid-template-columns:1.4fr 1fr 1fr 1fr !important;
  gap:8px !important;
  margin-top:12px !important;
}

#score-app .unified-team-actions .button{
  min-height:48px !important;
  padding:6px 5px !important;
  font-size:13px !important;
}

#score-app .unified-team-actions .quarter-lineup-button{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
}

/* The separate legacy substitution button must not appear */
#score-app .legacy-substitution-controls{
  display:none !important;
}

/* Remove old game-mode overrides that visually enlarge shot UI */
#score-app[data-score-ui="0"] .compact-shot-types,
#score-app[data-score-ui="0"] .compact-shot-results{
  display:none !important;
}

@media(max-width:767px){
  #score-app[data-score-ui="0"] .v17-team-panel{
    padding:14px;
  }

  #score-app[data-score-ui="0"] .v17-team-panel > h2{
    font-size:22px;
    margin-bottom:14px;
  }

  #score-app[data-score-ui="0"] .v17-shooter-buttons{
    gap:6px !important;
  }

  #score-app[data-score-ui="0"] .v17-shooter-buttons button{
    min-height:52px !important;
    font-size:12px !important;
  }

  #score-app .unified-shot-grid{
    gap:7px !important;
    margin-top:10px !important;
  }

  #score-app .unified-shot-grid .v17-shot{
    min-height:48px !important;
    height:48px !important;
  }

  #score-app .unified-shot-grid .v17-shot strong{
    font-size:16px !important;
  }

  #score-app[data-score-ui="0"] .game-mode-stat-types{
    gap:6px !important;
  }

  #score-app[data-score-ui="0"] .game-mode-stat-types button{
    min-height:68px !important;
  }

  #score-app[data-score-ui="0"] .game-mode-stat-types button strong{
    font-size:17px !important;
  }

  #score-app .unified-team-actions{
    grid-template-columns:1.4fr 1fr 1fr 1fr !important;
    gap:6px !important;
  }

  #score-app .unified-team-actions .button{
    min-height:45px !important;
    font-size:11px !important;
  }
}

/* =========================================================
   Version 1.9 - Unified score/game mode interface
   Both modes share exactly the same base layout.
   Game mode only adds AST/TO/OREB/DREB.
   ========================================================= */

#score-app[data-unified-ui="1"] .v17-team-panel{
  padding:18px !important;
  margin-bottom:18px !important;
}

#score-app[data-unified-ui="1"] .v17-team-panel > h2{
  text-align:left !important;
  font-size:24px !important;
  line-height:1.2 !important;
  margin:0 0 14px !important;
  padding:0 0 12px !important;
  border-bottom:1px solid #e4e8ec !important;
}

/* Never show duplicate "出場5人" strip */
#score-app[data-unified-ui="1"] .score-mode-active-players,
#score-app[data-unified-ui="1"] .game-mode-active-players,
#score-app[data-unified-ui="1"] .v17-lineup-box{
  display:none !important;
}

/* Player row */
#score-app[data-unified-ui="1"] .v17-player-select-label{
  margin:0 0 8px !important;
  font-size:14px !important;
  font-weight:800 !important;
  color:#68727d !important;
}

#score-app[data-unified-ui="1"] .v17-shooter-buttons,
#score-app[data-unified-ui="1"] .score-mode-player-buttons{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:8px !important;
}

#score-app[data-unified-ui="1"] .v17-shooter-buttons button,
#score-app[data-unified-ui="1"] .score-mode-player-buttons button{
  min-width:0 !important;
  min-height:54px !important;
  height:54px !important;
  padding:6px 3px !important;
  border:1px solid #ccd3da !important;
  border-radius:11px !important;
  background:#fff !important;
  color:#111820 !important;
  font-size:13px !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

#score-app[data-unified-ui="1"] .v17-shooter-buttons button.selected,
#score-app[data-unified-ui="1"] .score-mode-player-buttons button.selected{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
  outline:3px solid #ff8a3d !important;
  outline-offset:-3px !important;
}

/* Same shot controls for BOTH modes */
#score-app[data-unified-ui="1"] .unified-shot-grid{
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:8px !important;
  margin:12px 0 0 !important;
}

#score-app[data-unified-ui="1"] .unified-shot-grid .v17-shot{
  min-height:46px !important;
  height:46px !important;
  padding:4px 3px !important;
  border-radius:10px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex-direction:row !important;
}

#score-app[data-unified-ui="1"] .unified-shot-grid .v17-shot strong{
  display:block !important;
  margin:0 !important;
  font-size:15px !important;
  line-height:1 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
}

#score-app[data-unified-ui="1"] .unified-shot-grid .made{
  background:linear-gradient(#23272c,#080a0d) !important;
  color:#fff !important;
  border:1px solid #080a0d !important;
}

#score-app[data-unified-ui="1"] .unified-shot-grid .missed{
  background:linear-gradient(#fff,#eceef0) !important;
  color:#111 !important;
  border:1px solid #ccd2d8 !important;
}

#score-app[data-unified-ui="1"] .unified-record-guide{
  margin:10px 0 8px !important;
  font-size:12px !important;
  color:#68727d !important;
}

/* Game-mode-only stats */
#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-controls{
  margin-top:12px !important;
  padding-top:12px !important;
  border-top:1px solid #e3e7eb !important;
}

#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-guide{
  margin:0 0 8px !important;
  font-size:12px !important;
  color:#68727d !important;
  font-weight:700 !important;
}

#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types{
  display:grid !important;
  grid-template-columns:repeat(4,1fr) !important;
  gap:7px !important;
}

#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button{
  min-height:62px !important;
  height:62px !important;
  padding:4px 2px !important;
  border:0 !important;
  border-radius:0 !important;
  background:#050505 !important;
  color:#fff !important;
}

#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button strong{
  font-size:16px !important;
  line-height:1 !important;
}

#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button span{
  margin-top:4px !important;
  font-size:7px !important;
  line-height:1.1 !important;
  color:#9aa3ac !important;
}

/* Score mode has no stat area */
#score-app[data-unified-ui="1"][data-score-ui="1"] .game-mode-stat-controls{
  display:none !important;
}

/* Bottom management actions identical */
#score-app[data-unified-ui="1"] .unified-team-actions{
  display:grid !important;
  grid-template-columns:1.4fr 1fr 1fr 1fr !important;
  gap:7px !important;
  margin-top:10px !important;
}

#score-app[data-unified-ui="1"] .unified-team-actions .button{
  min-height:44px !important;
  height:44px !important;
  padding:5px 4px !important;
  font-size:12px !important;
  line-height:1.15 !important;
}

#score-app[data-unified-ui="1"] .unified-team-actions .quarter-lineup-button{
  background:#111820 !important;
  color:#fff !important;
  border-color:#111820 !important;
}

/* No legacy duplicate substitution row */
#score-app[data-unified-ui="1"] .legacy-substitution-controls{
  display:none !important;
}

/* Old large shot control remnants are always hidden */
#score-app[data-unified-ui="1"] .compact-shot-types,
#score-app[data-unified-ui="1"] .compact-shot-results{
  display:none !important;
}

@media (max-width:767px){
  #score-app[data-unified-ui="1"] .v17-team-panel{
    padding:12px !important;
    margin-bottom:14px !important;
  }

  #score-app[data-unified-ui="1"] .v17-team-panel > h2{
    font-size:20px !important;
    margin-bottom:11px !important;
    padding-bottom:10px !important;
  }

  #score-app[data-unified-ui="1"] .v17-shooter-buttons,
  #score-app[data-unified-ui="1"] .score-mode-player-buttons{
    gap:5px !important;
  }

  #score-app[data-unified-ui="1"] .v17-shooter-buttons button,
  #score-app[data-unified-ui="1"] .score-mode-player-buttons button{
    min-height:48px !important;
    height:48px !important;
    font-size:11px !important;
    padding:4px 2px !important;
  }

  #score-app[data-unified-ui="1"] .unified-shot-grid{
    gap:6px !important;
    margin-top:8px !important;
  }

  #score-app[data-unified-ui="1"] .unified-shot-grid .v17-shot{
    min-height:42px !important;
    height:42px !important;
  }

  #score-app[data-unified-ui="1"] .unified-shot-grid .v17-shot strong{
    font-size:13px !important;
  }

  #score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types{
    gap:5px !important;
  }

  #score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button{
    min-height:58px !important;
    height:58px !important;
  }

  #score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button strong{
    font-size:14px !important;
  }

  #score-app[data-unified-ui="1"] .unified-team-actions{
    grid-template-columns:1.4fr 1fr 1fr 1fr !important;
    gap:5px !important;
  }

  #score-app[data-unified-ui="1"] .unified-team-actions .button{
    min-height:42px !important;
    height:42px !important;
    font-size:10px !important;
    padding:4px 2px !important;
  }
}

/* Version 1.9: 選手5人設定モーダル内の選手登録 */
.lineup-dialog { width:min(760px,94vw); }
.lineup-dialog-help { margin:-4px 0 14px; }
#lineup-options {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
#lineup-options .check-player {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:58px;
  padding:10px 16px;
  border:1px solid #d5dbe1;
  border-radius:12px;
  background:#fff;
  font-size:16px;
  font-weight:800;
  cursor:pointer;
}
#lineup-options .check-player:has(input:checked) {
  border-color:#2874e8;
  background:#f4f8ff;
}
#lineup-options .check-player input {
  width:20px;
  height:20px;
}
.lineup-dialog-actions {
  border-top:1px solid #e2e6ea;
  margin-top:18px;
  padding-top:16px;
  justify-content:flex-end;
}
.lineup-register-button {
  margin-right:auto;
  border-color:#2874e8 !important;
  color:#2874e8 !important;
  background:#fff !important;
  font-weight:800 !important;
}
.lineup-register-button::before {
  content:"＋";
  margin-right:4px;
  font-weight:900;
}
@media (max-width:767px) {
  #lineup-options { grid-template-columns:1fr; gap:7px; }
  #lineup-options .check-player { min-height:50px; padding:8px 12px; font-size:14px; }
  .lineup-dialog-actions {
    display:grid !important;
    grid-template-columns:1.15fr 1fr 1fr;
    gap:7px;
  }
  .lineup-dialog-actions .button {
    width:100%;
    min-width:0;
    padding-left:6px;
    padding-right:6px;
    font-size:13px;
  }
  .lineup-register-button { margin-right:0; }
}

/* 選手交代ボタン復活：スコア/ゲーム、ホーム/アウェイ共通 */
#score-app .restored-substitution-controls{display:block!important;margin-top:8px!important}
#score-app .restored-substitution-controls .substitution-button{
 display:block!important;width:100%!important;min-height:44px!important;
 border:1px solid #d5dbe1!important;border-radius:10px!important;
 background:#fff!important;color:#111820!important;font-size:13px!important;font-weight:800!important
}
@media(max-width:767px){
 #score-app .restored-substitution-controls .substitution-button{min-height:42px!important;font-size:12px!important}
}

/* Version 1.10: Game stats = 2 rows x 3 columns */
#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types{
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:7px !important;
}
#score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button{
  min-height:62px !important;
  height:62px !important;
}
@media(max-width:767px){
  #score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types{
    grid-template-columns:repeat(3,1fr) !important;
    gap:5px !important;
  }
  #score-app[data-unified-ui="1"][data-score-ui="0"] .game-mode-stat-types button{
    min-height:58px !important;
    height:58px !important;
  }
}

/* Version 1.11 - reference-image mobile scorer */
.ref-score-console{display:none}
@media(max-width:767px){
  body:has(#ref-score-console){background:#d9d9d9}
  body:has(#ref-score-console) .site-header{display:none!important}
  body:has(#ref-score-console)>main.container{width:100%;max-width:none;margin:0;padding:0}
  #score-app>.ref-score-console{display:block!important}
  #score-app>.game-input-head,
  #score-app>.scoreboard,
  #score-app>.flow-steps,
  #score-app>.quarter-lineup-gate,
  #score-app>.team-panels,
  #score-app>.quarter-save-card,
  #score-app>.play-history-card{display:none!important}
  .ref-score-console{min-height:100dvh;background:#ddd;color:#111;padding-bottom:78px;font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif}
  .rsc-topbar{height:92px;background:#fa8d73;display:grid;grid-template-columns:1fr auto 1fr;align-items:end;padding:16px 18px 10px;gap:10px}
  .rsc-back,.rsc-undo{border:0;background:transparent;padding:8px 0;font-size:18px;font-weight:800;color:#4b4b4b;text-decoration:none;box-shadow:none}
  .rsc-back{justify-self:start}.rsc-undo{justify-self:end;display:flex;align-items:center;gap:7px}.rsc-undo-icon{font-size:28px;line-height:1}
  .rsc-quarter-switch{height:50px;min-width:180px;border-radius:30px;background:#555;display:grid;grid-template-columns:45px 1fr 45px;align-items:center;color:#fff;overflow:hidden}
  .rsc-quarter-switch strong{text-align:center;font-size:24px}.rsc-q-arrow{border:0;background:transparent;color:#fff;padding:0;font-size:25px;min-height:50px;box-shadow:none}
  .rsc-score-head{height:112px;background:#aaa;display:grid;grid-template-columns:1fr 1fr 110px;align-items:center;padding:0 18px 0 115px;position:relative}
  .rsc-main-score{text-align:center}.rsc-main-score strong{font-size:48px;line-height:1}
  .rsc-shot-mini{display:grid;grid-template-columns:1fr 1fr;gap:5px 10px;text-align:center;font-weight:800;font-size:14px}.rsc-shot-mini strong{font-size:24px}
  .rsc-court{display:grid;grid-template-columns:150px minmax(0,1fr) 150px;gap:10px;padding:14px 16px 10px;align-items:start}
  .rsc-roster{display:grid;grid-template-rows:repeat(5,1fr);gap:11px}
  .rsc-jersey{border:0;background:transparent;padding:0;min-height:112px;position:relative;display:flex;align-items:center;justify-content:center;box-shadow:none}
  .rsc-jersey-shape{width:82px;height:104px;clip-path:polygon(16% 0,36% 0,41% 9%,59% 9%,64% 0,84% 0,100% 17%,91% 29%,88% 100%,12% 100%,9% 29%,0 17%);border-radius:9px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:12px;font-weight:900;filter:drop-shadow(0 1px 1px rgba(0,0,0,.45))}
  .rsc-roster-home .rsc-jersey-shape{background:#080808;color:#fff}.rsc-roster-away .rsc-jersey-shape{background:#fff;color:#050505;outline:2px solid #555;outline-offset:-4px}
  .rsc-jersey-number{font-size:32px;line-height:1}.rsc-jersey-name{font-size:13px;max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:7px}
  .rsc-jersey.selected .rsc-jersey-shape{outline:4px solid #ff7a00;outline-offset:3px}.rsc-fouls{position:absolute;right:10px;top:0;background:#f11;color:#fff;border-radius:50%;width:25px;height:25px;display:grid;place-items:center;font-size:14px}
  .rsc-controls{display:grid;gap:4px}.rsc-shot-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px}.rsc-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.rsc-rebound-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px}
  .rsc-action{border:1px solid #b8b8b8;border-radius:10px;background:linear-gradient(#f7f7f7,#d9d9d9);color:#111;min-height:88px;padding:4px;font-size:17px;font-weight:900;box-shadow:0 1px 2px rgba(0,0,0,.2)}
  .rsc-shot-grid .rsc-action{min-height:124px}.rsc-shot-grid .rsc-action strong{font-size:62px;font-weight:300;line-height:1}.rsc-shot-grid .rsc-action span{font-size:17px;font-weight:500;display:block;margin-top:8px}
  .rsc-shot-grid .rsc-made{background:linear-gradient(#1d1d1d,#000);color:#fff}
  .rsc-ft-miss{min-height:32px;border:0;background:transparent;color:#666;font-size:12px;padding:3px}
  .rsc-selection{text-align:center;font-size:11px;color:#666;min-height:28px;padding-top:3px}
  .rsc-points-card{margin:2px auto 12px;width:52%;min-width:330px;border:1px solid #888;border-radius:10px;background:#e7e7e7;display:grid;grid-template-columns:75px 1fr 75px;align-items:center;padding:8px 10px}
  .rsc-team-mark{height:84px;clip-path:polygon(16% 0,36% 0,41% 9%,59% 9%,64% 0,84% 0,100% 17%,91% 29%,88% 100%,12% 100%,9% 29%,0 17%);display:grid;place-items:center;font-size:28px;font-weight:900}.rsc-team-mark-home{background:#070707;color:#fff}.rsc-team-mark-away{background:#fff;color:#111;outline:1px solid #555}
  .rsc-points-center{text-align:center}.rsc-points-center>strong{font-size:20px}.rsc-quarter-points{display:grid;grid-template-columns:1fr auto 1fr;gap:1px 12px;margin-top:2px;font-size:19px;color:#555}.rsc-quarter-points .current{color:red;font-weight:800}
  .rsc-bottom-actions{position:fixed;left:0;right:0;bottom:0;height:72px;background:#fff;display:grid;grid-template-columns:repeat(4,1fr);z-index:20;border-top:1px solid #eee;padding-bottom:env(safe-area-inset-bottom)}
  .rsc-bottom-actions button{border:0;background:transparent;color:#999;font-size:26px;padding:6px 3px;display:grid;gap:1px;place-items:center;box-shadow:none}.rsc-bottom-actions span{font-size:10px}
}
@media(max-width:560px){
  .rsc-topbar{height:82px;padding-inline:12px}.rsc-quarter-switch{min-width:142px;height:44px;grid-template-columns:36px 1fr 36px}.rsc-quarter-switch strong{font-size:21px}.rsc-q-arrow{min-height:44px;font-size:20px}
  .rsc-score-head{height:95px;padding-left:86px;grid-template-columns:1fr 1fr 82px}.rsc-main-score strong{font-size:40px}.rsc-shot-mini{font-size:11px;gap:3px 5px}.rsc-shot-mini strong{font-size:20px}
  .rsc-court{grid-template-columns:92px minmax(0,1fr) 92px;gap:4px;padding:10px 5px 8px}.rsc-roster{gap:8px}.rsc-jersey{min-height:101px}.rsc-jersey-shape{width:68px;height:91px}.rsc-jersey-number{font-size:28px}.rsc-jersey-name{font-size:11px;max-width:58px}.rsc-fouls{right:2px;width:22px;height:22px;font-size:12px}
  .rsc-action{min-height:76px;font-size:14px;border-radius:8px}.rsc-shot-grid .rsc-action{min-height:112px}.rsc-shot-grid .rsc-action strong{font-size:54px}.rsc-shot-grid .rsc-action span{font-size:14px}.rsc-stat-grid{gap:3px}.rsc-rebound-grid{gap:3px}.rsc-shot-grid{gap:3px}
  .rsc-points-card{width:58%;min-width:280px;grid-template-columns:62px 1fr 62px}.rsc-team-mark{height:72px;font-size:24px}.rsc-quarter-points{font-size:16px;gap:1px 9px}
}
\n\n/* =========================================================\n   Version 2.0\n   - Hannari font\n   - monochrome score toolbar\n   - compact 2P/3P shot buttons\n   - success label on made shots\n   - remove orange focus/selection border from shot buttons\n   ========================================================= */\nbody,button,input,select,textarea{font-family:"Hannari",serif;}\n\n/* Desktop / common header refinement */\n.site-header{background:#101820;padding:26px 40px;min-height:112px;}\n.site-header .brand{display:flex;flex-direction:column;align-items:flex-start;gap:8px;font-size:24px;line-height:1.05;}\n.site-header .app-version{display:block;margin:0;padding:5px 12px;border:1px solid rgba(255,255,255,.55);border-radius:999px;font-size:14px;line-height:1;color:#fff;}\n.site-header .header-nav{gap:18px;}\n.site-header .header-nav>a{font-size:17px;font-weight:800;}\n.site-header .header-nav .button{min-height:52px;padding:12px 20px;border-radius:14px;font-size:16px;}\n\n@media(max-width:767px){\n  /* Score page toolbar: white / black base */\n  .ref-score-console{font-family:"Hannari",serif;}\n  .rsc-topbar{\n    background:linear-gradient(180deg,#fff 0%,#f8f8f8 100%);\n    border-top:1px solid #111820;\n    border-bottom:1px solid #c9c9c9;\n    box-shadow:0 2px 7px rgba(0,0,0,.08);\n  }\n  .rsc-back,.rsc-undo{color:#111820;}\n  .rsc-quarter-switch{\n    background:linear-gradient(180deg,#383b3f 0%,#17191c 100%);\n    border:1px solid #111;\n    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 2px 5px rgba(0,0,0,.18);\n  }\n  .rsc-quarter-switch strong,.rsc-q-arrow{color:#fff;}\n\n  /* All four 2/3 shot buttons = 2/3 of v1.11 height */\n  .rsc-shot-grid .rsc-action{\n    min-height:83px;\n    height:83px;\n  }\n  /* 2 / 3 numeral size = 2/3 of v1.11 */\n  .rsc-shot-grid .rsc-action strong{\n    font-size:41px;\n    line-height:.9;\n  }\n  .rsc-shot-grid .rsc-action span{\n    font-size:13px;\n    line-height:1;\n    margin-top:6px;\n  }\n  /* Made labels sit beside/under number cleanly */\n  .rsc-shot-grid .rsc-made{\n    display:flex;\n    flex-direction:column;\n    align-items:center;\n    justify-content:center;\n  }\n\n  /* Never show orange outline on shot buttons (including 3P missed) */\n  .rsc-shot-grid .rsc-action,\n  .rsc-shot-grid .rsc-action:hover,\n  .rsc-shot-grid .rsc-action:focus,\n  .rsc-shot-grid .rsc-action:focus-visible,\n  .rsc-shot-grid .rsc-action:active,\n  .rsc-shot-grid .rsc-action.selected{\n    outline:none!important;\n    outline-offset:0!important;\n  }\n  .rsc-shot-grid .rsc-missed{border:1px solid #b8b8b8!important;}\n  .rsc-shot-grid .rsc-made{border:1px solid #080808!important;}\n}\n\n@media(max-width:560px){\n  .rsc-shot-grid .rsc-action{\n    min-height:75px;\n    height:75px;\n  }\n  .rsc-shot-grid .rsc-action strong{font-size:36px;}\n  .rsc-shot-grid .rsc-action span{font-size:12px;margin-top:5px;}\n}\n
/* =========================================================
   Version 2.0 - FINAL SMARTPHONE LAYOUT
   2026-08-09
   Target: approved monochrome smartphone mockup
   ========================================================= */
@media (max-width: 767px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body:has(#ref-score-console) {
    background:#f4f4f4 !important;
  }

  /* Keep Version 2.0 app header visible on the scorer screen. */
  body:has(#ref-score-console) .site-header {
    display:grid !important;
    grid-template-columns:minmax(118px, 34%) minmax(0, 66%);
    align-items:center;
    gap:8px;
    width:100%;
    min-height:76px !important;
    padding:10px 12px !important;
    background:linear-gradient(135deg,#111b24 0%,#071019 100%) !important;
    overflow:hidden;
  }

  body:has(#ref-score-console) .site-header .brand {
    min-width:0;
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:5px !important;
    color:#fff !important;
    font-family:"Hannari",serif !important;
    font-size:15px !important;
    line-height:1 !important;
    white-space:nowrap;
  }

  body:has(#ref-score-console) .site-header .app-version {
    margin:0 !important;
    padding:4px 8px !important;
    border:1px solid rgba(255,255,255,.65) !important;
    border-radius:999px !important;
    font-size:9px !important;
    line-height:1 !important;
    white-space:nowrap;
  }

  body:has(#ref-score-console) .site-header .header-nav {
    min-width:0;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    flex-wrap:nowrap !important;
    gap:7px !important;
    overflow:hidden;
  }

  body:has(#ref-score-console) .site-header .header-nav > a {
    flex:0 0 auto;
    color:#fff !important;
    font-family:"Hannari",serif !important;
    font-size:10px !important;
    line-height:1.1 !important;
    font-weight:800 !important;
    white-space:nowrap;
  }

  body:has(#ref-score-console) .site-header .header-nav form {
    flex:0 0 auto;
  }

  body:has(#ref-score-console) .site-header .header-nav .button {
    min-height:34px !important;
    height:34px !important;
    padding:5px 8px !important;
    border-radius:10px !important;
    background:#fff !important;
    color:#111820 !important;
    border-color:#e6e6e6 !important;
    font-size:10px !important;
    line-height:1 !important;
    white-space:nowrap;
  }

  body:has(#ref-score-console) > main.container {
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
  }

  #score-app > .ref-score-console {
    display:block !important;
  }

  .ref-score-console {
    width:100%;
    min-height:calc(100dvh - 76px) !important;
    padding-bottom:76px !important;
    background:linear-gradient(180deg,#f8f8f8 0%,#f2f2f2 100%) !important;
    color:#111 !important;
    font-family:"Hannari",serif !important;
    overflow:hidden !important;
  }

  /* Approved white/black quarter toolbar */
  .rsc-topbar {
    height:66px !important;
    display:grid !important;
    grid-template-columns:1fr auto 1fr !important;
    align-items:center !important;
    gap:8px !important;
    padding:8px 14px !important;
    background:linear-gradient(180deg,#fff 0%,#fafafa 100%) !important;
    border-top:0 !important;
    border-bottom:1px solid #d3d3d3 !important;
    box-shadow:0 2px 7px rgba(0,0,0,.06) !important;
  }

  .rsc-back,
  .rsc-undo {
    min-width:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:#111820 !important;
    font-family:"Hannari",serif !important;
    font-size:14px !important;
    font-weight:800 !important;
    line-height:1 !important;
    padding:0 !important;
    text-decoration:none !important;
  }
  .rsc-back { justify-self:start !important; }
  .rsc-undo { justify-self:end !important; display:flex !important; align-items:center !important; gap:5px !important; }
  .rsc-undo-icon { font-size:20px !important; line-height:1 !important; }

  .rsc-quarter-switch {
    width:140px !important;
    min-width:140px !important;
    height:44px !important;
    display:grid !important;
    grid-template-columns:35px 1fr 35px !important;
    align-items:center !important;
    overflow:hidden !important;
    border-radius:999px !important;
    border:1px solid #090909 !important;
    background:linear-gradient(180deg,#303235 0%,#050505 100%) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 2px 4px rgba(0,0,0,.18) !important;
  }
  .rsc-quarter-switch strong {
    font-size:19px !important;
    line-height:1 !important;
    color:#fff !important;
    text-align:center !important;
  }
  .rsc-q-arrow {
    min-height:42px !important;
    height:42px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:#fff !important;
    font-size:18px !important;
    line-height:1 !important;
  }

  /* Score strip */
  .rsc-score-head {
    width:100% !important;
    height:108px !important;
    display:grid !important;
    grid-template-columns:1fr 1fr 80px !important;
    align-items:center !important;
    padding:0 16px 0 82px !important;
    background:linear-gradient(180deg,#f4f4f4 0%,#e9e9e9 100%) !important;
    border-bottom:1px solid #ededed;
  }
  .rsc-main-score strong {
    font-size:42px !important;
    font-weight:700 !important;
    line-height:1 !important;
  }
  .rsc-shot-mini {
    gap:3px 6px !important;
    font-size:10px !important;
    line-height:1.05 !important;
  }
  .rsc-shot-mini strong { font-size:18px !important; line-height:1 !important; }

  /* Never allow the 3-column court to exceed the viewport. */
  .rsc-court {
    width:100% !important;
    max-width:100% !important;
    display:grid !important;
    grid-template-columns:76px minmax(0,1fr) 76px !important;
    gap:6px !important;
    align-items:start !important;
    padding:14px 10px 8px !important;
    overflow:hidden !important;
  }

  .rsc-roster {
    min-width:0 !important;
    display:grid !important;
    grid-template-rows:repeat(5, 1fr) !important;
    gap:9px !important;
  }
  .rsc-jersey {
    width:100% !important;
    min-width:0 !important;
    min-height:82px !important;
    height:82px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  .rsc-jersey-shape {
    width:61px !important;
    height:78px !important;
    padding-top:8px !important;
    border-radius:4px !important;
  }
  .rsc-jersey-number {
    font-size:26px !important;
    font-weight:900 !important;
    line-height:1 !important;
  }
  .rsc-jersey-name {
    max-width:52px !important;
    margin-top:6px !important;
    font-size:10px !important;
    line-height:1.05 !important;
  }
  .rsc-roster-away .rsc-jersey-shape {
    outline:1px solid #555 !important;
    outline-offset:-2px !important;
  }
  .rsc-jersey.selected .rsc-jersey-shape {
    outline:2px solid #111 !important;
    outline-offset:1px !important;
  }
  .rsc-fouls {
    width:18px !important;
    height:18px !important;
    right:0 !important;
    top:0 !important;
    font-size:10px !important;
  }

  .rsc-controls {
    min-width:0 !important;
    width:100% !important;
    display:grid !important;
    gap:7px !important;
  }
  .rsc-shot-grid {
    min-width:0 !important;
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:7px !important;
  }
  .rsc-stat-grid {
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  .rsc-rebound-grid {
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:7px !important;
  }

  /* Approved compact 2/3 buttons: about 2/3 original height and numeral size. */
  .rsc-shot-grid .rsc-action {
    width:100% !important;
    min-width:0 !important;
    min-height:60px !important;
    height:60px !important;
    padding:5px 5px !important;
    border-radius:8px !important;
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;
    overflow:hidden !important;
    box-shadow:0 1px 3px rgba(0,0,0,.18) !important;
  }
  .rsc-shot-grid .rsc-action strong {
    flex:0 0 auto !important;
    font-family:"Hannari",serif !important;
    font-size:34px !important;
    font-weight:400 !important;
    line-height:.9 !important;
    margin:0 !important;
  }
  .rsc-shot-grid .rsc-action span {
    flex:0 1 auto !important;
    min-width:0 !important;
    display:block !important;
    margin:4px 0 0 !important;
    font-family:"Hannari",serif !important;
    font-size:10px !important;
    font-weight:700 !important;
    line-height:1 !important;
    white-space:nowrap !important;
  }
  .rsc-shot-grid .rsc-made {
    color:#fff !important;
    background:linear-gradient(180deg,#242424 0%,#000 100%) !important;
    border:1px solid #111 !important;
  }
  .rsc-shot-grid .rsc-missed {
    color:#111 !important;
    background:linear-gradient(180deg,#fff 0%,#ededed 100%) !important;
    border:1px solid #cecece !important;
  }

  /* Kill every focus/selected orange outline, including iOS tap state. */
  .rsc-shot-grid .rsc-action,
  .rsc-shot-grid .rsc-action:hover,
  .rsc-shot-grid .rsc-action:focus,
  .rsc-shot-grid .rsc-action:focus-visible,
  .rsc-shot-grid .rsc-action:active,
  .rsc-shot-grid .rsc-action.selected,
  .rsc-shot-grid .rsc-action[aria-pressed="true"] {
    outline:0 !important;
    outline-color:transparent !important;
    outline-offset:0 !important;
    -webkit-tap-highlight-color:transparent !important;
  }

  .rsc-stat-grid .rsc-action,
  .rsc-rebound-grid .rsc-action {
    width:100% !important;
    min-width:0 !important;
    min-height:58px !important;
    height:58px !important;
    padding:4px 2px !important;
    border-radius:8px !important;
    border:1px solid #d0d0d0 !important;
    background:linear-gradient(180deg,#fff 0%,#ededed 100%) !important;
    color:#111 !important;
    font-family:"Hannari",serif !important;
    font-size:12px !important;
    font-weight:900 !important;
    line-height:1 !important;
    overflow:hidden !important;
  }

  .rsc-ft-miss {
    min-height:21px !important;
    height:21px !important;
    padding:0 !important;
    font-size:10px !important;
    font-weight:700 !important;
    line-height:1 !important;
    color:#777 !important;
  }
  .rsc-selection {
    min-height:24px !important;
    padding:0 !important;
    font-size:9px !important;
    line-height:1.25 !important;
    color:#777 !important;
  }

  /* Points card follows the approved compact mockup. */
  .rsc-points-card {
    width:54% !important;
    min-width:230px !important;
    max-width:255px !important;
    margin:4px auto 16px !important;
    display:grid !important;
    grid-template-columns:55px minmax(0,1fr) 55px !important;
    align-items:center !important;
    padding:8px 9px !important;
    border:1px solid #999 !important;
    border-radius:9px !important;
    background:#f0f0f0 !important;
  }
  .rsc-team-mark {
    height:68px !important;
    font-size:22px !important;
  }
  .rsc-points-center > strong {
    font-size:16px !important;
    line-height:1 !important;
  }
  .rsc-quarter-points {
    gap:1px 7px !important;
    margin-top:4px !important;
    font-size:13px !important;
    line-height:1.1 !important;
  }

  .rsc-bottom-actions {
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    z-index:100 !important;
    height:70px !important;
    padding-bottom:env(safe-area-inset-bottom) !important;
    display:grid !important;
    grid-template-columns:repeat(4,1fr) !important;
    background:rgba(255,255,255,.98) !important;
    border-top:1px solid #e4e4e4 !important;
    box-shadow:0 -2px 8px rgba(0,0,0,.03) !important;
  }
  .rsc-bottom-actions button {
    min-width:0 !important;
    padding:5px 2px !important;
    display:grid !important;
    place-items:center !important;
    gap:1px !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:#929292 !important;
    font-size:22px !important;
    line-height:1 !important;
  }
  .rsc-bottom-actions span {
    font-size:9px !important;
    line-height:1 !important;
  }
}

/* Extra-narrow iPhone sizes. Keep all three court columns inside viewport. */
@media (max-width: 390px) {
  body:has(#ref-score-console) .site-header {
    grid-template-columns:108px minmax(0,1fr) !important;
    padding-inline:9px !important;
    gap:4px !important;
  }
  body:has(#ref-score-console) .site-header .brand { font-size:13px !important; }
  body:has(#ref-score-console) .site-header .header-nav { gap:5px !important; }
  body:has(#ref-score-console) .site-header .header-nav > a { font-size:8px !important; }
  body:has(#ref-score-console) .site-header .header-nav .button { padding-inline:6px !important; font-size:8px !important; }

  .rsc-topbar { padding-inline:10px !important; }
  .rsc-quarter-switch { width:126px !important; min-width:126px !important; }
  .rsc-back,.rsc-undo { font-size:12px !important; }

  .rsc-score-head {
    grid-template-columns:1fr 1fr 68px !important;
    padding-left:70px !important;
  }
  .rsc-court {
    grid-template-columns:69px minmax(0,1fr) 69px !important;
    gap:4px !important;
    padding-inline:6px !important;
  }
  .rsc-jersey-shape { width:56px !important; height:74px !important; }
  .rsc-jersey-number { font-size:24px !important; }
  .rsc-shot-grid .rsc-action { height:58px !important; min-height:58px !important; }
  .rsc-shot-grid .rsc-action strong { font-size:31px !important; }
  .rsc-shot-grid .rsc-action span { font-size:9px !important; }
  .rsc-stat-grid .rsc-action,
  .rsc-rebound-grid .rsc-action { height:56px !important; min-height:56px !important; font-size:11px !important; }
  .rsc-points-card { min-width:218px !important; max-width:238px !important; }
}

/* =========================================================
   Version 2.0.2 - scorer UI integration
   Approved score-entry layout 2026-08-09
   ========================================================= */

/* Use the new scorer console at every viewport width. */
body:has(#ref-score-console){
  background:#fff !important;
  overflow-x:hidden !important;
}
body:has(#ref-score-console)>main.container{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
}
#score-app>.ref-score-console{display:block !important;}
#score-app>.game-input-head,
#score-app>.scoreboard,
#score-app>.flow-steps,
#score-app>.quarter-lineup-gate,
#score-app>.team-panels,
#score-app>.quarter-save-card,
#score-app>.play-history-card{display:none !important;}

.ref-score-console{
  width:100% !important;
  min-height:calc(100dvh - 112px) !important;
  padding-bottom:calc(92px + env(safe-area-inset-bottom)) !important;
  background:#fff !important;
  color:#050505 !important;
  overflow:hidden !important;
}

/* Quarter selector: no back / undo labels, perfectly centered. */
.rsc-topbar{
  width:100% !important;
  height:108px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 16px !important;
  background:#fff !important;
  border:0 !important;
  border-bottom:1px solid #e3e3e3 !important;
  box-shadow:none !important;
}
.rsc-quarter-switch{
  width:min(290px,38vw) !important;
  min-width:220px !important;
  height:68px !important;
  display:grid !important;
  grid-template-columns:64px 1fr 64px !important;
  align-items:center !important;
  overflow:hidden !important;
  border-radius:999px !important;
  border:0 !important;
  background:#000 !important;
  box-shadow:none !important;
}
.rsc-quarter-switch strong{
  font-size:36px !important;
  font-weight:800 !important;
  line-height:1 !important;
  color:#fff !important;
  text-align:center !important;
}
.rsc-q-arrow{
  height:100% !important;
  min-height:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  color:#fff !important;
  font-size:28px !important;
  box-shadow:none !important;
}

/* Score: HOME | 3pt/miss | AWAY */
.rsc-score-head{
  width:100% !important;
  height:138px !important;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) !important;
  align-items:center !important;
  gap:0 !important;
  padding:0 !important;
  background:#fafafa !important;
  border-bottom:1px solid #efefef !important;
}
.rsc-main-score{
  height:100% !important;
  display:flex !important;
  align-items:center !important;
}
.rsc-home-score{justify-content:flex-start !important;padding-left:7% !important;}
.rsc-away-score{justify-content:flex-end !important;padding-right:7% !important;}
.rsc-main-score strong{
  min-width:82px !important;
  min-height:74px !important;
  display:grid !important;
  place-items:center !important;
  background:#fff !important;
  font-size:84px !important;
  font-weight:700 !important;
  line-height:1 !important;
}
.rsc-shot-mini{
  display:grid !important;
  grid-template-columns:repeat(2,auto) !important;
  justify-content:center !important;
  align-items:center !important;
  gap:8px 28px !important;
  padding:0 16px !important;
  text-align:center !important;
  font-weight:800 !important;
  color:#080808 !important;
}
.rsc-shot-mini span{font-size:18px !important;line-height:1 !important;white-space:nowrap !important;}
.rsc-shot-mini strong{font-size:38px !important;line-height:1 !important;}

/* Court layout mirrors the approved coding while never exceeding viewport. */
.rsc-court{
  width:min(100%,1024px) !important;
  max-width:1024px !important;
  margin:0 auto !important;
  display:grid !important;
  grid-template-columns:minmax(72px,12%) minmax(0,1fr) minmax(72px,12%) !important;
  gap:clamp(10px,1.5vw,16px) !important;
  align-items:start !important;
  padding:20px 2% 14px !important;
  overflow:hidden !important;
}
.rsc-roster{
  min-width:0 !important;
  display:grid !important;
  grid-template-rows:repeat(5,1fr) !important;
  gap:18px !important;
}
.rsc-jersey{
  width:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  height:auto !important;
  aspect-ratio:.74 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.rsc-jersey-shape{
  width:min(100%,92px) !important;
  height:auto !important;
  aspect-ratio:.74 !important;
  padding:14% 8% 8% !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  clip-path:polygon(18% 0,34% 8%,42% 16%,50% 17%,58% 16%,66% 8%,82% 0,93% 12%,87% 24%,88% 100%,12% 100%,13% 24%,7% 12%) !important;
  border-radius:0 !important;
  filter:none !important;
}
.rsc-roster-home .rsc-jersey-shape{background:#020202 !important;color:#fff !important;}
.rsc-roster-away .rsc-jersey-shape{
  background:#f3f3f3 !important;
  color:#060606 !important;
  outline:0 !important;
  filter:drop-shadow(0 0 1px #aaa) drop-shadow(0 0 1px #aaa) !important;
}
.rsc-jersey-number{font-size:44px !important;font-weight:900 !important;line-height:1 !important;}
.rsc-jersey-name{
  max-width:100% !important;
  margin-top:8px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  font-size:18px !important;
  font-weight:800 !important;
  line-height:1 !important;
}
.rsc-jersey.selected .rsc-jersey-shape{
  outline:2px solid #111 !important;
  outline-offset:2px !important;
}
.rsc-fouls{right:0 !important;top:0 !important;}

.rsc-controls{min-width:0 !important;width:100% !important;display:grid !important;gap:8px !important;}
.rsc-shot-grid,.rsc-stat-grid,.rsc-rebound-grid{min-width:0 !important;width:100% !important;display:grid !important;gap:8px !important;}
.rsc-shot-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;margin-bottom:4px !important;}
.rsc-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.rsc-rebound-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.rsc-action{
  width:100% !important;
  min-width:0 !important;
  border:1px solid #e1e1e1 !important;
  border-radius:11px !important;
  background:linear-gradient(#fff,#f8f8f8) !important;
  color:#050505 !important;
  box-shadow:0 2px 7px rgba(0,0,0,.14) !important;
}
.rsc-shot-grid .rsc-action{
  min-height:86px !important;
  height:86px !important;
  padding:6px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:0 !important;
}
.rsc-shot-grid .rsc-made{
  background:linear-gradient(#323232,#030303) !important;
  border-color:#2e2e2e !important;
  color:#fff !important;
}
.rsc-shot-grid .rsc-missed{background:linear-gradient(#fff,#f8f8f8) !important;color:#111 !important;}
.rsc-shot-grid .rsc-action strong{font-size:48px !important;font-weight:500 !important;line-height:1 !important;margin:0 !important;}
.rsc-shot-grid .rsc-action span{margin-top:7px !important;font-size:18px !important;font-weight:700 !important;line-height:1 !important;white-space:nowrap !important;}
.rsc-stat-grid .rsc-action,.rsc-rebound-grid .rsc-action{
  min-height:76px !important;
  height:76px !important;
  padding:4px !important;
  font-size:22px !important;
  font-weight:500 !important;
}
.rsc-shot-grid .rsc-action,
.rsc-shot-grid .rsc-action:hover,
.rsc-shot-grid .rsc-action:focus,
.rsc-shot-grid .rsc-action:focus-visible,
.rsc-shot-grid .rsc-action:active,
.rsc-shot-grid .rsc-action.selected,
.rsc-shot-grid .rsc-action[aria-pressed="true"]{outline:0 !important;outline-offset:0 !important;-webkit-tap-highlight-color:transparent !important;}
.rsc-ft-miss{
  min-height:28px !important;
  height:auto !important;
  padding:3px 0 !important;
  border:0 !important;
  background:transparent !important;
  color:#777 !important;
  font-size:16px !important;
  font-weight:500 !important;
  box-shadow:none !important;
}
.rsc-selection{min-height:28px !important;padding:0 !important;text-align:center !important;color:#777 !important;font-size:16px !important;font-weight:700 !important;}

.rsc-points-card{
  width:min(100% - 24px,540px) !important;
  min-width:0 !important;
  max-width:540px !important;
  margin:0 auto 16px !important;
  padding:10px 20px 12px !important;
  display:grid !important;
  grid-template-columns:86px minmax(0,1fr) 86px !important;
  align-items:center !important;
  gap:16px !important;
  border:1px solid #c8c8c8 !important;
  border-radius:15px !important;
  background:#fff !important;
}
.rsc-team-mark{
  width:76px !important;
  height:auto !important;
  aspect-ratio:.73 !important;
  display:grid !important;
  place-items:center !important;
  padding-top:10px !important;
  font-size:48px !important;
  clip-path:polygon(18% 0,34% 8%,42% 16%,50% 17%,58% 16%,66% 8%,82% 0,93% 12%,87% 24%,88% 100%,12% 100%,13% 24%,7% 12%) !important;
}
.rsc-team-mark-home{background:#020202 !important;color:#fff !important;}
.rsc-team-mark-away{background:#f3f3f3 !important;color:#111 !important;outline:0 !important;filter:drop-shadow(0 0 1px #aaa) !important;}
.rsc-points-center>strong{font-size:26px !important;line-height:1 !important;}
.rsc-quarter-points{grid-template-columns:1fr auto 1fr !important;gap:1px 10px !important;margin-top:6px !important;font-size:17px !important;line-height:1.35 !important;color:#111 !important;}
.rsc-quarter-points .current{color:red !important;font-weight:800 !important;}

.rsc-bottom-actions{
  position:fixed !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  z-index:100 !important;
  height:calc(92px + env(safe-area-inset-bottom)) !important;
  padding-bottom:env(safe-area-inset-bottom) !important;
  display:grid !important;
  grid-template-columns:repeat(4,1fr) !important;
  background:rgba(255,255,255,.97) !important;
  border-top:1px solid #ccc !important;
  box-shadow:none !important;
}
.rsc-bottom-actions button{
  min-width:0 !important;
  padding:6px 2px !important;
  display:grid !important;
  place-items:center !important;
  align-content:center !important;
  gap:4px !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:#666 !important;
  font-size:30px !important;
  line-height:1 !important;
}
.rsc-bottom-actions span{font-size:16px !important;line-height:1 !important;font-weight:700 !important;}

@media(max-width:767px){
  body:has(#ref-score-console) .site-header{
    display:grid !important;
    grid-template-columns:1fr auto !important;
    align-items:start !important;
    gap:12px !important;
    width:100% !important;
    min-height:0 !important;
    padding:16px 14px !important;
    background:linear-gradient(135deg,#111b24 0%,#071019 100%) !important;
  }
  body:has(#ref-score-console) .site-header .brand{
    font-size:20px !important;
    white-space:nowrap !important;
  }
  body:has(#ref-score-console) .site-header .app-version{font-size:12px !important;padding:3px 10px !important;}
  body:has(#ref-score-console) .site-header .header-nav{
    grid-column:1/-1 !important;
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:8px !important;
    overflow:visible !important;
  }
  body:has(#ref-score-console) .site-header .header-nav>a,
  body:has(#ref-score-console) .site-header .header-nav .button{
    display:grid !important;
    place-items:center !important;
    min-width:0 !important;
    min-height:38px !important;
    height:auto !important;
    padding:6px !important;
    font-size:12px !important;
    text-align:center !important;
    white-space:normal !important;
  }
  body:has(#ref-score-console) .site-header .header-nav form{min-width:0 !important;}

  .ref-score-console{min-height:calc(100dvh - 132px) !important;padding-bottom:calc(72px + env(safe-area-inset-bottom)) !important;}
  .rsc-topbar{height:76px !important;padding:0 12px !important;}
  .rsc-quarter-switch{width:min(245px,66vw) !important;min-width:0 !important;height:50px !important;grid-template-columns:46px 1fr 46px !important;}
  .rsc-quarter-switch strong{font-size:26px !important;}
  .rsc-q-arrow{font-size:20px !important;}

  .rsc-score-head{height:100px !important;}
  .rsc-home-score{padding-left:3% !important;}
  .rsc-away-score{padding-right:3% !important;}
  .rsc-main-score strong{min-width:52px !important;min-height:54px !important;font-size:44px !important;}
  .rsc-shot-mini{gap:5px 12px !important;padding:0 6px !important;}
  .rsc-shot-mini span{font-size:12px !important;}
  .rsc-shot-mini strong{font-size:26px !important;}

  .rsc-court{
    grid-template-columns:52px minmax(0,1fr) 52px !important;
    gap:6px !important;
    padding:16px 5px 12px !important;
  }
  .rsc-roster{gap:14px !important;}
  .rsc-jersey{aspect-ratio:.74 !important;}
  .rsc-jersey-shape{width:48px !important;height:auto !important;aspect-ratio:.74 !important;}
  .rsc-jersey-number{font-size:22px !important;}
  .rsc-jersey-name{margin-top:5px !important;font-size:9px !important;}
  .rsc-fouls{width:17px !important;height:17px !important;font-size:9px !important;}

  .rsc-shot-grid .rsc-action{height:72px !important;min-height:72px !important;border-radius:9px !important;}
  .rsc-shot-grid .rsc-action strong{font-size:25px !important;}
  .rsc-shot-grid .rsc-action span{margin-top:5px !important;font-size:10px !important;}
  .rsc-stat-grid .rsc-action,.rsc-rebound-grid .rsc-action{height:58px !important;min-height:58px !important;font-size:12px !important;border-radius:9px !important;}
  .rsc-ft-miss{font-size:14px !important;}
  .rsc-selection{font-size:13px !important;min-height:25px !important;}

  .rsc-points-card{
    width:calc(100% - 20px) !important;
    grid-template-columns:54px minmax(0,1fr) 54px !important;
    gap:8px !important;
    padding:8px 10px 10px !important;
  }
  .rsc-team-mark{width:50px !important;font-size:32px !important;}
  .rsc-points-center>strong{font-size:18px !important;}
  .rsc-quarter-points{font-size:13px !important;line-height:1.3 !important;}

  .rsc-bottom-actions{height:calc(72px + env(safe-area-inset-bottom)) !important;}
  .rsc-bottom-actions button{font-size:24px !important;}
  .rsc-bottom-actions span{font-size:11px !important;}
}

@media(max-width:360px){
  .rsc-court{grid-template-columns:46px minmax(0,1fr) 46px !important;gap:4px !important;padding-inline:4px !important;}
  .rsc-jersey-shape{width:43px !important;}
  .rsc-jersey-number{font-size:20px !important;}
  .rsc-shot-grid .rsc-action span{font-size:9px !important;}
  .rsc-stat-grid .rsc-action,.rsc-rebound-grid .rsc-action{font-size:11px !important;}
  .rsc-shot-mini{gap:4px 8px !important;}
  .rsc-shot-mini span{font-size:11px !important;}
  .rsc-shot-mini strong{font-size:24px !important;}
}


/* =========================================================
   SP Japanese labels + 24-second team turnover buttons
   ========================================================= */
.rsc-roster-column{
  min-width:0 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  gap:12px !important;
}
.rsc-roster-column .rsc-roster{
  width:100% !important;
}
.rsc-24sec-button{
  width:min(100%,92px) !important;
  min-width:0 !important;
  min-height:58px !important;
  padding:7px 3px !important;
  border:1px solid #bdbdbd !important;
  border-radius:9px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:2px !important;
  background:#fff !important;
  color:#111 !important;
  box-shadow:0 2px 6px rgba(0,0,0,.12) !important;
  line-height:1 !important;
}
.rsc-24sec-button strong{
  font-size:17px !important;
  font-weight:900 !important;
}
.rsc-24sec-button span{
  font-size:12px !important;
  font-weight:800 !important;
}
.rsc-24sec-home{
  background:#111 !important;
  color:#fff !important;
  border-color:#111 !important;
}
.rsc-24sec-away{
  background:#f3f3f3 !important;
  color:#111 !important;
  border-color:#c7c7c7 !important;
}
.rsc-stat-grid .rsc-action,
.rsc-rebound-grid .rsc-action{
  line-height:1.2 !important;
  white-space:normal !important;
  word-break:keep-all !important;
  overflow-wrap:anywhere !important;
  letter-spacing:-.03em !important;
}

@media(max-width:767px){
  .rsc-roster-column{gap:10px !important;}
  .rsc-24sec-button{
    width:48px !important;
    min-height:48px !important;
    padding:5px 1px !important;
    border-radius:7px !important;
  }
  .rsc-24sec-button strong{font-size:13px !important;}
  .rsc-24sec-button span{font-size:9px !important;}
  .rsc-stat-grid .rsc-action,
  .rsc-rebound-grid .rsc-action{
    font-size:10px !important;
    padding-inline:2px !important;
  }
  .rsc-ft-miss{
    font-size:12px !important;
  }
}

@media(max-width:360px){
  .rsc-24sec-button{width:43px !important;min-height:44px !important;}
  .rsc-24sec-button strong{font-size:12px !important;}
  .rsc-24sec-button span{font-size:8px !important;}
  .rsc-stat-grid .rsc-action,
  .rsc-rebound-grid .rsc-action{font-size:9px !important;}
}


/* =========================================================
   v3 scoring interface
   2P / 3P / FT in 3 columns, two rows
   + turnover detail buttons
   ========================================================= */

.rsc-shot-grid{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
}

.rsc-shot-grid .rsc-action{
  min-width:0 !important;
}

.rsc-shot-grid .rsc-ft-action strong{
  font-size:clamp(24px,3.4vw,38px) !important;
  font-weight:700 !important;
}

.rsc-stat-grid{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
  margin-bottom:10px !important;
}

.rsc-mistake-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:8px !important;
  margin-bottom:10px !important;
}

.rsc-mistake-grid .rsc-action{
  min-width:0 !important;
  min-height:76px !important;
  line-height:1.2 !important;
  white-space:normal !important;
  word-break:keep-all !important;
}

.rsc-ft-miss{
  display:none !important;
}

@media(max-width:767px){
  .rsc-shot-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }

  .rsc-shot-grid .rsc-action{
    min-height:70px !important;
    padding:6px 2px !important;
  }

  .rsc-shot-grid .rsc-action strong{
    font-size:23px !important;
  }

  .rsc-shot-grid .rsc-action span{
    font-size:10px !important;
  }

  .rsc-shot-grid .rsc-ft-action strong{
    font-size:20px !important;
  }

  .rsc-stat-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }

  .rsc-stat-grid .rsc-action{
    min-height:56px !important;
    padding:4px 2px !important;
    font-size:9.5px !important;
  }

  .rsc-mistake-grid{
    gap:6px !important;
  }

  .rsc-mistake-grid .rsc-action{
    min-height:56px !important;
    padding:4px 2px !important;
    font-size:10px !important;
  }
}

@media(max-width:360px){
  .rsc-shot-grid,
  .rsc-stat-grid{
    gap:4px !important;
  }

  .rsc-shot-grid .rsc-action{
    min-height:64px !important;
  }

  .rsc-shot-grid .rsc-action strong{
    font-size:21px !important;
  }

  .rsc-shot-grid .rsc-ft-action strong{
    font-size:18px !important;
  }

  .rsc-stat-grid .rsc-action{
    min-height:52px !important;
    font-size:8.7px !important;
  }

  .rsc-mistake-grid .rsc-action{
    min-height:52px !important;
    font-size:9px !important;
  }
}


/* =========================================================
   v4 stat order / 4 rows x 3 columns
   ========================================================= */
.rsc-stat-grid-v4{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
  margin-bottom:10px !important;
}

.rsc-stat-grid-v4 .rsc-action{
  min-width:0 !important;
  min-height:76px !important;
  white-space:normal !important;
  word-break:keep-all !important;
  line-height:1.2 !important;
}

.rsc-mistake-grid{
  display:none !important;
}

@media(max-width:767px){
  .rsc-stat-grid-v4{
    gap:6px !important;
  }
  .rsc-stat-grid-v4 .rsc-action{
    min-height:56px !important;
    padding:4px 2px !important;
    font-size:9.5px !important;
  }
}

@media(max-width:360px){
  .rsc-stat-grid-v4{
    gap:4px !important;
  }
  .rsc-stat-grid-v4 .rsc-action{
    min-height:52px !important;
    font-size:8.6px !important;
  }
}


/* =========================================================
   Mobile lineup team chooser fix
   ========================================================= */
.rsc-lineup-team-dialog{
  width:min(420px,calc(100% - 28px)) !important;
  max-width:420px !important;
  border:0 !important;
  border-radius:16px !important;
  padding:20px !important;
  background:#fff !important;
  color:#111 !important;
}
.rsc-lineup-team-dialog::backdrop{
  background:rgba(0,0,0,.48) !important;
}
.rsc-lineup-team-dialog h2{
  margin:0 0 8px !important;
  font-size:22px !important;
}
.rsc-lineup-team-choices{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:10px !important;
  margin:16px 0 4px !important;
}
.rsc-lineup-team-choices .button{
  min-height:82px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:5px !important;
  white-space:normal !important;
  text-align:center !important;
}
.rsc-lineup-team-choices .button strong{
  font-size:16px !important;
}
.rsc-lineup-team-choices .button span{
  font-size:12px !important;
  opacity:.75 !important;
}
@media(max-width:430px){
  .rsc-lineup-team-dialog{
    padding:16px !important;
  }
  .rsc-lineup-team-choices{
    grid-template-columns:1fr !important;
  }
  .rsc-lineup-team-choices .button{
    min-height:66px !important;
  }
}


/* =========================================================
   Lineup modal: explicit Home / Away tabs
   ========================================================= */
.lineup-side-tabs{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:10px !important;
  margin:12px 0 14px !important;
}
.lineup-side-tab{
  min-width:0 !important;
  min-height:64px !important;
  padding:9px 12px !important;
  border:2px solid #d7dce2 !important;
  border-radius:12px !important;
  background:#fff !important;
  color:#111 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:3px !important;
  cursor:pointer !important;
}
.lineup-side-tab span{
  font-size:12px !important;
  color:#6a7480 !important;
  font-weight:700 !important;
}
.lineup-side-tab strong{
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  font-size:15px !important;
}
.lineup-side-tab.active{
  border-color:#1478ff !important;
  background:#eef6ff !important;
  box-shadow:0 0 0 2px rgba(20,120,255,.08) !important;
}
.lineup-side-tab.active span,
.lineup-side-tab.active strong{
  color:#0767d7 !important;
}
.lineup-empty-message{
  min-height:130px !important;
  padding:20px !important;
  border:1px dashed #c6ccd3 !important;
  border-radius:12px !important;
  background:#fafbfc !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  align-items:center !important;
  gap:8px !important;
  text-align:center !important;
}
.lineup-empty-message strong{
  font-size:16px !important;
}
.lineup-empty-message span{
  color:#69727d !important;
  font-size:13px !important;
}

@media(max-width:520px){
  .lineup-side-tabs{
    grid-template-columns:1fr 1fr !important;
    gap:6px !important;
  }
  .lineup-side-tab{
    min-height:58px !important;
    padding:7px 6px !important;
  }
  .lineup-side-tab strong{
    font-size:13px !important;
  }
}


/* =========================================================
   v5 Score mode button visibility
   ========================================================= */
body.mode-score .rsc-game-only-stat{
  display:none !important;
}

body.mode-score .rsc-stat-grid-v4{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

body.mode-score .rsc-stat-grid-v4 .rsc-scoremode-allowed-stat{
  display:flex !important;
}

@media(max-width:767px){
  body.mode-score .rsc-stat-grid-v4{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
}


/* =========================================================
   v5.1 score mode visibility FIX
   score-app itself owns the mode class.
   ========================================================= */
#score-app.mode-score .rsc-game-only-stat{
  display:none !important;
}

#score-app.mode-score .rsc-scoremode-allowed-stat{
  display:flex !important;
}

#score-app.mode-score .rsc-stat-grid-v4{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

/* Hide the now-empty side 24-sec slots naturally in score mode */
#score-app.mode-score .rsc-roster-column{
  justify-content:flex-start !important;
}

@media(max-width:767px){
  #score-app.mode-score .rsc-stat-grid-v4{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
}
\n\n/* =========================================================\n   v6 visual tap feedback\n   ========================================================= */\n.rsc-action,\n.rsc-24sec-button{\n  transition:transform .08s ease, box-shadow .08s ease, filter .08s ease, background-color .12s ease !important;\n  transform-origin:center !important;\n}\n.rsc-action:active,\n.rsc-24sec-button:active{\n  transform:scale(.96) translateY(1px) !important;\n  box-shadow:0 1px 2px rgba(0,0,0,.18) !important;\n}\n.rsc-action.rsc-tap-feedback,\n.rsc-24sec-button.rsc-tap-feedback{\n  animation:rscTapFeedback .26s ease-out !important;\n}\n.rsc-action.rsc-tap-feedback:not(.rsc-made),\n.rsc-24sec-button.rsc-tap-feedback{\n  box-shadow:0 0 0 3px rgba(20,120,255,.28), 0 2px 8px rgba(0,0,0,.15) !important;\n}\n.rsc-made.rsc-tap-feedback{\n  filter:brightness(1.28) !important;\n  box-shadow:0 0 0 3px rgba(20,120,255,.32), 0 2px 8px rgba(0,0,0,.24) !important;\n}\n.rsc-missed.rsc-tap-feedback{\n  background:#eef6ff !important;\n}\n@keyframes rscTapFeedback{\n  0%{transform:scale(1)}\n  35%{transform:scale(.94)}\n  70%{transform:scale(1.025)}\n  100%{transform:scale(1)}\n}\n@media (prefers-reduced-motion: reduce){\n  .rsc-action,.rsc-24sec-button{transition:none !important}\n  .rsc-action.rsc-tap-feedback,.rsc-24sec-button.rsc-tap-feedback{animation:none !important}\n}\n

/* =========================================================
   v9 SCORE MODE - exact six turnover buttons
   ========================================================= */

/* Hide every game-only non-point control in score mode. */
#score-app.mode-score .rsc-game-only-stat{
  display:none !important;
}

/* Show only the six requested score-mode controls. */
#score-app.mode-score .rsc-scoremode-allowed-stat{
  display:flex !important;
}

/* 6 buttons = 3 columns x 2 rows */
#score-app.mode-score .rsc-stat-grid-v4{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
}

/* Remove any leftover empty/obsolete secondary stat area. */
#score-app.mode-score .rsc-mistake-grid{
  display:none !important;
}

@media(max-width:767px){
  #score-app.mode-score .rsc-stat-grid-v4{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  #score-app.mode-score .rsc-stat-grid-v4 .rsc-action{
    min-height:56px !important;
  }
}


/* =========================================================
   Selected player status - larger text
   ========================================================= */
#score-app .rsc-selected-status,
#score-app .rsc-selected-player,
#score-app [data-rsc-selected-label]{
  font-size:2em !important;
  line-height:1.35 !important;
  font-weight:700 !important;
}


/* =========================================================
   Remember login
   ========================================================= */
.remember-login-check{
  display:flex !important;
  grid-template-columns:none !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:10px !important;
  width:max-content !important;
  max-width:100% !important;
  cursor:pointer !important;
  font-weight:700 !important;
}
.remember-login-check input[type="checkbox"]{
  width:22px !important;
  height:22px !important;
  min-width:22px !important;
  margin:0 !important;
  padding:0 !important;
  accent-color:var(--primary) !important;
}
.remember-login-check span{
  line-height:1.35 !important;
}
.remember-login-note{
  margin:-8px 0 0 32px !important;
  font-size:13px !important;
  line-height:1.5 !important;
}
@media(max-width:560px){
  .remember-login-check input[type="checkbox"]{
    width:24px !important;
    height:24px !important;
    min-width:24px !important;
  }
  .remember-login-note{
    margin-left:34px !important;
  }
}


.public-url-copied{
  border-color:#198754 !important;
  color:#198754 !important;
}


.result-history-list{
  display:grid;
  gap:8px;
}
.result-history-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid #e1e5e9;
  border-radius:10px;
  background:#fff;
}
.result-history-main{
  min-width:0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:7px 10px;
}
.result-history-quarter,
.result-history-clock{
  color:#68727d;
  font-size:13px;
  font-weight:700;
}
.result-history-team{
  font-size:13px;
}
.result-history-player{
  font-size:14px;
}
.result-history-label{
  font-weight:700;
}
.result-history-actions{
  display:flex;
  gap:6px;
  flex-shrink:0;
}
.button.small{
  min-height:34px;
  padding:6px 10px;
  font-size:12px;
}
.button.danger{
  border-color:#d14a4a;
  color:#fff;
}
.result-event-edit-dialog{
  width:min(520px,calc(100% - 28px));
  border:0;
  border-radius:16px;
  padding:20px;
}
.result-event-edit-dialog::backdrop{
  background:rgba(0,0,0,.48);
}
.result-event-edit-dialog form{
  display:grid;
  gap:12px;
}
.result-event-edit-dialog label{
  display:grid;
  gap:5px;
  font-weight:700;
}
.result-event-edit-dialog select,
.result-event-edit-dialog input{
  width:100%;
}
#result-edit-shot-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
@media(max-width:640px){
  .result-history-row{
    align-items:flex-start;
    flex-direction:column;
  }
  .result-history-actions{
    width:100%;
  }
  .result-history-actions .button{
    flex:1;
  }
}


/* =========================================================
   v15 result.php layout
   ========================================================= */
.page-actions{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 14px;
  padding:10px 0;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
}

.result-history-card{
  overflow:hidden;
}

.result-history-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.result-history-head h2{
  margin:0 0 4px;
}

.result-history-head .muted{
  margin:0;
}

.result-history-legend{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  align-items:center;
  font-size:12px;
  color:#66717c;
  white-space:nowrap;
}

.legend-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  display:inline-block;
  margin-right:4px;
}
.legend-dot.shot{background:#111;}
.legend-dot.stat{background:#6a87a0;}
.legend-dot.turnover{background:#b26a38;}

.result-history-table{
  border:1px solid #dde2e7;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}

.result-history-table-head,
.result-history-row{
  display:grid;
  grid-template-columns:58px 78px minmax(110px,1.1fr) minmax(130px,1.3fr) minmax(130px,1.3fr) 126px;
  align-items:center;
}

.result-history-table-head{
  min-height:42px;
  padding:0 12px;
  background:#f4f6f8;
  color:#5f6872;
  font-size:12px;
  font-weight:800;
  border-bottom:1px solid #dde2e7;
}

.result-history-row{
  min-height:58px;
  padding:8px 12px;
  border-bottom:1px solid #edf0f2;
  transition:background-color .12s ease;
}

.result-history-row:last-child{
  border-bottom:0;
}

.result-history-row:hover{
  background:#fafbfc;
}

.result-history-row > span,
.result-history-row > strong{
  min-width:0;
}

.cell-q{
  font-weight:800;
}
.cell-clock{
  font-variant-numeric:tabular-nums;
  color:#616b75;
}
.cell-team{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cell-player{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cell-label b{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 9px;
  border-radius:999px;
  background:#f1f3f5;
  font-size:12px;
}

.result-history-row.is-shot .cell-label b{
  background:#111;
  color:#fff;
}

.result-history-row.is-stat .cell-label b{
  background:#edf4f8;
  color:#37556b;
}

.result-history-row.is-turnover .cell-label b{
  background:#fff1e7;
  color:#8d4d22;
}

.result-history-row.is-substitution .cell-label b{
  background:#f1f1f1;
  color:#666;
}

.cell-actions{
  display:flex;
  gap:6px;
  justify-content:flex-end;
}

.result-history-empty{
  padding:30px 16px;
  text-align:center;
  color:#7a838c;
}

@media(max-width:820px){
  .result-history-head{
    flex-direction:column;
  }

  .result-history-table{
    overflow:visible;
    border:0;
    background:transparent;
  }

  .result-history-table-head{
    display:none;
  }

  .result-history-row{
    display:grid;
    grid-template-columns:72px 1fr;
    gap:6px 10px;
    min-height:0;
    margin-bottom:10px;
    padding:12px;
    border:1px solid #e2e6ea;
    border-radius:12px;
    background:#fff;
  }

  .result-history-row:last-child{
    border-bottom:1px solid #e2e6ea;
  }

  .result-history-row > *::before{
    display:block;
    margin-bottom:2px;
    color:#8a939c;
    font-size:10px;
    font-weight:700;
  }

  .cell-q::before{content:"Q";}
  .cell-clock::before{content:"時間";}
  .cell-team::before{content:"チーム";}
  .cell-player::before{content:"選手";}
  .cell-label::before{content:"記録";}
  .cell-actions::before{content:"操作";}

  .cell-actions{
    justify-content:flex-start;
    align-items:center;
  }
}

@media(max-width:520px){
  .page-actions{
    position:static;
    padding-top:0;
  }

  .page-actions .button{
    flex:1 1 calc(50% - 6px);
    text-align:center;
  }

  .result-history-row{
    grid-template-columns:64px 1fr;
  }

  .cell-actions{
    width:100%;
  }

  .cell-actions .button{
    flex:1;
  }
}


/* =========================================================
   v16 Result history action buttons
   ========================================================= */
.result-history-card .button.danger,
.result-history-card .button.danger:visited{
  background:#d64545 !important;
  border-color:#d64545 !important;
  color:#fff !important;
}
.result-history-card .button.danger:hover,
.result-history-card .button.danger:focus{
  background:#bd3434 !important;
  border-color:#bd3434 !important;
  color:#fff !important;
}
.result-history-card .button.danger:active{
  background:#a92b2b !important;
  border-color:#a92b2b !important;
  color:#fff !important;
}


/* =========================================================
   v17 Result history is view-only
   ========================================================= */
.result-history-table-head,
.result-history-row{
  grid-template-columns:58px 78px minmax(110px,1.1fr) minmax(130px,1.3fr) minmax(130px,1.3fr) !important;
}

@media(max-width:820px){
  .result-history-row{
    grid-template-columns:72px 1fr !important;
  }
}

@media(max-width:520px){
  .result-history-row{
    grid-template-columns:64px 1fr !important;
  }
}


/* =========================================================
   v18 PLAY BY PLAY history
   ========================================================= */
.playbyplay-history{
  padding:0 !important;
  overflow:hidden;
}
.playbyplay-history .result-history-head{
  margin:0 !important;
  padding:18px 20px;
  align-items:center;
  border-bottom:1px solid #e5e7e9;
}
.playbyplay-history .result-history-head h2{
  letter-spacing:.08em;
}
.playbyplay-quarter-tabs{
  display:flex;
  align-items:stretch;
  border:1px solid #d8dde1;
  border-radius:8px;
  overflow:hidden;
  background:#fff;
}
.playbyplay-tab{
  appearance:none;
  min-width:62px;
  min-height:44px;
  padding:8px 14px;
  border:0;
  border-right:1px solid #d8dde1;
  background:#fff;
  color:#222;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.playbyplay-tab:last-child{border-right:0;}
.playbyplay-tab.is-active{
  background:#111;
  color:#fff;
}
.playbyplay-list{
  padding:14px 20px 20px;
}
.playbyplay-item{
  display:grid;
  grid-template-columns:82px minmax(0,1fr);
  align-items:stretch;
  min-height:82px;
  margin:0;
}
.playbyplay-time{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:2px;
  border-right:1px solid #d8dde1;
  color:#7a8289;
  font-size:11px;
}
.playbyplay-time strong{
  color:#333;
  font-size:13px;
  font-variant-numeric:tabular-nums;
}
.playbyplay-event{
  position:relative;
  width:min(62%,620px);
  min-height:82px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:14px 22px;
  background:#f2f2f2;
}
.playbyplay-item.is-home .playbyplay-event{
  justify-self:start;
  text-align:left;
  border-left:4px solid #111;
}
.playbyplay-item.is-away .playbyplay-event{
  justify-self:end;
  text-align:right;
  border-right:4px solid #aeb5bb;
}
.playbyplay-title{
  font-size:15px;
  line-height:1.35;
}
.playbyplay-player{
  font-size:16px;
  line-height:1.35;
}
.playbyplay-item[hidden]{
  display:none !important;
}

@media(max-width:767px){
  .playbyplay-history .result-history-head{
    padding:14px 12px 0;
    gap:12px;
  }
  .playbyplay-history .result-history-head > div:first-child{
    width:100%;
  }
  .playbyplay-quarter-tabs{
    width:100%;
    border-radius:7px 7px 0 0;
  }
  .playbyplay-tab{
    flex:1;
    min-width:0;
    min-height:46px;
    padding:7px 4px;
    font-size:14px;
  }
  .playbyplay-list{
    padding:14px 10px 18px;
  }
  .playbyplay-item{
    grid-template-columns:48px minmax(0,1fr);
    min-height:92px;
  }
  .playbyplay-time{
    font-size:9px;
  }
  .playbyplay-time strong{
    font-size:10px;
  }
  .playbyplay-event{
    width:84%;
    min-height:82px;
    padding:12px 14px;
  }
  .playbyplay-title{
    font-size:15px;
  }
  .playbyplay-player{
    font-size:16px;
  }
}


/* =========================================================
   v19 Result history: anchor links + table layout
   ========================================================= */
.history-table-card{
  overflow:hidden !important;
}
.history-table-card .result-history-head{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:18px !important;
  margin-bottom:16px !important;
}
.history-quarter-nav{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:6px !important;
}
.history-quarter-link{
  min-width:56px !important;
  min-height:42px !important;
  display:grid !important;
  place-items:center !important;
  padding:7px 12px !important;
  border:1px solid #d8dde1 !important;
  border-radius:8px !important;
  background:#fff !important;
  color:#111 !important;
  text-decoration:none !important;
  font-weight:800 !important;
}
.history-quarter-link:hover,
.history-quarter-link:focus{
  background:#111 !important;
  color:#fff !important;
  border-color:#111 !important;
}
.history-quarter-sections{
  display:grid !important;
  gap:22px !important;
}
.history-quarter-section{
  scroll-margin-top:90px !important;
}
.history-quarter-title{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  margin-bottom:8px !important;
}
.history-quarter-title strong{
  font-size:21px !important;
}
.history-back-top{
  color:#6e7882 !important;
  font-size:12px !important;
  text-decoration:none !important;
}
.history-table-wrap{
  width:100% !important;
  overflow-x:auto !important;
  -webkit-overflow-scrolling:touch !important;
  border:1px solid #dfe4e8 !important;
  border-radius:12px !important;
  background:#fff !important;
}
.history-play-table{
  width:100% !important;
  min-width:680px !important;
  border-collapse:collapse !important;
  table-layout:fixed !important;
}
.history-play-table th,
.history-play-table td{
  padding:13px 15px !important;
  border-bottom:1px solid #eceff2 !important;
  text-align:left !important;
  vertical-align:middle !important;
}
.history-play-table thead th{
  background:#f3f5f7 !important;
  color:#5b6570 !important;
  font-size:12px !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}
.history-play-table tbody tr:last-child td{
  border-bottom:0 !important;
}
.history-play-table th:nth-child(1),
.history-play-table td:nth-child(1){
  width:90px !important;
}
.history-play-table th:nth-child(2),
.history-play-table td:nth-child(2){
  width:180px !important;
}
.history-play-table th:nth-child(3),
.history-play-table td:nth-child(3){
  width:180px !important;
}
.history-play-table th:nth-child(4),
.history-play-table td:nth-child(4){
  width:auto !important;
}
.history-play-table tbody tr.is-home td:first-child{
  border-left:4px solid #111 !important;
}
.history-play-table tbody tr.is-away td:first-child{
  border-left:4px solid #b8c0c7 !important;
}
.history-time{
  font-variant-numeric:tabular-nums !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}
.history-team,
.history-player{
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.history-event{
  font-weight:700 !important;
}
.history-empty-cell{
  padding:24px 16px !important;
  text-align:center !important;
  color:#818991 !important;
}

@media(max-width:767px){
  .history-table-card .result-history-head{
    flex-direction:column !important;
    align-items:stretch !important;
  }
  .history-quarter-nav{
    width:100% !important;
  }
  .history-quarter-link{
    flex:1 1 0 !important;
    min-width:0 !important;
  }
  .history-play-table{
    min-width:720px !important;
  }
  .history-play-table th,
  .history-play-table td{
    padding:11px 12px !important;
  }
}


/* =========================================================
   v20 History table: score state instead of clock
   ========================================================= */
.history-play-table th:nth-child(1),
.history-play-table td:nth-child(1){
  width:190px !important;
}
.history-play-table th:nth-child(2),
.history-play-table td:nth-child(2){
  width:190px !important;
}
.history-play-table th:nth-child(3),
.history-play-table td:nth-child(3){
  width:auto !important;
}
.history-play-table th:nth-child(4),
.history-play-table td:nth-child(4){
  width:130px !important;
}
.history-score{
  text-align:center !important;
  white-space:nowrap !important;
  font-variant-numeric:tabular-nums !important;
}
.history-score strong{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:76px !important;
  min-height:30px !important;
  padding:4px 10px !important;
  border-radius:999px !important;
  background:#111 !important;
  color:#fff !important;
  font-size:13px !important;
}


/* =========================================================
   v21 History table: score first + identical PC/SP table
   ========================================================= */
.history-table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
}

.history-play-table{
  width:100% !important;
  min-width:760px !important;
  border-collapse:collapse !important;
  table-layout:fixed !important;
}

.history-play-table th:nth-child(1),
.history-play-table td:nth-child(1){
  width:130px !important;
}
.history-play-table th:nth-child(2),
.history-play-table td:nth-child(2){
  width:190px !important;
}
.history-play-table th:nth-child(3),
.history-play-table td:nth-child(3){
  width:190px !important;
}
.history-play-table th:nth-child(4),
.history-play-table td:nth-child(4){
  width:auto !important;
}

/* Score is always visible as a normal first table column. */
.history-score{
  display:table-cell !important;
  text-align:center !important;
  white-space:nowrap !important;
}

@media(max-width:767px){
  .history-table-card{
    overflow:visible !important;
  }

  .history-table-wrap{
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
  }

  .history-play-table{
    display:table !important;
    width:760px !important;
    min-width:760px !important;
    table-layout:fixed !important;
  }

  .history-play-table thead{
    display:table-header-group !important;
  }

  .history-play-table tbody{
    display:table-row-group !important;
  }

  .history-play-table tr{
    display:table-row !important;
  }

  .history-play-table th,
  .history-play-table td{
    display:table-cell !important;
    padding:11px 12px !important;
    vertical-align:middle !important;
  }

  .history-play-table th:nth-child(1),
  .history-play-table td:nth-child(1){
    width:130px !important;
  }
  .history-play-table th:nth-child(2),
  .history-play-table td:nth-child(2){
    width:190px !important;
  }
  .history-play-table th:nth-child(3),
  .history-play-table td:nth-child(3){
    width:190px !important;
  }
  .history-play-table th:nth-child(4),
  .history-play-table td:nth-child(4){
    width:250px !important;
  }

  .history-score{
    display:table-cell !important;
  }
}


/* =========================================================
   v22 Scrollable table
   Reference pattern:
   wrapper = overflow-x: scroll
   table = width:100% + min-width
   ========================================================= */

.history-scroll-note{
  display:none;
  margin:0 0 6px;
  color:#7b848d;
  font-size:11px;
  text-align:right;
}

.history-table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:scroll !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  border:1px solid #dfe4e8 !important;
  border-radius:12px !important;
  background:#fff !important;
}

.history-play-table{
  display:table !important;
  width:100% !important;
  min-width:760px !important;
  border-collapse:collapse !important;
  table-layout:auto !important;
  margin:0 !important;
}

.history-play-table thead{
  display:table-header-group !important;
}

.history-play-table tbody{
  display:table-row-group !important;
}

.history-play-table tr{
  display:table-row !important;
}

.history-play-table th,
.history-play-table td{
  display:table-cell !important;
  padding:13px 15px !important;
  vertical-align:middle !important;
  white-space:nowrap !important;
  border-bottom:1px solid #eceff2 !important;
}

/* Column widths. Score remains the first column. */
.history-play-table th:nth-child(1),
.history-play-table td:nth-child(1){
  width:130px !important;
  min-width:130px !important;
}
.history-play-table th:nth-child(2),
.history-play-table td:nth-child(2){
  width:180px !important;
  min-width:180px !important;
}
.history-play-table th:nth-child(3),
.history-play-table td:nth-child(3){
  width:190px !important;
  min-width:190px !important;
}
.history-play-table th:nth-child(4),
.history-play-table td:nth-child(4){
  min-width:260px !important;
}

@media(max-width:767px){
  .history-scroll-note{
    display:block !important;
  }

  .history-table-card{
    overflow:hidden !important;
  }

  .history-table-wrap{
    width:100% !important;
    max-width:100% !important;
    overflow-x:scroll !important;
    overflow-y:hidden !important;
  }

  .history-play-table{
    width:100% !important;
    min-width:760px !important;
  }

  .history-play-table th,
  .history-play-table td{
    padding:11px 12px !important;
    white-space:nowrap !important;
  }
}


/* =========================================================
   v23 History SP display = same behavior as player stats
   ========================================================= */

/* Use the global .table-wrap scrolling behavior used by 選手成績. */
.history-table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
}

/* Same sizing concept as the player-stat table:
   content width expands naturally and SP scrolls horizontally. */
.history-table-wrap .history-play-table{
  display:table !important;
  width:max-content !important;
  min-width:100% !important;
  table-layout:auto !important;
  border-collapse:collapse !important;
  margin:0 !important;
}

.history-table-wrap .history-play-table thead{
  display:table-header-group !important;
}
.history-table-wrap .history-play-table tbody{
  display:table-row-group !important;
}
.history-table-wrap .history-play-table tr{
  display:table-row !important;
}
.history-table-wrap .history-play-table th,
.history-table-wrap .history-play-table td{
  display:table-cell !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  padding:12px 14px !important;
  vertical-align:middle !important;
}

/* Score remains the first column and never disappears on SP. */
.history-table-wrap .history-score{
  display:table-cell !important;
  min-width:120px !important;
  text-align:center !important;
}
.history-table-wrap .history-team{
  min-width:160px !important;
}
.history-table-wrap .history-player{
  min-width:170px !important;
}
.history-table-wrap .history-event{
  min-width:210px !important;
}

/* Previous custom hint is no longer necessary. */
.history-scroll-note{
  display:none !important;
}

@media(max-width:767px){
  .history-table-card{
    overflow:hidden !important;
  }

  .history-table-wrap{
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }

  .history-table-wrap .history-play-table{
    width:max-content !important;
    min-width:100% !important;
    table-layout:auto !important;
  }

  .history-table-wrap .history-play-table th,
  .history-table-wrap .history-play-table td{
    padding:10px 12px !important;
    white-space:nowrap !important;
  }
}


/* =========================================================
   v24 History table scroll = EXACT same mechanism as 選手成績
   IMPORTANT:
   - scrolling is handled only by global .table-wrap
   - table sizing is handled only by global .table-wrap table
   ========================================================= */

/* Do not let the history card itself become the scroll container. */
.history-table-card{
  overflow:visible !important;
}

/* History table visual styling only.
   No overflow / width / min-width / display overrides here. */
.history-play-table{
  border-collapse:collapse !important;
}

.history-play-table th,
.history-play-table td{
  padding:12px 14px !important;
  border-bottom:1px solid #eceff2 !important;
  vertical-align:middle !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
}

.history-play-table thead th{
  background:#f3f5f7 !important;
  color:#5b6570 !important;
  font-size:12px !important;
  font-weight:800 !important;
}

.history-play-table tbody tr:last-child td{
  border-bottom:0 !important;
}

.history-score{
  text-align:center !important;
  white-space:nowrap !important;
  font-variant-numeric:tabular-nums !important;
}

.history-score strong{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:76px !important;
  min-height:30px !important;
  padding:4px 10px !important;
  border-radius:999px !important;
  background:#111 !important;
  color:#fff !important;
  font-size:13px !important;
}

.history-team,
.history-player,
.history-event{
  white-space:nowrap !important;
}

/* Keep reasonable content widths without forcing the whole card wider. */
.history-play-table .history-score{ min-width:110px !important; }
.history-play-table .history-team{ min-width:150px !important; }
.history-play-table .history-player{ min-width:160px !important; }
.history-play-table .history-event{ min-width:190px !important; }

/* Undo previous versions' custom history scroll geometry.
   This returns control to the same .table-wrap CSS as 選手成績. */
.history-table-wrap,
.history-table-wrap.table-wrap{
  all:unset;
}

@media(max-width:767px){
  .history-table-card{
    overflow:visible !important;
  }

  /* Do not convert history to cards or force 760px width.
     The common .table-wrap styles handle horizontal scrolling. */
  .history-play-table th,
  .history-play-table td{
    padding:10px 12px !important;
    white-space:nowrap !important;
  }
}


/* =========================================================
   v25 History horizontal-scroll containment fix
   Prevent the table itself from widening the result card.
   ========================================================= */

/* The outer result card must always stay inside the viewport. */
.result-history-card.history-table-card{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.result-history-card .result-history-head,
.result-history-card .history-quarter-sections,
.result-history-card .history-quarter-section{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

/* This div alone becomes the horizontal scroll container,
   exactly like the player-stat .table-wrap. */
.result-history-card .table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  box-sizing:border-box !important;
}

/* The table may be wider than the viewport, but only INSIDE .table-wrap. */
.result-history-card .table-wrap .history-play-table{
  display:table !important;
  width:max-content !important;
  min-width:100% !important;
  max-width:none !important;
  table-layout:auto !important;
  border-collapse:collapse !important;
  margin:0 !important;
}

/* Keep cells on one line so horizontal scrolling is used. */
.result-history-card .history-play-table th,
.result-history-card .history-play-table td{
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
}

/* Remove old history-specific wrapper behavior from previous versions. */
.result-history-card .history-table-wrap{
  all:revert !important;
}

/* Re-apply the exact scroll wrapper after reset. */
.result-history-card .history-table-wrap.table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  box-sizing:border-box !important;
}

/* SP: keep the PC table intact, scroll it only inside the card. */
@media(max-width:767px){
  .result-history-card.history-table-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow:hidden !important;
  }

  .result-history-card .history-quarter-section{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  .result-history-card .history-table-wrap.table-wrap{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
  }

  .result-history-card .history-play-table{
    width:max-content !important;
    min-width:100% !important;
    max-width:none !important;
  }
}


/* =========================================================
   v26 PLAY BY PLAY quarter anchor button style
   ========================================================= */
.history-quarter-nav{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:10px !important;
}

.history-quarter-link,
.history-quarter-link:link,
.history-quarter-link:visited{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:92px !important;
  height:70px !important;
  padding:0 18px !important;
  border:2px solid #d5dce2 !important;
  border-radius:14px !important;
  background:#fff !important;
  color:#111 !important;
  text-decoration:none !important;
  font-size:28px !important;
  font-weight:800 !important;
  line-height:1 !important;
  box-shadow:none !important;
}

.history-quarter-link:hover,
.history-quarter-link:focus{
  background:#f7f9fa !important;
  border-color:#aeb8c1 !important;
  color:#111 !important;
  text-decoration:none !important;
}

.history-quarter-link:active{
  transform:scale(.98) !important;
  background:#f1f3f5 !important;
}

.history-back-top,
.history-back-top:link,
.history-back-top:visited{
  color:#707a84 !important;
  text-decoration:none !important;
}

@media(max-width:767px){
  .history-quarter-nav{
    justify-content:center !important;
    gap:8px !important;
  }

  .history-quarter-link,
  .history-quarter-link:link,
  .history-quarter-link:visited{
    min-width:74px !important;
    height:58px !important;
    padding:0 12px !important;
    border-radius:12px !important;
    font-size:22px !important;
  }
}

@media(max-width:390px){
  .history-quarter-link,
  .history-quarter-link:link,
  .history-quarter-link:visited{
    min-width:66px !important;
    height:54px !important;
    padding:0 10px !important;
    font-size:20px !important;
  }
}


/* =========================================================
   v27 FINAL - PLAY BY PLAY quarter anchor buttons
   ========================================================= */
.result-history-card.history-table-card .result-history-head .history-quarter-nav{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:wrap !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:10px !important;
  width:auto !important;
}

.result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link,
.result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:link,
.result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:visited{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:92px !important;
  min-width:92px !important;
  max-width:92px !important;
  height:70px !important;
  min-height:70px !important;
  margin:0 !important;
  padding:0 !important;
  border:2px solid #d5dce2 !important;
  border-radius:14px !important;
  background:#ffffff !important;
  color:#111111 !important;
  text-decoration:none !important;
  font-size:28px !important;
  line-height:1 !important;
  font-weight:800 !important;
  box-shadow:none !important;
  box-sizing:border-box !important;
}

.result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:hover,
.result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:focus{
  background:#f7f9fa !important;
  border-color:#aeb8c1 !important;
  color:#111 !important;
  text-decoration:none !important;
}

@media(max-width:767px){
  .result-history-card.history-table-card .result-history-head .history-quarter-nav{
    justify-content:center !important;
    width:100% !important;
    gap:8px !important;
  }

  .result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link,
  .result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:link,
  .result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:visited{
    flex:0 0 74px !important;
    width:74px !important;
    min-width:74px !important;
    max-width:74px !important;
    height:58px !important;
    min-height:58px !important;
    border-radius:12px !important;
    font-size:22px !important;
  }
}

@media(max-width:390px){
  .result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link,
  .result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:link,
  .result-history-card.history-table-card .result-history-head .history-quarter-nav > a.history-quarter-link:visited{
    flex-basis:66px !important;
    width:66px !important;
    min-width:66px !important;
    max-width:66px !important;
    height:54px !important;
    min-height:54px !important;
    font-size:20px !important;
  }
}


/* =========================================================
   VERSION 3.0 - Chart mode / analysis
   ========================================================= */

.mode-chart .rsc-shot-grid{
  display:none !important;
}
.rsc-chart-panel{
  display:none;
}
.mode-chart .rsc-chart-panel{
  display:block !important;
  margin-bottom:12px;
}
.rsc-chart-head{
  display:flex;
  flex-direction:column;
  gap:3px;
  margin-bottom:8px;
  text-align:center;
}
.rsc-chart-head strong{font-size:18px;}
.rsc-chart-head span{font-size:12px;color:#737b83;}
.rsc-chart-court-wrap{
  width:100%;
  max-width:520px;
  margin:0 auto;
}
.rsc-shot-court,
.analysis-court{
  width:100%;
  height:auto;
  display:block;
  background:#f6efe5;
  border-radius:12px;
  touch-action:manipulation;
}
.court-bg{fill:#f6efe5;}
.court-line{
  fill:none;
  stroke:#7e664d;
  stroke-width:3;
  vector-effect:non-scaling-stroke;
}
.court-dash{stroke-dasharray:7 7;}
.court-backboard{stroke-width:5;}
.court-hoop{fill:none;stroke:#c55b2f;stroke-width:4;}
.court-ft-target{fill:#fff;fill-opacity:.82;stroke:#111;stroke-width:2;stroke-dasharray:5 4;}
.court-ft-label{font-size:18px;font-weight:800;fill:#111;pointer-events:none;}
.chart-preview-dot{fill:#1688ff;stroke:#fff;stroke-width:4;}
.chart-shot-marker.made,.analysis-shot.made{fill:#111;stroke:#fff;stroke-width:2;}
.chart-shot-marker.missed,.analysis-shot.missed{stroke:#d33;stroke-width:4;stroke-linecap:round;}
.rsc-chart-pending{
  margin-top:8px;
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
#rsc-chart-shot-label{font-size:13px;font-weight:700;color:#555;}
.rsc-chart-result-buttons{
  width:100%;
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:8px;
}
.rsc-chart-result,.rsc-chart-cancel{
  min-height:48px;
  border-radius:10px;
  border:1px solid #d8dde1;
  background:#fff;
  font-weight:800;
}
.rsc-chart-result.made{background:#111;color:#fff;border-color:#111;}
.rsc-chart-result.missed{background:#fff;color:#111;}
.rsc-chart-cancel{padding:0 14px;color:#666;}

/* Prevent old desktop shot buttons from being used in chart mode. */
.mode-chart .team-panel .v17-direct-shot-grid{
  display:none !important;
}
.mode-chart .team-panel .shot-controls .selection-summary{
  display:none !important;
}

/* Analysis */
.analysis-card h3{
  margin:22px 0 10px;
}
.analysis-summary-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:8px;
  margin-bottom:12px;
}
.analysis-summary-grid > div{
  min-height:78px;
  padding:12px;
  border:1px solid #e0e4e8;
  border-radius:10px;
  background:#fafbfc;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
}
.analysis-summary-grid small{color:#717a83;font-size:11px;}
.analysis-summary-grid strong{font-size:24px;}
.analysis-table th,.analysis-table td{text-align:center;white-space:nowrap;}
.analysis-table th:first-child{text-align:left;}

.plusminus-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:8px;
}
.plusminus-player{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 14px;
  border:1px solid #e1e5e8;
  border-radius:10px;
  background:#fff;
}
.plusminus-player span{font-weight:700;white-space:nowrap;}
.plusminus-player strong{font-size:24px;}
.plusminus-player.positive strong{color:#087c42;}
.plusminus-player.negative strong{color:#c43b3b;}
.plusminus-player.zero strong{color:#6d747b;}

.analysis-shot-chart{
  width:min(100%,600px);
  margin:0 auto;
}

@media(max-width:767px){
  .rsc-chart-head strong{font-size:16px;}
  .rsc-chart-result-buttons{grid-template-columns:1fr 1fr;}
  .rsc-chart-cancel{grid-column:1/-1;}
  .analysis-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .plusminus-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:430px){
  .plusminus-grid{grid-template-columns:1fr;}
}


/* =========================================================
   v3.1 Individual shot probability
   ========================================================= */
.shot-probability-player-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:14px 0 18px;
}
.shot-probability-player{
  min-width:92px;
  min-height:58px;
  padding:7px 12px;
  border:1px solid #d7dde2;
  border-radius:10px;
  background:#fff;
  color:#111;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  cursor:pointer;
}
.shot-probability-player span{font-size:12px;color:#737d86;font-weight:700;}
.shot-probability-player strong{font-size:14px;white-space:nowrap;}
.shot-probability-player.is-active{
  background:#111;
  border-color:#111;
  color:#fff;
}
.shot-probability-player.is-active span{color:#ccc;}

.shot-probability-layout{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);
  gap:20px;
  align-items:start;
}
.shot-probability-court-card,
.shot-probability-table-card{
  min-width:0;
}
.shot-probability-selected{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:8px 16px;
  margin-bottom:10px;
}
.shot-probability-selected strong{font-size:18px;}
.shot-probability-selected span{
  padding:6px 10px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:12px;
  font-weight:800;
}
.shot-probability-court-wrap{
  width:min(100%,620px);
  margin:0 auto;
}
.probability-court{
  overflow:visible;
}
.prob-zone-label{
  pointer-events:none;
}
.prob-zone-box{
  fill:rgba(255,255,255,.94);
  stroke:#c7cdd2;
  stroke-width:1.5;
}
.prob-zone-pct{
  fill:#111;
  font-size:14px;
  font-weight:900;
}
.prob-zone-count{
  fill:#68727b;
  font-size:10px;
  font-weight:700;
}
.shot-probability-note{
  margin-top:8px;
  text-align:center;
  font-size:11px;
}
.shot-probability-table{
  width:100%;
  min-width:420px;
}
.shot-probability-table th,
.shot-probability-table td{
  text-align:center;
  white-space:nowrap;
}
.shot-probability-table th:first-child{
  text-align:left;
}
.shot-probability-table td strong{
  font-size:16px;
}

@media(max-width:900px){
  .shot-probability-layout{
    grid-template-columns:1fr;
  }
}
@media(max-width:767px){
  .shot-probability-player-tabs{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
  }
  .shot-probability-player{
    min-width:0;
    padding:6px 4px;
  }
  .shot-probability-player strong{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .shot-probability-selected{
    align-items:flex-start;
    flex-direction:column;
  }
}
@media(max-width:430px){
  .shot-probability-player-tabs{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}


/* =========================================================
   v3.2 Chart mode - comprehensive personal analysis
   ========================================================= */
.chart-personal-analysis{overflow:hidden}
.chart-analysis-head{
  display:flex;justify-content:space-between;gap:18px;align-items:flex-end;margin-bottom:16px
}
.chart-analysis-head h2{margin:0 0 5px}
.chart-analysis-head p{margin:0;color:#6d7680}
.chart-player-select-wrap{display:grid;gap:5px;min-width:280px}
.chart-player-select-wrap label{font-size:11px;font-weight:800;color:#68727c}
.chart-player-select-wrap select{width:100%;min-height:44px}

.chart-kpi-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0 18px
}
.chart-kpi{
  min-height:104px;padding:14px;border:1px solid #e0e4e8;border-radius:13px;
  background:linear-gradient(180deg,#fff,#fafbfc);display:flex;flex-direction:column;justify-content:center;gap:4px
}
.chart-kpi small{font-size:11px;color:#717b84;font-weight:800}
.chart-kpi strong{font-size:25px;line-height:1.15}
.chart-kpi span{font-size:11px;color:#7d858d}

.chart-analysis-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px
}
.chart-analysis-top{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)}
.chart-analysis-panel{
  min-width:0;padding:16px;border:1px solid #e0e5e9;border-radius:14px;background:#fff
}
.panel-title{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:14px}
.panel-title h3{margin:0;font-size:18px}
.panel-title span{font-size:11px;color:#7b838b}
.ca-court-wrap{width:min(100%,560px);margin:auto}
.ca-note{margin:8px 0 0;text-align:center;font-size:11px}

.heat-bubble{opacity:0;transform-box:fill-box;transform-origin:center}
.heat-bubble circle{fill:rgba(20,20,20,.58);stroke:#fff;stroke-width:2}
.heat-bubble text{fill:#fff;font-size:11px;font-weight:900;pointer-events:none}
.heat-level-0 circle{fill:rgba(185,55,55,.58)}
.heat-level-1 circle{fill:rgba(190,105,42,.6)}
.heat-level-2 circle{fill:rgba(143,126,48,.62)}
.heat-level-3 circle{fill:rgba(62,126,85,.64)}
.heat-level-4 circle{fill:rgba(25,105,69,.68)}
.heat-bubble.is-animate{animation:heatPop .46s ease-out forwards}
@keyframes heatPop{0%{opacity:0;transform:scale(.25)}70%{opacity:1;transform:scale(1.12)}100%{opacity:1;transform:scale(1)}}

.animated-bars{display:grid;gap:12px}
.animated-bars.compact{gap:8px}
.anim-bar-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:4px 10px;align-items:center}
.anim-bar-label{display:flex;justify-content:space-between;gap:10px;align-items:center;grid-column:1/-1}
.anim-bar-label span{font-size:12px;font-weight:700}
.anim-bar-label b{font-size:13px}
.anim-bar-track{height:9px;border-radius:999px;background:#edf0f2;overflow:hidden}
.anim-bar-track i{display:block;width:0;height:100%;border-radius:inherit;background:#111;transition:width .72s cubic-bezier(.2,.8,.2,1)}
.anim-bar-row small{font-size:10px;color:#7b838b;text-align:right}

.mini-column-chart{height:235px;display:flex;align-items:flex-end;justify-content:space-around;gap:12px;padding:18px 10px 0}
.mini-col{width:22%;height:100%;display:grid;grid-template-rows:24px 1fr 20px 18px;justify-items:center;gap:3px}
.mini-col-value{font-size:12px;font-weight:800}
.mini-col-track{width:54px;height:100%;display:flex;align-items:flex-end;border-radius:8px 8px 0 0;background:#f0f2f4;overflow:hidden}
.mini-col-track i{display:block;width:100%;height:0;background:#111;transition:height .75s cubic-bezier(.2,.8,.2,1)}
.mini-col b{font-size:12px}.mini-col small{font-size:10px;color:#77808a}

.mini-line-chart{min-height:220px}
.trend-svg{width:100%;height:auto;display:block}
.trend-axis{stroke:#d9dee2;stroke-width:1}
.trend-line{fill:none;stroke:#111;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1200;stroke-dashoffset:1200;animation:trendDraw 1.15s ease forwards}
.trend-point{opacity:0;animation:trendPoint .38s ease forwards}
.trend-point circle{fill:#111;stroke:#fff;stroke-width:2}
.trend-point text{font-size:10px;fill:#555;font-weight:700}
@keyframes trendDraw{to{stroke-dashoffset:0}}
@keyframes trendPoint{to{opacity:1}}

.ca-detail-panel{margin-top:14px}
.ca-zone-table{min-width:640px}
.ca-zone-table th,.ca-zone-table td{text-align:center;white-space:nowrap}
.ca-zone-table th:first-child{text-align:left}

@media(max-width:980px){
  .chart-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chart-analysis-grid,.chart-analysis-top{grid-template-columns:1fr}
}
@media(max-width:767px){
  .chart-analysis-head{flex-direction:column;align-items:stretch}
  .chart-player-select-wrap{min-width:0}
  .chart-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .chart-kpi{min-height:92px;padding:11px}
  .chart-kpi strong{font-size:20px}
  .chart-analysis-panel{padding:12px}
  .panel-title{align-items:flex-start;flex-direction:column;gap:2px}
}
@media(max-width:420px){
  .chart-kpi-grid{grid-template-columns:1fr 1fr}
}


/* =========================================================
   v3.3 Clone past game -> chart position editor
   ========================================================= */
.chart-edit-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-bottom:14px;
}
.chart-edit-summary>div{
  min-height:78px;
  padding:12px;
  border:1px solid #e1e5e9;
  border-radius:11px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  background:#fafbfc;
}
.chart-edit-summary small{font-size:11px;color:#737c85;font-weight:800}
.chart-edit-summary strong{font-size:25px}

.chart-edit-layout{
  display:grid;
  grid-template-columns:minmax(280px,.72fr) minmax(0,1.28fr);
  gap:16px;
  align-items:start;
}
.chart-shot-list-panel{
  min-width:0;
  border:1px solid #dfe4e8;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
.chart-shot-list-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:12px;
  border-bottom:1px solid #e5e8eb;
  background:#f6f8f9;
}
.chart-shot-list-head>div{display:grid;gap:1px}
.chart-shot-list-head span{font-size:10px;color:#7a838b}
.chart-filter{display:flex;align-items:center;gap:5px;font-size:11px;font-weight:700;white-space:nowrap}
.chart-filter input{width:18px;height:18px;margin:0}
.chart-shot-list{
  max-height:650px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.chart-shot-row{
  width:100%;
  min-height:64px;
  padding:8px 10px;
  border:0;
  border-bottom:1px solid #edf0f2;
  background:#fff;
  color:#111;
  display:grid;
  grid-template-columns:26px 34px minmax(0,1fr) auto;
  grid-template-areas:
    "status q player shot"
    "status q team shot";
  align-items:center;
  gap:2px 7px;
  text-align:left;
  cursor:pointer;
}
.chart-shot-row:hover{background:#f8fafb}
.chart-shot-row.is-active{background:#eef6ff;box-shadow:inset 4px 0 0 #1478ff}
.chart-shot-row.ce-saved-flash{animation:ceSaved .5s ease}
@keyframes ceSaved{0%{background:#c9f2d9}100%{background:#eef6ff}}
.chart-shot-status{
  grid-area:status;
  width:24px;height:24px;border-radius:50%;
  display:grid;place-items:center;
  background:#eef0f2;color:#7c858d;font-size:10px;font-weight:900;
}
.chart-shot-row.is-assigned .chart-shot-status{background:#111;color:#fff}
.chart-shot-order{grid-area:q;font-size:11px;font-weight:800;color:#707983}
.chart-shot-player{grid-area:player;font-size:13px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chart-shot-row strong{grid-area:shot;font-size:12px;white-space:nowrap}
.chart-shot-row small{grid-area:team;color:#7d858d;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chart-shot-empty{padding:20px;text-align:center}

.chart-edit-court-panel{
  min-width:0;
  padding:14px;
  border:1px solid #dfe4e8;
  border-radius:12px;
  background:#fff;
}
.chart-edit-current{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:3px 10px;
  align-items:center;
  margin-bottom:10px;
}
.chart-edit-current>span{
  grid-row:1/3;
  min-width:54px;
  min-height:48px;
  display:grid;
  place-items:center;
  padding:6px;
  border-radius:9px;
  background:#111;color:#fff;
  font-size:11px;font-weight:800;
}
.chart-edit-current strong{font-size:16px}
.chart-edit-current small{color:#747d86}
.chart-edit-court-wrap{width:min(100%,620px);margin:0 auto}
.chart-edit-court{cursor:crosshair}
.ce-all-dot{fill:rgba(0,0,0,.36);stroke:#fff;stroke-width:1.5}
.ce-all-x{stroke:rgba(190,50,50,.42);stroke-width:3;stroke-linecap:round}
.ce-current-dot{fill:#1478ff;stroke:#fff;stroke-width:4;filter:drop-shadow(0 2px 4px rgba(0,0,0,.25))}
.ce-current-x{stroke:#1478ff;stroke-width:5;stroke-linecap:round;filter:drop-shadow(0 2px 3px rgba(0,0,0,.22))}
.ce-saving{animation:cePulse .7s ease infinite alternate}
@keyframes cePulse{to{opacity:.45;transform:scale(.8)}}
.chart-edit-help{min-height:44px;padding:10px 4px;text-align:center;color:#68717a;font-size:12px}
.chart-edit-actions{display:grid;grid-template-columns:1fr auto 1fr;gap:8px}
.chart-edit-actions .button:last-child{text-align:center}

.clone-chart-form .button{border-style:dashed}

@media(max-width:900px){
  .chart-edit-layout{grid-template-columns:1fr}
  .chart-shot-list-panel{order:2}
  .chart-edit-court-panel{order:1}
  .chart-shot-list{max-height:420px}
}
@media(max-width:560px){
  .chart-edit-summary{grid-template-columns:repeat(3,1fr)}
  .chart-edit-summary>div{min-height:66px;padding:8px}
  .chart-edit-summary strong{font-size:20px}
  .chart-edit-card{padding:10px}
  .chart-edit-court-panel{padding:9px}
  .chart-edit-actions{grid-template-columns:1fr 1fr}
  .chart-edit-actions #ce-clear{grid-row:2;grid-column:1/-1}
}


/* =========================================================
   v3.4 Public analysis
   ========================================================= */
.public-result-bottom-actions{
  margin-top:18px !important;
}
@media(max-width:767px){
  .public-result-bottom-actions .button{
    flex:1 1 calc(50% - 6px);
    text-align:center;
  }
}


/* =========================================================
   v3.5 Chart edit progress save / resume
   ========================================================= */
.chart-edit-progress-block{
  margin:-3px 0 15px;
  padding:12px 14px;
  border:1px solid #e1e5e8;
  border-radius:11px;
  background:#fff;
}
.chart-edit-progress-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:7px;
  font-size:12px;
}
.chart-edit-progress-meta span{
  font-weight:900;
}
.chart-edit-progress-track{
  height:10px;
  overflow:hidden;
  border-radius:999px;
  background:#edf0f2;
}
.chart-edit-progress-track i{
  display:block;
  height:100%;
  border-radius:inherit;
  background:#111;
  transition:width .35s ease;
}
#ce-save-status{
  margin:8px 0 0;
  font-size:11px;
}
#ce-save-status.chart-save-success{
  color:#087c42;
  font-weight:700;
}
.chart-save-exit-wide{
  width:100%;
  margin-top:10px;
  min-height:50px;
}
.chart-progress-save{
  border-color:#111 !important;
  font-weight:800 !important;
}
.chart-resume-button{
  border-color:#111 !important;
  font-weight:800 !important;
}
@media(max-width:767px){
  .chart-edit-page-head .page-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    width:100%;
  }
  .chart-edit-page-head .page-actions .chart-progress-save{
    grid-column:1/-1;
  }
}


/* =========================================================
   v3.6 Partial chart analysis
   ========================================================= */
.chart-analysis-progress-card{
  border:1px solid #dfe4e8 !important;
  background:linear-gradient(180deg,#fff,#fafbfc) !important;
}
.chart-analysis-progress-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:10px;
}
.chart-analysis-progress-head h2{
  margin:0 0 4px;
}
.chart-analysis-progress-head p{
  margin:0;
  color:#6f7881;
}
.chart-analysis-progress-head>strong{
  font-size:30px;
  line-height:1;
}
.chart-analysis-progress-track{
  height:12px;
  border-radius:999px;
  background:#edf0f2;
  overflow:hidden;
}
.chart-analysis-progress-track i{
  display:block;
  height:100%;
  border-radius:inherit;
  background:#111;
  animation:chartProgressGrow .7s ease-out;
  transform-origin:left center;
}
@keyframes chartProgressGrow{
  from{transform:scaleX(0)}
  to{transform:scaleX(1)}
}
.chart-analysis-progress-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.chart-analysis-progress-stats>div{
  min-height:68px;
  padding:10px 12px;
  border:1px solid #e3e7ea;
  border-radius:10px;
  background:#fff;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
}
.chart-analysis-progress-stats small{
  font-size:10px;
  color:#747d86;
  font-weight:800;
}
.chart-analysis-progress-stats strong{
  font-size:22px;
}
.chart-analysis-partial-note{
  margin:12px 0;
  color:#8a5a24;
  font-size:12px;
  font-weight:700;
}
.chart-analysis-complete-note{
  margin:12px 0 0;
  color:#087c42;
  font-size:12px;
  font-weight:800;
}
.chart-partial-analysis-button{
  border-color:#111 !important;
  font-weight:800 !important;
}
.chart-edit-bottom-cta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.chart-edit-bottom-cta .button{
  width:100%;
  min-height:50px;
  text-align:center;
}
.chart-edit-bottom-cta .chart-save-exit-wide{
  margin-top:0;
}

@media(max-width:560px){
  .chart-analysis-progress-head{
    align-items:flex-end;
  }
  .chart-analysis-progress-head>strong{
    font-size:26px;
  }
  .chart-analysis-progress-stats{
    grid-template-columns:repeat(3,1fr);
  }
  .chart-edit-bottom-cta{
    grid-template-columns:1fr;
  }
}

/* v3.7 cloned team labels + partial analysis */
.analysis-matchup{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  margin-top:5px;font-size:18px;
}
.analysis-matchup strong{
  display:inline-flex;align-items:center;min-height:38px;
  padding:6px 12px;border:1px solid #dce2e7;border-radius:9px;background:#fff;
}
.analysis-matchup span{font-weight:900;color:#68727c}
.chart-personal-partial-badge{
  display:inline-block!important;width:auto!important;
  margin-top:7px!important;padding:5px 9px!important;border-radius:999px;
  background:#fff2d9;color:#8a5a24!important;font-size:11px!important;font-weight:900!important;
}
@media(max-width:560px){
  .analysis-matchup{gap:7px;font-size:14px}
  .analysis-matchup strong{min-height:34px;padding:5px 8px}
}


/* =========================================================
   v3.9 Chart input complete
   ========================================================= */
.chart-complete-state{
  margin-top:10px;
  padding:9px 11px;
  border-radius:9px;
  background:#f2f4f6;
  color:#69727a;
  font-size:11px;
  font-weight:800;
}
.chart-complete-state.is-complete{
  background:#e8f7ee;
  color:#087c42;
}
.chart-edit-bottom-cta-v39{
  grid-template-columns:1fr 1fr !important;
}
.chart-edit-bottom-cta-v39 .chart-complete-button{
  grid-column:1/-1;
  min-height:58px;
  font-size:17px;
  font-weight:900;
}
.chart-complete-button:disabled{
  opacity:.4;
  cursor:not-allowed;
}
.chart-complete-status{
  background:#e7f7ed !important;
  color:#087c42 !important;
}
.chart-progress-status{
  background:#fff2d9 !important;
  color:#8a5a24 !important;
}
.chart-analysis-final-badge{
  display:inline-flex;
  margin-top:6px;
  padding:5px 9px;
  border-radius:999px;
  background:#e8f7ee;
  color:#087c42;
  font-size:11px;
  font-weight:900;
}
@media(max-width:560px){
  .chart-edit-bottom-cta-v39{
    grid-template-columns:1fr !important;
  }
  .chart-edit-bottom-cta-v39 .chart-complete-button{
    grid-column:auto;
  }
}

/* v3.10 manual */
.manual-page{max-width:1180px;margin:auto;padding-bottom:45px}.manual-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:10px 0 24px}.manual-hero span{display:inline-block;background:#111;color:#fff;border-radius:999px;padding:5px 10px;font-size:11px;font-weight:900}.manual-hero h1{font-size:40px;margin:7px 0}.manual-hero p{color:#66717b;margin:0}
.manual-toc{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;padding:13px;margin-bottom:18px;border:1px solid #dfe4e8;border-radius:14px;background:#fff;position:sticky;top:8px;z-index:5}.manual-toc a{padding:10px;text-align:center;text-decoration:none;background:#f3f5f6;border-radius:8px;color:#17212b;font-size:12px;font-weight:800}
.manual-section{display:grid;grid-template-columns:60px 1fr;gap:18px;margin:13px 0;padding:26px;border:1px solid #dfe4e8;border-radius:15px;background:#fff;scroll-margin-top:100px}.manual-no{display:flex;width:48px;height:48px;align-items:center;justify-content:center;border-radius:50%;background:#111;color:#fff}.manual-section h2{font-size:24px;margin:3px 0 10px}.manual-section h3{font-size:15px;margin:20px 0 8px}.manual-section p{line-height:1.75}
.manual-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:15px 0}.manual-grid.two{grid-template-columns:repeat(2,1fr)}.manual-grid article{padding:15px;border:1px solid #e1e5e8;border-radius:11px;background:#fafbfc}.manual-grid article p{font-size:12px;color:#68727b;margin:5px 0 0}
.manual-chips{display:flex;flex-wrap:wrap;gap:7px}.manual-chips span{padding:7px 10px;background:#f4f6f7;border:1px solid #dde2e6;border-radius:8px;font-size:12px;font-weight:800}.manual-flow{display:flex;gap:8px;align-items:center;overflow-x:auto;margin:16px 0}.manual-flow span{white-space:nowrap;padding:10px 12px;border:1px solid #dde2e6;border-radius:9px;font-size:12px;font-weight:800}.manual-flow i{font-style:normal;color:#87919a}.manual-note,.manual-warn,.manual-tip{margin-top:14px;padding:12px 14px;border-radius:9px;font-size:12px;line-height:1.7}.manual-note{background:#f1f3f5}.manual-warn{background:#fff2dd;color:#80551c}.manual-tip{background:#edf6ff;color:#285c8c}.manual-bottom{display:flex;justify-content:center;gap:8px;padding:24px}
@media(max-width:767px){.manual-page{padding:0 10px 35px}.manual-hero{align-items:flex-start;flex-direction:column}.manual-hero h1{font-size:30px}.manual-toc{position:static;grid-template-columns:repeat(2,1fr)}.manual-section{grid-template-columns:1fr;padding:18px}.manual-grid,.manual-grid.two{grid-template-columns:1fr}.manual-section h2{font-size:21px}.manual-bottom{flex-direction:column}.manual-bottom .button{text-align:center}}


/* =========================================================
   v3.11 Manual navigation visibility
   ========================================================= */
.header-nav .manual-nav-link{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:40px !important;
  padding:8px 13px !important;
  border:1px solid rgba(255,255,255,.45) !important;
  border-radius:9px !important;
  color:#fff !important;
  text-decoration:none !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}
.header-nav .manual-nav-link:hover{
  background:#fff !important;
  color:#111 !important;
}

@media(max-width:767px){
  .site-header{
    align-items:flex-start !important;
  }
  .header-nav{
    flex-wrap:wrap !important;
  }
  .header-nav .manual-nav-link{
    min-height:36px !important;
    padding:6px 9px !important;
  }
}

/* =========================================================
   v3.13 Chart edit scope
   ========================================================= */
.chart-scope-panel{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  margin-bottom:14px;
  padding:14px;
  border:1px solid #dfe4e8;
  border-radius:12px;
  background:#fff;
}
.chart-scope-panel p{margin:4px 0 0;color:#6e7780;font-size:11px}
.chart-scope-options{display:flex;gap:8px}
.chart-scope-option{cursor:pointer}
.chart-scope-option input{position:absolute;opacity:0;pointer-events:none}
.chart-scope-option span{
  min-width:170px;
  min-height:62px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:9px 12px;
  border:2px solid #dce2e6;
  border-radius:10px;
  background:#fff;
  transition:.18s ease;
}
.chart-scope-option b{font-size:13px}
.chart-scope-option small{margin-top:3px;color:#737c84;font-size:10px}
.chart-scope-option input:checked+span{
  border-color:#111;
  background:#111;
  color:#fff;
}
.chart-scope-option input:checked+span small{color:#d7d7d7}
.chart-scope-analysis-note{
  display:inline-block!important;
  margin-top:6px!important;
  padding:5px 9px!important;
  border-radius:999px;
  background:#eef6ff;
  color:#285c8c!important;
  font-size:11px!important;
  font-weight:900!important;
}
@media(max-width:767px){
  .chart-scope-panel{grid-template-columns:1fr}
  .chart-scope-options{display:grid;grid-template-columns:1fr 1fr}
  .chart-scope-option span{min-width:0}
}
@media(max-width:430px){
  .chart-scope-options{grid-template-columns:1fr}
}

/* =========================================================
   v3.14 Live chart analysis sync
   ========================================================= */
.ca-live-sync-badge{
  display:inline-flex;
  margin-top:6px;
  padding:5px 9px;
  border-radius:999px;
  background:#eef7f1;
  color:#087c42;
  font-size:10px;
  font-weight:900;
}
.chart-analysis-panel.ca-no-data{
  position:relative;
}
.chart-analysis-panel.ca-no-data::after{
  content:"分析対象の保存済みシュートデータがありません";
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100px;
  margin-top:10px;
  border-radius:9px;
  background:#f6f7f8;
  color:#7a838b;
  font-size:12px;
  font-weight:700;
}

/* =========================================================
   v3.15 Analysis player auto-select / data visibility
   ========================================================= */
.ca-analysis-summary{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:10px 0 14px;
}
.ca-analysis-summary span{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:6px 9px;
  border:1px solid #dfe4e8;
  border-radius:999px;
  background:#f7f9fa;
  color:#68727b;
  font-size:11px;
  font-weight:700;
}
.ca-analysis-summary strong{
  color:#111;
  font-size:13px;
}

/* =========================================================
   v3.17 Home team all-games analysis
   ========================================================= */
.home-analysis-filter-card{padding:14px!important}
.home-analysis-filter{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr)) auto;gap:8px;align-items:end}
.home-analysis-filter label{display:grid;gap:4px}.home-analysis-filter label span{font-size:10px;font-weight:800;color:#6e7780}
.home-analysis-filter select,.home-analysis-filter input{width:100%;min-height:42px}
.home-analysis-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:16px 0;padding:20px 22px;border-radius:16px;background:#111;color:#fff}
.home-analysis-hero h2{font-size:28px;margin:4px 0}.home-analysis-hero p{margin:0;color:#c6cbd0}
.ha-team-label{font-size:10px;letter-spacing:.15em;color:#b9c0c6}.ha-period-summary{font-size:13px;font-weight:800}
.ha-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin-bottom:14px}
.ha-kpi{padding:15px;border:1px solid #dfe4e8;border-radius:13px;background:#fff;display:flex;flex-direction:column;gap:4px}
.ha-kpi small{font-size:10px;color:#707983;font-weight:800}.ha-kpi strong{font-size:26px}.ha-kpi span{font-size:10px;color:#7b848c}
.ha-analysis-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.ha-panel{min-width:0}.ha-wide{grid-column:span 1}
.ha-court-wrap{width:min(100%,600px);margin:auto}
.ha-shot{opacity:0;animation:haShotPop .35s ease forwards}.ha-shot.made{fill:#111;stroke:#fff;stroke-width:2}.ha-shot.missed{stroke:#c34848;stroke-width:3;stroke-linecap:round}
@keyframes haShotPop{from{opacity:0;transform:scale(.25)}to{opacity:1;transform:scale(1)}}
.ha-svg-chart{min-height:270px}.ha-svg-chart svg{width:100%;height:auto;display:block}.ha-grid{stroke:#e7eaed;stroke-width:1}.ha-axis-text{fill:#78818a;font-size:10px}
.ha-trend-line{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1500;stroke-dashoffset:1500;animation:haDraw 1s ease forwards}
.ha-trend-line.series-0{stroke:#111}.ha-trend-line.series-1{stroke:#777}.ha-trend-line.series-2{stroke:#aaa}
.ha-point{opacity:0;animation:haPoint .35s ease forwards}.ha-point circle{stroke:#fff;stroke-width:2}.ha-point.series-0 circle{fill:#111}.ha-point.series-1 circle{fill:#777}.ha-point.series-2 circle{fill:#aaa}.ha-point text{font-size:9px;fill:#555;font-weight:800}
@keyframes haDraw{to{stroke-dashoffset:0}}@keyframes haPoint{to{opacity:1}}
.ha-chart-legend{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:5px;font-size:10px;font-weight:800}.ha-chart-legend span{display:flex;align-items:center;gap:5px}.ha-chart-legend i{width:18px;height:3px;background:#111}.ha-chart-legend i.series-1{background:#777}.ha-chart-legend i.series-2{background:#aaa}
.ha-month-table,.ha-game-table{width:100%;min-width:680px}.ha-month-table th,.ha-month-table td,.ha-game-table th,.ha-game-table td{text-align:center;white-space:nowrap}.ha-game-table th:first-child{text-align:left}.ha-game-table small{display:block;color:#7b848c}
@media(max-width:1100px){.home-analysis-filter{grid-template-columns:repeat(3,1fr)}.ha-kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:767px){.home-analysis-filter{grid-template-columns:1fr 1fr}.home-analysis-filter .button{grid-column:1/-1}.home-analysis-hero{align-items:flex-start;flex-direction:column}.ha-kpi-grid{grid-template-columns:repeat(2,1fr)}.ha-analysis-grid{grid-template-columns:1fr}.ha-wide{grid-column:auto}}
@media(max-width:430px){.home-analysis-filter{grid-template-columns:1fr}.ha-kpi-grid{grid-template-columns:1fr 1fr}}


/* v3.19 aggregate shot-position bubbles */
.ha-shot-cluster{opacity:0;animation:haShotBubbleIn .38s ease forwards;transform-box:fill-box;transform-origin:center}
.ha-shot-bubble{fill:rgba(17,24,39,.82);stroke:#fff;stroke-width:2.5;filter:drop-shadow(0 3px 5px rgba(0,0,0,.18))}
.ha-shot-pct{fill:#fff;font-weight:800;pointer-events:none}
.ha-shot-count{fill:#fff;font-size:9px;font-weight:700;opacity:.9;pointer-events:none}
@keyframes haShotBubbleIn{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:scale(1)}}


/* =========================================================
   v3.20 Area click -> focus corresponding shot circles
   ========================================================= */
#ha-zone-bars .ha-zone-row{
  width:100%;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
  border-radius:9px;
  transition:background .18s ease, padding .18s ease, transform .18s ease;
}
#ha-zone-bars .ha-zone-row:hover{
  background:#f5f6f7;
}
#ha-zone-bars .ha-zone-row.is-active{
  background:#fff0f0;
  padding:8px 9px;
}
#ha-zone-bars .ha-zone-row.is-active .anim-bar-label span,
#ha-zone-bars .ha-zone-row.is-active .anim-bar-label b,
#ha-zone-bars .ha-zone-row.is-active small{
  color:#c91f1f;
  font-weight:900;
}
#ha-zone-bars .ha-zone-row.is-active .anim-bar-track i{
  background:#c91f1f;
}
.ha-shot-cluster{
  transition:opacity .18s ease, filter .18s ease;
}
.ha-shot-cluster.is-dimmed{
  opacity:.18 !important;
}
.ha-shot-cluster.is-active{
  opacity:1 !important;
}
.ha-shot-cluster.is-active .ha-shot-bubble{
  fill:#d82323 !important;
  stroke:#fff !important;
  stroke-width:3.5 !important;
  filter:drop-shadow(0 5px 9px rgba(160,0,0,.34));
}
.ha-shot-cluster.is-active .ha-shot-pct,
.ha-shot-cluster.is-active .ha-shot-count{
  fill:#fff !important;
}
.ha-shot-cluster.is-active{
  animation:haShotFocus .3s ease both;
}
@keyframes haShotFocus{
  0%{transform:scale(.92)}
  70%{transform:scale(1.08)}
  100%{transform:scale(1)}
}


/* =========================================================
   v3.21 総合分析：視認性・カラー・エリア連動強化
   ========================================================= */

/* グラフの文字を少し大きくして読みやすく */
.ha-axis-text{
  font-size:12px !important;
  font-weight:700;
  fill:#66717b !important;
}
.ha-point text{
  font-size:11.5px !important;
  font-weight:900 !important;
}
.ha-chart-legend{
  font-size:12px !important;
  gap:16px !important;
}
.ha-chart-legend i{
  width:22px !important;
  height:4px !important;
  border-radius:999px;
}

/* 白一色を避け、分析パネルごとにごく薄い背景を追加 */
.ha-analysis-grid .ha-panel{
  background:linear-gradient(180deg,#ffffff 0%,#fbfcfe 100%);
  box-shadow:0 5px 18px rgba(28,39,52,.035);
}
#ha-to-trend{
  background:linear-gradient(180deg,#fff8f6 0%,#ffffff 42%);
  border-radius:10px;
  padding:8px;
}
#ha-shot-trend{
  background:linear-gradient(180deg,#f6faff 0%,#ffffff 42%);
  border-radius:10px;
  padding:8px;
}
#ha-zone-bars{
  padding:4px;
  border-radius:10px;
  background:linear-gradient(180deg,#fafcff,#fff);
}

/* ターンオーバー推移 = 赤系 */
.ha-chart-turnover .ha-trend-line.series-0{
  stroke:#e34b4b !important;
}
.ha-chart-turnover .ha-point.series-0 circle{
  fill:#e34b4b !important;
}
.ha-chart-turnover .ha-chart-legend i.series-0{
  background:#e34b4b !important;
}

/* シュート成功率：2P=ブルー / 3P=オレンジ / FT=グリーン */
.ha-chart-shooting .ha-trend-line.series-0{
  stroke:#2878d0 !important;
}
.ha-chart-shooting .ha-trend-line.series-1{
  stroke:#e58a2b !important;
}
.ha-chart-shooting .ha-trend-line.series-2{
  stroke:#2b9b67 !important;
}
.ha-chart-shooting .ha-point.series-0 circle{
  fill:#2878d0 !important;
}
.ha-chart-shooting .ha-point.series-1 circle{
  fill:#e58a2b !important;
}
.ha-chart-shooting .ha-point.series-2 circle{
  fill:#2b9b67 !important;
}
.ha-chart-shooting .ha-chart-legend i.series-0{
  background:#2878d0 !important;
}
.ha-chart-shooting .ha-chart-legend i.series-1{
  background:#e58a2b !important;
}
.ha-chart-shooting .ha-chart-legend i.series-2{
  background:#2b9b67 !important;
}

/* エリア成功率：数値に応じた色分け */
#ha-zone-bars .ha-zone-row .anim-bar-track{
  height:10px;
}
#ha-zone-bars .ha-zone-row.is-high .anim-bar-track i{
  background:#2b9b67;
}
#ha-zone-bars .ha-zone-row.is-mid .anim-bar-track i{
  background:#e58a2b;
}
#ha-zone-bars .ha-zone-row.is-low .anim-bar-track i{
  background:#e34b4b;
}
#ha-zone-bars .ha-zone-row.is-none .anim-bar-track i{
  background:#c9d0d6;
}
#ha-zone-bars .ha-zone-row{
  padding:7px 8px !important;
  margin:0 0 3px;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
#ha-zone-bars .ha-zone-row .anim-bar-label span{
  font-size:13px;
  font-weight:900;
}
#ha-zone-bars .ha-zone-row .anim-bar-label b{
  font-size:13px;
  font-weight:900;
}
#ha-zone-bars .ha-zone-row small{
  font-size:11px;
}

/* 選択中のエリアは右側も赤で明確に */
#ha-zone-bars .ha-zone-row.is-active{
  background:#d92f2f !important;
  color:#fff !important;
  box-shadow:0 4px 12px rgba(180,25,25,.18);
  transform:translateX(-2px);
}
#ha-zone-bars .ha-zone-row.is-active .anim-bar-label span,
#ha-zone-bars .ha-zone-row.is-active .anim-bar-label b,
#ha-zone-bars .ha-zone-row.is-active small{
  color:#fff !important;
}
#ha-zone-bars .ha-zone-row.is-active .anim-bar-track{
  background:rgba(255,255,255,.28) !important;
}
#ha-zone-bars .ha-zone-row.is-active .anim-bar-track i{
  background:#fff !important;
}

/* コート側：選択したエリアの丸を必ず最前面・赤背景・白文字 */
.ha-shot-cluster.is-dimmed{
  opacity:.12 !important;
  filter:grayscale(.6);
}
.ha-shot-cluster.is-active{
  opacity:1 !important;
}
.ha-shot-cluster.is-active .ha-shot-bubble{
  fill:#d92f2f !important;
  stroke:#fff !important;
  stroke-width:4 !important;
  filter:drop-shadow(0 6px 11px rgba(180,25,25,.45)) !important;
}
.ha-shot-cluster.is-active .ha-shot-pct,
.ha-shot-cluster.is-active .ha-shot-count{
  fill:#fff !important;
}
.ha-shot-cluster.is-focus-pop{
  animation:haZonePop .42s cubic-bezier(.2,.9,.3,1.25) both !important;
}
@keyframes haZonePop{
  0%{transform:scale(.72)}
  70%{transform:scale(1.14)}
  100%{transform:scale(1)}
}

/* ヒートマップの通常丸も少し色味を追加 */
.ha-shot-bubble{
  fill:#34415a !important;
}
.ha-shot-cluster:nth-child(3n+2) .ha-shot-bubble{
  fill:#41516d !important;
}
.ha-shot-cluster:nth-child(3n+3) .ha-shot-bubble{
  fill:#2e3a50 !important;
}

/* KPIも見分けやすく */
.ha-kpi:nth-child(1){border-top:4px solid #2878d0}
.ha-kpi:nth-child(2){border-top:4px solid #e58a2b}
.ha-kpi:nth-child(3){border-top:4px solid #2b9b67}
.ha-kpi:nth-child(4),
.ha-kpi:nth-child(5){border-top:4px solid #e34b4b}

@media(max-width:767px){
  .ha-axis-text{font-size:13px !important}
  .ha-point text{font-size:12.5px !important}
  .ha-chart-legend{font-size:13px !important}
  #ha-zone-bars .ha-zone-row .anim-bar-label span,
  #ha-zone-bars .ha-zone-row .anim-bar-label b{
    font-size:14px;
  }
}


/* =========================================================
   v3.22 総合分析：グラフ文字拡大 / TO原因別カラー
   ========================================================= */
.ha-svg-chart .ha-axis-text{
  font-size:15px !important;
  font-weight:800 !important;
}
.ha-svg-chart .ha-point text{
  font-size:15px !important;
  font-weight:900 !important;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:3px;
  stroke-linejoin:round;
}
.ha-svg-chart .ha-chart-legend{
  font-size:16px !important;
  font-weight:900 !important;
  line-height:1.4;
  gap:18px !important;
  flex-wrap:wrap;
}
.ha-svg-chart .ha-chart-legend i{
  width:28px !important;
  height:6px !important;
}

/* ターンオーバー原因別カラー */
.ha-chart-turnover .ha-trend-line.series-0{stroke:#e53935 !important}
.ha-chart-turnover .ha-trend-line.series-1{stroke:#8e44ad !important}
.ha-chart-turnover .ha-trend-line.series-2{stroke:#f39c12 !important}
.ha-chart-turnover .ha-trend-line.series-3{stroke:#16a085 !important}
.ha-chart-turnover .ha-trend-line.series-4{stroke:#2980b9 !important}
.ha-chart-turnover .ha-trend-line.series-5{stroke:#7f8c8d !important}
.ha-chart-turnover .ha-trend-line.series-6{stroke:#d35400 !important}

.ha-chart-turnover .ha-point.series-0 circle{fill:#e53935 !important}
.ha-chart-turnover .ha-point.series-1 circle{fill:#8e44ad !important}
.ha-chart-turnover .ha-point.series-2 circle{fill:#f39c12 !important}
.ha-chart-turnover .ha-point.series-3 circle{fill:#16a085 !important}
.ha-chart-turnover .ha-point.series-4 circle{fill:#2980b9 !important}
.ha-chart-turnover .ha-point.series-5 circle{fill:#7f8c8d !important}
.ha-chart-turnover .ha-point.series-6 circle{fill:#d35400 !important}

.ha-chart-turnover .ha-chart-legend i.series-0{background:#e53935 !important}
.ha-chart-turnover .ha-chart-legend i.series-1{background:#8e44ad !important}
.ha-chart-turnover .ha-chart-legend i.series-2{background:#f39c12 !important}
.ha-chart-turnover .ha-chart-legend i.series-3{background:#16a085 !important}
.ha-chart-turnover .ha-chart-legend i.series-4{background:#2980b9 !important}
.ha-chart-turnover .ha-chart-legend i.series-5{background:#7f8c8d !important}
.ha-chart-turnover .ha-chart-legend i.series-6{background:#d35400 !important}

/* 下のTO内訳もグラフと同じ順番で色を合わせる */
#ha-to-bars .anim-bar-row:nth-child(1) .anim-bar-track i{background:#e53935 !important}
#ha-to-bars .anim-bar-row:nth-child(2) .anim-bar-track i{background:#8e44ad !important}
#ha-to-bars .anim-bar-row:nth-child(3) .anim-bar-track i{background:#f39c12 !important}
#ha-to-bars .anim-bar-row:nth-child(4) .anim-bar-track i{background:#16a085 !important}
#ha-to-bars .anim-bar-row:nth-child(5) .anim-bar-track i{background:#2980b9 !important}
#ha-to-bars .anim-bar-row:nth-child(6) .anim-bar-track i{background:#7f8c8d !important}
#ha-to-bars .anim-bar-row:nth-child(7) .anim-bar-track i{background:#d35400 !important}

@media(max-width:767px){
  .ha-svg-chart .ha-axis-text{font-size:16px !important}
  .ha-svg-chart .ha-point text{font-size:16px !important}
  .ha-svg-chart .ha-chart-legend{font-size:15px !important}
}


/* =========================================================
   v3.23 試合分析：個人シュート分析カラー統一
   総合分析と同じ考え方で色分け
   ========================================================= */

/* 個人分析パネルも少し色味を付ける */
.chart-personal-analysis .chart-analysis-panel{
  background:linear-gradient(180deg,#ffffff 0%,#fbfcfe 100%);
  box-shadow:0 5px 18px rgba(28,39,52,.035);
}
.chart-personal-analysis .chart-kpi:nth-child(1){border-top:4px solid #2878d0}
.chart-personal-analysis .chart-kpi:nth-child(2){border-top:4px solid #e58a2b}
.chart-personal-analysis .chart-kpi:nth-child(3){border-top:4px solid #2b9b67}
.chart-personal-analysis .chart-kpi:nth-child(4){border-top:4px solid #e34b4b}

/* エリア別成功率：順番ごとに色を変えて位置の違いを把握しやすく */
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+1) .anim-bar-track i{background:#e34b4b}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+2) .anim-bar-track i{background:#ef8354}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+3) .anim-bar-track i{background:#e7b52c}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+4) .anim-bar-track i{background:#2b9b67}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+5) .anim-bar-track i{background:#2878d0}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+6) .anim-bar-track i{background:#6d63c7}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+7) .anim-bar-track i{background:#a557b8}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+8) .anim-bar-track i{background:#2096a8}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+9) .anim-bar-track i{background:#d4588c}
.ca-colored-zone-bars .anim-bar-row:nth-child(10n+10) .anim-bar-track i{background:#2f8f83}

/* シュート傾向 */
.ca-colored-volume-bars .anim-bar-row:nth-child(3n+1) .anim-bar-track i{background:#2878d0}
.ca-colored-volume-bars .anim-bar-row:nth-child(3n+2) .anim-bar-track i{background:#e58a2b}
.ca-colored-volume-bars .anim-bar-row:nth-child(3n+3) .anim-bar-track i{background:#2b9b67}

/* 左・中央・右 */
.ca-colored-side-bars .anim-bar-row:nth-child(1) .anim-bar-track i{background:#2878d0}
.ca-colored-side-bars .anim-bar-row:nth-child(2) .anim-bar-track i{background:#8e63bf}
.ca-colored-side-bars .anim-bar-row:nth-child(3) .anim-bar-track i{background:#e58a2b}

/* 距離別 */
.ca-colored-distance-bars .anim-bar-row:nth-child(1) .anim-bar-track i{background:#2b9b67}
.ca-colored-distance-bars .anim-bar-row:nth-child(2) .anim-bar-track i{background:#2878d0}
.ca-colored-distance-bars .anim-bar-row:nth-child(3) .anim-bar-track i{background:#8e63bf}
.ca-colored-distance-bars .anim-bar-row:nth-child(4) .anim-bar-track i{background:#e58a2b}
.ca-colored-distance-bars .anim-bar-row:nth-child(5) .anim-bar-track i{background:#d4588c}

/* Q別成功率：成功率による色分け */
.mini-col.is-high .mini-col-track i{background:#2b9b67 !important}
.mini-col.is-mid .mini-col-track i{background:#e58a2b !important}
.mini-col.is-low .mini-col-track i{background:#e34b4b !important}
.mini-col.is-none .mini-col-track i{background:#c9d0d6 !important}

/* 得点効率：総合分析と統一 2P=青 / 3P=オレンジ / FT=緑 */
.ca-colored-efficiency-bars .anim-bar-row:nth-child(1) .anim-bar-track i{background:#2878d0 !important}
.ca-colored-efficiency-bars .anim-bar-row:nth-child(2) .anim-bar-track i{background:#e58a2b !important}
.ca-colored-efficiency-bars .anim-bar-row:nth-child(3) .anim-bar-track i{background:#2b9b67 !important}

/* 最近のチャート試合：青系で視認性向上 */
.chart-personal-analysis .trend-line{
  stroke:#2878d0 !important;
}
.chart-personal-analysis .trend-point circle{
  fill:#2878d0 !important;
}
.chart-personal-analysis .trend-point text{
  font-size:12px !important;
  font-weight:900 !important;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:3px;
}

/* 個人ヒートマップ：成功率段階を総合分析に合わせて見やすく */
.chart-personal-analysis .heat-level-0 circle{fill:#e34b4b !important}
.chart-personal-analysis .heat-level-1 circle{fill:#ef8354 !important}
.chart-personal-analysis .heat-level-2 circle{fill:#e7b52c !important}
.chart-personal-analysis .heat-level-3 circle{fill:#2b9b67 !important}
.chart-personal-analysis .heat-level-4 circle{fill:#177d51 !important}

/* ラベル文字をわずかに拡大 */
.chart-personal-analysis .anim-bar-label span{
  font-size:13px !important;
}
.chart-personal-analysis .anim-bar-label b{
  font-size:13px !important;
}
.chart-personal-analysis .anim-bar-row small{
  font-size:11px !important;
}
.chart-personal-analysis .mini-col-value{
  font-size:13px !important;
}


/* =========================================================
   v3.24 External game import (Hoopapps beta)
   ========================================================= */
.external-import-url-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.external-import-url-form input{min-height:48px}
.import-confidence{display:inline-flex;padding:7px 10px;border-radius:999px;font-size:11px;font-weight:900}
.import-confidence.level-high{background:#e8f7ee;color:#087c42}
.import-confidence.level-mid{background:#fff2d9;color:#8a5a24}
.import-confidence.level-low{background:#fdeaea;color:#a42c2c}
.external-team-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.external-team-preview{min-width:0;padding:14px;border:1px solid #dfe4e8;border-radius:12px;background:#fafbfc}
.external-team-preview h3{margin:4px 0}.external-team-preview p{margin:0 0 10px;color:#727b83}
.external-team-side{font-size:10px;font-weight:900;color:#66717b}
.external-player-table{min-width:760px}.external-player-table th,.external-player-table td{text-align:center;white-space:nowrap}.external-player-table td:nth-child(2){text-align:left}
.external-import-confirm{margin-top:18px;padding-top:18px;border-top:1px solid #e1e5e8}
.external-import-confirm fieldset{border:0;padding:0;margin:0 0 14px}
.external-import-confirm legend{font-weight:900;margin-bottom:8px}
.external-source-side-picker{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.external-source-side-picker label{cursor:pointer}.external-source-side-picker input{position:absolute;opacity:0}
.external-source-side-picker span{display:block;padding:12px;border:2px solid #dfe4e8;border-radius:10px;font-weight:800;text-align:center}
.external-source-side-picker input:checked+span{background:#111;border-color:#111;color:#fff}
.external-import-warning{margin:14px 0;padding:13px;border-radius:10px;background:#fff3df;color:#80551c}
.external-import-warning p{margin:5px 0 0;line-height:1.7;font-size:12px}
.external-import-submit{width:100%;min-height:54px;font-size:15px;font-weight:900}
.external-import-debug summary{cursor:pointer;font-weight:900}.external-import-debug pre{max-height:280px;overflow:auto;padding:10px;background:#f3f5f6;border-radius:8px;font-size:11px}
@media(max-width:800px){.external-team-preview-grid{grid-template-columns:1fr}}
@media(max-width:560px){.external-import-url-form{grid-template-columns:1fr}.external-source-side-picker{grid-template-columns:1fr}}


/* =========================================================
   v3.25 Hoopapps API importer
   ========================================================= */
.hoopapps-game-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:12px 0;
}
.hoopapps-game-summary>div{
  min-height:68px;
  padding:11px 13px;
  border:1px solid #dfe4e8;
  border-radius:10px;
  background:#f8fafb;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
}
.hoopapps-game-summary small{
  font-size:10px;
  color:#747d86;
  font-weight:800;
}
.hoopapps-game-summary strong{
  font-size:15px;
}
.hoopapps-game-summary a{
  font-weight:800;
}
.hoopapps-period-score{
  overflow-x:auto;
  margin:12px 0 16px;
  border:1px solid #dfe4e8;
  border-radius:11px;
  background:#fff;
}
.hoopapps-period-score table{
  width:100%;
  min-width:520px;
  border-collapse:collapse;
}
.hoopapps-period-score th,
.hoopapps-period-score td{
  padding:10px 12px;
  text-align:center;
  border-bottom:1px solid #edf0f2;
}
.hoopapps-period-score th:first-child{
  text-align:left;
}
.hoopapps-api-player-table{
  min-width:1100px !important;
}
.external-source-side-picker span{
  display:flex !important;
  flex-direction:column;
  gap:3px;
}
.external-source-side-picker span small{
  opacity:.72;
  font-size:9px;
}
@media(max-width:767px){
  .hoopapps-game-summary{
    grid-template-columns:repeat(2,1fr);
  }
}

/* =========================================================
   v3.27 Player identity / combined analysis
   ========================================================= */
.identity-auto-card{border-left:4px solid #2878d0}
.identity-link-table{width:100%;min-width:720px}
.identity-link-table th,.identity-link-table td{white-space:nowrap;text-align:left}
.identity-link-table select{min-width:220px}


/* =========================================================
   v3.28 Combined analysis graph + shot map
   ========================================================= */
.combined-chart{
  min-height:360px;
}
.combined-chart svg{
  width:100%;
  height:auto;
  display:block;
}
.combined-chart-legend{
  display:flex;
  flex-wrap:wrap;
  gap:12px 18px;
  margin:0 0 8px;
  font-size:13px;
  font-weight:900;
}
.combined-chart-legend span{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.combined-chart-legend i{
  width:26px;
  height:5px;
  border-radius:999px;
}
.combined-grid{
  stroke:#e7ebef;
  stroke-width:1;
}
.combined-axis{
  fill:#68737d;
  font-size:13px;
  font-weight:800;
}
.combined-point-label{
  fill:#26313b;
  font-size:13px;
  font-weight:900;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:3px;
  stroke-linejoin:round;
}

.combined-shot-analysis .ha-panel{
  min-height:590px;
}
.combined-court-wrap{
  max-width:720px;
  margin:0 auto;
}
.combined-court{
  width:100%;
  height:auto;
  display:block;
}
.combined-court line,
.combined-court path,
.combined-court circle:not(.combined-rim):not(.combined-shot-bubble){
  stroke:#8d755a;
  stroke-width:1.5;
  fill:none;
}
.combined-court-bg{
  fill:#f7efe4;
  stroke:#9b8060;
  stroke-width:2;
}
.combined-rim{
  fill:none;
  stroke:#d35b2c !important;
  stroke-width:4 !important;
}
.combined-court-note{
  text-align:center;
  margin-top:8px;
}
.combined-shot-bubble{
  fill:#34415a;
  stroke:#fff;
  stroke-width:3;
  filter:drop-shadow(0 5px 8px rgba(0,0,0,.2));
}
.combined-shot-pct{
  fill:#fff;
  font-size:15px;
  font-weight:900;
}
.combined-shot-count{
  fill:#fff;
  font-size:10px;
  font-weight:800;
}
.combined-shot-cluster{
  transition:opacity .18s ease;
}
.combined-shot-cluster.is-dimmed{
  opacity:.12;
}
.combined-shot-cluster.is-active .combined-shot-bubble{
  fill:#d92f2f;
  stroke:#fff;
  stroke-width:4;
  filter:drop-shadow(0 6px 11px rgba(180,25,25,.45));
}

#combined-zone-bars{
  display:grid;
  gap:7px;
}
.combined-zone-row{
  width:100%;
  padding:9px 10px;
  border:0;
  border-radius:10px;
  background:transparent;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}
.combined-zone-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight:900;
  font-size:13px;
}
.combined-zone-track{
  height:10px;
  margin-top:5px;
  border-radius:999px;
  background:#edf0f2;
  overflow:hidden;
}
.combined-zone-track i{
  display:block;
  height:100%;
  border-radius:inherit;
}
.combined-zone-row.is-high .combined-zone-track i{background:#2b9b67}
.combined-zone-row.is-mid .combined-zone-track i{background:#e58a2b}
.combined-zone-row.is-low .combined-zone-track i{background:#e34b4b}
.combined-zone-row.is-none .combined-zone-track i{background:#c9d0d6}
.combined-zone-row small{
  display:block;
  margin-top:4px;
  color:#7b858e;
  font-size:11px;
}
.combined-zone-row.is-active{
  background:#d92f2f;
  color:#fff;
  transform:translateX(-2px);
  box-shadow:0 4px 12px rgba(180,25,25,.18);
}
.combined-zone-row.is-active small{color:#fff}
.combined-zone-row.is-active .combined-zone-track{background:rgba(255,255,255,.28)}
.combined-zone-row.is-active .combined-zone-track i{background:#fff !important}

@media(max-width:767px){
  .combined-axis,.combined-point-label{font-size:15px}
  .combined-chart-legend{font-size:14px}
  .combined-shot-analysis .ha-panel{min-height:0}
}


/* ===== HOOPROVE data migration ===== */
.hp-migration-card{padding:22px!important}
.hp-migration-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}
.hp-migration-summary>div{background:#fafafa;border:1px solid #e5e7e9;border-radius:9px;padding:13px}
.hp-migration-summary span{display:block;font-size:8px;color:#858b92}
.hp-migration-summary strong{display:block;font-size:24px;margin-top:4px}
.hp-migration-note{background:#f7f8f9;border:1px solid #e5e7e9;border-radius:9px;padding:13px;margin:14px 0;font-size:9px;line-height:1.7}
.hp-migration-note strong{display:block;margin-top:7px}.hp-migration-note strong:first-child{margin-top:0}.hp-migration-note p{margin:3px 0 0}
.hp-migration-download{display:inline-flex;margin-top:5px}
.hp-migration-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0 20px}
.hp-migration-steps>div{border:1px solid #e5e7e9;border-radius:9px;padding:14px}
.hp-migration-steps b{display:block;color:#dc143c;font-size:9px}.hp-migration-steps strong{display:block;font-size:12px;margin:6px 0}.hp-migration-steps span{display:block;color:#7c8289;font-size:8px;line-height:1.6}
.hp-migration-complete{text-align:center;padding:28px!important}.hp-migration-check{width:66px;height:66px;border-radius:50%;margin:0 auto 12px;display:grid;place-items:center;background:#eaf8ef;color:#278052;font-size:32px;font-weight:900}
.hp-migration-complete .page-actions{justify-content:center}
@media(max-width:700px){.hp-migration-summary{grid-template-columns:1fr 1fr}.hp-migration-steps{grid-template-columns:1fr}}

/* ===== v3.40 game create fixes ===== */
.v340-wear-grid{grid-template-columns:repeat(3,1fr)!important}
.v340-wear-roster{display:none}.v340-wear-roster.active{display:block}
.v340-home-other{display:none!important}.v340-home-other.active{display:block!important}
.v338-player-setting.variable{background:#fff6df;color:#a46c00}
.v340-extra-player-area{padding:14px 0 2px}
.v340-add-player-btn{border:1px solid #111;background:#111;color:#fff;border-radius:7px;padding:10px 15px;font-size:11px;font-weight:900;cursor:pointer}
.v340-extra-player-list{display:grid;gap:7px;margin-top:10px}
.v340-extra-row{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:10px;border:1px solid #e3e4e6;background:#fafafa;border-radius:8px;padding:10px 12px}
.v340-extra-row strong{font-size:11px}.v340-extra-row span{font-weight:900}.v340-extra-row button{border:1px solid #ddd;background:#fff;border-radius:6px;padding:6px 9px;font-size:9px}
.v340-final-actions{grid-template-columns:auto 1fr auto!important;gap:10px}
.v340-save-game{border:1px solid #111;background:#fff;color:#111;border-radius:8px;padding:0 28px;min-height:48px;font-weight:900;justify-self:end}
.v340-extra-modal{display:none;position:fixed;inset:0;z-index:400;place-items:center;padding:20px}.v340-extra-modal.open{display:grid}
.v340-extra-bg{position:absolute;inset:0;background:#0008}.v340-extra-card{position:relative;width:min(100%,440px);background:#fff;border-radius:12px;overflow:hidden}
.v340-extra-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid #eee}.v340-extra-head h3{margin:0;font-size:15px}.v340-extra-head button{width:34px;height:34px;border:0;border-radius:7px;background:#f2f2f2;font-size:20px}
.v340-extra-body{padding:18px;display:grid;gap:14px}.v340-extra-body label{font-size:10px;font-weight:900}.v340-extra-body select,.v340-extra-body input{width:100%;height:44px;margin-top:6px;border:1px solid #ddd;border-radius:7px;padding:0 10px}
.v340-extra-body>button{height:48px;border:0;border-radius:7px;background:#ff5708;color:#fff;font-weight:900}
@media(max-width:800px){.v340-wear-grid{grid-template-columns:repeat(3,1fr)!important}.v340-wear-grid .v338-team-choice{min-width:0;padding:12px 6px}.v340-wear-grid .v338-team-choice strong{font-size:12px}.v340-wear-grid .v338-team-choice small{font-size:8px}.v340-final-actions{grid-template-columns:1fr 1fr!important}.v340-final-actions .v333-back{grid-column:1}.v340-final-actions .v340-save-game{grid-column:2;width:100%;justify-self:stretch}.v340-final-actions .v333-next{grid-column:1/-1;width:100%}}

/* ===== v3.90 GAME INPUT MATCH ===== */
.v390-game-console{width:min(100%,920px);margin:0 auto;background:#fff;min-height:100vh;padding-bottom:90px;box-shadow:0 0 30px #0002}
.v390-top{background:#0b0e12;color:#fff;padding:14px 18px 16px;border-bottom:3px solid #dc143c}
.v390-brand{display:flex;align-items:center;justify-content:space-between;gap:14px}.v390-brand img{width:225px;background:#fff;border-radius:9px;padding:5px 8px}
.v390-top-actions{display:flex;gap:7px}.v390-top-actions button{height:40px;border:1px solid #3b3f44;border-radius:8px;background:#16191d;color:#fff;padding:0 13px;font-size:10px;font-weight:900}.v390-top-actions .end{background:#dc143c;border-color:#dc143c}
.v390-match{text-align:center;margin-top:12px;font-size:10px;color:#bbb}
.v390-scoreboard{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;margin-top:8px}.v390-score-side{text-align:center}.v390-score-side b{display:block;font-size:12px}.v390-score-side strong{display:block;font-size:42px;line-height:1.05;margin-top:4px}.v390-score-side.home strong{color:#ff9aad}.v390-score-side.away strong{color:#9eb4ff}
.v390-qbox{text-align:center}.v390-qbox b{display:block;font-size:18px}.v390-qbox>span{display:block;color:#ff9aad;font-size:11px;margin-top:2px}
.v390-qtabs{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:12px}.v390-qtabs button{height:38px;border:1px solid #3b3f44;border-radius:7px;background:#171a1f;color:#aaa;font-size:10px;font-weight:900}.v390-qtabs button.active{background:#dc143c;border-color:#dc143c;color:#fff}.v390-qtabs button.configured::after{content:"✓";font-size:8px;margin-left:5px;color:#fff}
.v390-mode-head{display:flex;justify-content:space-between;align-items:center;padding:15px 18px 10px}.v390-mode-head h1{font-size:18px;margin:0}.v390-mode-head span{background:#111;color:#fff;border-radius:999px;padding:6px 10px;font-size:8px;font-weight:900}
.v390-game-layout{display:grid;grid-template-columns:150px minmax(0,1fr) 150px;gap:10px;padding:0 14px 18px}.v390-team-column{border-radius:10px;padding:10px 8px}.v390-team-column.home{background:linear-gradient(#fff3f5,#fff);border:1px solid #efb2bc}.v390-team-column.away{background:linear-gradient(#f2f5ff,#fff);border:1px solid #b9c7ed}
.v390-team-label{text-align:center;font-size:9px;font-weight:900;margin-bottom:8px}.v390-team-column.home .v390-team-label{color:#dc143c}.v390-team-column.away .v390-team-label{color:#4169e1}.v390-roster{display:flex;flex-direction:column;gap:8px}
.v390-pcard{min-height:74px;border-radius:8px;background:#fff;border:1px solid #ddd;padding:8px 5px;text-align:center;font-weight:900;position:relative}.v390-pcard b{display:block;font-size:21px}.v390-pcard span{display:block;font-size:9px;margin-top:4px}.v390-pcard em{position:absolute;right:5px;top:5px;font-style:normal;font-size:8px}
.v390-team-column.home .v390-pcard.selected{background:#dc143c;color:#fff;border-color:#dc143c;box-shadow:inset 0 -4px 0 #8f0d27}.v390-team-column.away .v390-pcard.selected{background:#4169e1;color:#fff;border-color:#4169e1;box-shadow:inset 0 -4px 0 #274597}
.v390-center{min-width:0}.v390-section-title{display:flex;justify-content:space-between;align-items:center;margin:10px 0 6px}.v390-section-title strong{font-size:11px}.v390-section-title span{font-size:8px;color:#999}.v390-section-title.home strong{color:#dc143c}.v390-section-title.away strong{color:#4169e1}
.v390-team-actions{display:grid;grid-template-columns:1fr;gap:6px;margin:0 0 8px}.v390-team-actions button{height:46px;border-radius:7px;font-size:9px;font-weight:900}.v390-team-actions.home button{border:1px solid #e7a5b0;background:#fff2f4;color:#dc143c}.v390-team-actions.home .swap{background:#dc143c;color:#fff;border-color:#dc143c}.v390-team-actions.away button{border:1px solid #b9c6ed;background:#f2f5ff;color:#4169e1}.v390-team-actions.away .swap{background:#4169e1;color:#fff;border-color:#4169e1}
.v390-selected{border:1px solid #e2e2e2;background:#fafafa;border-radius:8px;padding:10px;text-align:center;margin-bottom:8px}.v390-selected small{font-size:8px;color:#999}.v390-selected strong{display:block;font-size:23px;margin-top:2px}
.v390-shots{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.v390-shot{border:1px solid #ddd;border-radius:8px;overflow:hidden}.v390-shot h3{height:30px;margin:0;color:#fff;display:grid;place-items:center;font-size:10px}.v390-shot:nth-child(1) h3{background:#dc143c}.v390-shot:nth-child(2) h3{background:#4169e1}.v390-shot:nth-child(3) h3{background:linear-gradient(90deg,#dc143c,#4169e1)}.v390-shot div{display:grid;grid-template-columns:1fr 1fr}.v390-shot button{height:54px;border:0;background:#fff;font-size:10px;font-weight:900}.v390-shot button+button{border-left:1px solid #eee}.v390-shot .made{color:#dc143c;background:#fff7f8}
.v390-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.v390-stats button{min-height:50px;border:1px solid #ddd;background:#fff;border-radius:7px;font-size:9px;font-weight:900}
.v390-log{margin:0 14px 16px;border:1px solid #e3e3e3;border-radius:8px;overflow:hidden}.v390-log-head{height:38px;background:#fafafa;border-bottom:1px solid #eee;display:flex;align-items:center;justify-content:space-between;padding:0 10px;font-size:9px;font-weight:900}.v390-log-row{display:grid;grid-template-columns:48px 1fr auto;gap:8px;padding:8px 10px;border-bottom:1px solid #eee;font-size:9px}.v390-log-row:last-child{border-bottom:0}.v390-log-row .home{color:#dc143c}.v390-log-row .away{color:#4169e1}
.v390-bottom{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,920px);height:74px;background:#fff;border-top:1px solid #ddd;display:grid;grid-template-columns:.8fr 1fr 1.3fr;gap:8px;padding:9px 14px;z-index:30}.v390-bottom button{border-radius:8px;font-size:10px;font-weight:900}.v390-bottom .undo{border:1px solid #ddd;background:#fff}.v390-bottom .save{border:0;background:#111;color:#fff}.v390-bottom .finish{border:0;background:linear-gradient(90deg,#dc143c,#b40f31);color:#fff}

/* Q lineup */
.v390-lineup-modal{position:fixed;inset:0;z-index:500;display:none;place-items:center;padding:14px}.v390-lineup-modal.open{display:grid}.v390-lineup-bg{position:absolute;inset:0;background:#000a}.v390-lineup-card{position:relative;width:min(100%,660px);max-height:94dvh;overflow:auto;background:#fff;border-radius:12px;box-shadow:0 30px 70px #0005}
.v390-lineup-head{padding:15px 18px;border-bottom:1px solid #eee}.v390-lineup-head h2{font-size:17px;margin:0}.v390-lineup-head p{font-size:9px;color:#777;margin:4px 0 0}
.v390-lineup-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid #eee}.v390-lineup-tabs button{height:48px;border:0;background:#fafafa;font-size:11px;font-weight:900;position:relative}.v390-lineup-tabs .home.active{background:#fff2f4;color:#dc143c}.v390-lineup-tabs .away.active{background:#f2f5ff;color:#4169e1}.v390-lineup-tabs button.active::after{content:"";position:absolute;left:0;right:0;bottom:0;height:4px}.v390-lineup-tabs .home.active::after{background:#dc143c}.v390-lineup-tabs .away.active::after{background:#4169e1}
.v390-lineup-team-head{padding:12px 16px;display:flex;justify-content:space-between;align-items:center}.v390-lineup-team-head strong{font-size:12px}.v390-lineup-team-head div{font-size:9px;color:#777}.v390-lineup-team-head b{font-size:18px}.v390-home-view .v390-lineup-team-head b{color:#dc143c}.v390-away-view .v390-lineup-team-head b{color:#4169e1}
.v390-lineup-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;padding:0 16px 14px}.v390-lineup-player{position:relative;border:1px solid #ddd;background:#fff;border-radius:8px;min-height:80px;padding:11px 8px;text-align:center}.v390-lineup-player b{display:block;font-size:20px}.v390-lineup-player span{display:block;font-size:9px;margin-top:5px}.v390-home-view .v390-lineup-player.selected{border:2px solid #dc143c;background:#fff4f6}.v390-away-view .v390-lineup-player.selected{border:2px solid #4169e1;background:#f3f6ff}.v390-lineup-player.selected::after{content:"✓";position:absolute;right:6px;top:6px;width:19px;height:19px;border-radius:50%;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:900}.v390-home-view .v390-lineup-player.selected::after{background:#dc143c}.v390-away-view .v390-lineup-player.selected::after{background:#4169e1}
.v390-lineup-status{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:0 16px 12px}.v390-lineup-status>div{border:1px solid #ddd;border-radius:7px;padding:8px 10px;font-size:9px}.v390-lineup-status strong{display:block;margin-bottom:3px}.v390-lineup-status .home.done{border-color:#e5a4af;background:#fff4f6}.v390-lineup-status .away.done{border-color:#afbfec;background:#f3f6ff}
.v390-lineup-note{margin:0 16px 12px;padding:10px 12px;background:#f7f7f7;border-radius:7px;font-size:9px;color:#666;line-height:1.6}.v390-lineup-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:8px;padding:13px 16px;border-top:1px solid #eee;background:#fafafa}.v390-lineup-actions button{height:46px;border-radius:7px;font-size:10px;font-weight:900}.v390-lineup-actions .cancel{border:1px solid #ddd;background:#fff}.v390-lineup-actions .confirm{border:0;background:linear-gradient(90deg,#dc143c,#4169e1);color:#fff}.v390-lineup-actions .confirm:disabled{opacity:.35}
#rsc-lineup-team-dialog{display:none!important}

/* hide legacy visual layers, keep DOM for existing JS/API functionality */
.game-input-head,.compact-scoreboard,.score-flow-steps,.quarter-lineup-gate,#flow-record-area,.quarter-save-card,.play-history-card{display:none!important}

@media(max-width:720px){
  .v390-game-console{width:100%}.v390-brand img{width:155px}.v390-top-actions button{height:34px;padding:0 9px}.v390-score-side strong{font-size:34px}
  .v390-game-layout{grid-template-columns:82px minmax(0,1fr) 82px;gap:5px;padding:0 7px 14px}.v390-team-column{padding:7px 4px}.v390-pcard{min-height:60px;padding:6px 2px}.v390-pcard b{font-size:17px}.v390-pcard span{font-size:8px}
  .v390-shots{gap:4px}.v390-shot h3{font-size:8px}.v390-shot button{height:46px;font-size:9px}.v390-team-actions{gap:4px}.v390-team-actions button{height:40px}.v390-stats{gap:4px}.v390-stats button{min-height:43px;font-size:8px}.v390-mode-head{padding-left:8px;padding-right:8px}.v390-log{margin-left:7px;margin-right:7px}
}


/* ===== v3.91 selected player visibility + legacy conflict reset ===== */
.v390-pcard.selected{
  outline:none !important;
  border-width:1px !important;
  box-shadow:none !important;
}
.v390-team-column.home .v390-pcard.selected{
  background:#dc143c !important;
  border-color:#dc143c !important;
  color:#fff !important;
}
.v390-team-column.away .v390-pcard.selected{
  background:#4169e1 !important;
  border-color:#4169e1 !important;
  color:#fff !important;
}
.v390-team-column.home .v390-pcard.selected b,
.v390-team-column.home .v390-pcard.selected span,
.v390-team-column.home .v390-pcard.selected em,
.v390-team-column.away .v390-pcard.selected b,
.v390-team-column.away .v390-pcard.selected span,
.v390-team-column.away .v390-pcard.selected em{
  color:#fff !important;
}
.v390-team-column .v390-pcard:not(.selected){
  background:#fff !important;
  color:#111 !important;
  outline:none !important;
  box-shadow:none !important;
}


/* =========================================================
   HOOPROVE TEAM COLOR RULE - FINAL
   HOME = crimson #dc143c / AWAY = royalblue #4169e1
   ========================================================= */

/* HOME 「そのほか」背番号選択 */
#v340HomeOtherGrid button.selected,
.v340-home-other .v338-away-number-grid button.selected,
[data-wear-roster="other"] .v338-away-number-grid button.selected {
  background:#dc143c !important;
  border-color:#dc143c !important;
  color:#fff !important;
  outline:none !important;
  box-shadow:none !important;
}

/* AWAY 背番号選択 */
#v338AwayNumberGrid button.selected,
.v338-away-number-card:not(.v340-home-other) #v338AwayNumberGrid button.selected {
  background:#4169e1 !important;
  border-color:#4169e1 !important;
  color:#fff !important;
  outline:none !important;
  box-shadow:none !important;
}

/* 選択中の文字は必ず白 */
#v340HomeOtherGrid button.selected *,
#v338AwayNumberGrid button.selected * {
  color:#fff !important;
}

/* 入力画面 HOME / AWAY 選手選択 */
.v390-team-column.home .v390-pcard.selected {
  background:#dc143c !important;
  border-color:#dc143c !important;
  color:#fff !important;
  outline:none !important;
  box-shadow:none !important;
}
.v390-team-column.away .v390-pcard.selected {
  background:#4169e1 !important;
  border-color:#4169e1 !important;
  color:#fff !important;
  outline:none !important;
  box-shadow:none !important;
}
.v390-team-column.home .v390-pcard.selected *,
.v390-team-column.away .v390-pcard.selected * {
  color:#fff !important;
}
