/* AppBar */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--primary-500);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-bar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 2px solid var(--primary-300);
}

.app-bar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-bar__tokens {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-bar__nickname {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-100);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.app-bar__token {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}

.app-bar__token--pe {
  color: var(--special-100);
}

.app-bar__token--pg {
  color: var(--purchase-100);
}

.app-bar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.app-bar__btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.app-bar__btn:active {
  background: rgba(255,255,255,0.15);
  transform: scale(0.92);
}

.app-bar__btn--menu {
  background: var(--primary-300);
  color: #fff;
}

.app-bar__menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--primary-400);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--border-radius-md);
  min-width: 140px;
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.app-bar__menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-100);
  transition: background var(--transition-fast);
}

.app-bar__menu-item:active {
  background: rgba(255,255,255,0.08);
}

.app-bar__menu-item[data-action="logout"] {
  color: var(--alert-300);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 700;
  font-size: 13px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--primary-300);
  color: #fff;
}

.btn--purchase {
  background: var(--purchase-200);
  color: #fff;
}

.btn--alert {
  background: var(--alert-400);
  color: #fff;
}

.btn--special {
  background: var(--special-200);
  color: var(--primary-500);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff;
}

.btn--ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn--disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Card */
.card {
  background: var(--primary-400);
  border-radius: var(--border-radius-md);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.2s ease;
}

.modal-content {
  background: var(--primary-400);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 340px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slide-up 0.25s ease;
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag--hot {
  background: var(--alert-400);
  color: #fff;
}

.tag--new {
  background: var(--purchase-200);
  color: #fff;
}

/* Bottom Navigation */
.bottom-nav {
  display: flex;
  align-items: stretch;
  background: var(--primary-500);
  border-top: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  bottom: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 8px;
  color: rgba(255,255,255,0.4);
  transition: all var(--transition-fast);
  position: relative;
}

.bottom-nav__item--active {
  color: var(--primary-300);
}

.bottom-nav__item--active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary-300);
  border-radius: 0 0 2px 2px;
}

.bottom-nav__icon {
  transition: transform var(--transition-fast);
}

.bottom-nav__item--active .bottom-nav__icon {
  transform: scale(1.1);
}

.bottom-nav__label {
  font-size: 10px;
  font-weight: 600;
}

/* Marquee (legacy) */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 0;
  border-radius: var(--border-radius-sm);
}

.marquee__inner {
  display: inline-block;
  animation: marquee-scroll 15s linear infinite;
  padding-left: 100%;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 15px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 30px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #FED187 0%, #FFB55D 100%);
  transition: width 0.5s ease-out;
  border-radius: 30px;
}

/* VIP Frame */
.vip-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Game iframe overlay */
.game-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.2s ease;
}

.game-iframe__header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0,0,0,0.9);
  z-index: 2001;
  position: relative;
}

.game-iframe__back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: background var(--transition-fast);
}

.game-iframe__back:active {
  background: rgba(255,255,255,0.1);
}

.game-iframe {
  flex: 1;
  width: 100%;
  border: none;
}

.game-iframe__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000;
  z-index: 2002;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.game-iframe__loader p {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}
