:root {
  --bg: #020906;
  --deep: #03140b;
  --panel: #062915;
  --panel2: #0b351b;
  --line: rgba(255, 255, 255, .15);
  --yellow: #ffd21a;
  --yellow2: #f5b800;
  --green: #17832d;
  --white: #f8fff8;
  --muted: #c7d4c8;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #03170c;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--white);
  overflow-x: hidden;
}

button { font: inherit; }

.phone-frame {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #03170c;
  border: 0;
  box-shadow: none;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 18px 18px 24px;
  overflow: auto;
  position: relative;
  background: radial-gradient(circle at 50% 0, rgba(29, 112, 45, .5), transparent 35%), linear-gradient(180deg, #042112, #020906);
}

.screen.active { display: block; }
.screen::-webkit-scrollbar { width: 0; }

h1, h2, h3, p { margin: 0; }

/* HOME */
.home-screen {
  padding: 0;
  overflow: hidden;
  background-image: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .22) 45%, rgba(0, 0, 0, .70) 100%), url('../assets/home-bg.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.home-content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px 28px;
}

.home-spacer {
  height: clamp(250px, 34vh, 340px);
  flex: 0 0 auto;
}

.home-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 100%;
}

.home-content h1 {
  text-transform: uppercase;
  font-size: clamp(30px, 8vw, 43px);
  line-height: .95;
  font-weight: 950;
  text-shadow: 0 5px 0 rgba(0, 0, 0, .55), 0 18px 35px #000;
  letter-spacing: -1px;
  max-width: 360px;
}

.home-content h1 strong {
  display: block;
  color: var(--yellow);
  font-size: clamp(38px, 10vw, 56px);
}

.home-content h3 {
  text-transform: uppercase;
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 950;
  text-shadow: 0 8px 22px #000;
}

.home-content p {
  font-size: 15px;
  line-height: 1.35;
  color: #fff;
  max-width: 330px;
  text-shadow: 0 4px 12px #000;
}

.campaign-box {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(255, 210, 26, .55);
  background: rgba(2, 30, 14, .70);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 13px;
  max-width: 335px;
  width: 100%;
  margin-top: 18px;
}

.campaign-box span { font-size: 25px; }
.campaign-box strong { display: block; font-size: 13px; }
.campaign-box small { display: block; color: #f2fff2; margin-top: 5px; line-height: 1.35; }

.primary-button,
.ghost-button,
.link-button {
  width: 100%;
  border: 0;
  border-radius: 11px;
  min-height: 52px;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(180deg, #ffe04b, var(--yellow2));
  color: #191000;
  box-shadow: 0 12px 24px rgba(255, 184, 0, .22);
}

.primary-button:disabled { opacity: .45; }

.ghost-button {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: #fff;
}

.link-button {
  background: transparent;
  color: #fff;
  min-height: 42px;
}

.home-content .primary-button,
.home-content .link-button { max-width: 335px; }
.home-content .primary-button { margin-top: 14px; }
.home-content .link-button { margin-top: 8px; text-shadow: 0 4px 12px #000; }

/* HEADERS */
.screen-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.screen-header.centered { text-align: center; align-items: center; }
.screen-header h2 { text-transform: uppercase; font-size: 21px; line-height: 1.05; }
.screen-header p { margin-top: 8px; color: #fff; font-size: 14px; line-height: 1.35; }

.icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 34px;
  line-height: 20px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* FORMAÇÕES */
.formation-list,
.position-list,
.ranking-list {
  display: grid;
  gap: 12px;
  padding-bottom: 78px;
}

.formation-card {
  display: grid;
  grid-template-columns: 158px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 126px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(5, 38, 20, .92);
  border: 1px solid rgba(255, 255, 255, .17);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 14px 28px rgba(0,0,0,.18);
  cursor: pointer;
}

.formation-card.selected {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 210, 26, .22), 0 14px 28px rgba(0,0,0,.24);
}

.formation-thumb {
  display: block;
  width: 158px;
  height: 102px;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 13px;
  background: #0b3b1b;
  border: 1px solid rgba(255,255,255,.14);
}

.mini-pitch {
  position: relative;
  width: 158px;
  height: 102px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 50%, rgba(255, 255, 255, .1) 50%), #195d25;
  overflow: hidden;
}

.mini-pitch:before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 4px;
}

.mini-pitch:after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mini-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  border: 1px solid #fff;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.formation-card > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
}

