/* ============================================================
   RogerATC — ATC MAYDAY  |  Main Version
   Sunset / palm-tree theme, glassmorphism UI
   ============================================================ */

:root {
  --sunset-1: #ff9a5a;
  --sunset-2: #ff7a4d;
  --sunset-3: #a855f7;
  --sky-deep: #1b1033;
  --ink: #2a1a3e;
  --cream: #fff4e6;
  --gold: #ffd166;
  --accent: #ff7a59;
  --good: #4ade80;
  --bad: #ff5436;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-brd: rgba(255, 255, 255, 0.28);
  --shadow: 0 10px 40px rgba(20, 8, 40, 0.45);
  --font: 'Trebuchet MS', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--sky-deep);
  color: var(--cream);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden { display: none !important; }

/* ===================== GLASS PRIMITIVE ===================== */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ===================== SCREENS ===================== */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;     /* centre when it fits; top-align + scroll (no clip) when it overflows */
  padding: 24px;
  z-index: 20;
  overflow-y: auto;                 /* scroll when content is taller than the viewport */
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(180deg, rgba(14,7,28,0.64) 0%, rgba(14,7,28,0.3) 45%, rgba(14,7,28,0.6) 100%),
    url('../assets/bg_sunset.webp') center/cover no-repeat;
  animation: fadeIn 0.4s ease;
}
.screen.overlay { background: rgba(15, 8, 30, 0.72); backdrop-filter: blur(6px); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.menu-inner {
  width: min(520px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

/* ===================== LOGO ===================== */
.logo-wrap { margin-top: 2px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand-emblem {
  width: clamp(110px, 30vw, 150px);
  height: clamp(110px, 30vw, 150px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 10px 34px rgba(0,0,0,0.45), 0 0 0 6px rgba(255,255,255,0.08);
}
.brand-emblem.small { width: 78px; height: 78px; border-width: 2px; margin-bottom: 2px; }
.logo-text { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; }
.logo-main {
  font-size: clamp(42px, 11vw, 72px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0,0,0,0.18), 0 14px 30px rgba(0,0,0,0.35);
}
.logo-main .accent { color: var(--gold); }
.logo-sub {
  font-size: clamp(13px, 3.4vw, 18px);
  letter-spacing: 6px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.tagline {
  font-size: clamp(14px, 3.6vw, 17px);
  color: rgba(255,255,255,0.9);
  max-width: 380px;
  line-height: 1.45;
}

/* ===================== OPTION GROUPS / SEGMENTS ===================== */
.opt-group { width: 100%; text-align: left; }
.opt-title {
  display: block;
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin: 0 0 8px 6px;
}
.seg {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.18);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--glass-brd);
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.78);
  padding: 12px 8px;
  border-radius: 11px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}
.seg-btn small { font-weight: 600; font-size: 11px; opacity: 0.8; }
.seg-btn.active {
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255,122,77,0.5);
  transform: translateY(-1px);
}
.seg-btn.locked { opacity: 0.75; }
.seg-btn.locked small { color: var(--gold); }

/* ===================== BUTTONS ===================== */
.primary-btn {
  width: 100%;
  max-width: 360px;
  padding: 16px 22px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: #3a1a10;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(16px, 4.4vw, 20px);
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255,122,89,0.5), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(255,122,89,0.6); }
.primary-btn:active { transform: translateY(1px) scale(0.99); }

.ghost-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  color: #fff;
  padding: 12px 18px;
  min-height: 46px;                 /* comfortable tap target (client: buttons too cluttered to tap) */
  border-radius: 13px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  backdrop-filter: blur(8px);
}
.ghost-btn:hover { background: rgba(255,255,255,0.2); }

/* more breathing room between footer buttons + space under the page so taps land cleanly */
.menu-foot { display: flex; gap: 16px 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 4px; }
#menu .menu-inner { padding-bottom: 30px; }
.account-line { font-size: 12px; letter-spacing: 0.5px; color: rgba(255,255,255,0.65); font-weight: 700; text-align: center; margin-top: -4px; }
.account-line .unverified { color: var(--gold); font-size: 9.5px; letter-spacing: 1px; margin-left: 6px; text-transform: uppercase;
  background: rgba(0,0,0,0.25); padding: 2px 7px; border-radius: 6px; }
