/* Shared game screen design for read-only viewers and series managers. */
.game-winner-value.winner-red {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #d99a90;
  border-radius: 999px;
  background: #f4d7d1;
  box-shadow: 0 1px 3px rgba(35, 24, 15, .2);
  color: #782b2b;
}

.game-winner-value.winner-black {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #d8bd91;
  border-radius: 999px;
  background: #f2e4ca;
  box-shadow: 0 1px 3px rgba(35, 24, 15, .2);
  color: #302015;
}

.game-view-page .game-player-row.team-red::before,
.game-view-page .game-player-row.team-black::before {
  display: none;
}

.game-roster-frame.winner-red .game-player-row.team-black:not(.is-pu),
.game-roster-frame.winner-black .game-player-row.team-red:not(.is-pu),
.game-entry-row.is-losing:not(.is-pu) {
  opacity: .68;
}

.game-roster-frame.winner-red .game-player-row.team-black.is-pu,
.game-roster-frame.winner-black .game-player-row.team-red.is-pu,
.game-entry-row.is-losing.is-pu {
  opacity: .68;
}

/* Manager/judge entry form: retain all input fields without a mobile-wide table. */
.game-edit-page .game-randomize-form {
  margin: 0 0 12px;
}

.game-randomize-button {
  font-size: 12px;
}

.game-edit-hero {
  margin-bottom: 14px;
}

.game-edit-settings {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid #e1e6ef;
  border-radius: 13px;
  background: #ffffffd9;
  box-shadow: 0 4px 14px #27364b0a;
}

.game-edit-settings p {
  margin: 0;
  color: #738096;
  font-size: 11px;
}

.game-edit-page .game-roster-frame {
  padding: 12px;
  border-width: 1.5px;
  background: #ffffff70;
}

.game-edit-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 0 2px 12px;
}

.game-edit-section-heading h2 {
  margin: 0 0 3px;
  color: #27354a;
  font-size: 18px;
}

.game-edit-section-heading p {
  margin: 0;
  color: #758196;
  font-size: 11px;
}

.game-edit-section-heading .game-roster-legend {
  padding: 0;
  white-space: nowrap;
}

.game-entry-head,
.game-entry-row {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 2fr) 76px;
  align-items: center;
  gap: 12px;
}

.game-entry-head {
  padding: 0 12px 6px;
  color: #758196;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.game-entry-head span:last-child {
  text-align: right;
}

.game-entry-list {
  display: grid;
  gap: 6px;
}

.game-entry-row {
  min-height: 76px;
  padding: 8px 12px;
  border: 1px solid #d0d6df;
  border-radius: 10px;
  background: #e6e9ef;
  box-shadow: 0 2px 5px #1d2a3b08;
  transition: opacity .15s ease;
}

.game-entry-row.is-pu {
  border-color: #d9c99a;
  background: #f1e6c6;
}

.game-entry-main {
  min-width: 0;
}

.game-entry-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.game-entry-name {
  overflow: hidden;
  min-width: 0;
  color: #202b3b;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-entry-main .role-icon-picker {
  flex: none;
  width: 38px;
  height: 32px;
}

.game-entry-main .role-icon {
  width: 23px;
  height: 22px;
}

.game-entry-main .game-seat {
  flex: none;
}

.game-entry-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.game-entry-field {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: #69768a;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
}

.game-entry-field select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 3px 4px;
  border: 1px solid #d5dce7;
  border-radius: 7px;
  background: #fff;
  color: #34445a;
  font-size: 11px;
  text-align: center;
}

.game-entry-total {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: #778397;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.game-entry-total b {
  color: #26364a;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.game-edit-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 13px;
  padding: 12px 15px;
  border: 1px solid #dfe4ed;
  border-radius: 12px;
  background: #ffffffdb;
}

.game-edit-complete {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #34445a;
}

.game-edit-complete input {
  width: 17px;
  height: 17px;
  accent-color: #5b59df;
}

.game-edit-complete b,
.game-edit-complete small {
  display: block;
}

.game-edit-complete b {
  font-size: 12px;
}

.game-edit-complete small {
  margin-top: 2px;
  color: #7a8698;
  font-size: 10px;
}

.game-edit-winner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.game-edit-winner legend {
  float: left;
  margin-right: 8px;
  color: #7a8698;
  font-size: 10px;
  font-weight: 800;
}

.game-edit-winner-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid #dfe4ed;
  border-radius: 8px;
  background: #fff;
  color: #34445a;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.game-edit-winner-option input {
  display: grid;
  width: 16px;
  height: 16px;
  margin: 0;
  appearance: none;
  place-content: center;
  border: 1.5px solid #aeb8c8;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.game-edit-winner-option input::before {
  width: 8px;
  height: 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg) scale(0);
}

