@layer scorer-appearance {
  #root .native-scorer:has(> .native-action-grid) {
    --canvas:transparent; --panel:#121314; --line:#303338;
    --text:#f7f9fb; --secondary:#b0b6bf;
    --goal-fill:#153000; --goal-border:#45d24a; --goal-label:#fff;
    background-color:var(--canvas) !important;
    color:var(--text) !important;
  }
  :root[data-ys-theme=light] #root .native-scorer:has(> .native-action-grid) {
    --canvas:#e3ddd5; --panel:#e3ddd5; --line:#b6c2bb;
    --text:#242a26; --secondary:#626b65;
    --goal-fill:#e2eade; --goal-border:#176c2c; --goal-label:#242a26;
  }
  #root .native-scorer > .native-action-headings { display:none !important; }
  #root .native-scorer > .native-scoreboard {
    width:100% !important; max-width:none !important; min-width:0 !important;
    box-sizing:border-box !important; align-self:stretch !important; margin-inline:0 !important;
  }
  #root .native-scorer > .native-scoreboard > .hockey-rink325 {
    inset:0 !important; width:100% !important; height:100% !important;
    max-width:none !important; max-height:none !important;
  }
  #root .native-scorer .native-action-grid > .native-action {
    --edge:var(--ink); --label:var(--ink);
    background:var(--tile) !important;
    border:2px solid var(--edge) !important; border-radius:15px !important;
    color:var(--label) !important;
  }
  #root .native-scorer .native-action-grid > .native-action b { color:var(--label) !important; }
  #root .native-scorer:has(> .native-action-grid) :is(.native-events,.native-sheet) {
    background:var(--panel) !important; color:var(--text) !important; border-color:var(--line) !important;
  }
  #root .native-scorer:has(> .native-action-grid) :is(.native-events,.native-sheet) :is(h2,h3,p,summary,label) {
    color:var(--text) !important;
  }
  #root .native-scorer:has(> .native-action-grid) :is(.native-history-tools small,.native-limits) {
    color:var(--secondary) !important;
  }
  #root .native-scorer .native-history-row { border-top-color:var(--line) !important; }
}

@layer scorer-appearance {
  #root .native-scorer .native-action-grid button.native-action {
    --edge:var(--ink) !important; --label:var(--ink) !important;
    background:var(--tile) !important; border-width:1px 1px 1px 3px !important; border-radius:6px !important;
  }
  #root .native-scorer .native-action.purple { --ink:#ad73ff !important; }
  #root .native-scorer .native-action.red { --ink:#ff5151 !important; }
  #root .native-scorer .native-action-grid button.green { --tile:#153000 !important; --edge:#45d24a !important; --label:#fff !important; }
  :root[data-ys-theme=light] #root .native-scorer .native-action-grid button.native-action { --label:#242a26 !important; }
  :root[data-ys-theme=light] #root .native-action-grid [aria-label^="OUR "] { --tile:#e2f5e4 !important; }
  :root[data-ys-theme=light] #root .native-action-grid [aria-label^="OPP "] { --tile:#e4f0ff !important; }
  :root[data-ys-theme=light] #root .native-action-grid [aria-label$=" CLOCK"] { --tile:#e2f7f5 !important; }
  :root[data-ys-theme=light] #root .native-action-grid [aria-label="NEXT PERIOD"] { --tile:#e4f0ff !important; }
  :root[data-ys-theme=light] #root .native-action-grid :is([aria-label="BOX SCORE"],[aria-label="PENALTY SHOT"],[aria-label="GREAT PLAY"],[aria-label="GOALIE"]) { --tile:#f0e7ff !important; --ink:#ad73ff !important; }
  :root[data-ys-theme=light] #root .native-scorer .native-action-grid button.green { --tile:#e2f5e4 !important; --edge:#45e64d !important; }
  #root .native-scorer .native-scoreboard > .native-clock-tools {
    grid-column:1/-1; display:flex !important; justify-content:center; gap:4px;
  }
  #root .native-scorer .native-scoreboard > .native-clock-tools button {
    flex:1; min-width:0; max-width:160px; min-height:32px !important; margin:0 !important;
    background:transparent !important; border:0 !important; color:#254052 !important;
    font-size:10px !important; font-weight:800 !important; padding:3px 5px !important;
  }
  #root .native-scorer .native-sheet .native-time {
    display:grid !important; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:6px; align-items:end;
  }
  #root .native-scorer .native-time input { width:100% !important; box-sizing:border-box; min-width:0; }
}
@layer scorer-appearance {
  #root .native-scorer .native-action-grid button.native-action { height:58px !important; }
  #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) {
    width:calc(84% + 2.52px) !important; height:44px !important;
  }
  #root .native-scorer .native-action-grid button.native-action:nth-child(2) { justify-self:end !important; }
  #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) .native-icon { width:34px; height:34px; }
  #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) .native-icon > * { zoom:.6; }
}


@layer scorer-appearance {
  :root[data-ys-theme=dark] #root .native-scorer .native-action-grid button.native-action {
    background:#1b2420 !important; color:#f0f5f1 !important;
    border-color:#39483e !important; border-left-color:var(--scoring-accent) !important;
  }
  :root[data-ys-theme=dark] #root .native-scorer .native-action-grid button.native-action b { color:#f0f5f1 !important; }
  .native-scorer .native-action.teal { --scoring-accent:#79bca7; }
  .native-scorer .native-action:is(.blue,.green) { --scoring-accent:#7ebc8e; }
  .native-scorer .native-action.gold { --scoring-accent:#cbb16f; }
  .native-scorer .native-action.purple { --scoring-accent:#aab5b0; }
  .native-scorer .native-action.red { --scoring-accent:#d18a8a; }
}
@layer scorer-appearance {
  #root .native-scorer > .native-scoreboard { min-height:160px !important; }
  #root .native-scoreboard > .native-score-side.opp { grid-column:3; }
  #root .native-scorer > .native-scoreboard > .native-clock-center {
    position:absolute !important; left:50%; top:50%; transform:translate(-50%,-50%);
    box-sizing:border-box; width:104px; height:104px; border:2px solid #abcce9;
    border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:2px; pointer-events:none;
  }
  #root .native-clock-center > output::before { content:none !important; }
  #root .native-scoreboard > .native-clock-tools { align-self:end; }
  #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) {
    width:50% !important; min-width:0 !important; justify-content:center !important; padding-inline:2px !important;
  }
  #root .native-action-grid { container-type:inline-size; }
  @container (max-width:540px) {
    #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) {
      flex-direction:column !important; gap:0 !important;
    }
    #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) .native-icon {
      width:17px; height:17px;
    }
    #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) .native-icon > * { zoom:.32; }
    #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) b {
      font-size:10px !important; white-space:normal !important; text-align:center;
    }
  }
}
@layer scorer-appearance {
  @container (max-width:540px) {
    #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) {
      display:grid !important; grid-template-rows:15px minmax(0,1fr); grid-template-columns:minmax(0,1fr);
      justify-items:center; align-items:center !important; padding:1px 2px !important;
    }
    #root .native-scorer .native-action-grid button.native-action:nth-child(-n+2) b { line-height:10px !important; margin:0 !important; }
  }
}


@layer scorer-appearance {
  #root .native-scorer .native-great-play-star { color:#ffca45 !important; font:38px/1 system-ui; }
  #root .native-scoreboard :is(.native-score-side,.native-clock-center)>small,
  #root .live-rink-columns330>div>small,
  .ys-watch-score>div:is(:first-child,:last-child)>span,
  .ys-watch-score>div:nth-child(2)>strong { font-weight:800 !important; }
}