.version-pill {
  position: absolute;
  bottom: 14px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
}

/* ===================== AUTH (login / signup) ===================== */
.auth-inner { gap: 16px; max-width: 360px; }
.auth-tabs {
  display: flex; width: 100%; background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-brd); border-radius: 14px; padding: 5px; gap: 5px;
}
.auth-tab {
  flex: 1; border: none; background: transparent; color: rgba(255,255,255,0.75);
  padding: 11px; border-radius: 10px; font-family: var(--font); font-weight: 800;
  font-size: 15px; cursor: pointer; transition: all 0.16s ease;
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-2));
  color: #fff; box-shadow: 0 5px 14px rgba(255,122,77,0.45);
}
.auth-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.auth-form .primary-btn { max-width: 100%; }   /* LOG IN button matches the input width (aligned) */
.auth-form input {
  width: 100%; padding: 14px 16px; border-radius: 13px;
  border: 1px solid var(--glass-brd); background: rgba(255,255,255,0.12);
  color: #fff; font-family: var(--font); font-size: 15px; font-weight: 600;
  outline: none; transition: border 0.15s, background 0.15s;
}
.auth-form input::placeholder { color: rgba(255,255,255,0.6); font-weight: 500; }
.auth-form input:focus { border-color: var(--gold); background: rgba(255,255,255,0.18); }
.auth-msg { font-size: 13px; font-weight: 700; min-height: 16px; text-align: center; }
.auth-msg.err { color: var(--bad); }
.auth-msg.ok { color: var(--good); }
.auth-or { display: flex; align-items: center; gap: 10px; width: 100%; color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 700; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.25); }
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: 13px; border: none; background: #fff; color: #3c4043;
  font-family: var(--font); font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25); transition: transform 0.12s;
}
.google-btn:hover { transform: translateY(-1px); }
.google-btn .g { font-weight: 900; color: #4285f4; font-size: 18px; }
#guestBtn { width: 100%; }
.gsi-wrap { display: flex; justify-content: center; width: 100%; }

/* ===================== LEADERBOARD ===================== */
.lb-list {
  width: 100%; max-height: 52vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px; border-radius: 16px;
  background: rgba(0,0,0,0.15); border: 1px solid var(--glass-brd);
}
.lb-list::-webkit-scrollbar { width: 8px; }
.lb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-brd);
  font-weight: 700;
}
.lb-row .lb-rank { width: 34px; font-weight: 900; color: rgba(255,255,255,0.7); font-size: 15px; }
.lb-row .lb-name { flex: 1; text-align: left; color: #fff; font-size: 15px; letter-spacing: 0.3px; }
.lb-row .lb-score { color: var(--gold); font-weight: 900; font-size: 17px; }
.lb-row.top1 { background: linear-gradient(135deg, rgba(255,209,102,0.3), rgba(255,122,77,0.25)); border-color: var(--gold); }
.lb-row.top1 .lb-rank, .lb-row.top2 .lb-rank, .lb-row.top3 .lb-rank { color: var(--gold); }
.lb-empty { color: rgba(255,255,255,0.7); padding: 24px; font-size: 15px; }
.lb-me {
  width: 100%; padding: 12px 16px; border-radius: 13px;
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-2));
  color: #fff; font-weight: 900; font-size: 15px;
  display: flex; justify-content: space-between; box-shadow: 0 6px 16px rgba(255,122,77,0.4);
}

/* ===================== MULTIPLAYER ===================== */
.mp-created { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.mp-share { color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 700; }
.mp-code {
  font-size: clamp(32px, 9vw, 46px); font-weight: 900; letter-spacing: 8px;
  color: var(--gold); background: rgba(0,0,0,0.25); border: 2px dashed var(--gold);
  border-radius: 14px; padding: 12px 20px; width: 100%; text-align: center;
}
#mpJoinCode { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 900; }
.mp-scores { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.mp-player { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.mp-av {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-3)); border: 3px solid rgba(255,255,255,0.7);
}
.mp-player span { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.85); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-player b { font-size: 30px; font-weight: 900; color: var(--gold); }
.mp-player.winner .mp-av { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,209,102,0.4); }
.mp-player.winner b { color: var(--good); }
.mp-vs { font-size: 18px; font-weight: 900; color: rgba(255,255,255,0.6); }

