:root {
  color-scheme: light;
  --paper: #f5f2ea;
  --ink: #1d2025;
  --muted: #676c75;
  --line: #d8d1c2;
  --panel: #fffaf0;
  --panel-2: #eef5ee;
  --charcoal: #24282f;
  --green: #15744f;
  --blue: #2d68b1;
  --amber: #d59f28;
  --red: #be3d42;
  --shadow: 0 18px 55px rgba(29, 32, 37, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 0%, rgba(213, 159, 40, 0.2), transparent 31rem),
    linear-gradient(135deg, #f6f2e9 0%, #edf4ef 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding:
    calc(22px + env(safe-area-inset-top))
    calc(22px + env(safe-area-inset-right))
    calc(22px + env(safe-area-inset-bottom))
    calc(22px + env(safe-area-inset-left));
}

.center-panel {
  min-height: calc(100vh - 44px);
  display: grid;
  place-items: center;
  text-align: center;
}

.center-panel .back-btn {
  justify-self: start;
  align-self: start;
}

.home-grid {
  min-height: calc(100vh - 44px);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 22px;
  align-items: stretch;
}

.auth-screen {
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  display: grid;
  place-items: center;
}

.auth-screen .action-box {
  width: min(460px, 100%);
}

.auth-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(340px, 0.95fr);
  gap: 22px;
  align-items: stretch;
}

.auth-layout .auth-gate {
  align-self: center;
  width: 100%;
}

.auth-hero {
  min-height: 560px;
}

.hero-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
}

.hero-steps span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 40, 47, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--charcoal);
  font-weight: 900;
  font-size: 0.82rem;
}

.menu-screen {
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  display: grid;
  align-items: start;
  justify-items: center;
}

.main-menu-shell {
  width: min(920px, 100%);
  display: grid;
  gap: 14px;
}

.menu-topline,
.menu-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-topline {
  justify-content: space-between;
}

.menu-actions {
  width: min(680px, 100%);
  align-content: start;
}

.home-stage,
.home-actions,
.panel,
.score-strip {
  border: 1px solid rgba(36, 40, 47, 0.13);
  background: rgba(255, 250, 240, 0.88);
  box-shadow: var(--shadow);
}

.home-stage {
  min-height: 620px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.home-stage::after {
  content: "";
  position: absolute;
  inset: auto -12% -18% 18%;
  height: 48%;
  background: url("/assets/pitch.svg") center / contain no-repeat;
  opacity: 0.96;
  transform: rotate(-6deg);
}

.home-stage h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.4rem, 7vw, 6.4rem);
  line-height: 0.9;
  max-width: 720px;
}

.home-stage p {
  color: var(--muted);
  max-width: 560px;
  line-height: 1.55;
  font-size: 1.05rem;
}

.mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  background: var(--charcoal);
  color: #fffaf0;
  font-weight: 900;
  border-radius: 8px;
  box-shadow: 8px 8px 0 var(--amber);
}

