/* ANAPACASINO cabinet + login — gmnt palette A */
:root {
  --cab-magenta: #de27d7;
  --cab-magenta-deep: #772574;
  --cab-surface: #360b39;
  --cab-surface-2: #4a0f4e;
  --cab-bg: #270326;
  --cab-play: #93d394;
  --cab-play-deep: #18a11b;
  --cab-tg: #229ed9;
  --cab-text: #f8eef9;
  --cab-muted: #d4b8d8;
  --cab-line: rgba(255, 255, 255, 0.08);
}

/* ---------- Logged-in bar under the header ---------- */
.anapa-cab-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px max(12px, env(safe-area-inset-left)) 8px max(12px, env(safe-area-inset-right));
  background: linear-gradient(90deg, rgba(222, 39, 215, 0.22), rgba(119, 37, 116, 0.18));
  border-bottom: 1px solid rgba(222, 39, 215, 0.25);
  color: var(--cab-text);
}

.anapa-cab-bar__me {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.anapa-cab-bar__me:hover {
  background: rgba(255, 255, 255, 0.06);
}

.anapa-cab-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--cab-magenta), var(--cab-magenta-deep));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.anapa-cab-bar__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.anapa-cab-bar__name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anapa-cab-bar__balance {
  font-size: 13px;
  font-weight: 700;
  color: #b9f5bb;
}

.anapa-cab-bar__chev {
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
  opacity: 0.5;
}

.anapa-cab-bar__topup {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #062006;
  background: linear-gradient(180deg, var(--cab-play), var(--cab-play-deep));
  box-shadow: 0 6px 16px rgba(24, 161, 27, 0.3);
  cursor: pointer;
}

/* ---------- Sheet (bottom on phones, centered on desktop) ---------- */
html.anapa-sheet-open,
html.anapa-sheet-open body {
  overflow: hidden !important;
}

.anapa-sheet,
.anapa-login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 2, 16, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: anapa-fade 0.18s ease-out;
}

.anapa-login-backdrop[hidden] {
  display: none !important;
}

.anapa-sheet__panel,
.anapa-login-modal {
  position: relative;
  width: min(440px, 100%);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: linear-gradient(170deg, var(--cab-surface-2), var(--cab-bg) 70%);
  border: 1px solid rgba(222, 39, 215, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color: var(--cab-text);
  font-family: inherit;
  animation: anapa-pop 0.2s ease-out;
}

.anapa-sheet__handle {
  display: none;
  width: 40px;
  height: 4px;
  margin: -6px auto 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
}

.anapa-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.anapa-sheet__head h2,
.anapa-login-modal h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.anapa-sheet__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--cab-text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.anapa-login-modal .anapa-sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.anapa-sheet__label {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cab-muted);
}

.anapa-sheet__hint {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cab-muted);
  text-align: center;
}

.anapa-sheet__btn {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.anapa-sheet__btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.anapa-sheet__btn--play {
  color: #062006;
  background: linear-gradient(180deg, var(--cab-play), var(--cab-play-deep));
}

.anapa-sheet__btn--tg {
  color: #fff;
  background: linear-gradient(180deg, #3bb2ec, var(--cab-tg));
}

.anapa-sheet__btn--ghost {
  color: var(--cab-muted);
  background: transparent;
  border: 1px solid var(--cab-line);
  font-weight: 700;
  font-size: 14px;
  min-height: 44px;
}

/* ---------- Top-up ---------- */
.anapa-topup__balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--cab-line);
}

.anapa-topup__balance span {
  color: var(--cab-muted);
  font-size: 14px;
}

.anapa-topup__balance b {
  font-size: 20px;
  color: #b9f5bb;
}

