/* Telegram Mini App — premium dark, soft violet-pink accents, minimal & clean */

:root {
  --bg-void: #060508;
  --bg-deep: #0a0810;
  --bg-elevated: rgba(22, 18, 34, 0.92);
  --bg-card: rgba(24, 19, 38, 0.72);
  --border-subtle: rgba(180, 160, 220, 0.1);
  --text-primary: #f4f0ff;
  --text-secondary: rgba(235, 228, 255, 0.88);
  --text-muted: rgba(200, 188, 230, 0.7);
  --text-faint: rgba(170, 158, 200, 0.5);
  --accent-violet: #c084fc;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text-primary);
  background-color: var(--bg-void);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(139, 92, 246, 0.14), transparent 50%),
    radial-gradient(ellipse 60% 45% at 100% 40%, rgba(236, 72, 153, 0.07), transparent 45%),
    radial-gradient(ellipse 50% 40% at 0% 70%, rgba(99, 102, 241, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 50%, #050308 100%);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ——— Header (Telegram-like) ——— */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: rgba(8, 6, 14, 0.85);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid rgba(180, 160, 220, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.header-left {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(180, 160, 220, 0.18);
  border-radius: 10px;
  background: rgba(28, 22, 42, 0.8);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}

.icon-btn:hover {
  border-color: rgba(192, 132, 252, 0.3);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* ——— Header action buttons ——— */
.header-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(180, 160, 220, 0.14);
  background: rgba(24, 19, 36, 0.8);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  white-space: nowrap;
}

.header-action-btn:hover {
  border-color: rgba(192, 132, 252, 0.28);
}

.header-action-btn:active {
  transform: scale(0.96);
}

.header-action-btn__icon {
  font-size: 0.9rem;
  line-height: 1;
}

.header-action-btn__badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.header-cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

.header-cal-dot--claimed {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.18);
}

.header-action-btn--pulse {
  border-color: rgba(245, 158, 11, 0.32);
}

.header-action-btn--lootbox {
  border-color: rgba(251, 146, 60, 0.2);
  background: rgba(40, 28, 14, 0.7);
}

.header-action-btn--lootbox .header-action-btn__badge {
  color: #fbbf24;
}

.lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(180, 160, 220, 0.14);
  background: rgba(24, 19, 36, 0.8);
  cursor: pointer;
  transition: border-color 0.15s;
}

.lang-picker:hover,
.lang-picker:focus-within {
  border-color: rgba(192, 132, 252, 0.35);
}

.lang-picker__label {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  line-height: 1;
}

.lang-picker__chevron {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.15s;
}

.lang-picker:hover .lang-picker__chevron {
  color: var(--accent-violet);
}

.lang-picker__select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.lang-picker__select option {
  background: #1a1428;
  color: #f4f0ff;
}

/* ——— Main ——— */
.app-main {
  flex: 1;
  padding: 14px 14px calc(22px + var(--safe-bottom));
}

.view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— Catalog tabs ——— */
.catalog-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(22, 18, 34, 0.7);
  border: 1px solid var(--border-subtle);
}

.catalog-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.catalog-tab:hover {
  color: var(--text-secondary);
}

.catalog-tab--active {
  background: rgba(192, 132, 252, 0.14);
  color: var(--accent-violet);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ——— Premium locked state ——— */
.premium-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 64px;
  min-height: 260px;
}

.premium-locked__icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  opacity: 0.7;
}

.premium-locked__title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--text-primary);
}

.premium-locked__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 28em;
}

/* ——— Catalog intro ——— */
.catalog-intro {
  margin-bottom: 18px;
}

.catalog-eyebrow {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.catalog-lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-faint);
  max-width: 36em;
}

/* ——— Catalog grid ——— */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.catalog-grid--loading {
  align-items: stretch;
}

.catalog-skeleton-card {
  position: relative;
  border-radius: var(--radius-lg);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(20, 16, 32, 0.9);
  border: 1px solid var(--border-subtle);
}

.catalog-skeleton-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.03) 55%, transparent 100%);
  background-size: 200% 100%;
  animation: catalogShine 1.4s ease-in-out infinite;
}

.catalog-skeleton-card__lines {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

@keyframes catalogShine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 18px 40px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(180, 160, 220, 0.15);
  background: rgba(18, 14, 30, 0.4);
}

