:root {
  --bg: #0e0e0e;
  --panel: #1b1c1d;
  --panel-2: #222426;
  --line: #2c2e31;
  --text: #ffffff;
  --muted: #9ea0a3;
  --green: #28a909;
  --green-dark: #1f8607;
  --orange: #d17205;
  --orange-hot: #e08a1e;
  --red: #de2334;
  --pink: #9135db;
  --blue: #34b4ff;
  --font: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input {
  font: inherit;
}

/* —— Loader: image + bar only —— */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__image {
  position: absolute;
  inset: 0;
  background: url("../assets/loading-valley.jpg") center / cover no-repeat;
  animation: loader-ken 12s ease-in-out infinite alternate;
}

.loader__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
}

.loader__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8a3d, #ff4d2e);
  transition: width 0.15s linear;
}

@keyframes loader-ken {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.08) translate(-1%, -0.5%);
  }
}

/* —— App shell —— */
.app {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  max-width: 1400px;
  margin: 0 auto;
  min-width: 0;
  overflow: hidden;
}

.app[hidden] {
  display: none !important;
}

.app > .topbar {
  grid-column: 1 / -1;
  grid-row: 1;
}

.app > .bets-feed {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
}

.app > .flight {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
}

.app > .bet-panels {
  grid-column: 1 / -1;
  grid-row: 3;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar__logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1a1b1c;
  border: 1px solid #2c2e31;
  overflow: hidden;
}

.topbar__logo img {
  width: 30px;
  height: auto;
  object-fit: contain;
}

.topbar__name span {
  color: var(--red);
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #15171a;
  border: 1px solid #2a2d31;
  font-size: 11px;
  font-weight: 700;
  color: #c5c6c8;
  white-space: nowrap;
}

.online-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 169, 9, 0.18);
}

.online-pill.is-busy {
  border-color: #5a4010;
  color: #f0b24a;
}

.online-pill.is-busy .online-pill__dot {
  background: #f0b24a;
  box-shadow: 0 0 0 3px rgba(240, 178, 74, 0.2);
}

.online-pill.is-full {
  border-color: #5a1820;
  color: #ff7b7b;
}

.online-pill.is-full .online-pill__dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(222, 35, 52, 0.22);
}

.capacity-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 70;
  max-width: min(520px, calc(100% - 24px));
  padding: 12px 16px;
  border-radius: 12px;
  background: #2a1216;
  border: 1px solid #5a1820;
  color: #ffd0d4;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.capacity-banner[hidden] {
  display: none !important;
}

.history {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
  min-width: 0;
  max-width: 100%;
}

.history::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #2a2c2e;
  color: #c5c6c8;
}

.chip--low {
  color: #d2d3d4;
}

.chip--mid {
  color: var(--blue);
}

.chip--high {
  color: var(--pink);
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--panel);
  border-radius: 20px;
  padding: 8px 14px;
  white-space: nowrap;
}

.balance__label {
  color: var(--muted);
  font-size: 12px;
}

.balance strong {
  font-size: 15px;
}

.balance__currency {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.bets-feed {
  background: var(--panel);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
}

.tabs__btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.tabs__btn.is-active {
  background: var(--panel-2);
  color: var(--text);
}

.feed-head,
.feed-list li {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.feed-head {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.feed-list li {
  border-bottom: 1px solid rgba(44, 46, 49, 0.6);
  color: #d8d9db;
}

.feed-list .win {
  color: var(--green);
  font-weight: 700;
}

.flight {
  position: relative;
  background: #0b1630 url("../assets/city-bg.jpg?v=night") center / cover no-repeat;
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
}

#flightCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.flight__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  gap: 6px;
}

.flight__status {
  margin: 0;
  color: #f2f4f7;
  font-size: 14px;
  font-weight: 600;
  min-height: 1.2em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.flight__multi {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.55),
    0 0 2px rgba(0, 0, 0, 0.8);
}

.flight__multi.is-crash {
  color: var(--red);
}

.flight__wait {
  width: min(220px, 50vw);
  margin: 10px auto 0;
}

.flight__wait-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.flight__wait-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
}

.bet-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.bet-panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 10px;
}

.bet-panel__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.bet-panel__tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.bet-panel__tab.is-active {
  background: #2a2c2e;
  color: #fff;
}

.bet-panel__body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.stake {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  background: #141516;
  border-radius: 30px;
  overflow: hidden;
  height: 44px;
}

