/* Shared UI styles for the phone apps. */
:root {
  --app-blue: #1676e8;
  --app-blue-deep: #0758b8;
  --app-ink: #142c43;
  --app-muted: #708197;
  --app-line: #dfe8f2;
  --app-surface: #f5f9fe;
}

.score-widget {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}

.score-widget-title {
  grid-column: 1 / -1;
}

.score-widget-row {
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 7px 5px;
}

.score-widget-grade {
  font-size: 10px;
}

.score-widget-number {
  min-width: 44px;
  min-height: 34px;
  font-size: 20px;
}

.home-app--partidos {
  -webkit-tap-highlight-color: transparent;
}

.home-app:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 14px;
}

.app-icon--partidos {
  display: grid;
  place-items: center;
}

.home-app-label {
  text-shadow: 0 1px 5px rgba(0, 20, 35, 0.5);
}

.partidos-launcher[hidden],
.partidos-app[hidden],
.goles-app[hidden],
.objetivos-app[hidden],
.perfil-app[hidden],
.matches-view[hidden] {
  display: none;
}

.partidos-launcher {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 17px;
  background: #1479e8;
  box-shadow: 0 10px 28px rgba(0, 60, 130, 0.32);
  color: #fff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition:
    top 720ms cubic-bezier(0.2, 0.8, 0.2, 1),
    left 720ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 720ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 720ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-radius 720ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 720ms ease,
    box-shadow 720ms ease,
    transform 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.partidos-launcher.is-expanding {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-color: #fff;
  border-radius: var(--open-corner-radius, 42px);
  background: #fff;
  box-shadow: none;
  transform: none;
}

.partidos-launcher svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  transition: opacity 240ms ease, transform 360ms ease;
}

.partidos-launcher.is-expanding svg {
  opacity: 0;
  transform: scale(0.8);
}

.partidos-app,
.goles-app,
.objetivos-app,
.perfil-app {
  position: absolute;
  inset: 1px;
  z-index: 14;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--open-corner-radius, 42px);
  background: #f7faff;
  color: var(--app-ink);
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}