.catalog-empty__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.catalog-empty__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-faint);
  max-width: 28em;
  margin-inline: auto;
}

/* ——— Character cards ——— */
.character-card {
  position: relative;
  border: 1px solid rgba(180, 160, 220, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-deep);
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.character-card__glow,
.character-card__accent {
  display: none;
}

.character-card:hover,
.character-card:focus-visible {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  outline: none;
}

.character-card:active {
  transform: scale(1.01);
}

.character-card__image-wrap {
  position: relative;
  z-index: 2;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(160deg, #1a1428, #0d0a14);
  border-radius: inherit;
}

.character-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  max-width: calc(100% - 20px);
  padding: 3px 9px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.character-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.character-card__image--placeholder {
  background: linear-gradient(155deg, rgba(80, 60, 120, 0.2), rgba(26, 20, 42, 0.95));
}

.character-card:hover .character-card__image:not(.character-card__image--placeholder) {
  transform: scale(1.04);
}

.character-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(6, 4, 10, 0.55) 60%, rgba(4, 3, 8, 0.92) 100%);
  pointer-events: none;
}

.character-card__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 10px 12px 12px;
}

.character-card__name {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.character-card__desc {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  font-weight: 450;
  color: rgba(240, 236, 255, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.character-card__stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(230, 224, 248, 0.6);
}

/* ——— Badge variants ——— */
.character-card__badge--new { background: rgba(244, 114, 182, 0.55); }
.character-card__badge--hot { background: rgba(251, 146, 60, 0.55); }
.character-card__badge--vip { background: rgba(168, 85, 247, 0.55); }
.character-card__badge--text { background: rgba(100, 90, 130, 0.5); }

/* ——— Character page ——— */
.character-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(180, 160, 220, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  aspect-ratio: 4 / 5;
  max-height: min(58vh, 440px);
}

.character-hero--no-image {
  background: linear-gradient(165deg, rgba(50, 38, 80, 0.3), rgba(26, 20, 42, 0.95), rgba(10, 8, 18, 1));
}

.character-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.character-hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 45%, transparent 30%, rgba(4, 3, 8, 0.45) 100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.character-hero-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 5, 10, 0.5) 40%, rgba(5, 4, 9, 0.95) 100%);
  pointer-events: none;
}

.character-body {
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.character-panel {
  padding: 14px 14px 16px;
  border-radius: 16px;
  background: rgba(20, 16, 32, 0.7);
  border: 1px solid rgba(180, 160, 220, 0.1);
}

.character-name {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.character-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ——— Chat button ——— */
.btn-chat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(145deg, #a855f7, #c026d3 50%, #db2777);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.25);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s, filter 0.15s;
}

.btn-chat__glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.25) 0%, transparent 50%);
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.btn-chat__label {
  position: relative;
  z-index: 1;
}

.btn-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
  border-radius: inherit;
}

.btn-chat:hover {
  filter: brightness(1.06);
}

.btn-chat:active {
  transform: scale(0.985);
}

/* ——— Recent chats ——— */
.recent-chats {
  margin-bottom: 16px;
}

.recent-chats__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.recent-chats__list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.recent-chats__list::-webkit-scrollbar {
  display: none;
}

.recent-chat-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
}

.recent-chat-item__avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}

.recent-chat-item__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(192, 132, 252, 0.2);
  transition: border-color 0.15s;
}

.recent-chat-item:hover .recent-chat-item__avatar {
  border-color: rgba(192, 132, 252, 0.45);
}

.recent-chat-item__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(70, 52, 110, 0.4), rgba(26, 20, 42, 0.9));
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
}

.recent-chat-item__online {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bg-void);
}

.recent-chat-item__name {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--text-faint);
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ——— Search ——— */
.search-wrap {
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: rgba(20, 16, 32, 0.7);
  border: 1px solid rgba(180, 160, 220, 0.12);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:focus {
  border-color: rgba(192, 132, 252, 0.35);
}

/* ——— Progress section ——— */
.progress-section {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18, 14, 30, 0.7);
  border: 1px solid rgba(180, 160, 220, 0.08);
}

.progress-level-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-level-name {
  font-size: 0.85rem;
  font-weight: 700;
  transition: color 0.2s;
}

