/* =========================================================
   SKY DRIFT — Premium Flappy
   Global resets, layout, and UI styling
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #0b1830;
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #233a6e 0%, #0b1830 70%);
}

/* Canvas — dynamically sized by JS */
#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  touch-action: none;
}

/* ======= Generic helpers ======= */
.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: auto;
  animation: screenIn .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes screenIn {
  0% { opacity: 0; transform: translateY(8px) scale(.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ======= Buttons ======= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #4a90ff 0%, #2461d9 100%);
  box-shadow:
    0 6px 0 #1a3f96,
    0 12px 24px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.4);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 2px 2px auto 2px;
  height: 30%;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0));
  border-radius: 16px 16px 50% 50% / 16px 16px 100% 100%;
  pointer-events: none;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #1a3f96, 0 6px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.3); }

.btn-primary {
  background: linear-gradient(180deg, #ffce4d 0%, #ff8a2b 100%);
  box-shadow:
    0 6px 0 #b1571a,
    0 12px 24px rgba(255,138,43,.45),
    inset 0 1px 0 rgba(255,255,255,.5);
  color: #3a1a00;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
  font-size: 18px;
  min-width: 200px;
  padding: 16px 28px;
}
.btn-primary:active { box-shadow: 0 2px 0 #b1571a, 0 6px 12px rgba(255,138,43,.4); }

.btn-secondary {
  background: linear-gradient(180deg, #6f86d6 0%, #48ABE0 100%);
  box-shadow: 0 5px 0 #2c4d8a, 0 10px 20px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 13px;
  min-width: 110px;
  padding: 12px 16px;
}
.btn-secondary:active { box-shadow: 0 2px 0 #2c4d8a, 0 5px 10px rgba(0,0,0,.25); }

.btn-danger {
  background: linear-gradient(180deg, #ff5a73 0%, #c41739 100%);
  box-shadow: 0 5px 0 #7a0e22, 0 10px 20px rgba(196,23,57,.4), inset 0 1px 0 rgba(255,255,255,.35);
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn-ico {
  width: 18px; height: 18px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.play-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 5v14l11-7z' fill='%233a1a00'/></svg>"); }
.shop-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 9h18l-2 11H5L3 9zm5-2a4 4 0 1 1 8 0v2h-2V7a2 2 0 0 0-4 0v2H8V7z' fill='white'/></svg>"); }
.missions-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 11l-4 4 1.5 1.5L9 14l8.5-8.5L16 4 9 11zM4 20h16v2H4z' fill='white'/></svg>"); }
.achievements-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l2.5 5 5.5.7-4 4 1 5.5L12 14.7 7 17.2l1-5.5-4-4 5.5-.7L12 2z' fill='white'/></svg>"); }
.leaderboard-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 22h4V10H5v12zm5 0h4V2h-4v20zm5 0h4v-8h-4v8z' fill='white'/></svg>"); }
.settings-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm9 4l-2.1.4a7 7 0 0 0-.7-1.6l1.4-1.6-2-2-1.6 1.4a7 7 0 0 0-1.6-.7L14 2h-4l-.4 2.1a7 7 0 0 0-1.6.7L6.4 3.4l-2 2L5.8 7a7 7 0 0 0-.7 1.6L3 9v4l2.1.4c.2.6.4 1.1.7 1.6l-1.4 1.6 2 2 1.6-1.4c.5.3 1 .5 1.6.7L10 22h4l.4-2.1c.6-.2 1.1-.4 1.6-.7l1.6 1.4 2-2-1.4-1.6c.3-.5.5-1 .7-1.6L21 15v-3z' fill='white'/></svg>"); }
.restart-ico { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 6V3L8 7l4 4V8a5 5 0 1 1-5 5H5a7 7 0 1 0 7-7z' fill='%233a1a00'/></svg>"); }

/* ======= Main Menu ======= */
.menu-screen {
  background: linear-gradient(180deg, rgba(11,24,48,.0) 0%, rgba(11,24,48,.55) 100%);
}
.title-wrap {
  text-align: center;
  margin-bottom: 12px;
  animation: floatY 4s ease-in-out infinite;
}
.title {
  font-size: clamp(40px, 9vw, 78px);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #fff7d2 0%, #ffce4d 55%, #ff8a2b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 4px 0 rgba(0,0,0,.18),
    0 12px 30px rgba(255,138,43,.5);
  filter: drop-shadow(0 6px 14px rgba(255,138,43,.35));
}
.title span {
  display: inline-block;
  background: linear-gradient(180deg, #d2f0ff 0%, #4cc7ff 55%, #1f6cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 14px rgba(31,108,255,.45));
}
.subtitle {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: .85;
  margin-top: 4px;
}

.menu-bird-stage {
  position: relative;
  width: 220px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 24px;
}
.menu-bird {
  width: 120px; height: 120px;
  animation: idleBob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.35));
}
.menu-bird::before {
  content: '';
  position: absolute;
  inset: auto auto -18px 50%;
  transform: translateX(-50%);
  width: 110px; height: 14px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.4), rgba(0,0,0,0) 70%);
  border-radius: 50%;
  animation: shadowPulse 2.2s ease-in-out infinite;
}
@keyframes idleBob {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
@keyframes shadowPulse {
  0%,100% { transform: translateX(-50%) scale(1); opacity: .5; }
  50% { transform: translateX(-50%) scale(.78); opacity: .35; }
}
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  width: min(420px, 92vw);
}

.menu-footer {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

/* ======= Coin counters ======= */
.coin-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(0,0,0,.35);
  border-radius: 99px;
  font-weight: 800;
  font-size: 18px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.coin-counter.small { font-size: 14px; padding: 6px 12px; }

.coin-ico, .coin-ico-large {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7c2, #ffd34d 50%, #c98a14 100%);
  box-shadow:
    inset -2px -3px 0 rgba(0,0,0,.25),
    inset 2px 2px 0 rgba(255,255,255,.55),
    0 0 10px rgba(255,210,80,.55);
  position: relative;
}
.coin-ico-large { width: 28px; height: 28px; }
.coin-ico::after {
  content: '$';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #8a5b08; font-weight: 900; font-size: 12px;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}

/* ======= HUD ======= */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top, 0px), 16px) 16px 16px;
}
.hud-top {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0,0,0,.4);
  border-radius: 99px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.hud-pill .label {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: .65;
  font-weight: 700;
}
.hud-pill .value {
  font-size: 18px;
  font-weight: 900;
  transition: transform .2s cubic-bezier(.2,.8,.3,1.4);
}
.hud-pill .value.pop {
  transform: scale(1.3);
  color: #ffd34d;
  text-shadow: 0 0 12px rgba(255,211,77,.7);
}
.score-pill { background: linear-gradient(180deg, rgba(255,206,77,.25), rgba(0,0,0,.45)); }
.best-pill .value { color: #d2f0ff; }
.coins-pill { background: linear-gradient(180deg, rgba(255,180,40,.2), rgba(0,0,0,.45)); }

/* ======= Powerup bar ======= */
.powerup-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-self: center;
  flex-wrap: wrap;
  justify-content: center;
}
.pu-chip {
  position: relative;
  padding: 6px 12px 6px 30px;
  border-radius: 99px;
  background: rgba(0,0,0,.45);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  animation: chipIn .3s ease;
}
@keyframes chipIn {
  from { opacity: 0; transform: translateY(-6px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pu-chip::before {
  content: '';
  position: absolute;
  left: 8px; top: 50%;
  width: 16px; height: 16px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--pu-color, #fff);
  box-shadow: 0 0 12px var(--pu-color, #fff);
}
.pu-chip .pu-time {
  margin-left: 6px;
  opacity: .8;
  font-variant-numeric: tabular-nums;
}

/* ======= Combo badge ======= */
.combo-badge {
  align-self: center;
  margin-top: 10px;
  padding: 6px 14px;
  background: linear-gradient(180deg, #ff5a73, #c41739);
  color: #fff;
  font-weight: 900;
  border-radius: 99px;
  letter-spacing: 2px;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(196,23,57,.5), inset 0 1px 0 rgba(255,255,255,.4);
  animation: comboPop .35s cubic-bezier(.2,.9,.3,1.5);
}
@keyframes comboPop {
  0% { transform: scale(.5); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* ======= Floating numbers ======= */
.float-numbers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.float-num {
  position: absolute;
  font-weight: 900;
  font-size: 22px;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  animation: floatNum 1s ease-out forwards;
  pointer-events: none;
}
@keyframes floatNum {
  0% { transform: translate(-50%, 0) scale(.7); opacity: 0; }
  20% { transform: translate(-50%, -10px) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -80px) scale(.9); opacity: 0; }
}

/* ======= Tap hint ======= */
.tap-hint {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: tapPulse 1.4s ease-in-out infinite;
}
.tap-hint p {
  font-weight: 800;
  letter-spacing: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  margin-top: 12px;
}
.tap-icon {
  width: 64px; height: 64px;
  margin: 0 auto;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><circle cx='32' cy='32' r='14' fill='none' stroke='white' stroke-width='3'/><circle cx='32' cy='32' r='7' fill='white'/><path d='M32 6v8M32 50v8M6 32h8M50 32h8' stroke='white' stroke-width='3' stroke-linecap='round'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5));
}
@keyframes tapPulse {
  0%,100% { transform: translate(-50%, -50%) scale(1); opacity: .9; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

/* ======= Pause button ======= */
.pause-btn {
  position: absolute;
  top: max(env(safe-area-inset-top, 0px), 14px);
  right: 14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  z-index: 5;
}
.pause-btn::before, .pause-btn::after {
  content: '';
  position: absolute;
  width: 4px; height: 16px;
  background: #fff;
  top: 14px;
  border-radius: 2px;
}
.pause-btn::before { left: 16px; }
.pause-btn::after { right: 16px; }

/* ======= Game Over ======= */
.game-over { background: rgba(8, 16, 32, .55); backdrop-filter: blur(6px); }
.game-over-title {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: 6px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ff8a8a, #c41739);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 18px rgba(196,23,57,.6);
  animation: titleDrop .5s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes titleDrop {
  0% { opacity: 0; transform: translateY(-30px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.new-record {
  padding: 6px 18px;
  background: linear-gradient(180deg, #ffce4d, #ff8a2b);
  color: #3a1a00;
  font-weight: 900;
  letter-spacing: 3px;
  border-radius: 99px;
  font-size: 14px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(255,138,43,.5);
  animation: bounceIn .6s cubic-bezier(.2,.9,.3,1.6);
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-card {
  width: min(360px, 90vw);
  background: rgba(0,0,0,.45);
  border-radius: 24px;
  padding: 18px 22px;
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  margin-bottom: 22px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.result-row:last-child { border-bottom: 0; }
.result-label { opacity: .8; letter-spacing: 1.5px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.result-value { font-weight: 900; font-size: 22px; }
.result-value.big { font-size: 38px; color: #ffd34d; text-shadow: 0 0 16px rgba(255,211,77,.5); }

.game-over-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ======= Pause screen ======= */
.pause-screen { background: rgba(8,16,32,.55); backdrop-filter: blur(6px); }
.pause-screen h2 {
  font-size: 48px;
  letter-spacing: 8px;
  margin-bottom: 24px;
  text-shadow: 0 4px 16px rgba(0,0,0,.5);
}

/* ======= Modals ======= */
.modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,16,32,.65);
  backdrop-filter: blur(8px);
  z-index: 10;
  padding: 14px;
  animation: screenIn .25s ease;
}
.modal-card {
  width: min(560px, 100%);
  max-height: 92vh;
  background: linear-gradient(180deg, #1a2748 0%, #0d1730 100%);
  border-radius: 24px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.modal-header h2 { flex: 1; font-size: 22px; letter-spacing: 3px; }
.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,.2); }
.modal-sub { opacity: .7; font-size: 12px; letter-spacing: 1px; margin: -6px 0 12px; text-align: center; }

/* ======= Shop ======= */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  background: rgba(0,0,0,.3);
  border-radius: 14px;
}
.tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  opacity: .65;
}
.tab.active {
  background: linear-gradient(180deg, #4a90ff, #2461d9);
  opacity: 1;
  box-shadow: 0 4px 0 #1a3f96, inset 0 1px 0 rgba(255,255,255,.3);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}
.shop-item {
  position: relative;
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  border: 2px solid transparent;
  transition: all .2s;
  cursor: pointer;
}
.shop-item:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.shop-item.owned { border-color: rgba(76, 199, 255, .5); }
.shop-item.equipped { border-color: #ffd34d; box-shadow: 0 0 20px rgba(255,211,77,.4); }
.shop-item .preview {
  width: 80px; height: 80px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  position: relative;
  overflow: hidden;
}
.shop-item .name { font-size: 13px; font-weight: 800; letter-spacing: 1px; margin-bottom: 4px; }
.shop-item .price {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(0,0,0,.35);
}
.shop-item .price.equipped-tag { background: linear-gradient(180deg, #ffce4d, #ff8a2b); color: #3a1a00; }
.shop-item .price.owned-tag { background: rgba(76,199,255,.25); color: #d2f0ff; }
.shop-item .locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  pointer-events: none;
}

/* ======= Achievements/Missions/Leaderboard lists ======= */
.achievement-list, .mission-list, .leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}
.ach-row, .mission-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
}
.ach-row.unlocked {
  background: linear-gradient(180deg, rgba(255,211,77,.18), rgba(255,138,43,.12));
  border-color: rgba(255,211,77,.4);
}
.ach-row .ach-emoji, .mission-row .mission-emoji {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(0,0,0,.3);
  flex-shrink: 0;
}
.ach-row.unlocked .ach-emoji {
  background: linear-gradient(180deg, #ffce4d, #ff8a2b);
  box-shadow: 0 0 16px rgba(255,138,43,.5);
}
.ach-info { flex: 1; }
.ach-info .ach-name { font-weight: 800; font-size: 14px; letter-spacing: 1px; }
.ach-info .ach-desc { opacity: .65; font-size: 12px; margin-top: 2px; }
.ach-progress {
  margin-top: 6px;
  height: 6px;
  background: rgba(0,0,0,.4);
  border-radius: 99px;
  overflow: hidden;
}
.ach-progress > div {
  height: 100%;
  background: linear-gradient(90deg, #4cc7ff, #1f6cff);
  border-radius: 99px;
  transition: width .5s;
}
.mission-reward {
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(0,0,0,.35);
  display: inline-flex; align-items: center; gap: 4px;
}
.mission-row.completed { opacity: .6; }
.mission-row.completed .mission-emoji { background: linear-gradient(180deg, #5dd17c, #2e9c4e); }

/* Leaderboard */
.lb-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; background: rgba(255,255,255,.06); border-radius: 14px;
}
.lb-rank {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; flex-shrink: 0;
  background: rgba(0,0,0,.3);
}
.lb-row:nth-child(1) .lb-rank { background: linear-gradient(180deg, #ffd34d, #c98a14); color: #3a1a00; }
.lb-row:nth-child(2) .lb-rank { background: linear-gradient(180deg, #e0e0e0, #909090); color: #2a2a2a; }
.lb-row:nth-child(3) .lb-rank { background: linear-gradient(180deg, #d99363, #7a4520); }
.lb-score { flex: 1; font-weight: 800; font-size: 18px; }
.lb-meta { opacity: .7; font-size: 12px; text-align: right; }

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 14px; }
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}
.setting-row input[type="range"] { width: 160px; accent-color: #4cc7ff; }
.toggle-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: #4cc7ff; }
.settings-foot { margin-top: 16px; display: flex; justify-content: center; }

/* Achievement popup */
.achievement-popup {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 12px;
  background: linear-gradient(180deg, rgba(255,211,77,.95), rgba(255,138,43,.95));
  color: #3a1a00;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4);
  z-index: 20;
  animation: achIn .5s cubic-bezier(.2,.9,.3,1.4);
  min-width: 240px;
}
.achievement-popup.out { animation: achOut .4s ease forwards; }
@keyframes achIn {
  0% { transform: translate(-50%, -120px); opacity: 0; }
  60% { transform: translate(-50%, 8px); opacity: 1; }
  100% { transform: translate(-50%, 0); }
}
@keyframes achOut {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -120px); opacity: 0; }
}
.achievement-popup .ach-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.achievement-popup .ach-icon::after { content: '🏆'; }
.achievement-popup .ach-title { font-size: 11px; font-weight: 800; letter-spacing: 2px; opacity: .8; }
.achievement-popup .ach-name { font-size: 15px; font-weight: 900; letter-spacing: 1px; }

/* Toast */
.toast {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: rgba(0,0,0,.75);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
  z-index: 50;
  animation: toastIn .3s ease;
}
@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Responsive */
@media (max-width: 500px) {
  .btn-primary { font-size: 16px; min-width: 180px; padding: 14px 22px; }
  .btn-secondary { font-size: 12px; min-width: 92px; padding: 10px 12px; }
  .title { letter-spacing: 3px; }
  .menu-bird-stage { width: 180px; height: 150px; }
  .menu-bird { width: 100px; height: 100px; }
  .hud-pill { padding: 6px 10px; }
  .hud-pill .value { font-size: 16px; }
}
@media (max-height: 600px) {
  .menu-bird-stage { width: 140px; height: 110px; margin: 2px 0 14px; }
  .menu-bird { width: 80px; height: 80px; }
  .title { font-size: clamp(32px, 7vw, 56px); }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
