/* Fumbly — refined minimalist sports UI */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --ink:#0a0e17;
  --surface-primary:rgba(15,19,32,.85);
  --surface-secondary:rgba(22,28,45,.72);
  --surface-tertiary:rgba(30,38,58,.58);
  --line:rgba(148,163,184,.12);
  --line-strong:rgba(148,163,184,.24);
  --text-primary:#f0f4f9;
  --text-secondary:#b4bfd4;
  --text-tertiary:#8b96ad;
  --accent:#ffa726;
  --accent-soft:rgba(255,167,38,.12);
  --success:#66bb6a;
  --warning:#ffa726;
  --error:#ef5350;
  --shadow-sm:0 2px 8px rgba(0,0,0,.2);
  --shadow-md:0 8px 24px rgba(0,0,0,.28);
  --shadow-lg:0 16px 48px rgba(0,0,0,.35);
}

html{background:var(--ink)}

body{
  min-width:320px;
  color:var(--text-primary);
  background:linear-gradient(135deg,rgba(10,14,23,.95) 0%,rgba(15,22,38,.92) 100%),
             radial-gradient(ellipse at 20% 50%,rgba(255,167,38,.04),transparent 50%);
  font:400 15px/1.6 "Inter","Segoe UI",sans-serif;
  image-rendering:auto;
  letter-spacing:.3px;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:radial-gradient(circle at 20% 80%,rgba(255,167,38,.03),transparent 40%),
             radial-gradient(circle at 80% 20%,rgba(102,187,106,.02),transparent 50%);
}