.stake__btn {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.stake__input {
  border: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.stake__input::-webkit-outer-spin-button,
.stake__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.quick {
  display: flex;
  gap: 6px;
  grid-column: 1;
}

.quick button {
  flex: 1;
  border: 0;
  background: #141516;
  color: var(--muted);
  border-radius: 16px;
  padding: 7px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.auto-row {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.auto-row[hidden] {
  display: none !important;
}

.auto-row input[type="number"] {
  width: 72px;
  border: 0;
  border-radius: 8px;
  background: #141516;
  color: #fff;
  padding: 6px 8px;
  text-align: center;
}

.bet-action {
  grid-row: 1 / span 3;
  align-self: stretch;
  min-width: 140px;
  border: 0;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  padding: 12px 18px;
  line-height: 1.15;
  transition: background 0.15s ease, transform 0.1s ease;
}

.bet-action:hover {
  background: var(--green-dark);
}

.bet-action:active {
  transform: scale(0.98);
}

.bet-action.is-cancel {
  background: #3a3c3e;
}

.bet-action.is-cashout {
  background: var(--orange);
}

.bet-action.is-cashout:hover {
  background: var(--orange-hot);
}

.bet-action small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
  .loader__image {
    animation: none;
  }
}

/* Customer login gate */
.customer-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(8, 10, 14, 0.92), rgba(14, 14, 14, 0.88)),
    url("../assets/city-bg.jpg?v=night") center / cover no-repeat;
  padding: 20px;
}

.customer-gate[hidden],
.customer-gate__form label[hidden],
.customer-otp[hidden],
[hidden] {
  display: none !important;
}

.customer-gate__card {
  width: min(400px, 100%);
  max-width: 100%;
  background: #121416;
  border: 1px solid #24272b;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.customer-gate__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.customer-gate__brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.customer-gate__brand h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.customer-gate__brand span {
  color: var(--red);
}

.customer-gate__sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.customer-gate__form {
  display: grid;
  gap: 12px;
}

.customer-gate__form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #c5c6c8;
}

.customer-gate__form input {
  width: 100%;
  border: 1px solid #2a2d31;
  border-radius: 10px;
  background: #0c0d0f;
  color: #fff;
  padding: 11px 12px;
  outline: none;
}

.customer-gate__form input:focus {
  border-color: var(--red);
}

.customer-gate__btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--green);
  color: #fff;
}

.customer-gate__btn:hover {
  background: var(--green-dark);
}

.customer-gate__btn--ghost {
  background: transparent;
  border: 1px solid #2a2d31;
  color: #c5c6c8;
}

.customer-gate__btn--ghost:hover {
  border-color: #3a3d42;
  color: #fff;
  background: #1a1c1f;
}

.customer-gate__link {
  border: 0;
  background: transparent;
  color: #8b8e93;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.customer-gate__link:hover {
  color: #fff;
}

.customer-otp {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #2a2d31;
  background: #0c0d0f;
}

.customer-otp[hidden] {
  display: none;
}

.customer-otp__hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  min-height: 1.2em;
}

.customer-gate__error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 1.2em;
  margin: 0;
}

.customer-gate__hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: 6px;
  padding: 0;
  border-radius: 50%;
  background: #15171a;
  border: 1px solid #2a2d31;
  color: #c5c6c8;
  cursor: pointer;
}

.profile-btn:hover {
  border-color: #3a3d42;
  background: #1a1c1f;
  color: #fff;
}

.profile-btn__icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.money-sheet {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 16px;
}

.money-sheet[hidden] {
  display: none !important;
}

.money-sheet__panel {
  width: min(420px, 100%);
  background: #121416;
  border: 1px solid #24272b;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.money-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.money-sheet__head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.money-sheet__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.money-sheet__close {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #2a2d31;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.money-sheet__form {
  display: grid;
  gap: 12px;
}

.money-sheet__form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #c5c6c8;
}

.money-sheet__form input {
  width: 100%;
  border: 1px solid #2a2d31;
  border-radius: 10px;
  background: #0c0d0f;
  color: #fff;
  padding: 14px 12px;
  font-size: 1.15rem;
  font-weight: 700;
  outline: none;
}

.money-sheet__form input:focus,
.money-sheet__form select:focus {
  border-color: var(--green);
}