.formation-name {
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
  color: #fff;
  text-shadow: 0 4px 12px rgba(0,0,0,.5);
}

.formation-desc {
  margin: 0;
  font-size: 0;
  line-height: 1.15;
  font-weight: 900;
  color: var(--yellow);
  text-align: left;
}

.formation-desc::after { font-size: 15px; }
.formation-card[data-formation='4-2-4'] .formation-desc::after { content: 'Ofensivo'; }
.formation-card[data-formation='4-3-3'] .formation-desc::after { content: 'Equilibrado'; }
.formation-card[data-formation='4-2-3-1'] .formation-desc::after { content: 'Organizado'; }

.bottom-button {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translateX(-50%);
  width: min(336px, calc(100% - 54px));
  z-index: 10;
}

/* ESCOLHA DOS JOGADORES */
.position-card {
  background: rgba(6, 43, 22, .95);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  padding: 12px;
}

.position-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 950;
  color: #fff;
  margin-bottom: 10px;
}

.position-title span:last-child { font-size: 11px; color: var(--yellow); text-transform: none; }

.player-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.player-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 9px;
  padding: 8px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.player-option:before {
  content: '';
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2ec344, #0f6e25);
  border: 1px solid var(--yellow);
}

.player-option.selected {
  border-color: var(--yellow);
  background: rgba(255, 210, 26, .13);
}

/* CAMPO */
.pitch {
  position: relative;
  width: 100%;
  height: 455px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .04) 0 38px, rgba(255, 255, 255, .08) 38px 76px), linear-gradient(180deg, #2d8b24, #0d4b18);
  overflow: hidden;
  margin: 10px 0 14px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .25);
}

.pitch:before {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 6px;
}

.pitch:after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.player-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  min-width: 62px;
}

.ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 auto 5px;
  background: linear-gradient(145deg, #29c043, #0d6f25);
  border: 2px solid var(--yellow);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .28);
}

.name {
  display: inline-block;
  background: rgba(0, 0, 0, .52);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
}

.formation-pill {
  margin: -4px auto 14px;
  width: max-content;
  background: rgba(0, 0, 0, .45);
  border-radius: 8px;
  padding: 8px 16px;
  text-transform: uppercase;
  font-size: 12px;
}

/* SUCESSO */
.success-screen {
  display: none;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.success-screen.active { display: flex; flex-direction: column; }

.success-icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #62cf52, #17772c);
  font-size: 58px;
  font-weight: 950;
  box-shadow: 0 0 45px rgba(65, 210, 85, .28);
}

.success-screen h2 { color: var(--yellow); font-size: 26px; }
.success-screen p, .success-screen span { color: #fff; line-height: 1.45; }
.success-screen .primary-button, .success-screen .ghost-button { max-width: 310px; }

/* RANKING */
.ranking-title h2 { color: var(--yellow); }
.pitch-ranking { height: 370px; }

.vote-total {
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  margin: -2px 0 14px;
}

.vote-total strong { display: block; font-size: 30px; margin-top: 4px; }

.ranking-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 2px 0;
}

.ranking-position { font-size: 22px; font-weight: 950; }
.ranking-name-line { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }

.ranking-bar {
  height: 7px;
  background: rgba(255, 255, 255, .12);
  border-radius: 99px;
  overflow: hidden;
}

.ranking-bar span {
  display: block;
  height: 100%;
  background: #32b842;
  border-radius: 99px;
}

@media (min-width: 431px) {
  body { background: #03170c; }
  .phone-frame { min-height: 100vh; }
}

@media (max-width: 420px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .home-screen { padding-left: 0; padding-right: 0; }
  .formation-card { grid-template-columns: 145px 1fr; gap: 11px; }
  .formation-thumb, .mini-pitch { width: 145px; height: 94px; }
  .formation-name { font-size: 26px; }
  .formation-desc::after { font-size: 13px; }
}

@media (max-height: 820px) {
  .home-spacer { height: 250px; }
  .home-content h1 { font-size: 29px; }
  .home-content h1 strong { font-size: 39px; }
  .campaign-box { margin-top: 12px; }
  .primary-button { min-height: 49px; }
}