.home-actions {
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.home-actions.menu-actions {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  align-content: start;
}

.action-box {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  padding: 20px;
  border-radius: 8px;
}

.action-box h2,
.panel h2,
.panel h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.compact-form {
  gap: 8px;
}

.account-box {
  display: grid;
  gap: 12px;
}

.account-strip {
  background: rgba(255, 250, 240, 0.86);
}

.auth-gate {
  gap: 16px;
}

.auth-head,
.menu-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-back-row {
  margin-bottom: 12px;
}

.back-btn {
  min-width: 84px;
}

.text-btn {
  min-height: 32px;
  padding: 0;
  justify-self: start;
  background: transparent;
  color: var(--green);
  font-weight: 850;
}

.auth-disclaimer {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.92rem;
}

.account-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mode-card {
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.mode-card h2,
.mode-card h3 {
  margin: 6px 0 4px;
}

.mode-choice-grid,
.friend-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-choice {
  min-height: 184px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  padding: 16px;
  color: var(--ink);
  text-align: left;
  align-content: space-between;
}

.mode-choice-button {
  display: grid;
  gap: 10px;
}

.mode-choice-button strong {
  font-size: 1.1rem;
}

.hearts {
  color: var(--red);
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0;
}

.profile-details div {
  border: 1px solid rgba(36, 40, 47, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 250, 240, 0.72);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.profile-details strong,
.profile-details span {
  min-width: 0;
}

.guest-disclaimer,
.pro-note {
  margin: 0;
  line-height: 1.4;
}

.verification-box {
  border: 1px solid rgba(190, 61, 66, 0.28);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: rgba(190, 61, 66, 0.06);
}

.verification-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.verification-link {
  color: var(--green);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.verification-code-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.code-input {
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.warning-pill {
  border-color: rgba(190, 61, 66, 0.42);
  color: var(--red);
}

.avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--charcoal);
  color: #fffaf0;
  font-weight: 950;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
}

.avatar img,
.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.install-box {
  display: grid;
}

.file-btn input {
  display: none;
}

.check-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffcf5;
  color: var(--ink);
  outline: none;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 104, 177, 0.15);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.google-btn,
.danger-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-btn {
  background: var(--charcoal);
  color: #fffaf0;
}

.secondary-btn {
  background: var(--green);
  color: #fffaf0;
}

.ghost-btn {
  background: #fffaf0;
  color: var(--charcoal);
  border: 1px solid var(--line);
}

.google-btn {
  background: #ffffff;
  color: var(--charcoal);
  border: 1px solid rgba(36, 40, 47, 0.2);
}

.google-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-note {
  margin-top: -6px;
}

.danger-btn {
  background: var(--red);
  color: #fffaf0;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.room-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.room-title h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(36, 40, 47, 0.12);
  background: #fffaf0;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.danger-pill {
  color: #fffaf0;
  background: var(--red);
  border-color: transparent;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
}

.status-dot.live {
  background: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.workspace.wide {
  grid-template-columns: 1fr;
}

.panel {
  border-radius: 8px;
  padding: 16px;
}

.lobby-panel {
  min-height: 380px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.code {
  font-size: clamp(2.6rem, 12vw, 7.5rem);
  line-height: 0.95;
  font-weight: 950;
  color: var(--charcoal);
}

.small-code {
  font-size: clamp(2rem, 8vw, 4.8rem);
}

.loading-spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 6px solid rgba(36, 40, 47, 0.14);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}

.matchmaking-count {
  min-width: 70px;
  min-height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 950;
  font-size: 1.25rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.muted {
  color: var(--muted);
}

.draft-order {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.turn-chip {
  width: 42px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffaf0;
  font-size: 0.82rem;
  font-weight: 900;
}

.turn-chip.done {
  background: var(--green);
  color: #fffaf0;
}

.turn-chip.now {
  background: var(--amber);
  color: var(--charcoal);
  border-color: transparent;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 10px;
}

.country-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.country-search-input {
  min-width: 0;
}

.country-card,
.player-card,
.matchup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.country-card {
  min-height: 88px;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 9px;
}

.country-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.country-flag {
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
}

.country-card .stripe,
.player-card .stripe {
  height: 5px;
  border-radius: 999px;
  background: var(--tone);
}

.country-card strong,
.player-card strong {
  display: block;
  font-size: 0.96rem;
}

.country-card span,
.player-card span,
.mini {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.country-card.selected {
  background: #e7efe8;
  border-color: rgba(21, 116, 79, 0.35);
}

.country-card.current {
  outline: 3px solid rgba(213, 159, 40, 0.28);
}

.country-empty {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
}

.country-row-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.side-list {
  display: grid;
  gap: 12px;
}

.team-stack {
  display: grid;
  gap: 8px;
}

.team-row {
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--tone);
  background: #fffdf8;
  border-radius: 8px;
  padding: 8px 10px;
}

.common-row {
  margin-top: 12px;
  background: #eef5ee;
}

.score-strip {
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.score-name {
  font-weight: 900;
}

.score-value {
  min-width: 96px;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fffaf0;
  font-weight: 950;
  text-align: center;
}

.score-value strong {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.score-value span {
  font-size: 0.72rem;
  line-height: 1;
  color: rgba(255, 250, 240, 0.74);
}

.score-right {
  text-align: right;
}

.result-banner {
  min-height: 86px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #fffaf0;
  font-size: clamp(2.4rem, 8vw, 5.6rem);
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.result-banner.win {
  background: var(--green);
}

.result-banner.lose {
  background: var(--red);
}

.result-banner.draw {
  background: var(--charcoal);
}

.round-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.lineup-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.98fr) minmax(380px, 1.02fr);
  gap: 16px;
  align-items: start;
}

.pitch-panel {
  position: sticky;
  top: 16px;
}

.pitch {
  width: 100%;
  aspect-ratio: 9 / 12.6;
  position: relative;
  background: url("/assets/pitch.svg") center / cover no-repeat;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), var(--shadow);
}

.slot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: clamp(82px, 11vw, 122px);
  min-height: 66px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px;
  display: grid;
  align-content: center;
  gap: 2px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.player-slot.has-player {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.82)),
    linear-gradient(90deg, var(--amber), var(--green));
  border-top: 4px solid var(--amber);
}

.slot-main {
  width: 100%;
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: center;
}

.slot.has-player {
  padding-right: 6px;
}

.slot-tools {
  position: absolute;
  top: -11px;
  right: -10px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.slot-clear,
.slot-captain,
.captain-badge {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.9);
  border-radius: 50%;
  background: var(--red);
  color: #fffaf0;
  font-size: 1rem;
  line-height: 1;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.slot-clear {
  background: var(--red);
  color: #fffaf0;
}

.slot-captain {
  background: var(--charcoal);
  color: #fffaf0;
}

.captain-badge {
  position: absolute;
  top: -9px;
  left: -9px;
  background: var(--charcoal);
  color: #fffaf0;
  z-index: 2;
}

.slot-captain.active,
.captain-badge {
  background: var(--amber);
  color: var(--charcoal);
}

.slot.active {
  outline: 3px solid var(--amber);
}

.slot.captain {
  outline: 3px solid rgba(213, 159, 40, 0.72);
}

.slot.revealed {
  outline: 3px solid var(--amber);
}

.slot-label {
  font-weight: 950;
  font-size: 0.78rem;
}

.slot-name {
  font-size: clamp(0.62rem, 1.2vw, 0.78rem);
  line-height: 1.05;
  min-height: 1.8em;
  overflow-wrap: anywhere;
}

.captain-inline {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--charcoal);
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
}

.reveal-stage {
  display: grid;
  gap: 16px;
}

.reveal-stage-head,
.reveal-side-head,
.reveal-focus-title,
.result-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reveal-stage-head .round-meta {
  margin-bottom: 0;
}

.reveal-duel-focus {
  min-height: 240px;
  display: grid;
  gap: 12px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(36, 40, 47, 0.12);
  background:
    linear-gradient(135deg, rgba(21, 116, 79, 0.1), rgba(213, 159, 40, 0.12)),
    rgba(255, 250, 240, 0.8);
  padding: 18px;
}

.reveal-focus-title {
  width: min(520px, 100%);
}

.reveal-focus-cards {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.reveal-card {
  min-height: 150px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 240, 0.78)),
    linear-gradient(90deg, var(--tone), rgba(36, 40, 47, 0.22));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
  padding: 14px;
  text-align: center;
  transform-origin: center;
}

.reveal-card.large.open {
  animation: card-pop 620ms ease both;
}

.reveal-card.closed {
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(36, 40, 47, 0.94), rgba(21, 116, 79, 0.86)),
    repeating-linear-gradient(45deg, rgba(255, 250, 240, 0.08) 0 8px, transparent 8px 16px);
}

.reveal-card-position,
.reveal-card-line {
  color: inherit;
  opacity: 0.76;
  font-size: 0.78rem;
  font-weight: 900;
}

.reveal-card strong {
  max-width: 100%;
  font-size: clamp(1rem, 3vw, 1.55rem);
  overflow-wrap: anywhere;
}

.reveal-card-score {
  min-width: 82px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fffaf0;
  padding: 0 10px;
  font-weight: 950;
}

.reveal-pitches {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.reveal-side {
  display: grid;
  gap: 10px;
}

.reveal-side.you .reveal-side-head {
  border-color: rgba(21, 116, 79, 0.36);
}

.reveal-side-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  padding: 10px;
}

.reveal-side-head > div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.reveal-side-head span {
  color: var(--muted);
  font-weight: 850;
}

.large-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fffaf0;
  font-size: 1.2rem;
  font-weight: 950;
  overflow: hidden;
}