.app-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 54px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid rgba(28, 69, 111, 0.08);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.app-topbar h1,
.app-topbar h2 {
  min-width: 0;
  margin: 0;
  color: var(--app-ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.app-topbar-spacer {
  flex: 1 1 auto;
}

.app-home-button,
.app-notifications-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(18, 88, 163, 0.12);
  border-radius: 50%;
  background: #f4f8fd;
  color: #155fae;
  font: 600 18px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.app-notifications-button {
  color: var(--app-blue);
}

.app-home-button:focus-visible,
.app-notifications-button:focus-visible,
.app-topbar button:focus-visible,
.see-all-matches:focus-visible,
.scorer-pill:focus-visible,
.avatar-options button:focus-visible,
.delete-account-button:focus-visible {
  outline: 2px solid var(--app-blue);
  outline-offset: 2px;
}

.partidos-content {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  overflow: auto;
  padding: 16px 20px 18px;
  overscroll-behavior: contain;
}

.partidos-overview,
.partidos-match-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.partidos-section-title {
  margin: 0;
  color: var(--app-ink);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.partidos-section-subtitle {
  margin: -7px 0 0;
  color: var(--app-muted);
  font-size: 10px;
  line-height: 1.35;
}

.score-comparison {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.score-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 19px;
  background: linear-gradient(145deg, #1582ef, #0861c7 75%, #0756af);
  color: #fff;
  box-shadow: 0 8px 19px rgba(16, 91, 174, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.23);
}

.score-side--4 {
  background: linear-gradient(145deg, #1474dc, #0756b7 75%, #034b9f);
}

.score-side-label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 750;
}

.score-number {
  display: inline-grid;
  min-width: 48px;
  min-height: 42px;
  align-self: flex-start;
  place-items: center;
  padding: 0 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: clamp(28px, 5vh, 38px);
  font-weight: 820;
  letter-spacing: -0.06em;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.23);
}

.comparison-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  line-height: 1.25;
}

.comparison-row strong {
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}

.trend-graphs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trend-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 13px rgba(25, 64, 102, 0.045);
}

.trend-card h3 {
  margin: 0;
  color: #4e647a;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.trend-card strong {
  color: var(--app-blue);
  font-size: 18px;
  font-weight: 790;
  line-height: 1;
}

.chart-plot {
  position: relative;
  min-width: 0;
  height: 76px;
  overflow: hidden;
  border-radius: 9px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 18px, rgba(46, 91, 139, 0.08) 18px 19px),
    linear-gradient(180deg, #fbfdff, #f2f8ff);
}

.chart-plot svg,
.chart-plot canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-plot svg {
  overflow: visible;
}

.chart-plot path,
.chart-plot polyline {
  fill: none;
  stroke: var(--app-blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.chart-plot circle {
  fill: #fff;
  stroke: var(--app-blue);
  stroke-width: 2;
}

.partidos-match-column {
  padding: 0;
}

.last-match-card {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border: 1px solid #dfe8f2;
  border-radius: 20px;
  background: linear-gradient(150deg, #fff 0%, #f2f8ff 100%);
  box-shadow: 0 7px 19px rgba(20, 59, 96, 0.065);
}

.last-match-card h2,
.last-match-card h3 {
  margin: 0;
  color: var(--app-ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.last-match-score {
  display: grid;
  min-height: 75px;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, #e5f2ff, #d7eaff);
  color: var(--app-blue-deep);
  font-size: clamp(30px, 5.8vh, 44px);
  font-weight: 820;
  letter-spacing: -0.055em;
}

.last-match-date {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 550;
}

.last-match-card p {
  margin: 0;
  color: #526a80;
  font-size: 10px;
  line-height: 1.4;
}

.scorer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scorer-pill {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(21, 107, 201, 0.14);
  border-radius: 999px;
  background: #eaf4ff;
  color: #145fae;
  font: 650 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.see-all-matches {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--app-blue);
  color: #fff;
  font: 650 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(17, 109, 209, 0.18);
}

.matches-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 16px 20px 18px;
  background: #f7faff;
  color: var(--app-ink);
}

.matches-heading {
  margin: 0;
  color: var(--app-ink);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.matches-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  overscroll-behavior: contain;
}

.match-row {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(86px, 0.55fr) minmax(0, 1.45fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 7px 12px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 13px;
  background: #fff;
}

.match-row-date {
  grid-column: 1;
  grid-row: 1;
  color: var(--app-muted);
  font-size: 10px;
}

.match-row-score {
  grid-column: 2;
  grid-row: 1;
  color: var(--app-blue-deep);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.match-row-scorers {
  grid-column: 1 / -1;
  grid-row: 2;
  color: #415a72;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.goles-app,
.objetivos-app,
.perfil-app {
  background: #f6f9fd;
}

.goles-content,
.objetivos-content,
.perfil-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px 22px 22px;
}

.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid var(--app-line);
  border-radius: 13px;
  background: #fff;
  color: var(--app-ink);
}

.player-row strong {
  color: var(--app-blue-deep);
  font-size: 15px;
}

.player-match-list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
}

.player-match {
  display: grid;
  grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: #fff;
  color: #3c546b;
  font-size: 10px;
}

.objective-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: #fff;
  color: var(--app-ink);
}

.objective-row strong {
  color: var(--app-blue-deep);
}

.profile-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #8dcaff, #2674d4);
  color: #fff;
  font-size: 30px;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(17, 81, 143, 0.18);
}

.avatar-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-options button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--app-line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cfe5fa;
  border-radius: 17px;
  background: linear-gradient(145deg, #eaf5ff, #dceeff);
  color: var(--app-ink);
}

.balance-card strong {
  color: var(--app-blue-deep);
  font-size: 24px;
}

.delete-account-button {
  min-height: 42px;
  align-self: flex-start;
  padding: 0 13px;
  border: 1px solid rgba(196, 46, 58, 0.16);
  border-radius: 11px;
  background: #fff3f3;
  color: #ac2633;
  font: 650 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.delete-confirmation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(196, 46, 58, 0.2);
  border-radius: 12px;
  background: #fff5f5;
  color: #7e1d27;
}

.delete-confirmation p {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.delete-confirmation button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 700 10px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.delete-confirmation button:hover { filter: brightness(.97); }
.delete-confirmation button:active { transform: scale(.97); }
#delete-account-cancel { border-color: #d7e2ed; background: #fff; color: #53677c; }
#delete-account-confirm { background: linear-gradient(145deg, #d94b57, #bd303d); color: #fff; box-shadow: 0 4px 10px rgba(189, 48, 61, .18); }
.delete-confirmation button:focus-visible { outline: 2px solid #9ebee0; outline-offset: 2px; }

.delete-confirmation[hidden] {
  display: none;
}

/* The existing full-screen notification layer must remain above app views. */
.notifications-screen {
  z-index: 40;
}

@media (max-width: 460px) {
  :root {
    --app-gap: 7px;
  }

  .score-widget {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 3px;
    padding: 7px;
  }

  .score-widget-title {
    font-size: 7px;
  }

  .score-widget-row {
    gap: 3px;
    padding: 3px 2px;
  }

  .score-widget-grade {
    font-size: 6px;
  }

  .score-widget-number {
    min-width: 22px;
    min-height: 19px;
    padding: 0 3px;
    border-radius: 5px;
    font-size: 11px;
  }

  .home-app--partidos {
    gap: 1px;
  }

  .app-icon--partidos svg {
    width: 18px;
    height: 18px;
  }

  .home-app-label {
    font-size: 7px;
  }

  .partidos-launcher {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .partidos-launcher svg {
    width: 22px;
    height: 22px;
  }

  .app-topbar {
    min-height: 36px;
    gap: 5px;
    padding: 5px 8px;
  }

  .app-topbar h1,
  .app-topbar h2 {
    font-size: 11px;
  }

  .app-home-button,
  .app-notifications-button {
    width: 25px;
    height: 25px;
    font-size: 15px;
  }

  .partidos-content {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
    padding: 7px;
  }

  .partidos-overview,
  .partidos-match-column {
    gap: 6px;
  }

  .partidos-section-title {
    font-size: 12px;
  }

  .partidos-section-subtitle {
    margin-top: -4px;
    font-size: 7px;
  }

  .score-comparison {
    gap: 4px;
  }

  .score-side {
    gap: 5px;
    padding: 7px 6px;
    border-radius: 11px;
  }

  .score-side-label {
    font-size: 8px;
  }

  .score-number {
    min-width: 28px;
    min-height: 27px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 19px;
  }

  .comparison-row {
    gap: 2px;
    padding-top: 4px;
    font-size: 6px;
  }

  .comparison-row strong {
    font-size: 7px;
  }

  .trend-graphs {
    gap: 4px;
  }

  .trend-card {
    gap: 4px;
    padding: 6px;
    border-radius: 9px;
  }

  .trend-card h3 {
    font-size: 6px;
  }

  .trend-card strong {
    font-size: 12px;
  }

  .chart-plot {
    height: 42px;
  }

  .last-match-card {
    gap: 6px;
    padding: 7px;
    border-radius: 11px;
  }

  .last-match-card h2,
  .last-match-card h3 {
    font-size: 10px;
  }

  .last-match-score {
    min-height: 42px;
    border-radius: 9px;
    font-size: 22px;
  }

  .last-match-date,
  .last-match-card p {
    font-size: 7px;
  }

  .scorer-pills {
    gap: 3px;
  }

  .scorer-pill {
    min-height: 20px;
    padding: 0 6px;
    font-size: 7px;
  }

  .see-all-matches {
    min-height: 29px;
    padding: 0 7px;
    border-radius: 8px;
    font-size: 8px;
  }

  .matches-view {
    gap: 7px;
    padding: 7px;
  }

  .matches-heading {
    font-size: 14px;
  }

  .match-row {
    grid-template-columns: 1fr auto;
    gap: 3px 7px;
    min-height: 42px;
    padding: 5px;
    border-radius: 8px;
  }

  .match-row-date {
    font-size: 7px;
  }

  .match-row-score {
    font-size: 10px;
  }

  .match-row-scorers {
    grid-column: 1 / -1;
    font-size: 7px;
  }

  .goles-content,
  .objetivos-content,
  .perfil-content {
    gap: 7px;
    padding: 8px;
  }

  .player-row,
  .objective-row {
    min-height: 36px;
    padding: 7px;
    border-radius: 9px;
    font-size: 8px;
  }

  .player-match {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 6px;
    border-radius: 8px;
    font-size: 7px;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .avatar-options {
    gap: 5px;
  }

  .avatar-options button {
    width: 28px;
    height: 28px;
  }

  .balance-card {
    padding: 8px;
    border-radius: 10px;
    font-size: 8px;
  }

  .balance-card strong {
    font-size: 16px;
  }

  .delete-account-button {
    min-height: 32px;
    font-size: 8px;
  }
}

/* Keep labels and controls legible when the open Duo has to scale to a narrow viewport. */
@media (max-width: 460px) {
  .app-topbar { min-height: 44px; gap: 7px; padding: 7px 10px; }
  .app-topbar h1, .app-topbar h2 { font-size: 14px; }
  .partidos-content { gap: 7px; padding: 9px; }
  .partidos-section-title { font-size: 14px; }
  .partidos-section-subtitle { margin-top: 0; font-size: 10px; }
  .score-side { gap: 6px; padding: 9px 7px; }
  .score-side-label { font-size: 10px; }
  .score-number { min-height: 34px; font-size: 24px; }
  .comparison-row { gap: 3px; font-size: 10px; }
  .comparison-row strong { font-size: 10px; }
  .trend-card { gap: 5px; padding: 8px; }
  .trend-card h3 { font-size: 10px; letter-spacing: .025em; }
  .last-match-card h2, .last-match-card h3 { font-size: 12px; }
  .last-match-date, .last-match-card p { font-size: 10px; }
  .scorer-pill { min-height: 36px; padding: 0 9px; font-size: 10px; }
  .see-all-matches { min-height: 36px; padding: 0 9px; font-size: 10px; }
  .match-row { min-height: 50px; padding: 7px; }
  .match-row-date, .match-row-scorers { font-size: 10px; }
  .match-row-score { font-size: 12px; }
  .goles-content, .objetivos-content, .perfil-content { gap: 9px; padding: 11px; }
  .player-row, .objective-row { min-height: 42px; padding: 8px; font-size: 10px; }
  .player-match { gap: 5px; padding: 8px; font-size: 10px; }
  .avatar-options button { width: 36px; height: 36px; }
  .delete-account-button { min-height: 38px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .partidos-launcher,
  .partidos-launcher svg {
    transition: none;
  }
}
