.vip-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.tier-0 { background: rgba(148, 163, 184, 0.15); color: var(--hint); }
.tier-1 { background: rgba(245, 158, 11, 0.15); color: var(--gold); border: 1px solid var(--gold); }
.tier-2 { background: rgba(82, 136, 193, 0.15); color: var(--accent); border: 1px solid var(--accent); }
.tier-3 { background: rgba(168, 85, 247, 0.2); color: var(--purple); border: 1px solid var(--purple); }

.steam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.steam-slot {
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; padding: 12px; position: relative; display: flex;
  flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
  gap: 4px; transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  min-height: 85px;
}
.steam-slot:active, .steam-slot.selected {
  border-color: var(--accent); background: rgba(82, 136, 193, 0.15); transform: scale(0.96);
}
.steam-slot.rare { border-bottom: 3px solid var(--gold); }
.steam-slot.mythical { border-bottom: 3px solid var(--purple); }
.steam-slot.uncommon { border-bottom: 3px solid #10b981; }

.steam-icon { font-size: 32px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.steam-slot-title { font-size: 12px; font-weight: 700; color: var(--text); text-align: center; }
.steam-badge {
  position: absolute; top: 6px; right: 8px; font-size: 11px;
  font-weight: 800; color: #fff; background: rgba(0, 0, 0, 0.65);
  padding: 2px 6px; border-radius: 8px;
}

.item-preview {
  margin-top: 12px; padding: 12px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 6px;
  animation: tabFadeIn 0.18s ease;
}

.chat-slot-card {
  background: rgba(0, 0, 0, 0.2); border-radius: 12px; padding: 12px; margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.chat-slot-card.locked { opacity: 0.5; background: rgba(0, 0, 0, 0.1); border-style: dashed; }
.chat-slot-card.matched-pulse {
  border-color: var(--success) !important;
  animation: matchGlow 1.2s ease-in-out infinite alternate;
}

@keyframes matchGlow {
  from { border-color: rgba(34, 197, 94, 0.4); }
  to { border-color: rgba(34, 197, 94, 0.95); }
}

.chat-slot-head { display: flex; justify-content: space-between; align-items: center; }

.slot-custom-panel {
  margin-top: 10px; padding: 10px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 8px;
}

/* Оформление отключённых полей без блокировки событий браузера */
select:disabled, input:disabled {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  border: 1px dashed rgba(255, 255, 255, 0.2) !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

select:not(:disabled), input:not(:disabled) {
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: text !important;
}

.toggle-switch input:disabled + .slider {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.search-drawer {
  display: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.search-drawer.open {
  display: block;
  animation: drawerSlideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawerSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.chat-messages-container {
  height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 8px; background: rgba(0, 0, 0, 0.3); border-radius: 12px; margin-bottom: 8px;
  overscroll-behavior: contain;
}
.chat-bubble {
  max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; word-break: break-word;
}
.chat-bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 2px; }
.chat-bubble.partner { align-self: flex-start; background: rgba(255, 255, 255, 0.1); color: var(--text); border-bottom-left-radius: 2px; }
.chat-bubble.spectator-a { align-self: flex-start; background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f6; border-bottom-left-radius: 2px; }
.chat-bubble.spectator-b { align-self: flex-end; background: #3b2d54; color: #d8b4fe; border: 1px solid #a855f7; border-bottom-right-radius: 2px; }
.chat-bubble.system {
  align-self: center; background: rgba(255, 255, 255, 0.08); color: var(--hint);
  font-size: 11px; text-align: center; border-radius: 8px; padding: 4px 10px;
}
.chat-img-thumb {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  margin-top: 4px;
  display: block;
  object-fit: contain;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.84);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000 !important;
  padding: 16px;
  animation: tabFadeIn 0.15s ease-out;
  touch-action: pan-y;
}
.modal-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 330px;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: tabFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.gift-item-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px; background: rgba(0, 0, 0, 0.2); border-radius: 10px; margin-bottom: 8px;
}

.subtab-bar {
  display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 8px;
}
.subtab-btn {
  background: rgba(255, 255, 255, 0.05); border: none; color: var(--hint);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; flex: 1;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
}
.subtab-btn:active { transform: scale(0.96); }
.subtab-btn.active { background: var(--accent); color: var(--accent-text); }
.subtab-content { display: none; }
.subtab-content.active { display: block; animation: tabFadeIn 0.18s ease; }

.spectator-chat-card {
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 12px; margin-bottom: 10px;
}

.spectator-hud {
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 8px 12px; margin-bottom: 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.hud-user {
  display: flex; flex-direction: column; font-size: 11px; line-height: 1.35;
  padding: 4px; border-radius: 8px; cursor: pointer; transition: background-color 0.15s ease;
}
.hud-user:active { background: rgba(255, 255, 255, 0.08); }
.hud-user.left { text-align: left; }
.hud-user.right { text-align: right; }
.hud-center {
  text-align: center; font-size: 11px; font-weight: 800; color: var(--accent);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--accent);
  padding: 4px 8px; border-radius: 8px;
}

.field-group { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.field-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.field-title { font-size: 13px; font-weight: 600; }
.req-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.req-badge.locked { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.req-badge.unlocked { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

select, input[type="text"], input[type="number"], input[type="range"] {
  width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px; color: var(--text); padding: 9px; font-size: 13px; outline: none;
}

.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-switch { position: relative; width: 44px; height: 24px; min-width: 44px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2); transition: background-color 0.2s ease; border-radius: 24px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; transition: transform 0.2s ease; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

.main-btn {
  width: 100%; background: var(--accent); color: var(--accent-text); border: none;
  border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px;
  display: flex; justify-content: center; align-items: center; gap: 6px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.main-btn:active { transform: scale(0.98); opacity: 0.9; }
.main-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.mini-btn {
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--accent);
  color: var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
}
.mini-btn:active { transform: scale(0.95); }
.mini-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.wheel-wrap { position: relative; width: 290px; height: 290px; margin: 16px auto; }
#wheel-canvas { width: 100%; height: 100%; border-radius: 50%; will-change: transform; }
.wheel-arrow {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 12px solid transparent;
  border-right: 12px solid transparent; border-top: 22px solid var(--accent); z-index: 10;
}

.wheel-toast {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate3d(-50%, 24px, 0);
  background: #141418;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.wheel-toast.show {
  transform: translate3d(-50%, 0, 0);
  opacity: 1;
}

.room-lobby-card {
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex;
  justify-content: space-between; align-items: center;
}
.room-lobby-card.my-room {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.admin-list-item {
  padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2);
  margin-bottom: 6px; font-size: 13px; display: flex; justify-content: space-between; align-items: center;
}

.ban-overlay-card {
  background: rgba(239, 68, 68, 0.15); border: 2px solid var(--danger);
  border-radius: 16px; padding: 16px; margin-bottom: 14px; text-align: center;
}

.shop-token-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.shop-token-card {
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 10px; text-align: center; display: flex;
  flex-direction: column; justify-content: space-between; gap: 6px;
}
.shop-vip-card {
  background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 12px;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
}
.discount-badge {
  background: rgba(34, 197, 94, 0.2); color: #4ade80;
  border: 1px solid #22c55e; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px; display: inline-block;
}
.old-price { text-decoration: line-through; opacity: 0.5; font-size: 11px; margin-right: 4px; }

.shop-dur-tabs .subtab-btn {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, color 0.18s ease;
}
.shop-dur-tabs .subtab-btn.active {
  transform: scale(1.03);
}

.price-anim {
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
}
.price-anim.updating {
  transform: scale(0.85) translateY(-3px);
  opacity: 0.3;
}

.media-fullscreen-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: tabFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: env(safe-area-inset-top, 16px) 16px env(safe-area-inset-bottom, 16px) 16px;
}

.media-fullscreen-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.media-fullscreen-close:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.35);
}

.media-fullscreen-content {
  max-width: 100vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}

.chat-bubble.gift-banner {
  align-self: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(168, 85, 247, 0.22));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border-radius: 12px;
  padding: 8px 14px;
  margin: 4px auto;
  max-width: 90%;
  animation: tabFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* iOS Luxury */
.layout-luxury .luxury-widgets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.layout-luxury .luxury-widget-card {
  background: var(--card-bg);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 72px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.layout-luxury .luxury-widget-card:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.05);
}

.layout-luxury .luxury-widget-card.highlight {
  border-color: rgba(168, 85, 247, 0.45);
}

.layout-luxury .widget-icon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.layout-luxury .widget-icon-badge {
  font-size: 20px;
  line-height: 1;
}

.layout-luxury .widget-title {
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text);
}

.layout-luxury .widget-subtitle {
  font-size: 11px;
  color: var(--hint);
  margin-top: 2px;
}

.layout-luxury .luxury-vip-hud {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.15), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.layout-luxury .luxury-vip-hud:active {
  transform: scale(0.98);
}

.layout-luxury .tab-bar {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transform: translateZ(0);
  will-change: transform;
  z-index: 200;
}

.layout-luxury .tab-btn {
  border-radius: 18px;
  padding: 6px 0;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
}

.layout-luxury .tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.layout-luxury .tab-btn:active {
  transform: scale(0.9);
}

.layout-luxury .chat-slot-card {
  background: var(--card-bg);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  margin-bottom: 10px;
  transition: transform 0.12s ease;
}

.layout-luxury .chat-slot-card:active {
  transform: scale(0.985);
}

.layout-luxury .modal-overlay {
  align-items: flex-end;
  padding: 0;
}

.layout-luxury .modal-card {
  max-width: 100%;
  border-radius: 24px 24px 0 0;
  border-bottom: none;
  animation: slideUpSheet 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
  touch-action: pan-y;
}

.sheet-drag-handle {
  width: 100%;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  margin-bottom: 6px;
}

.sheet-drag-handle::before {
  content: "";
  display: block;
  width: 42px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  transition: background-color 0.15s ease;
}

.sheet-drag-handle:active::before {
  background: rgba(255, 255, 255, 0.5);
}

.layout-luxury .modal-card::before {
  display: none !important;
}

@keyframes slideUpSheet {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.layout-classic .luxury-only,
.layout-classic .sheet-drag-handle {
  display: none !important;
}

.layout-luxury .classic-only {
  display: none !important;
}

/* ========================================================
   УНИВЕРСАЛЬНЫЙ АВТО-СЕЛЕКТ (CUSTOM SELECT)
   ======================================================== */
.custom-select-wrap,
.custom-select-container {
  position: relative;
  width: 100%;
  margin-top: 4px;
}

.custom-select-trigger {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.custom-select-trigger:active {
  background: rgba(255, 255, 255, 0.06);
}

.custom-select-wrap.open .custom-select-trigger,
.custom-select-container.open .custom-select-trigger {
  border-color: var(--accent);
}

.custom-select-arrow {
  font-size: 10px;
  color: var(--hint);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-wrap.open .custom-select-arrow,
.custom-select-container.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  bottom: auto;
  left: 0;
  right: 0;
  background: #18181d;
  border: 1px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding: 6px;
  gap: 3px;
  box-sizing: border-box;
}

.custom-select-wrap.dropdown-down .custom-select-dropdown {
  bottom: auto;
  top: calc(100% + 6px);
}

.custom-select-wrap.drop-up .custom-select-dropdown,
.custom-select-container.drop-up .custom-select-dropdown {
  top: auto;
  bottom: calc(100% + 6px);
}

.custom-select-wrap.open .custom-select-dropdown,
.custom-select-container.open .custom-select-dropdown {
  display: flex;
  animation: tabFadeIn 0.14s ease-out;
}

.custom-select-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  min-height: 38px;
  box-sizing: border-box;
  transition: background-color 0.12s ease;
}

.custom-select-option:active {
  background: rgba(255, 255, 255, 0.08);
}

.custom-select-option.selected {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  font-weight: 700;
}

.custom-select-container.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ==========================================================
   Кастомный минималистичный плеер медиа (Fullscreen)
   ========================================================== */
#media-fullscreen-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#media-fullscreen-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.custom-video-element {
  max-width: 100vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
}

.custom-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.custom-video-overlay.playing {
  opacity: 0;
}

.custom-play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-video-controls {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  padding: 10px 16px;
  background: rgba(18, 18, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  transition: opacity 0.25s ease;
}

.custom-video-controls.fade-out {
  opacity: 0;
  pointer-events: none;
}

.custom-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.custom-progress-container {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.custom-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.custom-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent, #6366f1);
  border-radius: 2px;
}

.custom-video-time {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

.currency-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.curr-icon {
  font-size: 13px;
  line-height: 1;
  opacity: 0.9;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.curr-token-svg {
  width: 15px;
  height: 15px;
  opacity: 0.4;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.currency-toggle-wrapper.active-tokens .curr-token-svg {
  opacity: 1;
  transform: scale(1.15);
}
.currency-toggle-wrapper.active-tokens .curr-stars {
  opacity: 0.4;
  transform: scale(0.9);
}

.currency-toggle-wrapper:not(.active-tokens) .curr-stars {
  opacity: 1;
  transform: scale(1.15);
}

.shop-dur-tabs {
  transition: opacity 0.2s ease;
}

.shop-currency-switch {
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.shop-currency-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 68px;
  height: 30px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 0 7px;
  position: relative;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.switch-icon {
  font-size: 13px;
  line-height: 1;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.switch-icon.stars {
  opacity: 1;
  transform: scale(1.1);
}

.switch-icon.tokens {
  opacity: 0.4;
  transform: scale(0.9);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 22px;
  height: 22px;
  background: var(--gold);
  border-radius: 50%;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  pointer-events: none;
}

.shop-currency-switch input:checked + .switch-track {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

.shop-currency-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(36px);
}

.shop-currency-switch input:checked + .switch-track .switch-icon.stars {
  opacity: 0.4;
  transform: scale(0.9);
}

.shop-currency-switch input:checked + .switch-track .switch-icon.tokens {
  opacity: 1;
  transform: scale(1.15);
}

.quest-item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.quest-item-card.completed {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.12);
}

.quest-item-card.claimed {
  opacity: 0.5;
}

.quest-info {
  flex: 1;
}

.quest-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text);
}

.quest-desc {
  font-size: 11px;
  color: var(--hint);
  line-height: 1.3;
  margin-bottom: 6px;
}

.quest-progress-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.quest-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.25s ease;
}

.quest-action-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 80px;
}

.streak-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background-color 0.18s ease;
}
.streak-dot.active {
  background: var(--accent);
}

.ref-card {
  margin: 16px 0;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ref-header {
  margin-bottom: 14px;
}

.ref-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-icon-badge {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.05);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.ref-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.ref-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.ref-perks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.ref-perk-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px;
  border-radius: 12px;
}

.ref-perk-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.ref-perk-val {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ref-perk-sub {
  font-size: 11px;
  font-weight: 500;
  color: #4cd964;
  margin-left: 2px;
}

.ref-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.ref-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ref-stat-num {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.ref-stat-num.highlight {
  color: #ffb800;
}

.ref-stat-name {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.ref-action-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-link-input-wrap {
  display: flex;
  gap: 8px;
}

.ref-link-input-wrap input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  outline: none;
  font-family: monospace;
}

.ref-btn-copy {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.ref-btn-copy:active {
  background: rgba(255, 255, 255, 0.2);
}

.ref-btn-share {
  background: linear-gradient(135deg, #0088cc, #0077b5);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ref-btn-share:active {
  opacity: 0.85;
}

.token-svg {
  display: inline-block;
  vertical-align: middle;
}

/* ========================================================
   ПОЛНОЭКРАННЫЙ ЧАТ: АККУРАТНАЯ СЕТКА 2x2 И СТИЛИ КНОПОК
   ======================================================== */

body.in-chat-room {
  overflow: hidden !important;
}

body.in-chat-room #chats-subtabs-nav {
  display: none !important;
}

body.in-chat-room #chats-room-view {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  /* noinspection CssOverwrittenProperties */
  height: 100dvh !important;
  z-index: 990 !important;
  background: var(--bg) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: calc(env(safe-area-inset-top, 8px) + 6px) 12px calc(env(safe-area-inset-bottom, 8px) + 6px) 12px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

#report-modal,
#gift-modal {
  z-index: 20000 !important;
}

#chats-room-view .room-header,
#chats-room-view > div:first-child {
  flex-shrink: 0 !important;
  margin-bottom: 8px !important;
}

#chats-room-view #reveal-buttons-box {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
  flex-shrink: 0 !important;
}

#chats-room-view #reveal-buttons-box .mini-btn {
  width: 100% !important;
  text-align: center !important;
  padding: 8px 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease !important;
}

#chats-room-view #reveal-buttons-box .mini-btn.btn-pressed,
#chats-room-view #reveal-buttons-box .mini-btn:disabled {
  opacity: 0.45 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--hint) !important;
  cursor: default !important;
  box-shadow: none !important;
  transform: none !important;
}

#chats-room-view #room-messages-box {
  flex: 1 1 auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: rgba(0, 0, 0, 0.25) !important;
  border-radius: 12px !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
  -webkit-overflow-scrolling: touch !important;
}

#chats-room-view #room-input-container {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

#chats-room-view #reveal-buttons-box .mini-btn.btn-18-accepted {
  background: rgba(34, 197, 94, 0.12) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #4ade80 !important;
  opacity: 0.85 !important;
}