.game-edit-winner-option input:checked {
  border-color: #e34955;
  background: #e34955;
}

.game-edit-winner-option.winner-black-choice input:checked {
  border-color: #252b38;
  background: #252b38;
}

.game-edit-winner-option input:checked::before {
  transform: rotate(-45deg) scale(1);
}

.game-edit-winner-option input:focus-visible {
  outline: 3px solid #7774e866;
  outline-offset: 2px;
}

.game-edit-savebar > .button {
  min-height: 40px;
}

.game-edit-page .game-view-foot {
  padding: 9px 4px 0;
}

.game-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 2px;
}

.game-nav-button {
  display: inline-flex;
  min-width: 112px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 5px 12px;
  border: 1px solid rgba(120, 76, 49, .24);
  border-radius: 13px;
  background: linear-gradient(145deg, #fff8e9, #f2dfc5);
  box-shadow: 0 3px 8px rgba(74, 48, 31, .11), inset 0 1px rgba(255, 255, 255, .75);
  color: #71482f;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.game-nav-button > span {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 9px;
  background: #8b5638;
  box-shadow: inset 0 1px rgba(255, 255, 255, .25);
  color: #fff8e9;
  font-size: 20px;
  line-height: 1;
}

.game-nav-button small {
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

a.game-nav-button:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 76, 49, .48);
  box-shadow: 0 5px 12px rgba(74, 48, 31, .16), inset 0 1px rgba(255, 255, 255, .75);
}

.game-nav-button:focus-visible {
  outline: 3px solid rgba(161, 99, 52, .4);
  outline-offset: 2px;
}

.game-nav-button.is-disabled {
  opacity: .48;
}

