@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ============ Tokens ============ */
:root {
  --bg: #0B2818;
  --bg-2: #071C10;
  --paper: #F7F5EE;
  --paper-soft: #EFEBDF;
  --ink: #0E2A1B;
  --muted: #6C7B70;
  --lime: #C6FF3D;
  --lime-ink: #17300F;
  --violet: #7C5CFF;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(3, 20, 10, 0.35);
  --radius: 20px;

  --text-hi: #F4F7F3;
  --text-mid: rgba(244, 247, 243, 0.68);
  --text-dim: rgba(244, 247, 243, 0.42);

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ============ Reset / Base ============ */
* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(198, 255, 61, 0.10), transparent 55%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 44px, transparent 44px, transparent 88px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Faint center-circle nod to a pitch, purely decorative */
body::before {
  content: "";
  position: fixed;
  top: -120px;
  left: 50%;
  width: 320px;
  height: 320px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

/* ============ Layout shell ============ */
.container {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 460px;
  margin: 56px auto;
  background: var(--paper);
  padding: 28px 22px 26px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 5px solid var(--lime);
}

.page-fut { --accent: var(--lime); --accent-ink: var(--lime-ink); --accent-glow: rgba(198, 255, 61, 0.30); }
.page-game { --accent: var(--violet); --accent-ink: #FFFFFF; --accent-glow: rgba(124, 92, 255, 0.35); }

.page-fut .container,
.page-game .container {
  width: 90%;
  max-width: 460px;
  margin: -34px auto 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding: 26px 20px 24px;
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  color: var(--text-hi);
  position: relative;
  z-index: 2;
}

/* ============ Page hero band (topo colorido, igual à home) ============ */
.page-hero {
  position: relative;
  padding: 56px 24px 64px;
  text-align: center;
  overflow: hidden;
  animation: heroInTop 0.45s ease both;
}

.page-hero.fut {
  background:
    radial-gradient(circle at 25% 15%, rgba(198, 255, 61, 0.14), transparent 55%),
    linear-gradient(160deg, #16452B 0%, #0B2818 85%);
}

.page-hero.game {
  background:
    radial-gradient(circle at 75% 25%, rgba(124, 92, 255, 0.20), transparent 55%),
    linear-gradient(200deg, #241B45 0%, #100b2299 85%);
}

.page-hero .icon-circle {
  width: 66px;
  height: 66px;
  font-size: 1.5rem;
}

.page-hero.fut .icon-circle { color: var(--lime); }
.page-hero.game .icon-circle { color: var(--violet); }

.page-hero h2 {
  color: #fff;
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.page-hero .subtitle {
  color: rgba(255, 255, 255, 0.6);
  max-width: 260px;
  margin: 0 auto;
}

.hero-back {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 3;
}

.hero-back:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.22); }

/* ============ Type ============ */
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--ink);
}

h1 { font-size: 2.1rem; line-height: 1.05; }
h2 { font-size: 1.6rem; }
h3 {
  font-size: 1.05rem;
  margin-top: 26px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.subtitle {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.4;
}

/* ============ Home: split-screen "versus" select ============ */
body.home-page {
  background: var(--bg-2);
}

.hero-select {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
  transition: flex 0.3s ease;
}

.hero-half.fut {
  background:
    radial-gradient(circle at 25% 20%, rgba(198, 255, 61, 0.10), transparent 55%),
    linear-gradient(160deg, #16452B 0%, #0B2818 75%);
  animation: heroInTop 0.5s ease both;
}

.hero-half.game {
  background:
    radial-gradient(circle at 75% 80%, rgba(124, 92, 255, 0.16), transparent 55%),
    linear-gradient(200deg, #241B45 0%, #100B22 75%);
  animation: heroInBottom 0.5s ease both;
  animation-delay: 0.08s;
}

@keyframes heroInTop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroInBottom { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (hover: hover) {
  .hero-half:hover { flex: 1.12; }
}
.hero-half:active { flex: 1.12; }

.icon-circle {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  margin: 0 auto 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.2s ease;
}

.hero-half:active .icon-circle { transform: scale(0.92); }

.hero-half.fut .icon-circle { color: var(--lime); }
.hero-half.game .icon-circle { color: var(--violet); }

.hero-half h2 {
  color: #fff;
  font-size: 1.9rem;
  margin-bottom: 4px;
}

.hero-half p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin: 0;
  max-width: 220px;
}

.tap-hint {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.tap-hint i { margin-left: 4px; }

.vs-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  border: 3px solid var(--bg-2);
  z-index: 5;
  animation: vsPulse 2.6s ease-in-out infinite;
}

@keyframes vsPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-half.fut, .hero-half.game { animation: none; opacity: 1; }
  .vs-badge { animation: none; }
}

@media (min-width: 768px) {
  .hero-select { flex-direction: row; }
  .hero-half.game { animation-name: heroInBottomDesktop; }
  @keyframes heroInBottomDesktop { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
}

/* ============ Forms ============ */
.field-group { margin-top: 14px; text-align: left; }
.field-group.half { flex: 1; }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(14, 42, 27, 0.14);
  font-size: 1rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--ink);
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(198, 255, 61, 0.35);
}

input:disabled {
  opacity: 0.4;
}

/* buttons */
button {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 13px 16px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:active { transform: scale(0.97); }

.btn-add {
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
  padding: 13px 18px;
}

.btn-primary {
  width: 100%;
  margin-top: 20px;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 1.15rem;
  padding: 16px;
  box-shadow: 0 6px 0 #9fd928;
}

.btn-primary:active { box-shadow: 0 2px 0 #9fd928; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed rgba(14, 42, 27, 0.25);
  width: 100%;
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 10px;
}

/* ============ Lists ============ */
ul { list-style: none; padding: 0; margin: 10px 0 0; text-align: left; }

li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-light, rgba(14, 42, 27, 0.08));
  font-size: 0.95rem;
}

li:last-child { border-bottom: none; }

li.empty {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: normal;
  padding: 14px 10px;
  border: 1.5px dashed rgba(14, 42, 27, 0.15);
  border-radius: 10px;
  border-bottom: 1.5px dashed rgba(14, 42, 27, 0.15);
  text-align: center;
}

.badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

li .name { flex: 1; text-align: left; }

.remove {
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.remove:hover { color: #d1435a; background: rgba(209, 67, 90, 0.08); }

.count-tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
}

/* ============ Segmented control (com indicador deslizante) ============ */
.segmented {
  position: relative;
  display: flex;
  background: var(--paper-soft);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.segmented-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 6px);
  height: calc(100% - 8px);
  background: var(--ink);
  border-radius: 8px;
  transition: transform 0.25s cubic-bezier(.4, 0, .2, 1);
  z-index: 0;
}

.segmented-indicator.shifted {
  transform: translateX(calc(100% + 4px));
}

.segmented-option {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.segmented-option input { display: none; }

.segmented-option.active { color: #fff; }

/* ============ Micro-interações ============ */
.btn-primary i { margin-right: 6px; transition: transform 0.2s ease; }
.btn-primary.shuffling i { animation: spinIcon 0.5s ease; }

@keyframes spinIcon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-add i, .remove i { pointer-events: none; }

li { animation: liEnter 0.25s ease both; }

@keyframes liEnter {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.team-card.from-left { animation-name: teamInLeft; }
.team-card.from-right { animation-name: teamInRight; }

@keyframes teamInLeft {
  from { opacity: 0; transform: translate(-14px, 6px); }
  to { opacity: 1; transform: translate(0, 0); }
}

@keyframes teamInRight {
  from { opacity: 0; transform: translate(14px, 6px); }
  to { opacity: 1; transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  li { animation: none; }
  .btn-primary.shuffling i { animation: none; }
}

/* ============ Error message ============ */
.error-msg {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: #b3243c;
  background: rgba(179, 36, 60, 0.08);
  font-size: 0.85rem;
  border-radius: 8px;
  text-align: left;
  transition: all 0.2s ease;
  margin-top: 0;
}

.error-msg.show {
  max-height: 60px;
  opacity: 1;
  padding: 10px 12px;
  margin-top: 10px;
}

/* ============ Results ============ */
.result { margin-top: 18px; text-align: left; }

.team-card {
  background: var(--paper-soft);
  border-left: 5px solid var(--lime);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  opacity: 0;
  animation: teamIn 0.35s ease forwards;
}

@keyframes teamIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.team-card .team-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.team-card .team-head h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  margin: 0;
}

.team-card .team-head span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #fff;
  padding: 5px 10px;
  border-radius: 100px;
  font-size: 0.82rem;
}

.team-card .empty-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ============ Back link ============ */
.back {
  display: inline-block;
  margin-top: 22px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--paper-soft);
}

/* ============ Responsive (tablet/desktop) ============ */
@media (min-width: 768px) {
  .container { max-width: 560px; padding: 36px 40px; margin-top: 80px; }
  h1 { font-size: 2.6rem; }
  .menu { flex-direction: row; }
  .card-link { flex-direction: column; text-align: center; align-items: center; }
  .card-link .arrow { display: none; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .team-card { animation: none; opacity: 1; }
  .card-link, button { transition: none; }
}

/* ============ Créditos ============ */
.credits {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.credits i { color: var(--accent, var(--lime)); }

.credits a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-hi);
  margin-left: 2px;
  text-decoration: none;
}

.home-page .hero-select { min-height: calc(100vh - 42px); }

.home-credits {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 3;
}

.home-credits i { color: var(--lime); }

.home-credits a {
   font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-hi);
  margin-left: 2px;
  text-decoration: none;
}

/* ============ Modo escuro dos formulários (fut/game) ============ */
.page-fut .container h3,
.page-game .container h3 {
  color: var(--text-mid);
}

.page-fut .container .subtitle,
.page-game .container .subtitle { display: none; } /* subtítulo já vive na hero band */

.page-fut .field-label,
.page-game .field-label { color: var(--text-dim); }

.page-fut .count-tag,
.page-game .count-tag { color: var(--text-dim); }

.page-fut input[type="text"],
.page-fut input[type="number"],
.page-game input[type="text"],
.page-game input[type="number"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: var(--text-hi);
}

.page-fut input::placeholder,
.page-game input::placeholder { color: var(--text-dim); }

.page-fut input:focus,
.page-game input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.page-fut .btn-add,
.page-game .btn-add {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-hi);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.page-fut .btn-add:active,
.page-game .btn-add:active { background: var(--accent); color: var(--accent-ink); }

.page-fut li,
.page-game li { border-bottom-color: rgba(255, 255, 255, 0.09); color: var(--text-hi); }

.page-fut li.empty,
.page-game li.empty {
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.14);
}

.page-fut .badge,
.page-game .badge {
  background: var(--accent);
  color: var(--accent-ink);
}

.page-fut .remove,
.page-game .remove { color: var(--text-dim); }

.page-fut .remove:hover,
.page-game .remove:hover { color: #FF8FA3; background: rgba(255, 143, 163, 0.12); }

.page-fut .segmented,
.page-game .segmented { background: rgba(255, 255, 255, 0.06); }

.page-fut .segmented-indicator,
.page-game .segmented-indicator { background: var(--accent); }

.page-fut .segmented-option,
.page-game .segmented-option { color: var(--text-dim); }

.page-fut .segmented-option.active,
.page-game .segmented-option.active { color: var(--accent-ink); }

.page-fut .btn-primary,
.page-game .btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

.page-fut .team-card,
.page-game .team-card { background: rgba(255, 255, 255, 0.06); }

.page-fut .team-card h4,
.page-game .team-card h4 { color: var(--text-hi); }

.page-fut .team-card span,
.page-game .team-card span { color: var(--text-dim); }

.page-fut .chip,
.page-game .chip { background: rgba(255, 255, 255, 0.10); color: var(--text-hi); }

.page-fut .empty-note,
.page-game .empty-note { color: var(--text-dim); }

.page-fut .error-msg,
.page-game .error-msg { background: rgba(255, 90, 110, 0.14); color: #FF8FA3; }