.money-sheet__form select {
  width: 100%;
  border: 1px solid #2a2d31;
  border-radius: 10px;
  background: #0c0d0f;
  color: #fff;
  padding: 14px 12px;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

#withdrawSheet .money-sheet__form input:focus,
#withdrawSheet .money-sheet__form select:focus {
  border-color: var(--orange);
}

#withdrawSheet .money-sheet__quick button:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.money-sheet__quick {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.money-sheet__quick button {
  border: 1px solid #2a2d31;
  border-radius: 10px;
  background: #1a1c1f;
  color: #fff;
  padding: 10px 6px;
  font-weight: 700;
  cursor: pointer;
}

.money-sheet__quick button:hover {
  border-color: var(--green);
  color: var(--green);
}

.money-sheet__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}

.money-sheet__hint.is-wait {
  color: #fbbf24;
}

.money-sheet__hint.is-ok {
  color: #22c55e;
}

.money-sheet__error {
  margin: 0;
  min-height: 1.2em;
  color: #ff6b6b;
  font-size: 13px;
}

.money-sheet__submit {
  border: 0;
  border-radius: 10px;
  padding: 14px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.money-sheet__submit:hover {
  background: var(--green-dark);
}

.money-sheet__submit--withdraw {
  background: var(--orange);
}

.money-sheet__submit--withdraw:hover {
  background: var(--orange-hot);
}

.account-sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 16px;
}

.account-sheet[hidden] {
  display: none !important;
}

.account-sheet__panel {
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  background: #121416;
  border: 1px solid #24272b;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.account-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.account-sheet__head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.account-sheet__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-sheet__close {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #2a2d31;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.account-username {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0c0d0f;
  border: 1px solid #2a2d31;
}

.account-username label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-username__row {
  display: flex;
  gap: 8px;
}

.account-username__row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #2a2d31;
  border-radius: 10px;
  background: #15171a;
  color: #fff;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
}

.account-username__row input:focus {
  outline: 1px solid #e11d48;
  border-color: #e11d48;
}

.account-username__save {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: #e11d48;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.account-username__save:hover {
  filter: brightness(1.08);
}

.account-username__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.account-username__msg {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  min-height: 1.2em;
}

.account-username__msg.is-ok {
  color: #22c55e;
}

.account-username__msg.is-error {
  color: #f87171;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.account-stat {
  background: #0c0d0f;
  border: 1px solid #24272b;
  border-radius: 12px;
  padding: 12px;
}

.account-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.account-stat strong {
  font-size: 1rem;
}

.account-stat strong.is-up {
  color: var(--green);
}

.account-stat strong.is-down {
  color: var(--red);
}

.account-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.account-cols h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #24272b;
  border-radius: 12px;
  background: #0c0d0f;
}

.account-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #1c1e22;
  font-size: 13px;
}

.account-list li:last-child {
  border-bottom: 0;
}

.account-list .meta {
  color: var(--muted);
  font-size: 11px;
}

.account-list .amt {
  font-weight: 700;
  white-space: nowrap;
}

.account-list .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-list .tag.pending {
  background: #3a2a10;
  color: #f0b24a;
}

.account-list .tag.paid {
  background: #123018;
  color: #4cdd6a;
}

.account-list .tag.rejected {
  background: #3a1418;
  color: #ff7b7b;
}

.account-list .empty {
  color: var(--muted);
  justify-content: center;
  padding: 18px;
}