.large-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reveal-pitch {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 12px 38px rgba(29, 32, 37, 0.15);
}

.reveal-slot {
  min-height: 62px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.82)),
    linear-gradient(90deg, var(--tone), rgba(36, 40, 47, 0.18));
  border-top: 4px solid var(--tone);
}

.reveal-slot.face-down {
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(36, 40, 47, 0.94), rgba(21, 116, 79, 0.86)),
    repeating-linear-gradient(45deg, rgba(255, 250, 240, 0.08) 0 8px, transparent 8px 16px);
  border-top-color: rgba(255, 250, 240, 0.38);
}

@keyframes card-pop {
  0% {
    opacity: 0.2;
    transform: scale(0.82) translateY(18px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pool,
.search-panel {
  display: grid;
  gap: 12px;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.quota-chip {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--tone);
  background: #fffdf8;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.quota-chip span {
  color: var(--muted);
  font-weight: 850;
}

.search-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.search-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.pool-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.56);
}

.pool-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}

.player-card {
  min-height: 68px;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 6px;
  touch-action: manipulation;
  user-select: none;
}

.player-card.used {
  background: #e8efe9;
  border-color: rgba(21, 116, 79, 0.34);
}

.player-card.blocked {
  opacity: 0.46;
}

.lineup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.matchup-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.matchup-card {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.matchup-card.current {
  outline: 3px solid rgba(213, 159, 40, 0.35);
}

.matchup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.duel {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 8px;
  align-items: stretch;
}

.duel-side {
  border-radius: 8px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--tone);
  background: #fffdf8;
  padding: 10px;
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.duel-side.captain {
  background: #fff3cc;
  border-color: rgba(213, 159, 40, 0.62);
}

.duel-side.winner {
  background: #e7f1e8;
  border-color: rgba(21, 116, 79, 0.38);
}

.duel-side.loser {
  background: #faece9;
  border-color: rgba(190, 61, 66, 0.28);
}

.duel-stat {
  min-height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--charcoal);
  color: #fffaf0;
  font-size: 1.2rem;
  font-weight: 950;
}