.progress-level-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-faint);
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease, background 0.3s;
  box-shadow: 0 0 10px rgba(200, 170, 80, 0.2);
}

.progress-next {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-faint);
  transition: color 0.2s;
}

/* ——— Gift buttons ——— */
.gifts-section {
  padding: 12px 12px 13px;
  border-radius: 14px;
  background: rgba(18, 14, 30, 0.65);
  border: 1px solid rgba(180, 160, 220, 0.08);
}

.gifts-hint {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #e2c36b;
  opacity: 0.85;
  text-align: center;
}

.gifts-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.gifts-row {
  display: flex;
  gap: 8px;
}

.gift-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(180, 160, 220, 0.12);
  background: rgba(26, 20, 42, 0.65);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.15s, box-shadow 0.15s;
}

.gift-btn:hover {
  transform: scale(1.03);
  border-color: rgba(192, 132, 252, 0.28);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.gift-btn:active {
  transform: scale(0.96);
}

.gift-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(180, 160, 220, 0.06);
  background: rgba(14, 11, 24, 0.5);
  box-shadow: none;
  transform: none;
}

.gift-btn:disabled .gift-btn__icon {
  filter: grayscale(0.5);
}

.gift-btn--sending {
  transform: scale(1.02);
}

.gift-btn__icon {
  font-size: 1.4rem;
  line-height: 1;
}

.gift-btn__pts {
  font-size: 0.66rem;
  font-weight: 600;
  color: rgba(230, 222, 248, 0.75);
}

.gift-btn__count {
  font-size: 0.58rem;
  font-weight: 700;
  min-width: 22px;
  padding: 2px 6px;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(192, 132, 252, 0.18);
  color: #d4c0ff;
  line-height: 1.4;
  text-align: center;
}

.gift-btn:disabled .gift-btn__count {
  background: rgba(100, 90, 130, 0.1);
  color: var(--text-faint);
}

/* ——— Calendar modal ——— */
.calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.calendar-modal:not([hidden]) {
  display: flex;
}

.calendar-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s;
}

.calendar-modal--open .calendar-modal__backdrop {
  opacity: 1;
}

.calendar-modal__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 18px 14px calc(24px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: rgba(14, 11, 26, 0.98);
  border: 1px solid rgba(180, 160, 220, 0.1);
  border-bottom: none;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: none;
}

.calendar-modal__content::-webkit-scrollbar {
  display: none;
}

.calendar-modal--open .calendar-modal__content {
  transform: translateY(0);
}

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

.calendar-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-modal__close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(180, 160, 220, 0.12);
  background: rgba(24, 19, 36, 0.6);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  font: inherit;
  transition: color 0.15s;
}

.calendar-modal__close:hover {
  color: var(--text-primary);
}

.calendar-modal__header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-modal__info-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(180, 160, 220, 0.12);
  background: rgba(24, 19, 36, 0.6);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  font: inherit;
  transition: color 0.15s;
  padding: 0;
  line-height: 1;
}

.calendar-modal__info-btn:hover {
  color: var(--text-primary);
}

/* ——— Calendar info panel ——— */
.calendar-info {
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(22, 18, 36, 0.8);
  border: 1px solid rgba(180, 160, 220, 0.1);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.calendar-info.calendar-info--visible {
  opacity: 1;
  transform: translateY(0);
}

.calendar-info__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}

.calendar-info__icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.calendar-info__text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(235, 228, 255, 0.85);
}

.calendar-modal__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ——— Daily claim ——— */
.cal-claim-bar {
  text-align: center;
  margin-bottom: 6px;
}

.cal-claim-btn {
  display: inline-block;
  padding: 13px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1a0e02;
  cursor: pointer;
  font: inherit;
  transition: transform 0.14s ease, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.cal-claim-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.32);
}

.cal-claim-btn:active {
  transform: scale(0.97);
}

.cal-claim-done {
  display: inline-block;
  padding: 10px 22px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ——— Day grid ——— */
.cal-grid-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 3px 7px;
  border-radius: 12px;
  border: 1px solid rgba(180, 160, 220, 0.12);
  background: rgba(24, 19, 38, 0.7);
  min-height: 64px;
  transition: border-color 0.15s, opacity 0.15s;
}

.cal-day__num {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(245, 241, 255, 0.92);
}