/* ---- GROUP lobby + leaderboard ---- */
#mpModeSeg { width: 100%; }
.grp-count { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.82); }
.grp-count b { color: var(--gold); font-size: 15px; }
.grp-players { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; max-height: 36vh; overflow-y: auto; }
.grp-players li { padding: 9px 14px; border-radius: 10px; background: var(--glass-bg); border: 1px solid var(--glass-brd); font-size: 14px; font-weight: 700; color: #fff; text-align: left; }
.grp-players li.me { border-color: var(--gold); color: var(--gold); }
.grp-leaderboard { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 7px; max-height: 52vh; overflow-y: auto; }
.grp-leaderboard li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--glass-bg); border: 1px solid var(--glass-brd); }
.grp-leaderboard li .rank { font-size: 15px; font-weight: 900; min-width: 30px; text-align: center; }
.grp-leaderboard li .who { flex: 1; font-size: 14px; font-weight: 700; color: #fff; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-leaderboard li b { font-size: 18px; font-weight: 900; color: var(--gold); }
.grp-leaderboard li.me { border-color: rgba(255,209,102,0.7); }
.grp-leaderboard li.winner { background: rgba(255,209,102,0.18); border-color: var(--gold); box-shadow: 0 4px 16px rgba(255,160,70,0.25); }

/* ===================== SUBSCRIBE / PLANS ===================== */
/* Payment status banner — tells the player EXACTLY what happened (failed reason / past due / active) */
.pay-banner {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border-radius: 12px; text-align: left;
  font-size: 13px; font-weight: 700; line-height: 1.35;
  background: rgba(255,90,90,0.16); border: 1px solid rgba(255,90,90,0.5); color: #ffd9d9;
}
.pay-banner.good { background: rgba(60,200,120,0.16); border-color: rgba(60,200,120,0.5); color: #c9ffdd; }
.pay-banner.warn { background: rgba(255,185,60,0.16); border-color: rgba(255,185,60,0.55); color: #ffe6b3; }
.pay-banner #payBannerText { flex: 1; }
.pay-banner #payBannerX { background: none; border: none; color: inherit; font-size: 15px; cursor: pointer; opacity: 0.65; padding: 2px 4px; line-height: 1; }
.pay-banner #payBannerX:hover { opacity: 1; }

/* provider chooser (Stripe card vs Square) */
.pay-provider { display: flex; align-items: center; gap: 12px; width: 100%; }
.pay-provider-label { font-size: 10px; letter-spacing: 2px; font-weight: 800; opacity: 0.6; white-space: nowrap; }
.pay-seg { flex: 1; }
.pay-seg .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.pay-seg .seg-btn svg { width: 17px; height: 17px; }
.pay-seg .seg-btn.active { background: linear-gradient(135deg, var(--gold), #ff9a5a); color: #3a1a10; border-color: transparent; box-shadow: 0 4px 14px rgba(255,150,70,0.4); }

/* Square card-entry modal */
.sq-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(10,6,22,0.74); backdrop-filter: blur(6px); padding: 20px; animation: fadeIn 0.25s ease; }
.sq-modal-box { width: min(400px, 100%); background: #1d1430; border: 1px solid var(--glass-brd);
  border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.55); }
.sq-title { font-size: 18px; font-weight: 900; color: #fff; text-align: center; margin: 0; }
.sq-card { min-height: 54px; background: #fff; border-radius: 10px; padding: 6px 10px; }
.sq-powered { font-size: 10px; letter-spacing: 1px; opacity: 0.5; text-align: center; }

.screen-title .title-ico { width: 24px; height: 24px; color: var(--gold); vertical-align: -4px; margin-right: 6px; filter: drop-shadow(0 2px 5px rgba(255,170,60,0.5)); }

.plan-card {
  position: relative; width: 100%; text-align: left; padding: 16px 18px 18px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.05));
  border: 1px solid var(--glass-brd); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.plan-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.42); }
.plan-card.recommended { border-color: rgba(255,209,102,0.6); box-shadow: 0 10px 30px rgba(255,160,70,0.2), inset 0 0 0 1px rgba(255,209,102,0.22); }
.plan-badge {
  position: absolute; top: -9px; right: 16px; padding: 3px 11px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ff9a5a); color: #3a1a10;
  font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(255,150,70,0.5);
}
.plan-head { display: flex; align-items: center; gap: 12px; }
.plan-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,0.1); border: 1px solid var(--glass-brd); color: var(--gold); }
.plan-ico svg { width: 23px; height: 23px; }
.plan-name { flex: 1; font-size: 17px; font-weight: 900; color: #fff; }
.plan-price { font-size: 22px; font-weight: 900; color: var(--gold); line-height: 1; white-space: nowrap; }
.plan-price small { font-size: 11px; font-weight: 700; opacity: 0.75; margin-left: 1px; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-feats li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.3; color: rgba(255,255,255,0.84); }
.plan-feats li svg { flex: none; width: 15px; height: 15px; padding: 2.5px; border-radius: 50%; background: rgba(90,220,140,0.2); color: #7fe6a8; box-sizing: border-box; }
.plan-btn {
  width: 100%; padding: 12px; border-radius: 13px; border: none; cursor: pointer;
  font-family: var(--font); font-size: 15px; font-weight: 900; letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--gold), #ff9a5a); color: #3a1a10;
  box-shadow: 0 6px 18px rgba(255,150,70,0.38), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.plan-btn:hover { box-shadow: 0 8px 24px rgba(255,150,70,0.5); }
.plan-btn:active { transform: scale(0.98); }
.plan-card.owned { border-color: rgba(90,220,140,0.6); }
.plan-card.owned .plan-btn { background: linear-gradient(135deg, #52d98a, #2fb36a); color: #06341c; pointer-events: none; box-shadow: none; }

/* ===================== ADS ===================== */
.ad-slot {
  width: 100%; max-width: 360px; min-height: 90px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25); border: 1px dashed var(--glass-brd); overflow: hidden;
}
.ad-label { font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,0.45); font-weight: 700; }
.ad-slot img, .ad-slot video { width: 100%; height: 100%; max-height: 220px; object-fit: contain; display: block; }
.ad-slot a { display: block; width: 100%; }

/* ----- My Ad (advertiser upload) ----- */
.myad-preview {
  width: 100%; max-width: 360px; min-height: 120px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: rgba(0,0,0,0.28); border: 1px dashed var(--glass-brd);
}
.myad-preview img, .myad-preview video { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.myad-file {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 14px 16px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--glass-brd); background: rgba(255,255,255,0.12);
  color: #fff; font-weight: 700; font-size: 14px;
}
.myad-file input { display: none; }

/* ===================== MESSAGES ===================== */
.msg-inner { width: min(460px, 100%); }
.msg-players { width: 100%; max-height: 54vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding: 6px; border-radius: 16px; background: rgba(0,0,0,0.15); border: 1px solid var(--glass-brd); }
.msg-players::-webkit-scrollbar { width: 8px; } .msg-players::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 8px; }
.msg-player-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-brd); cursor: pointer; font-weight: 700; color: #fff; transition: background 0.14s; }
.msg-player-row:hover { background: rgba(255,255,255,0.2); }
.msg-player-row .msg-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-3)); font-size: 16px; }
.msg-player-row .msg-name { flex: 1; text-align: left; }
.msg-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.msg-dot.online { background: var(--good); box-shadow: 0 0 8px var(--good); }
.msg-empty { color: rgba(255,255,255,0.7); padding: 20px; font-size: 14px; }
.msg-convo { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.msg-convo-head { display: flex; align-items: center; gap: 10px; }
.msg-convo-head .ghost-btn { padding: 8px 14px; }
.msg-convo-head span#msgWith { font-weight: 900; font-size: 17px; color: #fff; }
.msg-list { width: 100%; height: 44vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px;
  padding: 10px; border-radius: 14px; background: rgba(0,0,0,0.2); border: 1px solid var(--glass-brd); }
.msg-list::-webkit-scrollbar { width: 8px; } .msg-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 8px; }
.msg-bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; font-weight: 600; line-height: 1.35; word-wrap: break-word; }
.msg-bubble.theirs { align-self: flex-start; background: rgba(255,255,255,0.9); color: #2a1a3e; border-bottom-left-radius: 4px; }
.msg-bubble.mine { align-self: flex-end; background: linear-gradient(135deg, var(--sunset-1), var(--sunset-2)); color: #fff; border-bottom-right-radius: 4px; }
.msg-form { display: flex; gap: 8px; width: 100%; }
.msg-form input { flex: 1; padding: 13px 16px; border-radius: 13px; border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,0.12); color: #fff; font-family: var(--font); font-size: 15px; font-weight: 600; outline: none; }
.msg-form input::placeholder { color: rgba(255,255,255,0.6); }
.msg-form .primary-btn { width: auto; padding: 13px 22px; }

/* ===================== BREEZE (blue free variant) ===================== */
body.breeze { --sunset-1: #38bdf8; --sunset-2: #2563eb; --accent: #0ea5e9; }
body.breeze .screen {
  background:
    linear-gradient(180deg, rgba(8,24,54,0.5) 0%, rgba(8,24,54,0.2) 45%, rgba(8,30,70,0.55) 100%),
    url('../assets/breeze/bg_breeze.webp') center/cover no-repeat;
}
.breeze-mascot {
  position: fixed; bottom: 10px; left: 10px; width: clamp(60px, 15vw, 96px);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45)); z-index: 5; pointer-events: none;
  animation: mascotBob 3s ease-in-out infinite;
}
@keyframes mascotBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
/* Breeze plane in the upper-left corner of the home screen (client request) */
.breeze-plane-link {
  position: fixed; top: 14px; left: 10px; width: clamp(90px, 22vw, 148px);
  z-index: 6; pointer-events: auto; cursor: pointer;
  animation: planeDrift 4s ease-in-out infinite;
}
.breeze-plane-corner {
  width: 100%; display: block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.4)); pointer-events: none;
}
@keyframes planeDrift { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-7px) rotate(-5deg); } }
.breeze-footer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.breeze-links { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: center; margin-top: 2px; }
.breeze-links a { color: rgba(255,255,255,0.88); font-size: 12px; font-weight: 700; text-decoration: none; padding: 5px 6px; }
.breeze-links a:hover { color: #fff; text-decoration: underline; }
.breeze-rogerlink { color: var(--gold); font-size: 12.5px; font-weight: 800; letter-spacing: 0.5px; text-decoration: none;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,209,102,0.4); border-radius: 10px; padding: 5px 12px; }
.breeze-rogerlink:hover { background: rgba(0,0,0,0.4); }
.breeze-powered { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 1px; color: rgba(255,255,255,0.65); font-weight: 700; }
.breeze-powered img { height: 22px; border-radius: 4px; }