/* Mobile overrides must stay at end so they win over base rules */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100dvh;
    max-height: none;
    min-width: 0;
    overflow: visible;
    padding: 4px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    gap: 4px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(200px, 42vh) auto minmax(260px, 38vh);
  }

  .app > .topbar,
  .app > .flight,
  .app > .bet-panels,
  .app > .bets-feed {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-height: 0;
    flex-shrink: 0;
  }

  .topbar__brand {
    min-width: 0;
    flex-wrap: wrap;
  }

  .topbar__name {
    font-size: 14px;
  }

  .online-pill {
    margin-left: 4px;
    padding: 3px 8px;
    font-size: 10px;
  }

  .history {
    width: 100%;
    padding: 0;
  }

  .balance {
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 12px;
    white-space: normal;
  }

  .balance__label {
    display: none;
  }

  .balance strong {
    font-size: 13px;
    margin-right: auto;
  }

  .profile-btn {
    width: 30px;
    height: 30px;
    margin-right: 2px;
  }

  .deposit-btn,
  .withdraw-btn,
  .logout-btn,
  .admin-top-btn {
    margin-left: 0;
    padding: 6px 9px;
    font-size: 11px;
  }

  .app > .topbar {
    grid-column: 1;
    grid-row: 1;
  }

  .app > .flight {
    grid-column: 1;
    grid-row: 2;
    min-height: 180px;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
  }

  .app > .bet-panels {
    grid-column: 1;
    grid-row: 3;
    overflow: hidden;
  }

  .app > .bets-feed {
    grid-column: 1;
    grid-row: 4;
    max-height: none;
    min-height: 260px;
    height: 38vh;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .bets-feed .tabs,
  .bets-feed .feed-head {
    flex-shrink: 0;
  }

  .bets-feed .feed-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .flight__multi {
    font-size: clamp(2.2rem, 12vw, 3.6rem);
  }

  .flight__status {
    font-size: 12px;
    padding: 0 10px;
  }

  .bet-panels {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px;
  }

  .bet-panel {
    padding: 6px;
    border-radius: 10px;
    min-width: 0;
  }

  .bet-panel__tabs {
    margin-bottom: 6px;
  }

  .bet-panel__tab {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* Stake left, Bet button right (sideways) */
  .bet-panel__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(84px, 36%);
    grid-template-rows: auto auto auto;
    gap: 5px;
    align-items: stretch;
  }

  .stake {
    grid-column: 1;
    grid-row: 1;
    height: 36px;
    grid-template-columns: 32px 1fr 32px;
  }

  .quick {
    grid-column: 1;
    grid-row: 2;
    gap: 3px;
  }

  .auto-row {
    grid-column: 1;
    grid-row: 3;
    font-size: 10px;
    gap: 4px;
  }

  .bet-action {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: 100%;
    font-size: 14px;
    padding: 8px 4px;
    border-radius: 12px;
  }

  .stake__btn {
    font-size: 18px;
  }

  .quick button {
    padding: 5px 0;
    font-size: 10px;
    border-radius: 10px;
  }

  .bet-action small {
    font-size: 10px;
  }

  .auto-row input[type="number"] {
    width: 52px;
    font-size: 14px;
    padding: 4px;
  }

  .customer-gate {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    place-items: unset;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .customer-gate[hidden] {
    display: none !important;
  }

  .customer-gate__card {
    width: 100%;
    max-width: 400px;
    flex: 0 0 auto;
    margin: auto 0;
    padding: 20px 16px;
    border-radius: 16px;
  }

  .customer-gate__form input,
  .money-sheet__form input,
  .money-sheet__form select,
  .account-username__row input,
  .stake__input {
    font-size: 16px;
  }

  .money-sheet,
  .account-sheet {
    place-items: end stretch;
    padding: 0;
  }

  .money-sheet__panel,
  .account-sheet__panel {
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: min(92dvh, 920px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  }

  .money-sheet__quick {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .money-sheet__quick button {
    padding: 8px 4px;
    font-size: 12px;
  }

  .account-stats,
  .account-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 3px;
    gap: 3px;
  }

  .topbar__logo {
    width: 28px;
    height: 28px;
  }

  .topbar__logo img {
    width: 24px;
  }

  .app > .bets-feed {
    min-height: 240px;
    height: 36vh;
  }

  .feed-head,
  .feed-list li {
    padding: 4px 6px;
    font-size: 10px;
    gap: 3px;
  }

  .bet-panels {
    gap: 3px;
  }

  .bet-panel {
    padding: 5px;
  }

  .bet-panel__body {
    grid-template-columns: minmax(0, 1fr) minmax(70px, 36%);
    gap: 4px;
  }

  .bet-action {
    font-size: 12px;
    padding: 6px 3px;
    border-radius: 10px;
  }

  .balance strong {
    font-size: 12px;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .deposit-btn,
  .withdraw-btn,
  .logout-btn {
    padding: 5px 7px;
    font-size: 10px;
  }

  .customer-gate__brand h2 {
    font-size: 1.2rem;
  }

  .customer-gate__sub,
  .customer-gate__hint {
    font-size: 12px;
  }

  .account-stats,
  .account-cols {
    grid-template-columns: 1fr;
  }

  .account-username__row {
    flex-wrap: wrap;
  }

  .account-username__save {
    width: 100%;
  }
}