body:not(:has(#bg)) main{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);
  gap:24px;
  width:min(100% - 48px,1220px);
  max-width:1220px;
  padding:48px 0 80px;
  margin:0 auto;
}

body:not(:has(#bg)) main>h1,
body:not(:has(#bg)) main>.sub,
body:not(:has(#bg)) main>.nav,
body:not(:has(#bg)) main>.guide,
body:not(:has(#bg)) main>.sub:last-child{
  grid-column:1/-1;
}

h1{
  margin:0;
  display:flex;
  align-items:center;
  gap:16px;
  color:var(--text-primary);
  font:700 clamp(20px,3.2vw,32px)/1.1 "Outfit","Trebuchet MS",sans-serif;
  letter-spacing:-.8px;
  font-weight:700;
}

h1 svg{
  width:40px;
  height:40px;
  flex-shrink:0;
  filter:drop-shadow(0 4px 12px rgba(0,0,0,.2));
}

h1 span[style]{
  color:var(--accent) !important;
  font:600 11px/1 "Inter",sans-serif !important;
  letter-spacing:.8px !important;
  text-transform:uppercase;
  opacity:.9;
}

.sub{
  margin:12px 0 8px;
  color:var(--text-secondary);
  font:500 14px/1.6 "Inter",sans-serif;
  letter-spacing:.2px;
}

.sub a{
  color:var(--accent) !important;
  text-decoration:none;
  transition:opacity .2s ease;
}

.sub a:hover{
  opacity:.8;
  text-decoration:underline;
}

.nav{
  display:flex;
  gap:8px;
  margin:0 0 24px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-secondary);
  backdrop-filter:blur(8px);
}

.lk{
  flex:1;
  padding:12px 14px;
  border:0;
  border-radius:10px;
  color:var(--text-secondary);
  background:transparent;
  box-shadow:none;
  font:600 12px/1 "Inter",sans-serif;
  letter-spacing:.4px;
  transition:all .25s ease;
  cursor:pointer;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
}

.lk:hover{
  color:var(--text-primary);
  background:rgba(255,167,38,.08);
}

.lk.on{
  color:var(--ink);
  background:var(--accent);
  box-shadow:0 4px 12px rgba(255,167,38,.24);
}

.card,.guide{
  margin:0;
  padding:28px;
  border:1px solid var(--line-strong);
  border-radius:18px;
  background:var(--surface-primary);
  box-shadow:var(--shadow-md);
  transition:all .3s ease;
}

.card:hover{
  border-color:var(--line-strong);
  box-shadow:var(--shadow-lg);
}

.top{
  margin:-28px -28px 24px;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  border-radius:18px 18px 0 0;
  color:var(--accent);
  background:var(--surface-secondary);
  font:600 11px/1.4 "Inter",sans-serif;
  letter-spacing:.6px;
  text-transform:uppercase;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.q{
  margin:0 0 24px;
  color:var(--text-primary);
  font:700 clamp(20px,2.8vw,32px)/1.2 "Outfit","Trebuchet MS",sans-serif;
  letter-spacing:-.6px;
}

input{
  width:100%;
  padding:14px 16px;
  border:1px solid var(--line-strong);
  border-radius:12px;
  color:var(--text-primary);
  background:var(--surface-secondary);
  font:600 16px "Press Start 2P","Courier New",monospace;
  image-rendering:auto;
  transition:all .25s ease;
}

input::placeholder{
  color:var(--text-tertiary);
}

input:focus{
  outline:none;
  border-color:var(--accent);
  background:var(--surface-tertiary);
  box-shadow:0 0 0 3px rgba(255,167,38,.12),var(--shadow-sm);
}

.row{
  display:flex;
  gap:12px;
  margin-top:16px;
}

button{
  min-height:48px;
  padding:13px 20px;
  border:0;
  border-radius:12px;
  color:var(--ink);
  background:var(--accent);
  box-shadow:var(--shadow-md);
  font:700 12px "Inter",sans-serif;
  letter-spacing:.5px;
  text-transform:uppercase;
  transition:all .25s cubic-bezier(.4,0,.2,1);
  cursor:pointer;
}

button:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-lg);
  filter:brightness(1.1);
}

button:active{
  transform:translateY(0);
  box-shadow:var(--shadow-sm);
}

button.ghost{
  color:var(--text-primary);
  background:var(--surface-secondary);
  border:1px solid var(--line-strong);
  box-shadow:none;
  font-size:11px;
}

button.ghost:hover{
  background:var(--surface-tertiary);
  box-shadow:var(--shadow-sm);
}

button.sg{
  min-height:36px;
  padding:8px 12px;
  border-radius:10px;
  color:var(--ink);
  background:var(--accent);
  box-shadow:none;
  font-size:11px;
  flex-shrink:0;
}

.msg{
  color:var(--text-secondary);
  font:500 13px/1.7 "Inter",sans-serif;
  margin-top:12px;
}

.big{
  margin:16px 0;
  color:var(--accent);
  font:400 clamp(32px,5.5vw,56px)/1.05 "Press Start 2P","Courier New",monospace;
  letter-spacing:-.8px;
  text-shadow:0 4px 16px rgba(0,0,0,.3);
}

.tier{
  color:var(--text-secondary);
  font:600 13px/1.65 "Inter",sans-serif;
  letter-spacing:.3px;
}

.bar{
  height:12px;
  margin:18px 0;
  border:0;
  border-radius:99px;
  background:var(--surface-secondary);
  overflow:hidden;
  box-shadow:inset 0 2px 4px rgba(0,0,0,.2);
}

.bar i{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--accent),rgba(255,167,38,.7));
  border-radius:inherit;
  box-shadow:0 0 12px rgba(255,167,38,.24);
}

ol{
  list-style:none;
  margin:20px 0 0;
  padding:0;
  font:500 13px/1.6 "Inter",sans-serif;
}

li{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  color:var(--text-secondary);
  transition:all .2s ease;
}

li:hover{
  background:var(--surface-secondary);
}

li.me{
  color:var(--ink);
  background:var(--accent);
  outline:1px solid var(--accent);
  border-radius:10px;
  border-bottom-color:transparent;
}

li span:last-child{
  font-variant-numeric:tabular-nums;
  color:var(--text-tertiary);
}

.guide{
  color:var(--text-primary);
}

.guide-head{
  border-bottom-color:var(--line);
}

.guide-kicker{
  color:var(--accent);
  font:700 10px/1.4 "Inter",sans-serif;
  letter-spacing:.6px;
  text-transform:uppercase;
}

.guide h2{
  font:700 24px/1.25 "Outfit","Trebuchet MS",sans-serif;
  letter-spacing:-.5px;
}

.guide-copy,.guide-example,.guide-source{
  color:var(--text-secondary);
  font:500 13px/1.7 "Inter",sans-serif;
}

.guide-example{
  padding:16px 18px;
  color:var(--text-primary);
  background:var(--surface-secondary);
  border-left:3px solid var(--accent);
  border-radius:0 10px 10px 0;
}

.guide-example strong{
  color:var(--accent);
  font-size:11px;
  font-weight:700;
}

.guide-source{
  color:var(--text-tertiary);
}

.guide a{
  color:var(--accent);
}

.opp{
  margin-bottom:20px;
  padding:14px 16px;
  border:1px solid var(--line-strong);
  border-radius:12px;
  color:var(--accent);
  background:var(--accent-soft);
  font:600 13px/1.6 "Inter",sans-serif;
}

.opp .slot{
  color:var(--ink);
  background:var(--accent);
  border-radius:6px;
  font:700 10px/1.4 "Inter",sans-serif;
  padding:4px 8px;
  display:inline-block;
}

.opcard{
  padding-top:24px;
}

.oph{
  color:var(--text-secondary);
  font:700 10px/1.4 "Inter",sans-serif;
  letter-spacing:.4px;
  text-transform:uppercase;
}

.opteams{
  gap:20px;
}

.thead{
  padding:12px 14px;
  border:0;
  border-radius:10px;
  box-shadow:none;
  font:700 11px/1.4 "Inter",sans-serif;
  letter-spacing:.4px;
  text-transform:uppercase;
  color:var(--ink);
  background:var(--accent);
}

.thead.you{
  background:var(--accent);
}

.thead.opp{
  background:var(--error);
}

.trow{
  padding:11px 14px;
  border-bottom:1px solid var(--line);
  color:var(--text-primary);
  font:500 13px/1.5 "Inter",sans-serif;
  transition:all .2s ease;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.trow:hover{
  background:var(--surface-secondary);
}

.trow>span{
  flex-shrink:0;
  color:var(--text-secondary);
  font:600 10px "Inter",sans-serif;
  letter-spacing:.3px;
  text-transform:uppercase;
  padding:4px 8px;
  background:var(--accent-soft);
  border-radius:6px;
}

.trow>b{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display:flex;
  align-items:center;
  gap:8px;
}

.trow .team-badge{
  flex-shrink:0;
  font:700 9px "Inter",sans-serif;
  letter-spacing:.4px;
  text-transform:uppercase;
  padding:3px 7px;
  background:var(--accent);
  color:var(--ink);
  border-radius:4px;
  min-width:32px;
  text-align:center;
}

.trow .team-badge.fa{
  background:rgba(139,150,173,.3);
  color:var(--text-secondary);
  border:1px solid rgba(139,150,173,.4);
}

.trow>i{
  flex-shrink:0;
  font-style:normal;
  color:var(--text-secondary);
  font:600 11px "Press Start 2P","Courier New",monospace;
  font-variant-numeric:tabular-nums;
}

.trow.on{
  color:var(--ink);
  background:var(--accent);
  outline:0;
  border-radius:8px;
}

.trow.on>span,.trow.on>i,.trow.on .team-badge{
  color:var(--ink);
}

.matchup{
  border:1px solid var(--line-strong);
  border-radius:14px;
  background:var(--surface-secondary);
  box-shadow:var(--shadow-sm);
}

.matchup .mu{
  padding:6px 12px;
  border-radius:8px;
  color:var(--accent);
  background:var(--accent-soft);
  font:700 10px "Inter",sans-serif;
}

.matchup span{
  color:var(--text-secondary);
  font:700 10px "Inter",sans-serif;
}

.matchup b,.matchup i{
  font-family:"Inter",sans-serif;
}

.finalgrid{
  font:600 13px/1.5 "Inter",sans-serif;
}

.finalgrid>div{
  padding:11px 14px;
  border-bottom-color:var(--line);
}

.finalgrid>div>span{
  border-radius:6px;
  color:var(--ink);
  background:var(--accent);
  font:700 10px "Inter",sans-serif;
  padding:4px 8px;
  display:inline-block;
}

.vs{
  color:var(--text-tertiary);
}

#play{
  overflow:hidden;
}

/* Modern sport backgrounds */
#gamebg{
  background:linear-gradient(135deg,#0a0e17 0%,#0f1620 50%,#1a2238 100%) !important;
  opacity:1 !important;
}

#gamebg::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 20% 50%,rgba(255,167,38,.08),transparent 40%),
    radial-gradient(circle at 80% 80%,rgba(102,187,106,.06),transparent 50%),
    radial-gradient(circle at 50% 0%,rgba(100,150,255,.04),transparent 60%);
  pointer-events:none;
}

#gamebg.env-field{
  background:
    linear-gradient(135deg,#0f5a1a 0%,#0d3f14 50%,#0a2810 100%),
    radial-gradient(ellipse at 20% 30%,rgba(255,167,38,.12),transparent 50%),
    radial-gradient(ellipse at 80% 70%,rgba(102,187,106,.08),transparent 60%) !important;
}

#gamebg.env-pitch{
  background:
    linear-gradient(135deg,#0a2810 0%,#0d3f14 50%,#0f5a1a 100%),
    radial-gradient(ellipse at 30% 40%,rgba(102,187,106,.1),transparent 50%),
    radial-gradient(ellipse at 70% 60%,rgba(255,167,38,.08),transparent 60%) !important;
}

#gamebg.env-court{
  background:
    linear-gradient(135deg,#2a1810 0%,#1f1410 50%,#140a05 100%),
    radial-gradient(ellipse at 25% 35%,rgba(255,167,38,.1),transparent 50%),
    radial-gradient(ellipse at 75% 65%,rgba(230,118,68,.06),transparent 60%) !important;
}

#gamebg.env-rink{
  background:
    linear-gradient(135deg,#0a1a3a 0%,#0f2a4a 50%,#1a3a5a 100%),
    radial-gradient(ellipse at 25% 40%,rgba(100,180,255,.1),transparent 50%),
    radial-gradient(ellipse at 75% 60%,rgba(102,187,206,.06),transparent 60%) !important;
}

/* Animated gradient overlay for visual depth */
#gamebg::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,.02) 2px,
      rgba(255,255,255,.02) 4px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,.01) 2px,
      rgba(255,255,255,.01) 4px
    );
  pointer-events:none;
  opacity:.6;
}

.sportbg{
  opacity:.12 !important;
}

@media(max-width:820px){
  body:not(:has(#bg)) main{
    grid-template-columns:1fr;
    width:min(100% - 32px,700px);
    padding-top:36px;
    gap:20px;
  }

  body:not(:has(#bg)) main>#play,
  body:not(:has(#bg)) main>#opcard{
    grid-column:1;
  }
}

@media(max-width:620px){
  body:not(:has(#bg)) main{
    width:min(100% - 24px,700px);
    gap:16px;
    padding-top:28px;
    padding-bottom:60px;
  }

  .card,.guide{
    padding:20px;
    border-radius:14px;
  }

  .top{
    margin:-20px -20px 18px;
    border-radius:14px 14px 0 0;
    padding:12px 16px;
  }

  .q{
    font-size:clamp(18px,5vw,28px);
  }

  .big{
    font-size:clamp(28px,8vw,42px);
  }

  h1{
    font-size:clamp(18px,5vw,28px);
  }
}

@media(max-width:560px){
  .opteams{
    grid-template-columns:1fr;
  }
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    transition-duration:.01ms !important;
    animation-duration:.01ms !important;
  }
}

/* Landing page: refined glass-morphism with animated pixel stadium */
body:has(#bg) main{
  width:min(460px,94vw);
  padding:40px 32px 36px;
  align-items:stretch;
  gap:14px;
  border:1px solid rgba(255,167,38,.16);
  border-radius:22px;
  background:linear-gradient(135deg,rgba(15,19,32,.92),rgba(10,14,23,.88));
  box-shadow:0 24px 64px rgba(0,0,0,.4),inset 0 1px 1px rgba(255,255,255,.06);
  backdrop-filter:blur(12px);
}

body:has(#bg) h1{
  justify-content:center;
  font-size:clamp(24px,6vw,36px);
  letter-spacing:-.6px;
}

body:has(#bg) .sub{
  text-align:center;
  color:var(--text-secondary);
  font-size:15px;
  margin:4px 0 16px;
}

body:has(#bg) .links{
  gap:12px;
}

body:has(#bg) .links a{
  min-height:56px;
  border:0;
  border-radius:12px;
  color:var(--ink);
  background:var(--accent);
  box-shadow:var(--shadow-md);
  font:700 12px "Inter",sans-serif;
  letter-spacing:.5px;
  text-transform:uppercase;
  transition:all .25s cubic-bezier(.4,0,.2,1);
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

body:has(#bg) .links a:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-lg);
  filter:brightness(1.1);
}

body:has(#bg) .links a:active{
  transform:translateY(1px);
  box-shadow:var(--shadow-sm);
}

body:has(#bg) .legal{
  color:var(--text-tertiary);
  font:500 11px/1.7 "Inter",sans-serif;
  text-shadow:none;
  margin:16px 0 0;
}

body:has(#bg) .legal a{
  color:var(--text-secondary);
  text-decoration:underline;
  transition:color .2s ease;
}

body:has(#bg) .legal a:hover{
  color:var(--accent);
}

/* Football game: three bodies — your team | question & answer | opponent team.
   Your team sits on the left, the opponent on the right, and the question/answer
   panel is its own body in the middle so it can fade out independently while the
   scoring animations play and the earned number flies into your lineup. */
body:not(:has(#bg)) main.matchup-main{
  grid-template-columns:minmax(0,.92fr) minmax(0,1.55fr) minmax(0,.92fr);
  align-items:start;
}

.teamcard{
  display:flex;
  flex-direction:column;
}

.teamcard .thead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin:0 0 12px;
}

.teamcard .thead b{
  font:700 12px/1 "Press Start 2P","Courier New",monospace;
  font-variant-numeric:tabular-nums;
}

.team-head{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.team-head>span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.team-logo{
  flex:none;
  width:22px;
  height:22px;
  border-radius:5px;
  display:block;
  object-fit:contain;
  image-rendering:pixelated;
}

.team-logo svg{
  display:block;
  width:100%;
  height:100%;
}

.team-logo[hidden]{
  display:none;
}

.plink{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:inherit;
  text-decoration:none;
  transition:color .2s ease;
}

.plink:hover,.plink:focus-visible{
  color:var(--accent);
  text-decoration:none;
}

.teamweek{
  margin:-6px 0 10px;
  color:var(--text-tertiary);
  font:600 10px "Inter",sans-serif;
  letter-spacing:.4px;
  text-transform:uppercase;
}

.trows{
  display:flex;
  flex-direction:column;
}

/* Question & answer body fades out the moment an answer lands */
.qa{
  transition:opacity .34s ease;
}

.qa.fade{
  opacity:0;
  pointer-events:none;
}

#res{
  animation:resIn .4s ease both;
}

@keyframes resIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

/* The earned number flies from the question body into your lineup row */
.flynum{
  position:fixed;
  z-index:62;
  pointer-events:none;
  white-space:nowrap;
  transform:translate(-50%,-50%);
  font:700 20px "Press Start 2P","Courier New",monospace;
  color:#ffe66b;
  text-shadow:2px 2px 0 #000;
}

.flynum.f0{color:#cfcab8}
.flynum.f1{color:#fff}
.flynum.f3{color:#3cc8ff}
.flynum.f4{color:#ff9f1c;font-size:24px}
.flynum.f5{font-size:28px;color:#fff;text-shadow:2px 2px 0 #000,0 0 16px #ff3cac}

.trow.land{
  animation:land .7s ease;
}

@keyframes land{
  0%{background:var(--accent);color:var(--ink)}
  100%{background:transparent}
}

@media(max-width:980px){
  body:not(:has(#bg)) main.matchup-main{
    grid-template-columns:1fr;
    gap:16px;
  }

  body:not(:has(#bg)) main.matchup-main>#user-card,
  body:not(:has(#bg)) main.matchup-main>#play,
  body:not(:has(#bg)) main.matchup-main>#opp-card{
    grid-column:1;
  }
}

@media(prefers-reduced-motion:reduce){
  #res{animation:none}
  .trow.land{animation:none}
}