/* ===================== CALL SIGN GRID ===================== */
.screen-title {
  font-size: clamp(24px, 6.5vw, 36px);
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.screen-sub { color: rgba(255,255,255,0.82); font-size: 15px; margin-top: -8px; }
/* Cash-prize note (spec: "TOP RANK IS SUBJECT TO CASH PRIZES AND REWARDS") */
.prize-note {
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.4px;
  color: var(--gold); text-align: center; line-height: 1.35;
  background: rgba(0,0,0,0.26); border: 1px solid rgba(255,209,102,0.45);
  border-radius: 12px; padding: 9px 14px; max-width: 340px; margin: -4px auto 0;
}
body.breeze .prize-note { display: none; } /* Breeze is free — no ranking, no prizes */
.callsign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
  width: 100%;
  max-height: 46vh;
  overflow-y: auto;
  padding: 6px;
  border-radius: 16px;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--glass-brd);
}
.callsign-grid::-webkit-scrollbar { width: 8px; }
.callsign-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 8px; }
.cs-chip {
  padding: 11px 8px;
  border-radius: 11px;
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.cs-chip:hover { background: rgba(255,255,255,0.2); }
.cs-chip.sel {
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-2));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(255,122,77,0.5);
  transform: translateY(-1px);
}
.callsign-actions { display: flex; gap: 12px; width: 100%; max-width: 420px; }
.callsign-actions .primary-btn { flex: 2; font-size: clamp(13px, 3.4vw, 16px); padding: 14px 16px; }
.callsign-actions .ghost-btn { flex: 1; }

