/* The player shell: the phone screen a player plays on (layouts/game_player and app/views/player_shell/*).
   Sizes follow the "… player" designs: a 480px column, a header with avatar / nickname / one stat, big
   headings, ruled rows, solid cards and a fixed bottom bar with one big button.
   Classes are .gtf-pl-* (page and parts) and .gtf-ph-* (header). Game-specific parts go in their own file
   (21_player_races.css for At the Races). */

:root {
  --gtf-danger-red: oklch(0.72 0.19 20);
}

.gtf-pl {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 150px;

  & [hidden] {
    display: none !important;
  }
}

/* ---------- Header ---------- */

.gtf-ph {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 2px solid var(--gtf-surface-2);

  & .avatar-component {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 15px;
  }

  & .avatar-component__initials {
    font-size: 18px;
  }
}

.gtf-ph__body {
  flex: 1;
  min-width: 0;
}

.gtf-ph__name {
  overflow: hidden;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gtf-ph__context {
  font-size: 14px;
  color: var(--gtf-text-2);
}

.gtf-ph__stat {
  text-align: right;
}

.gtf-ph__stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-ph__stat-value {
  font-family: var(--gtf-mono);
  font-size: 26px;
  line-height: 1;
  color: var(--gtf-yellow);
}

/* "Customise avatar": a small link under the header row */
.gtf-ph__action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-basis: 100%;
  min-height: 36px;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Headings and text ---------- */

.gtf-pl-title {
  margin: 28px 0 8px;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.gtf-pl-lede {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--gtf-text-2);
}

.gtf-pl-note {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--gtf-text-2);
}

.gtf-pl-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--gtf-surface-2);
}

.gtf-pl-section__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: normal;
}

.gtf-pl-section__lede {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--gtf-text-2);
}

.gtf-pl-tone--success { color: var(--gtf-success); }
.gtf-pl-tone--danger { color: var(--gtf-danger-red); }
.gtf-pl-tone--muted { color: var(--gtf-text-2); }

/* ---------- Solid cards ---------- */

.gtf-pl-card {
  margin: 28px 0;
  padding: 22px 24px;
  border-radius: var(--gtf-radius-card);
  color: var(--gtf-ink);
}

.gtf-pl-card--yellow { background: var(--gtf-yellow); }
.gtf-pl-card--orange { background: var(--gtf-orange); }
.gtf-pl-card--success { background: var(--gtf-success); }
.gtf-pl-card--danger { background: var(--gtf-danger-red); }

.gtf-pl-card__label {
  font-size: 16px;
  font-weight: 800;
}

.gtf-pl-card__value {
  font-family: var(--gtf-mono);
  font-size: 56px;
  line-height: 1.1;
}

.gtf-pl-card__title {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.gtf-pl-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gtf-pl-card__sub {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 600;
}

.gtf-pl-card__value + .gtf-pl-card__sub {
  margin-top: 0;
}

/* ---------- Ruled rows ---------- */

.gtf-pl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 2px solid var(--gtf-surface-2);
}

.gtf-pl-row__mark {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--mark, var(--gtf-line));
}

.gtf-pl-row__lead {
  flex: none;
  min-width: 36px;
  font-family: var(--gtf-mono);
  color: var(--gtf-text-2);
}

.gtf-pl-row__main {
  flex: 1;
  min-width: 0;
}

.gtf-pl-row__title {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.gtf-pl-row__meta {
  display: block;
  font-size: 15px;
  color: var(--gtf-text-2);
}

.gtf-pl-row__meta--detail {
  font-family: var(--gtf-mono);
  font-size: 14px;
}

.gtf-pl-row__value {
  font-family: var(--gtf-mono);
  font-size: 20px;
}

.gtf-pl-row__remove {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--gtf-radius-btn);
  background: transparent;
  font-size: 24px;
  color: var(--gtf-danger-red);
  cursor: pointer;

  &:disabled {
    opacity: 0.4;
  }
}

/* Label / value summary */
.gtf-pl-rows__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 2px solid var(--gtf-surface-2);
  font-size: 18px;
}