.vs {
  display: grid;
  place-items: center;
  font-weight: 950;
  color: var(--muted);
}

.result-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding:
    calc(18px + env(safe-area-inset-top))
    calc(18px + env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom))
    calc(18px + env(safe-area-inset-left));
  background: rgba(29, 32, 37, 0.58);
  backdrop-filter: blur(3px);
}

.result-modal {
  width: min(620px, 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 250, 240, 0.42);
  background: #fffaf0;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  padding: 22px;
  display: grid;
  gap: 12px;
  text-align: center;
}

.result-modal.win {
  border-top: 8px solid var(--green);
}

.result-modal.lose {
  border-top: 8px solid var(--red);
}

.result-modal.draw {
  border-top: 8px solid var(--charcoal);
}

.result-modal-meta,
.result-modal-unit {
  color: var(--muted);
  font-weight: 850;
}

.result-modal-reason {
  color: var(--green);
  font-weight: 950;
}

.result-modal-score {
  min-height: 68px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fffaf0;
  font-size: clamp(1.8rem, 7vw, 3.4rem);
  line-height: 1;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.result-modal-outcome {
  font-size: clamp(2.5rem, 12vw, 5.5rem);
  line-height: 0.95;
  font-weight: 950;
}

.result-modal.win .result-modal-outcome {
  color: var(--green);
}

.result-modal.lose .result-modal-outcome {
  color: var(--red);
}

.result-podium {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-player {
  min-height: 162px;
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 14px;
  overflow: hidden;
}

.result-player strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.result-player.winner {
  border-color: rgba(21, 116, 79, 0.45);
  animation: winner-glow 1200ms ease-in-out infinite alternate;
}

.result-player.loser::after {
  content: "";
  position: absolute;
  inset: 18px;
  background:
    linear-gradient(45deg, transparent calc(50% - 4px), rgba(190, 61, 66, 0.88) calc(50% - 4px), rgba(190, 61, 66, 0.88) calc(50% + 4px), transparent calc(50% + 4px)),
    linear-gradient(-45deg, transparent calc(50% - 4px), rgba(190, 61, 66, 0.88) calc(50% - 4px), rgba(190, 61, 66, 0.88) calc(50% + 4px), transparent calc(50% + 4px));
  animation: loser-cross 520ms ease both;
  pointer-events: none;
}

.result-progress {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 12px;
}

.level-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(36, 40, 47, 0.12);
  overflow: hidden;
}

.level-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber));
  animation: level-fill 700ms ease both;
}