/* ===================== HOW TO ===================== */
.howto-inner { align-items: flex-start; text-align: left; }
.howto-list { list-style: none; display: flex; flex-direction: column; gap: 12px; width: 100%; }
.howto-list li {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: 13px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.5;
}
.howto-list b { color: var(--gold); }
.howto-list .warn { color: var(--bad); font-weight: 900; }
kbd {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-brd);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
  font-family: var(--font);
}

/* ===================== RESULT SCREEN ===================== */
.result-title {
  font-size: clamp(34px, 9vw, 56px);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--bad);
  text-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.result-title.survived { color: var(--good); }
.result-msg { font-size: 16px; color: rgba(255,255,255,0.9); max-width: 380px; line-height: 1.45; }
.result-scores { display: flex; gap: 14px; }
.result-score { padding: 16px 26px; display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.result-score .label { font-size: 11px; letter-spacing: 2px; opacity: 0.7; }
.result-score span:last-child { font-size: 34px; font-weight: 900; color: var(--gold); }
.new-best {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 1px;
  font-size: 18px;
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.result-actions { display: flex; gap: 12px; flex-direction: column; width: 100%; max-width: 320px; }

/* ===================== HUD ===================== */
.hud {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hud button { pointer-events: auto; }

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}
.hud-score, .hud-timer, .hud-best {
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 60px;
}
.hud-top .label { font-size: 9px; letter-spacing: 2px; opacity: 0.75; font-weight: 700; }
.hud-score span:last-child, .hud-timer span:last-child, .hud-best span:last-child {
  font-size: 20px; font-weight: 900; color: #fff;
}
.hud-score span:last-child { color: var(--gold); }
#scoreValue.flash-good { animation: popGood 0.4s ease; }
#scoreValue.flash-bad { animation: popBad 0.4s ease; }
@keyframes popGood { 0% { color: var(--good); transform: scale(1.4); } 100% { color: var(--gold); transform: scale(1); } }
@keyframes popBad { 0% { color: var(--bad); transform: scale(1.4); } 100% { color: var(--gold); transform: scale(1); } }

/* Radio chatter — comic CLOUD word bubble with a frosted-glass (iOS-style) interior.
   Whatever is behind the bubble is blurred inside it (backdrop-filter), masked to the cloud shape. */
.chatter {
  position: absolute;
  /* client: pinned at the TOP-CENTRE (between the Clock & Scoreboard) so it stays clear of the flight course */
  left: 50%;
  top: clamp(66px, 10vh, 100px);
  bottom: auto;
  transform: translateX(-50%);
  /* ▼▼▼ RESIZE THE WHOLE BUBBLE: change ONLY this one value ▼▼▼ */
  --bub: 120PX;
  width: var(--bub);
  aspect-ratio: 1.22;                /* height auto from width — keeps the cloud shape */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9% 4% 13% 9%;            /* % padding scales with the bubble */
  color: #1d1430;
  font-weight: 800;
  font-size: calc(var(--bub) * 0.095);   /* text scales with the bubble too */
  text-align: center;
  line-height: 1.22;
  z-index: 2;
  background: url("../assets/bubble_frame_v2.webp");
  animation: bubbleIn 0.3s ease;
  background-size: contain;
  background-position: center;
  background-repeat: NO-REPEAT;
}
/* frosted-glass fill, clipped to the cloud shape (clip-path works with backdrop-filter; mask does not) */
.chatter-frost {
  position: absolute;
  inset: 0;
  display: none;   /* white interior shape removed — bubble is now outline + text only */
  -webkit-clip-path: polygon(34.2% 5.5%, 30.1% 8.3%, 28.0% 11.1%, 28.7% 13.9%, 29.4% 16.6%, 15.7% 19.4%, 13.7% 22.2%, 12.3% 24.9%, 13.0% 27.7%, 13.7% 30.5%, 13.7% 33.2%, 13.7% 36.0%, 8.2% 38.8%, 6.2% 41.6%, 5.5% 44.3%, 5.5% 47.1%, 6.2% 49.9%, 8.2% 52.6%, 18.5% 55.4%, 18.5% 58.2%, 18.5% 60.9%, 19.1% 63.7%, 20.5% 66.5%, 21.9% 69.3%, 25.3% 72.0%, 41.7% 74.8%, 43.7% 77.6%, 45.8% 80.3%, 47.2% 80.3%, 47.2% 77.6%, 45.1% 74.8%, 58.1% 72.0%, 62.2% 69.3%, 64.2% 66.5%, 64.9% 63.7%, 73.1% 60.9%, 73.1% 58.2%, 77.9% 55.4%, 82.0% 52.6%, 84.1% 49.9%, 84.7% 47.1%, 85.4% 44.3%, 84.7% 41.6%, 84.1% 38.8%, 81.3% 36.0%, 77.9% 33.2%, 75.2% 30.5%, 75.2% 27.7%, 77.2% 24.9%, 75.2% 22.2%, 64.9% 19.4%, 64.9% 16.6%, 63.6% 13.9%, 62.2% 11.1%, 60.1% 8.3%, 34.2% 5.5%);
  clip-path: polygon(34.2% 5.5%, 30.1% 8.3%, 28.0% 11.1%, 28.7% 13.9%, 29.4% 16.6%, 15.7% 19.4%, 13.7% 22.2%, 12.3% 24.9%, 13.0% 27.7%, 13.7% 30.5%, 13.7% 33.2%, 13.7% 36.0%, 8.2% 38.8%, 6.2% 41.6%, 5.5% 44.3%, 5.5% 47.1%, 6.2% 49.9%, 8.2% 52.6%, 18.5% 55.4%, 18.5% 58.2%, 18.5% 60.9%, 19.1% 63.7%, 20.5% 66.5%, 21.9% 69.3%, 25.3% 72.0%, 41.7% 74.8%, 43.7% 77.6%, 45.8% 80.3%, 47.2% 80.3%, 47.2% 77.6%, 45.1% 74.8%, 58.1% 72.0%, 62.2% 69.3%, 64.2% 66.5%, 64.9% 63.7%, 73.1% 60.9%, 73.1% 58.2%, 77.9% 55.4%, 82.0% 52.6%, 84.1% 49.9%, 84.7% 47.1%, 85.4% 44.3%, 84.7% 41.6%, 84.1% 38.8%, 81.3% 36.0%, 77.9% 33.2%, 75.2% 30.5%, 75.2% 27.7%, 77.2% 24.9%, 75.2% 22.2%, 64.9% 19.4%, 64.9% 16.6%, 63.6% 13.9%, 62.2% 11.1%, 60.1% 8.3%, 34.2% 5.5%);
}
#chatterText {position: absolute;z-index: 1;color: #15102a;text-shadow: 0 0 3px rgba(255,255,255,0.95), 0 0 6px rgba(255,255,255,0.9), 0 1px 2px rgba(255,255,255,0.9);display: flex;justify-content: center;align-items: center;text-align: center;line-height: 1.12;overflow: hidden;inset: 20% 19% 32% 15%;}
@keyframes bubbleIn { from { opacity: 0; } to { opacity: 1; } }

/* Bottom controls */
.hud-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 20px;
}
.lift-btn {
  pointer-events: auto;
  width: clamp(88px, 24vw, 132px);
  height: clamp(78px, 20vw, 104px);
  border-radius: 24px;
  border: 1px solid var(--glass-brd);
  background: linear-gradient(135deg, rgba(255,209,102,0.9), rgba(255,122,89,0.9));
  color: #3a1a10;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255,122,89,0.45), inset 0 2px 0 rgba(255,255,255,0.5);
  transition: transform 0.08s ease;
}
.lift-btn:active { transform: scale(0.93); box-shadow: 0 4px 14px rgba(255,122,89,0.4); }
.tap-word { font-size: clamp(20px, 6vw, 30px); font-weight: 900; letter-spacing: 1px; }
.tap-sub { font-size: 11px; font-weight: 800; letter-spacing: 2px; opacity: 0.85; }

/* Speedometer */
.speedo {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 128px;
}
.speedo-dial {
  width: 86px;
  height: 43px;
  border-radius: 86px 86px 0 0;
  background: conic-gradient(from 270deg at 50% 100%,
    var(--good) 0deg, var(--gold) 45deg, var(--accent) 90deg, var(--bad) 180deg);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.4);
  border-bottom: none;
}
.speedo-dial::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 0; top: 10px;
  background: var(--ink);
  border-radius: 86px 86px 0 0;
}
.speedo-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 38px;
  background: #fff;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  border-radius: 3px;
  z-index: 2;
  box-shadow: 0 0 6px rgba(255,255,255,0.8);
  transition: transform 0.25s ease;
}
.speedo-read { font-size: 18px; font-weight: 900; color: #fff; }
.speedo-read small { font-size: 10px; opacity: 0.8; }
.callsign-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold);
  background: rgba(0,0,0,0.25);
  padding: 2px 10px;
  border-radius: 8px;
}

