/* Neon Fairway — neon golf-solitaire skin. Palette: #0a0a18 / #39ff88 / #00e5ff / #ff2d95 / #7c4dff */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #0a0a18; color: #e8ecff;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, .card:focus-visible { outline: 2px solid #00e5ff; outline-offset: 1px; }
.hide { display: none !important; }
#stage {
  max-width: 460px; margin: 0 auto; padding: 6px 6px 10px;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 6px;
  background:
    radial-gradient(120% 42% at 50% -4%, rgba(57,255,136,.10), transparent 60%),
    radial-gradient(90% 30% at 50% 104%, rgba(0,229,255,.08), transparent 60%),
    #0a0a18;
}

/* ---- top bar ---- */
#topbar { display: flex; align-items: center; gap: 6px; }
.tab {
  flex: 1; min-height: 44px; border-radius: 10px; font-weight: 700; font-size: 13px;
  color: #9fb0d8; background: rgba(255,255,255,.05); border: 1px solid rgba(159,176,216,.25);
}
.tab.on { color: #0a0a18; background: #39ff88; border-color: #39ff88; box-shadow: 0 0 12px rgba(57,255,136,.45); }
.chip {
  min-height: 44px; padding: 0 10px; border-radius: 10px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  background: rgba(124,77,255,.14); border: 1px solid rgba(124,77,255,.5); color: #c9b4ff;
}

/* ---- HUD ---- */
#hud { display: flex; align-items: stretch; gap: 6px; text-align: center; }
.stat {
  flex: 1; border-radius: 10px; padding: 4px 2px 3px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(159,176,216,.18); min-width: 0;
}
.stat .big { display: block; font-size: 17px; font-weight: 800; color: #39ff88; line-height: 1.15; }
.stat span { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; }
.stat label { display: block; font-size: 8.5px; letter-spacing: .08em; color: #7d8db5; text-transform: uppercase; }
#flagBox { flex: 1.15; border-radius: 10px; padding: 2px; background: rgba(255,45,149,.08); border: 1px solid rgba(255,45,149,.4); }
#multFlag {
  font-size: 15px; font-weight: 900; color: #ff2d95; line-height: 1.35;
  text-shadow: 0 0 8px rgba(255,45,149,.55);
}
#multFlag.hot { color: #ffd54a; text-shadow: 0 0 10px rgba(255,213,74,.7); }
#multFlag.pop { animation: pop .3s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }
#tierChip { font-size: 10.5px; color: #9fb0d8; text-align: center; min-height: 13px; }

/* ---- field ---- */
#field {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  align-content: start;
}
.card {
  position: relative; aspect-ratio: 1 / 1.16; border-radius: 7px;
  background: linear-gradient(160deg, #fdfdff 0%, #dfe6ff 100%);
  border: 1px solid #b9c4ea; color: #10142e;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; line-height: 1; min-width: 0;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s;
}
.card .rk { font-size: clamp(12px, 4.2vw, 17px); }
.card .st { font-size: clamp(9px, 3vw, 12px); margin-top: 1px; }
.card.red { color: #ff2d95; }
.card:not(.red) { color: #00b8d4; }
.card.ok { border-color: #39ff88; box-shadow: 0 0 0 1px #39ff88, 0 0 9px rgba(57,255,136,.4); cursor: pointer; }
.card.ok::after {
  content: ""; position: absolute; inset: -2px; border-radius: 8px;
  border: 1.5px solid rgba(57,255,136,.75); opacity: .15; pointer-events: none;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .8; } }
.card.ok:active, .card.press { transform: scale(.9); }
.card:not(.ok) { filter: saturate(.65) brightness(.82); }
.card.gone { animation: vanish .22s ease forwards; }
@keyframes vanish { to { transform: scale(.3) rotate(14deg); opacity: 0; } }
.card.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ---- bottom: waste + stock ---- */
#bottom { display: flex; align-items: center; gap: 8px; }
#wasteWrap { flex: 1; text-align: center; min-width: 0; }
#waste {
  position: relative; height: 74px; display: flex; align-items: center; justify-content: center;
}
.wcard {
  position: absolute; width: 52px; height: 70px; border-radius: 7px;
  background: linear-gradient(160deg, #fdfdff, #dfe6ff); border: 1px solid #b9c4ea;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; line-height: 1;
}
.wcard .st { font-size: 13px; margin-top: 2px; }
.wcard.red { color: #ff2d95; } .wcard:not(.red) { color: #00b8d4; }
#waste .wcard:last-child {
  z-index: 3; box-shadow: 0 0 0 1.5px #ffd54a, 0 0 14px rgba(255,213,74,.5);
  animation: pop .25s ease;
}
label { font-size: 8.5px; letter-spacing: .08em; color: #7d8db5; text-transform: uppercase; display: block; }
#stocksWrap { display: flex; align-items: flex-end; gap: 6px; }
.stockpile {
  position: relative; width: 52px; height: 70px; border-radius: 7px;
  background:
    repeating-linear-gradient(45deg, rgba(57,255,136,.14) 0 6px, rgba(57,255,136,.05) 6px 12px),
    #14261e;
  border: 1px solid #2f8f63; display: flex; align-items: center; justify-content: center;
}
.stockpile.on { box-shadow: 0 0 0 1px #39ff88, 0 0 10px rgba(57,255,136,.35); }
.stockpile .pileface { font-size: 11px; font-weight: 800; color: #39ff88; text-align: center; line-height: 1.25; }
.stockpile.empty { opacity: .3; border-style: dashed; }
.stockpile:active { transform: scale(.95); }
#msg { min-height: 16px; font-size: 11.5px; text-align: center; color: #9fb0d8; }
#msg.glow { color: #ffd54a; }

/* ---- fly card + fx ---- */
.flycard {
  position: fixed; width: 52px; height: 70px; border-radius: 7px; z-index: 60; pointer-events: none;
  background: linear-gradient(160deg, #fdfdff, #dfe6ff); border: 1px solid #b9c4ea;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
  transition: left .3s cubic-bezier(.5,-.2,.6,1), top .3s cubic-bezier(.3,.6,.6,1), transform .3s;
}
#fxLayer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 55; }
.spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; animation: sparkfly .5s ease-out forwards; }
@keyframes sparkfly { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.cf { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; animation: cfall 1.5s ease-in forwards; }
@keyframes cfall { to { transform: translate(var(--dx), 105vh) rotate(720deg); opacity: .7; } }
.combo {
  position: absolute; font-weight: 900; font-size: 21px; color: #ffd54a;
  text-shadow: 0 0 12px rgba(255,213,74,.8); animation: rise .8s ease-out forwards; white-space: nowrap;
}
@keyframes rise { to { transform: translateY(-46px) scale(1.15); opacity: 0; } }

/* ---- overlays ---- */
.overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(6,8,24,.82); padding: 14px;
}
.panel {
  width: 100%; max-width: 400px; border-radius: 16px; padding: 16px;
  background: #10142e; border: 1px solid rgba(159,176,216,.3); text-align: center;
}
.panel.glass { background: rgba(16,20,46,.85); backdrop-filter: blur(6px); border-color: rgba(124,77,255,.5); }
.panel h2 { font-size: 19px; margin-bottom: 4px; color: #39ff88; text-shadow: 0 0 10px rgba(57,255,136,.4); }
.panel p { font-size: 12px; color: #9fb0d8; margin-bottom: 10px; }
#jokerCards { display: flex; gap: 8px; justify-content: center; }
.jcard {
  flex: 1; min-height: 118px; border-radius: 12px; padding: 10px 6px;
  background: linear-gradient(160deg, rgba(124,77,255,.22), rgba(255,213,74,.08));
  border: 1.5px solid #7c4dff; box-shadow: 0 0 12px rgba(124,77,255,.35);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.jcard .ji { font-size: 26px; }
.jcard .jn { font-size: 12.5px; font-weight: 800; color: #ffd54a; }
.jcard .jd { font-size: 10px; color: #cdd6f4; line-height: 1.35; }
.jcard:hover, .jcard:focus-visible { transform: translateY(-4px); box-shadow: 0 6px 18px rgba(124,77,255,.55); }
.jcard.locked { filter: grayscale(.7) brightness(.65); border-style: dashed; cursor: not-allowed; }
.jcard.locked .jn { color: #9fb0d8; }
.jcard.picked { border-color: #39ff88; box-shadow: 0 0 16px rgba(57,255,136,.6); }
#epNew {
  margin: 2px auto 8px; display: inline-block; padding: 3px 14px; border-radius: 99px; font-weight: 900;
  font-size: 12px; color: #ffd54a; border: 1px solid #ffd54a; overflow: hidden; position: relative;
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { 0% { box-shadow: -60px 0 18px rgba(255,213,74,.7) inset; } 100% { box-shadow: 60px 0 18px rgba(255,213,74,.7) inset; } }
#epRows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
#epRows .erow { background: rgba(255,255,255,.05); border-radius: 10px; padding: 7px 4px; }
#epRows .erow b { display: block; font-size: 15px; color: #39ff88; }
#epRows .erow i { font-style: normal; font-size: 9px; color: #7d8db5; letter-spacing: .06em; text-transform: uppercase; }
.panel button.primary, .panel button:not(.primary) {
  display: block; width: 100%; min-height: 46px; border-radius: 11px; margin-top: 8px;
  font-weight: 800; font-size: 14px;
}
.panel button.primary { background: #39ff88; color: #0a0a18; box-shadow: 0 0 14px rgba(57,255,136,.45); }
.panel button:not(.primary) { background: rgba(255,255,255,.08); border: 1px solid rgba(159,176,216,.3); }

/* frozen (QA) */
body.frozen * { animation-play-state: paused !important; transition: none !important; }

/* compact phones / short iframes */
@media (max-height: 560px) {
  #stage { gap: 4px; padding: 4px 5px 8px; }
  .tab, .chip { min-height: 36px; }
  #hud .stat .big { font-size: 15px; } #multFlag { font-size: 14px; }
  #field { gap: 3px; }
  #waste { height: 64px; } .wcard { width: 46px; height: 62px; font-size: 17px; }
  .stockpile { width: 46px; height: 62px; }
  #jokerCards { flex-direction: column; } .jcard { min-height: 62px; flex-direction: row; justify-content: flex-start; text-align: left; }
}