.anapa-topup__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.anapa-topup__amt {
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(147, 211, 148, 0.35);
  background: rgba(147, 211, 148, 0.1);
  color: #e6ffe6;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.anapa-topup__amt:hover,
.anapa-topup__amt:active {
  background: rgba(147, 211, 148, 0.22);
  transform: translateY(-1px);
}

.anapa-topup__custom {
  position: relative;
}

.anapa-topup__input,
.anapa-login-modal input {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 12px 40px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(222, 39, 215, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
}

.anapa-topup__input.is-error {
  border-color: #ff7a9c;
}

.anapa-topup__input:focus,
.anapa-login-modal input:focus {
  outline: none;
  border-color: var(--cab-magenta);
  box-shadow: 0 0 0 3px rgba(222, 39, 215, 0.25);
}

.anapa-topup__cur {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cab-muted);
  font-weight: 700;
}

/* ---------- Cabinet ---------- */
.anapa-cab-card {
  padding: 14px;
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(222, 39, 215, 0.25), transparent 60%),
    rgba(0, 0, 0, 0.22);
  border: 1px solid var(--cab-line);
}

.anapa-cab-card__who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.anapa-cab-card__who b {
  display: block;
  font-size: 16px;
}

.anapa-cab-card__who small {
  color: var(--cab-muted);
  font-size: 13px;
}

.anapa-cab-card__balance {
  margin-top: 14px;
}

.anapa-cab-card__balance small {
  display: block;
  color: var(--cab-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.anapa-cab-card__balance b {
  font-size: 28px;
  font-weight: 800;
  color: #b9f5bb;
}

.anapa-cab-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 0 8px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.anapa-cab-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--cab-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.anapa-cab-tabs button[aria-selected='true'] {
  color: #fff;
  background: rgba(222, 39, 215, 0.35);
}

.anapa-cab-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.anapa-cab-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--cab-line);
  font-size: 14px;
}

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

.anapa-cab-list__main {
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anapa-cab-list__main small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  font-size: 12px;
  color: var(--cab-muted);
}

.anapa-cab-list__plus {
  color: #b9f5bb;
}

.anapa-cab-list__at {
  flex: 0 0 auto;
  font-size: 12px;
  color: #a07fa6;
  text-align: right;
}

.anapa-cab-list__empty {
  margin: 14px 0;
  text-align: center;
  font-size: 14px;
  color: var(--cab-muted);
}

/* ---------- Header login CTA (next to ИГРАТЬ) ---------- */
#anapa-login-btn {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px 0 0;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: none;
  flex-shrink: 0;
}

#anapa-login-btn[hidden] {
  display: none !important;
}

#anapa-login-btn:hover {
  filter: brightness(1.05);
}

/* ---------- Login form ---------- */
.anapa-login-modal p {
  margin: 6px 0 16px;
  font-size: 14px;
  color: var(--cab-muted);
}

.anapa-login-modal label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #e9c4ea;
}

.anapa-login-modal input {
  margin: 0 0 14px;
  padding-right: 14px;
}

.anapa-login-modal .anapa-login-modal__error {
  min-height: 1.2em;
  margin: -4px 0 4px;
  color: #ff9bb5;
  font-size: 14px;
}

.anapa-login-modal .anapa-login-modal__foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}

.anapa-login-modal__foot a {
  color: #7fd0ff;
  font-weight: 700;
  text-decoration: none;
}

.anapa-hide-register {
  display: none !important;
}

@keyframes anapa-fade {
  from {
    opacity: 0;
  }
}

@keyframes anapa-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes anapa-slide-up {
  from {
    transform: translateY(100%);
  }
}

/* Phones: sheets slide up from the bottom, full width */
@media (max-width: 640px) {
  .anapa-sheet,
  .anapa-login-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .anapa-sheet__panel,
  .anapa-login-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
    animation: anapa-slide-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .anapa-sheet__handle {
    display: block;
  }

  .anapa-login-modal .anapa-sheet__close {
    top: 18px;
  }

  .anapa-cab-bar {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .anapa-cab-avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .anapa-cab-bar__chev {
    display: none;
  }

  .anapa-cab-bar__topup {
    padding: 9px 14px;
  }
}