/* Mini controls */
.hud-mini {
  position: absolute;
  /* sit below the 40k ceiling line (≈8.5% of height) and clear of the BEST card */
  top: calc(8.5vh + 24px);
  top: calc(8.5dvh + 24px);
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mini-btn {
  pointer-events: auto;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.mini-btn:active { transform: scale(0.92); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 420px) {
  .chatter { --bub: 108px; }
  .result-scores { flex-direction: row; }
}
@media (min-aspect-ratio: 16/10) and (min-width: 720px) {
  .lift-btn { width: 130px; height: 110px; }
}

/* ---------- Landscape / widescreen (phone on its side): fit menus + compact HUD ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  /* .screen is a ROW flex — margin:auto on the child centres it BOTH ways AND lets it
     scroll from the top when taller than the viewport (no clipping). */
  .screen { overflow-y: auto; padding: 10px 20px; }
  .menu-inner { gap: 9px; width: min(640px, 100%); }
  .chatter { bottom: clamp(92px, 26vh, 120px); }
  .logo-wrap { gap: 3px; margin-top: 0; }
  .brand-emblem { width: 50px; height: 50px; border-width: 2px; }
  .brand-emblem.small { width: 40px; height: 40px; }
  .logo-text { gap: 6px; }
  .logo-main { font-size: clamp(22px, 6vw, 34px); letter-spacing: -1px; }
  .logo-sub { font-size: 9px; letter-spacing: 3px; }
  .tagline { font-size: 11px; line-height: 1.3; max-width: 100%; }
  .screen-title { font-size: clamp(18px, 5vw, 26px); }
  .screen-sub, .prize-note { font-size: 11px; }
  .opt-title { font-size: 9px; margin: 0 0 4px 6px; }
  .seg { padding: 4px; }
  .seg-btn { padding: 7px 6px; font-size: 12px; }
  .seg-btn small { font-size: 9px; }
  .primary-btn { padding: 10px 18px; font-size: 15px; max-width: 320px; }
  .ghost-btn, .google-btn { padding: 11px 15px; font-size: 12px; }
  .auth-inner, .auth-form { gap: 8px; }
  .auth-form input { padding: 9px 13px; font-size: 13px; }
  .auth-tab { padding: 8px; font-size: 13px; }
  .menu-foot { gap: 13px 10px; }
  .account-line { font-size: 10px; }
  .lb-list, .msg-list { max-height: 40vh; }

  /* Gameplay HUD/controls: compact so the play area gets most of the short height */
  .hud-top { padding: 6px 12px; }
  .hud-score, .hud-timer, .hud-best { padding: 4px 11px; min-width: 52px; }
  .hud-score span:last-child, .hud-timer span:last-child, .hud-best span:last-child { font-size: 16px; }
  .hud-bottom { padding: 4px 10px 6px; }
  .lift-btn { width: clamp(72px, 12vw, 104px); height: clamp(40px, 11vh, 54px); border-radius: 14px; }
  .lift-btn .tap-word { font-size: clamp(18px, 3vh, 24px); }
  .lift-btn .tap-sub { font-size: 8px; }
  .speedo { padding: 3px 12px 4px; min-width: 96px; gap: 1px; }
  .speedo-dial { width: 54px; height: 27px; }
  .speedo-read { font-size: 13px; }
  .speedo-read small { font-size: 8px; }
  .callsign-tag { font-size: 8px; padding: 1px 6px; }
  .hud-mini { top: 50px; }
  .chatter { --bub: 90px; }
}