.cal-day__rewards {
  font-size: 0.58rem;
  line-height: 1.3;
  text-align: center;
  color: rgba(220, 210, 240, 0.8);
}

.cal-day--done {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(34, 197, 94, 0.12);
}

.cal-day--done .cal-day__num {
  color: #4ade80;
}

.cal-day--done .cal-day__num::after {
  content: " \2713";
  font-size: 0.6rem;
}

.cal-day--done .cal-day__rewards {
  color: rgba(74, 222, 128, 0.65);
}

.cal-day--current {
  border-color: rgba(192, 132, 252, 0.45);
  background: rgba(168, 85, 247, 0.14);
  box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.15) inset, 0 0 14px rgba(168, 85, 247, 0.2);
}

.cal-day--locked {
  opacity: 0.45;
}

.cal-day--milestone {
  border-width: 2px;
}

.cal-day--milestone:not(.cal-day--locked) {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.05);
}

.cal-day--milestone .cal-day__num {
  color: #facc15;
}

.cal-day--milestone.cal-day--done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
}

.cal-day--milestone.cal-day--done .cal-day__num {
  color: #4ade80;
}

/* ——— Loot box reveal ——— */
.lootbox-reveal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}

.lootbox-reveal:not([hidden]) {
  display: flex;
}

.lootbox-reveal--visible {
  opacity: 1;
}

.lootbox-reveal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.lootbox-reveal__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 160px;
  padding: 28px;
  border-radius: 20px;
  background: rgba(22, 17, 38, 0.94);
  border: 1px solid rgba(251, 146, 60, 0.22);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.lootbox-reveal__box {
  font-size: 4rem;
  line-height: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.lootbox-reveal--opened .lootbox-reveal__box {
  transform: scale(0.8);
  opacity: 0;
}

.lootbox-reveal__result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  animation: lbRevealPop 0.22s ease-out;
}

.lootbox-reveal__emoji {
  font-size: 3.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(251, 146, 60, 0.25));
}

.lootbox-reveal__text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fbbf24;
}

.lootbox-reveal__name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

@keyframes lbRevealPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ——— Rarity glow (subtle) ——— */
.lootbox-reveal__result--common .lootbox-reveal__emoji {
  filter: drop-shadow(0 0 8px rgba(200, 200, 210, 0.2));
}

.lootbox-reveal__result--rare {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.lootbox-reveal__result--rare .lootbox-reveal__emoji {
  filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.4));
}

.lootbox-reveal__result--rare .lootbox-reveal__text {
  color: #60a5fa;
}

.lootbox-reveal__result--epic {
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.3);
}

.lootbox-reveal__result--epic .lootbox-reveal__emoji {
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.5));
}

.lootbox-reveal__result--epic .lootbox-reveal__text {
  color: #c084fc;
}

.lootbox-reveal__result--legendary {
  box-shadow: 0 0 26px rgba(255, 215, 0, 0.3);
}

.lootbox-reveal__result--legendary .lootbox-reveal__emoji {
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.lootbox-reveal__result--legendary .lootbox-reveal__text {
  color: #ffd700;
}

/* ——— Milestone flash (subtle) ——— */
.progress-track--flash {
  animation: progressFlash 0.4s ease-out;
}

@keyframes progressFlash {
  0% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
  30% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.12); }
  100% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
}

.progress-bar--milestone-pop {
  animation: barMilestonePop 0.35s ease;
}

@keyframes barMilestonePop {
  0%, 100% { transform: scaleY(1); }
  40% { transform: scaleY(1.8); }
  70% { transform: scaleY(0.9); }
}

/* ——— Toast ——— */
.toast {
  position: fixed;
  bottom: calc(22px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(24, 19, 40, 0.94);
  border: 1px solid rgba(180, 160, 220, 0.15);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--hide {
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
}

/* ——— RTL (Arabic) ——— */
[dir="rtl"] .character-card {
  text-align: right;
}

[dir="rtl"] .character-card__badge {
  right: auto;
  left: 10px;
}

[dir="rtl"] .recent-chat-item__online {
  right: auto;
  left: 1px;
}

[dir="rtl"] .header-back svg {
  transform: scaleX(-1);
}

[dir="rtl"] .lang-picker {
  direction: ltr;
}

[dir="rtl"] .character-body {
  text-align: right;
}

[dir="rtl"] .search-input {
  text-align: right;
}