html[data-theme="dark"] .game-nav-button {
  border-color: rgba(220, 183, 145, .25);
  background: linear-gradient(145deg, #48392e, #392d25);
  color: #f1d5b4;
}

html[data-theme="dark"] .game-nav-button > span {
  background: #9a6847;
  color: #fff9ef;
}

@media (max-width: 700px) {
  .game-navigation {
    gap: 9px;
    margin-top: 10px;
  }

  .game-nav-button {
    min-width: 108px;
    min-height: 40px;
    border-radius: 12px;
  }
}

/* Keep the read-only game result screen phone-sized on desktop as well. */
@media (min-width: 701px) {
  .game-view-page:not(.game-edit-page) .page-shell {
    max-width: 480px;
    padding: 37px 14px 25px;
  }

  .game-view-page:not(.game-edit-page) .game-crumb {
    margin-bottom: 5px;
    font-size: 10px;
  }

  .game-view-page:not(.game-edit-page) .game-title-line {
    margin: 0 1px 8px;
  }

  .game-view-page:not(.game-edit-page) .game-title-line h1 {
    font-size: 18px;
  }

  .game-view-page:not(.game-edit-page) .game-state {
    padding: 4px 7px;
    font-size: 8px;
  }

  .game-view-page:not(.game-edit-page) .game-hero-card {
    display: block;
    margin-bottom: 8px;
    padding: 9px 11px;
    border-radius: 11px;
  }

  .game-view-page:not(.game-edit-page) .game-eyebrow {
    margin-bottom: 2px;
    font-size: 8px;
  }

  .game-view-page:not(.game-edit-page) .game-hero-title {
    font-size: 16px;
  }

  .game-view-page:not(.game-edit-page) .game-hero-meta {
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-top: 5px;
    font-size: 9px;
  }

  .game-view-page:not(.game-edit-page) .game-series-name {
    max-width: 44%;
  }

  .game-view-page:not(.game-edit-page) .game-winner-label {
    padding-left: 9px;
    font-size: 8px;
  }

  .game-view-page:not(.game-edit-page) .game-roster-frame {
    padding: 6px;
    border-radius: 12px;
  }

  .game-view-page:not(.game-edit-page) .game-roster-frame.winner-red,
  .game-view-page:not(.game-edit-page) .game-roster-frame.winner-black {
    border-width: 1.5px;
  }

  .game-view-page:not(.game-edit-page) .game-roster-legend {
    gap: 8px;
    padding: 0 5px 5px;
    font-size: 8px;
  }

  .game-view-page:not(.game-edit-page) .game-roster-legend span {
    gap: 4px;
  }

  .game-view-page:not(.game-edit-page) .game-roster-legend i {
    width: 8px;
    height: 8px;
  }

  .game-view-page:not(.game-edit-page) .game-table-head,
  .game-view-page:not(.game-edit-page) .game-player-row {
    grid-template-columns: 44px minmax(0, 1fr) 30px 57px;
    column-gap: 6px;
  }

  .game-view-page:not(.game-edit-page) .game-table-head {
    padding: 0 6px 4px;
    font-size: 8px;
    letter-spacing: .35px;
  }

  .game-view-page:not(.game-edit-page) .game-table-head .role-heading {
    font-size: 0;
  }

  .game-view-page:not(.game-edit-page) .game-roster {
    gap: 3px;
  }

  .game-view-page:not(.game-edit-page) .game-player-row {
    height: 39px;
    padding: 0 6px;
    border-radius: 8px;
  }

  .game-view-page:not(.game-edit-page) .game-player-row.team-red::before,
  .game-view-page:not(.game-edit-page) .game-player-row.team-black::before {
    top: 7px;
    bottom: 7px;
  }

  .game-view-page:not(.game-edit-page) .game-seat {
    width: 23px;
    height: 23px;
    border-radius: 7px;
    font-size: 10px;
  }

  .game-view-page:not(.game-edit-page) .game-nickname {
    padding-right: 2px;
    font-size: 12px;
  }

  .game-view-page:not(.game-edit-page) .game-role-icon {
    width: 25px;
    height: 25px;
    border-radius: 7px;
  }

  .game-view-page:not(.game-edit-page) .game-role-icon img {
    width: 19px;
    height: 19px;
  }

  .game-view-page:not(.game-edit-page) .game-score-trigger {
    font-size: 12px;
  }

  .game-view-page:not(.game-edit-page) .game-view-foot {
    flex-direction: column;
    gap: 3px;
    padding: 7px 2px 0;
    font-size: 9px;
  }
}

@media (max-width: 700px) {
  .game-view-page:not(.game-edit-page) .game-table-head,
  .game-view-page:not(.game-edit-page) .game-player-row {
    grid-template-columns: 44px minmax(0, 1fr) 30px 57px;
    column-gap: 6px;
  }
}

@media (max-width: 1000px) {
  .game-entry-head,
  .game-entry-row {
    grid-template-columns: minmax(180px, .8fr) minmax(0, 2fr) 65px;
    gap: 8px;
  }

  .game-entry-stats {
    gap: 4px;
  }

  .game-entry-field select {
    font-size: 10px;
  }
}

@media (max-width: 700px) {
  .game-edit-page .page-shell {
    padding: 17px 10px 25px;
  }

  .game-edit-hero {
    margin-bottom: 9px;
  }

  .game-randomize-button {
    width: 100%;
    min-height: 38px;
  }

  .game-edit-settings {
    display: grid;
    gap: 8px;
    margin-bottom: 9px;
    padding: 10px 12px;
  }

  .game-edit-settings p {
    font-size: 10px;
  }

  .game-edit-page .game-roster-frame {
    padding: 7px;
  }

  .game-edit-section-heading {
    align-items: flex-start;
    margin: 0 2px 8px;
  }

  .game-edit-section-heading h2 {
    font-size: 15px;
  }

  .game-edit-section-heading p {
    font-size: 9px;
  }

  .game-edit-section-heading .game-roster-legend {
    font-size: 8px;
  }

  .game-entry-head {
    display: none;
  }

  .game-entry-list {
    gap: 5px;
  }

  .game-entry-row {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 6px;
    padding: 7px;
    border-radius: 9px;
  }

  .game-entry-main {
    grid-column: 1;
    grid-row: 1;
  }

  .game-entry-identity {
    gap: 6px;
  }

  .game-entry-main .game-seat {
    width: 23px;
    height: 23px;
    border-radius: 7px;
    font-size: 10px;
  }

  .game-entry-name {
    font-size: 12px;
  }

  .game-entry-main .role-icon-picker {
    width: 33px;
    height: 29px;
  }

  .game-entry-stats {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 7px;
  }

  .game-entry-field {
    gap: 2px;
    font-size: 8px;
  }

  .game-entry-field select {
    height: 29px;
    font-size: 11px;
  }

  .game-entry-total {
    grid-column: 2;
    grid-row: 1;
    font-size: 7px;
  }

  .game-entry-total b {
    font-size: 13px;
  }

  .game-edit-savebar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .game-edit-winner {
    flex-wrap: wrap;
  }

  .game-edit-winner legend {
    width: 100%;
    margin: 0 0 2px;
  }

  .game-edit-winner-option {
    flex: 1;
    justify-content: center;
  }

  .game-edit-savebar > .button {
    width: 100%;
  }

  .game-edit-complete b {
    font-size: 11px;
  }

  .game-edit-complete small {
    font-size: 9px;
  }
}