.result-modal-actions {
  display: grid;
  grid-template-columns: 0.7fr 1.15fr 1.15fr;
  gap: 10px;
}

@keyframes winner-glow {
  from {
    box-shadow: 0 0 0 rgba(21, 116, 79, 0);
  }
  to {
    box-shadow: 0 0 34px rgba(21, 116, 79, 0.38);
  }
}

@keyframes loser-cross {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes level-fill {
  from {
    width: 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  z-index: 20;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fffaf0;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 750;
}

@media (max-width: 1040px) {
  .auth-layout,
  .home-grid,
  .workspace,
  .lineup-grid,
  .reveal-pitches {
    grid-template-columns: 1fr;
  }

  .home-stage {
    min-height: 460px;
  }

  .pitch-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding:
      calc(12px + env(safe-area-inset-top))
      calc(12px + env(safe-area-inset-right))
      calc(12px + env(safe-area-inset-bottom))
      calc(12px + env(safe-area-inset-left));
  }

  .home-stage,
  .home-actions,
  .panel {
    padding: 14px;
  }

  .hero-steps,
  .mode-choice-grid,
  .friend-actions,
  .reveal-focus-cards,
  .result-podium {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 380px;
  }

  .topbar,
  .score-strip,
  .duel {
    grid-template-columns: 1fr;
  }

  .profile-details {
    grid-template-columns: 1fr;
  }

  .verification-code-form {
    grid-template-columns: 1fr;
  }

  .score-right {
    text-align: left;
  }

  .score-value {
    width: 100%;
  }

  .slot {
    width: clamp(62px, 18vw, 82px);
    min-height: 50px;
    padding: 5px;
  }

  .slot-tools {
    top: -10px;
    right: -8px;
  }

  .slot-clear,
  .slot-captain,
  .captain-badge {
    width: 22px;
    height: 22px;
    font-size: 0.78rem;
  }

  .reveal-duel-focus {
    min-height: 0;
    padding: 12px;
  }

  .result-modal {
    padding: 16px;
  }

  .result-modal-actions {
    grid-template-columns: 1fr;
  }
}
