.ys-shell {
  --ys-red: #c43f38;
  --ys-red-dark: #982f2b;
  --ys-cream: #fffaf0;
  --ys-rule: #cfc5b5;
  display: grid;
  gap: 14px;
}

.ys-player-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 7px;
}

.ys-player-strip button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: white;
  text-align: left;
}

.ys-player-strip button.active {
  border-color: var(--ys-red);
  background: #fff1ef;
  box-shadow: inset 0 0 0 1px var(--ys-red);
}

.ys-player-strip i,
.ys-turn i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  font-style: normal;
  font-weight: 900;
}

.ys-player-strip span {
  display: grid;
  min-width: 0;
}

.ys-player-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ys-player-strip small {
  color: var(--muted);
  font-size: 0.65rem;
}

.ys-player-strip button > b {
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.ys-card-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.ys-card-tools > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ys-card-tools select {
  padding: 7px 9px;
}

.ys-card-tools button {
  border: 0;
  background: none;
  color: var(--ys-red);
  font-weight: 850;
}

.ys-turn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-radius: 16px;
  padding: 14px 17px;
  background: var(--ys-red);
  color: white;
}

.ys-turn > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ys-turn > span > span,
.ys-turn > div {
  display: grid;
}

.ys-turn small {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ys-turn > div {
  text-align: right;
}

.ys-turn > div b {
  font-family: Georgia, serif;
  font-size: 1.8rem;
  line-height: 1;
}

.ys-scorecard {
  overflow: hidden;
  border: 2px solid var(--ys-red-dark);
  border-radius: 16px;
  background:
    repeating-linear-gradient(0deg, rgba(123, 91, 51, 0.025) 0, rgba(123, 91, 51, 0.025) 1px, transparent 1px, transparent 5px),
    var(--ys-cream);
  box-shadow: 0 12px 30px rgba(80, 49, 35, 0.1);
}

.ys-scorecard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px;
  background: var(--ys-red);
  color: white;
}

.ys-scorecard-head > span {
  display: grid;
}

.ys-scorecard-head > span b {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.ys-scorecard-head small {
  opacity: 0.82;
}

.ys-scorecard-head > em {
  display: grid;
  min-width: 55px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 1.15rem;
  font-style: normal;
  text-align: center;
}

.ys-scorecard-head > em small {
  font-size: 0.58rem;
}

.ys-section > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--ys-red-dark);
  padding: 8px 13px;
  background: #f5ddd7;
  color: var(--ys-red-dark);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.ys-section > header span {
  color: #775a53;
  font-size: 0.61rem;
}

.ys-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--ys-rule);
  background: transparent;
  padding: 0;
  text-align: left;
}

.ys-row:hover,
.ys-row:focus-visible {
  background: #fff0ed;
  outline: none;
}

.ys-row > span {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 13px;
}

.ys-row > span strong {
  font-family: Georgia, serif;
  font-size: 1rem;
}

.ys-row > span small {
  color: var(--muted);
  font-size: 0.66rem;
}

.ys-row > em {
  display: grid;
  place-items: center;
  align-content: center;
  border-left: 1px solid var(--ys-rule);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ys-red);
  font-style: normal;
}

.ys-row > em b {
  font-size: 1.3rem;
}

.ys-row > em small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ys-row.filled > em {
  background: #f7e4dc;
  color: var(--ink);
}

.ys-totals > div,
.ys-bonus-row,
.ys-grand-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--ys-rule);
}

.ys-totals span,
.ys-bonus-row > span,
.ys-grand-total > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 13px;
  font-size: 0.76rem;
  font-weight: 800;
}

.ys-totals span small,
.ys-bonus-row small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
}

.ys-totals div > b,
.ys-grand-total > b {
  display: grid;
  align-self: stretch;
  place-items: center;
  border-left: 1px solid var(--ys-rule);
}

.ys-totals .earned {
  background: #e8f0e9;
  color: var(--green-dark);
}

.ys-bonus-row > div {
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: space-around;
  border-left: 1px solid var(--ys-rule);
}

.ys-bonus-row button {
  border: 0;
  background: transparent;
  color: var(--ys-red);
  font-size: 1.1rem;
  font-weight: 900;
}

.ys-grand-total {
  border-bottom: 0;
  background: var(--ys-red-dark);
  color: white;
}

.ys-grand-total > span {
  display: grid;
}

.ys-grand-total > span small {
  font-size: 0.58rem;
  letter-spacing: 0.09em;
}

.ys-grand-total > b {
  border-left-color: rgba(255, 255, 255, 0.35);
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.ys-tip {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.yt-score-dialog {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
}

.yt-score-dialog h2 {
  margin: 7px 0 2px;
  font-family: Georgia, serif;
  font-size: 2rem;
}

.yt-score-dialog > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.ys-dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 1.2rem;
}

.ys-score-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ys-score-choices button {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 6px;
  background: var(--ys-cream);
}

.ys-score-choices button:hover {
  border-color: var(--ys-red);
}

.ys-score-choices span {
  color: var(--muted);
  font-size: 0.62rem;
}

.ys-score-choices b {
  font-size: 1.15rem;
}

.ys-manual-score {
  display: grid;
  gap: 5px;
  margin: 17px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ys-manual-score input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--ink);
  padding: 7px 0;
  background: transparent;
  font-family: Georgia, serif;
  font-size: 2.7rem;
  outline: 0;
}

.ys-dice-helper {
  margin: 0 0 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: #f7f4ed;
}

.ys-dice-helper summary {
  cursor: pointer;
  color: var(--ys-red);
  font-size: 0.76rem;
  font-weight: 850;
}

.ys-dice-helper p {
  margin: 9px 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.ys-dice-helper nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ys-dice-helper nav button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ys-red-dark);
  font-size: 1.65rem;
}

#ys-use-dice {
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-radius: 9px;
  padding: 9px;
  background: #f2ddd8;
  color: var(--ys-red-dark);
  font-weight: 800;
}

.yt-score-dialog #save-yt {
  display: grid;
  background: var(--ys-red);
}

.yt-score-dialog #save-yt:hover {
  background: var(--ys-red-dark);
}

.yt-score-dialog #save-yt small {
  font-size: 0.64rem;
}

@media (max-width: 620px) {
  .game-layout.wide {
    display: block;
  }

  .game-layout.wide .standings-card {
    margin-top: 16px;
  }

  .ys-player-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 3px;
  }

  .ys-player-strip button {
    flex: 0 0 155px;
    scroll-snap-align: start;
  }

  .ys-scorecard-head {
    padding: 13px;
  }

  .ys-scorecard-head > span b {
    font-size: 0.9rem;
  }

  .ys-row {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .ys-totals > div,
  .ys-bonus-row,
  .ys-grand-total {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .ys-score-choices {
    grid-template-columns: repeat(2, 1fr);
  }

  .yt-score-dialog {
    margin-bottom: 8px;
    padding: 22px 17px 17px;
  }
}