.gtf-pl-rows__label {
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-pl-rows__value {
  font-family: var(--gtf-mono);
}

/* ---------- Numbered steps ---------- */

.gtf-pl-steps__title,
/* ---------- Buttons, toggle, chips, fields ---------- */

.gtf-pl-btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--gtf-radius-btn);
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  color: var(--gtf-ink);

  &:hover:not(:disabled) {
    filter: brightness(1.08);
  }

  &:disabled {
    opacity: 0.6;
    cursor: default;
  }
}

.gtf-pl-btn--orange { background: var(--gtf-orange); }
.gtf-pl-btn--success { min-height: 60px; font-size: 20px; background: var(--gtf-success); }
.gtf-pl-btn--ink { background: var(--gtf-ink); color: var(--gtf-cream); }

/* Two-way toggle (Win / Each-way) */
.gtf-pl-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--gtf-radius-btn);
  background: var(--gtf-surface-2);
}

.gtf-pl-seg__btn {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 17px;
  font-weight: 800;
  color: var(--gtf-text-2);
  cursor: pointer;

  &[aria-pressed="true"] {
    background: var(--gtf-yellow);
    color: var(--gtf-ink);
  }
}

.gtf-pl-chip {
  flex: 1;
  min-height: 48px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: var(--gtf-radius-btn);
  background: transparent;
  font-family: var(--gtf-mono);
  font-size: 17px;
  color: var(--gtf-cream);
  cursor: pointer;

  &[aria-pressed="true"] {
    border-color: var(--gtf-yellow);
  }
}

.gtf-pl-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-pl-field__input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: var(--gtf-radius-btn);
  background: var(--gtf-ink);
  font-family: var(--gtf-mono);
  font-size: 20px;
  color: var(--gtf-cream);
}

/* ---------- Toast (errors from a button press) ---------- */

.gtf-pl-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 40;
  width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  border: 2px solid var(--gtf-orange);
  border-radius: var(--gtf-radius-btn);
  background: var(--gtf-surface-1);
  font-size: 15px;
  font-weight: 600;
  transform: translateX(-50%);
}

/* ---------- Fixed bottom bar ---------- */

.gtf-pl-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--gtf-surface-2);
  background: var(--gtf-ink);
}

.gtf-pl-bar__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}

.gtf-pl-bar__hint {
  padding: 2px 0;
  font-size: 15px;
  text-align: center;
  color: var(--gtf-text-2);
}

/* ---------- Save your profile (final screen) ---------- */

.gtf-pl-save {
  margin-top: 36px;
  padding: 24px;
  border-radius: var(--gtf-radius-card);
  background: var(--gtf-orange);
  color: var(--gtf-ink);
}

.gtf-pl-save__title {
  margin-bottom: 6px;
  font-size: 28px;
  font-weight: 900;
}

.gtf-pl-save__lede,
.gtf-pl-save__hint {
  font-size: 17px;
  line-height: 1.45;
}

.gtf-pl-save__hint {
  margin-top: 8px;
  font-size: 15px;
}

.gtf-pl-save__who {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;

  & .avatar-component {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    border-radius: 20px;
    border: 2px solid var(--gtf-ink);
  }
}

.gtf-pl-save__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gtf-pl-save__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gtf-pl-save__label {
  font-size: 16px;
  font-weight: 800;
}

.gtf-pl-save__input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--gtf-ink);
  border-radius: var(--gtf-radius-btn);
  background: var(--gtf-cream);
  font-size: 18px;
  color: var(--gtf-ink);
}

.gtf-pl-save__errors {
  padding: 10px 14px;
  border: 2px solid var(--gtf-ink);
  border-radius: var(--gtf-radius-btn);
  font-size: 15px;
  font-weight: 700;
  list-style: none;
}

.gtf-pl-save__skip {
  padding: 10px;
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 700;
  text-decoration: underline;
  color: var(--gtf-ink);
  cursor: pointer;
}

/* The page flash, inside the narrow column */
.gtf-pl > .gtf-flash {
  margin-top: 16px;
}
