/* ============================================
   RiskQuest In-Game Phone — All Styles
   ============================================ */

/* ===== CSS Variables ===== */
:root {
  --phone-width: 320px;
  --phone-height: 569px;
  --phone-accent: #0066cc;
  --phone-bg: #f0f0f5;
  --phone-text: #1a1a2e;
  --phone-text-dim: rgba(26,26,46,0.5);
  --phone-text-faint: rgba(26,26,46,0.3);
  --phone-card-bg: rgba(26,26,46,0.06);
  --phone-card-border: rgba(26,26,46,0.15);
  --phone-hover-bg: rgba(26,26,46,0.04);
  --phone-active-bg: rgba(26,26,46,0.08);
  --phone-input-bg: rgba(26,26,46,0.05);
  --phone-overlay-bg: rgba(0,0,0,0.08);
  --phone-modal-bg: #e8e8f0;
  --phone-toggle-track: rgba(26,26,46,0.18);
  --phone-toggle-knob: #1a1a2e;
  --phone-slider-track: rgba(26,26,46,0.18);
  --phone-success: #4ade80;
  --phone-danger: #ef4444;
  --phone-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ===== Phone FAB Button ===== */
.rq-phone-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066cc, #0088ee);
  border: none;
  cursor: pointer;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.rq-phone-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 102, 204, 0.5), 0 3px 12px rgba(0,0,0,0.3);
}

.rq-phone-fab:active {
  transform: scale(0.95);
}

.rq-phone-fab svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.rq-phone-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: var(--phone-font);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

.rq-phone-fab-badge.visible {
  display: flex;
}

/* ===== Phone Overlay (dim background) ===== */
.rq-phone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rq-phone-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Phone Container ===== */
.rq-phone-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: var(--phone-width);
  height: var(--phone-height);
  z-index: 100000;
  transform: translateY(120%) scale(0.8);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  will-change: transform, opacity;
  border-radius: 36px;
}

.rq-phone-container.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* ===== Phone Close Button (mobile) ===== */
.rq-phone-close-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(30, 30, 50, 0.85);
  color: white;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  min-height: 0 !important;
}

.rq-phone-close-btn:active {
  transform: scale(0.9);
  background: rgba(60, 60, 80, 0.9);
}

/* Phone frame image overlay — sits on top, transparent center reveals screen */
.rq-phone-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  user-select: none;
  -webkit-user-drag: none;
}

/* ===== Phone Screen (positioned inside frame cutout) ===== */
.rq-phone-screen {
  position: absolute;
  top: 7.9%;
  left: 15.84%;
  width: 68.51%;
  height: 83.9%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--phone-bg);
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* ===== Status Bar ===== */
.rq-phone-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 3px;
  font-size: 10px;
  font-family: var(--phone-font);
  color: var(--phone-text);
  flex-shrink: 0;
  background: transparent;
  height: 24px;
  z-index: 5;
}

.rq-phone-statusbar-left {
  font-weight: 600;
  font-size: 12px;
}

.rq-phone-statusbar-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rq-phone-statusbar-right svg {
  width: 14px;
  height: 14px;
  fill: var(--phone-text);
}

.rq-phone-statusbar-notif {
  background: var(--phone-danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.rq-phone-statusbar-notif.visible {
  display: flex;
}

/* ===== Phone Content Area ===== */
.rq-phone-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* App view wrapper */
.rq-phone-app-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* Lock app view scrolling when chat input bar is visible */
.rq-phone-app-view:has(.rq-chat-input-bar) {
  overflow: hidden !important;
}

/* App transition animations */
.rq-phone-app-view.slide-in-left {
  animation: phoneSlideInLeft 0.3s ease forwards;
}

.rq-phone-app-view.slide-out-right {
  animation: phoneSlideOutRight 0.3s ease forwards;
}

.rq-phone-app-view.slide-in-right {
  animation: phoneSlideInRight 0.3s ease forwards;
}

.rq-phone-app-view.slide-out-left {
  animation: phoneSlideOutLeft 0.3s ease forwards;
}

@keyframes phoneSlideInLeft {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes phoneSlideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes phoneSlideInRight {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes phoneSlideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

/* ===== Home Screen ===== */
.rq-phone-home {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Horizontal scroll-snap container for home pages */
.rq-home-pages {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rq-home-pages::-webkit-scrollbar { display: none; }

/* Each page fills the viewport width */
.rq-home-page {
  min-width: 100%;
  width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 6px 4px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Page label ("Main", "Games") */
.rq-home-page-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--phone-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 4px 0 6px;
  font-family: var(--phone-font);
}

/* Empty page placeholder */
.rq-home-page-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px 20px;
  min-height: 200px;
}
.rq-home-page-empty .rq-empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.4;
}
.rq-home-page-empty .rq-empty-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--phone-text-dim);
  margin-bottom: 4px;
}
.rq-home-page-empty .rq-empty-sub {
  font-size: 10px;
  color: var(--phone-text-faint);
  line-height: 1.4;
}

/* Page indicator dots */
.rq-home-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 8px;
  flex-shrink: 0;
}
.rq-home-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phone-text-faint);
  transition: background 0.2s ease, transform 0.2s ease;
}
.rq-home-dot.active {
  background: var(--phone-text);
  transform: scale(1.3);
}

.rq-phone-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 2px;
  padding: 4px 2px;
  flex: 1;
  align-content: start;
}

.rq-phone-app-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.rq-phone-app-icon-wrap:active .rq-phone-app-icon {
  transform: scale(0.9);
}

/* App icon floating tooltip (appended to phone container) */
.rq-app-tooltip {
  position: absolute;
  background: rgba(20, 20, 40, 0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100002;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  font-family: var(--phone-font);
  transform: translate(-50%, -100%) scale(0.9);
}

.rq-app-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
}

.rq-phone-app-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  position: relative;
  overflow: hidden;
}

.rq-phone-app-icon svg {
  width: 24px;
  height: 24px;
  color: white !important;
  fill: white !important;
  position: relative;
  z-index: 1;
}

.rq-phone-app-icon svg path,
.rq-phone-app-icon svg circle,
.rq-phone-app-icon svg rect,
.rq-phone-app-icon svg line,
.rq-phone-app-icon svg polyline {
  fill: white !important;
  stroke: none !important;
}

.rq-phone-app-name {
  font-size: 9px;
  color: var(--phone-text);
  font-family: var(--phone-font);
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* App icon badge — on the wrap element so it isn't clipped by icon overflow:hidden */
.rq-phone-icon-badge {
  position: absolute;
  top: -3px;
  right: calc(50% - 26px);
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--phone-font);
  z-index: 2;
}

.rq-phone-icon-badge.visible {
  display: flex;
}

/* ===== App Header (shared) ===== */
.rq-app-header {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 6px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--phone-card-border);
}

.rq-app-back {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--phone-card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.rq-app-back:hover {
  background: var(--phone-toggle-track);
}

.rq-app-back svg {
  width: 16px;
  height: 16px;
  fill: var(--phone-text);
}

.rq-app-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--phone-text);
  font-family: var(--phone-font);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rq-app-header-action {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--phone-card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.rq-app-header-action svg {
  width: 16px;
  height: 16px;
  fill: var(--phone-text);
}

/* ===== App Content (shared) ===== */
.rq-app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
}

/* ===== Shared UI Components ===== */

/* Card */
.rq-card {
  background: var(--phone-card-bg);
  border: 1px solid var(--phone-card-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

/* Button */
.rq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-family: var(--phone-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.rq-btn-primary {
  background: linear-gradient(135deg, #0066cc, #0088ee);
  color: #ffffff;
}

.rq-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3);
}

.rq-btn-secondary {
  background: var(--phone-card-bg);
  color: var(--phone-text);
  border: 1px solid var(--phone-card-border);
}

.rq-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.rq-btn-success {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #0a1628;
}

.rq-btn-block {
  width: 100%;
}

.rq-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Input */
.rq-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--phone-card-border);
  background: var(--phone-input-bg);
  color: var(--phone-text);
  font-size: 12px;
  font-family: var(--phone-font);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.rq-input:focus {
  border-color: var(--phone-accent);
  background: var(--phone-active-bg);
}

.rq-input::placeholder {
  color: var(--phone-text-dim);
}

/* List items */
.rq-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.rq-list-item:hover {
  background: var(--phone-hover-bg);
}

.rq-list-item:active {
  background: var(--phone-card-bg);
}

.rq-list-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--phone-text);
  font-family: var(--phone-font);
}

.rq-list-info {
  flex: 1;
  min-width: 0;
}

.rq-list-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--phone-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-list-subtitle {
  font-size: 10px;
  color: var(--phone-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.rq-list-meta {
  text-align: right;
  flex-shrink: 0;
}

.rq-list-time {
  font-size: 9px;
  color: var(--phone-text-dim);
}

.rq-list-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--phone-accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-top: 4px;
}

/* Friend online status dot */
.rq-friend-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--phone-bg);
}

.rq-friend-dot.online {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}

.rq-friend-dot.offline {
  background: #64748b;
}

/* Friend action buttons */
.rq-friend-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--phone-card-border);
  background: var(--phone-card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.rq-friend-action-btn:active {
  opacity: 0.7;
}

/* Divider */
.rq-divider {
  height: 1px;
  background: var(--phone-card-border);
  margin: 8px 0;
}

/* Empty state */
.rq-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.rq-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.rq-empty-text {
  font-size: 14px;
  color: var(--phone-text-dim);
  line-height: 1.5;
}

.rq-empty-sub {
  font-size: 12px;
  color: var(--phone-text-faint);
  margin-top: 6px;
  line-height: 1.4;
}

/* Tabs */
.rq-tabs {
  display: flex;
  border-bottom: 1px solid var(--phone-card-border);
  flex-shrink: 0;
}

.rq-tab {
  flex: 1;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--phone-text-dim);
  font-family: var(--phone-font);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.rq-tab.active {
  color: var(--phone-accent);
  border-bottom-color: var(--phone-accent);
}

/* Toggle switch */
.rq-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.rq-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.rq-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--phone-toggle-track);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.rq-toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--phone-toggle-knob);
  transition: transform 0.2s ease;
}

.rq-toggle input:checked + .rq-toggle-slider {
  background: var(--phone-accent);
}

.rq-toggle input:checked + .rq-toggle-slider::before {
  transform: translateX(20px);
}

/* Settings list */
.rq-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid var(--phone-card-border);
  gap: 12px;
}

.rq-settings-item:last-child {
  border-bottom: none;
}

.rq-settings-label {
  font-size: 14px;
  color: var(--phone-text);
  font-family: var(--phone-font);
}

.rq-settings-desc {
  font-size: 11px;
  color: var(--phone-text-dim);
  margin-top: 2px;
}

/* Section headers */
.rq-section-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--phone-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 8px 4px;
  font-family: var(--phone-font);
}

/* Slider */
.rq-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--phone-toggle-track);
  outline: none;
}

.rq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--phone-accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Progress bar */
.rq-progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--phone-active-bg);
  overflow: hidden;
}

.rq-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--phone-accent), #0088ee);
  transition: width 0.3s ease;
}

/* Toast notifications — iOS-style banners */
.rq-toast-container {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 8px;
  pointer-events: none;
}

.rq-toast {
  background: rgba(240, 240, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--phone-card-border);
  border-radius: 16px;
  padding: 12px 32px 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  animation: toastSlideIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 2px 8px rgba(0, 0, 0, 0.2);
}

.rq-toast-close {
  position: absolute;
  top: 8px;
  right: 6px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: var(--phone-text-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.rq-toast-close:hover {
  background: rgba(0, 0, 0, 0.15);
  color: var(--phone-text);
}

.rq-toast.dismissing {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from { transform: translateY(-120%) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(-120%) scale(0.95); opacity: 0; }
}

.rq-toast-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 36px;
  flex-shrink: 0;
  overflow: hidden;
}

.rq-toast-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.rq-toast-body {
  flex: 1;
  min-width: 0;
}

.rq-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.rq-toast-app-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--phone-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rq-toast-time {
  font-size: 10px;
  color: var(--phone-text-faint);
  font-weight: 400;
}

.rq-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--phone-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-toast-message {
  font-size: 12px;
  color: var(--phone-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  line-height: 1.3;
}

/* Modal */
.rq-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease;
  overflow: visible;
  box-sizing: border-box;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.rq-modal {
  background: var(--phone-modal-bg);
  border: 1px solid var(--phone-card-border);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 260px;
  animation: modalScaleIn 0.2s ease;
}

@keyframes modalScaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.rq-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--phone-text);
  margin-bottom: 8px;
  text-align: center;
  font-family: var(--phone-font);
}

.rq-modal-message {
  font-size: 13px;
  color: var(--phone-text-dim);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 16px;
}

.rq-modal-actions {
  display: flex;
  gap: 8px;
}

.rq-modal-actions .rq-btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
}

/* ===== Banking App Styles ===== */
/* ── Banking Sections ── */
.rq-bank-section {
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--phone-card-border);
  background: var(--phone-card-bg);
}

.rq-bank-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--phone-text-dim);
  background: var(--phone-hover-bg);
  border-bottom: 1px solid var(--phone-card-border);
}

.rq-bank-section-icon {
  width: 16px;
  height: 16px;
}

.rq-riskcoin-icon {
  fill: #FFD700;
}

.rq-bank-section-actions {
  padding: 6px 12px 8px;
  display: flex;
  gap: 8px;
}

.rq-bank-balance-card {
  text-align: center;
  padding: 14px 10px 10px;
}

.rq-riskcoin-card {
  background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,165,0,0.03));
}

.rq-bank-balance-label {
  font-size: 12px;
  color: var(--phone-text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rq-bank-balance-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--phone-accent);
  font-family: var(--phone-font);
}

.rq-bank-balance-sub {
  font-size: 10px;
  color: var(--phone-text-dim);
  margin-top: 2px;
}

.rq-bank-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.rq-bank-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--phone-card-bg);
  border: 1px solid var(--phone-card-border);
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--phone-text);
  font-family: var(--phone-font);
}

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

.rq-bank-action-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--phone-accent);
}

.rq-bank-action-label {
  font-size: 10px;
  font-weight: 600;
}

/* Exchange UI */
.rq-exchange-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--phone-card-border);
}

.rq-exchange-tab {
  flex: 1;
  padding: 10px 0;
  background: var(--phone-hover-bg);
  border: none;
  color: var(--phone-text-dim);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--phone-font);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rq-exchange-tab.active {
  background: rgba(0,102,204,0.12);
  color: var(--phone-accent);
}

.rq-exchange-balances {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.rq-exchange-bal-card {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  background: var(--phone-card-bg);
  border: 1px solid var(--phone-card-border);
  border-radius: 8px;
}

.rq-exchange-bal-label {
  font-size: 10px;
  color: var(--phone-text-dim);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.rq-exchange-bal-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--phone-font);
}

.rq-exchange-rate {
  text-align: center;
  font-size: 11px;
  color: var(--phone-text-dim);
  margin-bottom: 12px;
  padding: 6px;
  background: var(--phone-hover-bg);
  border-radius: 6px;
}

.rq-txn-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--phone-card-border);
}

.rq-txn-item:last-child {
  border-bottom: none;
}

.rq-txn-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.rq-txn-info {
  flex: 1;
  min-width: 0;
}

.rq-txn-desc {
  font-size: 13px;
  color: var(--phone-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-txn-time {
  font-size: 11px;
  color: var(--phone-text-dim);
  margin-top: 2px;
}

.rq-txn-amount {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--phone-font);
  flex-shrink: 0;
}

.rq-txn-amount.positive {
  color: var(--phone-success);
}

.rq-txn-amount.negative {
  color: var(--phone-danger);
}

/* ===== Account / Stats App Styles ===== */
.rq-account-header {
  text-align: center;
  padding: 12px 8px 8px;
}

.rq-account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  font-family: var(--phone-font);
  margin-bottom: 6px;
}

.rq-account-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--phone-text);
}

.rq-account-email {
  font-size: 9px;
  color: var(--phone-text-dim);
  margin-top: 2px;
}

.rq-account-balance {
  text-align: center;
  padding: 10px 8px;
  background: linear-gradient(135deg, rgba(0,102,204,0.1), rgba(0,136,238,0.05));
  border: 1px solid rgba(0,102,204,0.2);
  border-radius: 10px;
  margin: 4px 0 10px;
}

.rq-account-bal-label {
  font-size: 9px;
  color: var(--phone-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rq-account-bal-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--phone-accent);
  font-family: var(--phone-font);
}

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

.rq-account-stat {
  text-align: center;
  padding: 8px 4px;
  background: var(--phone-card-bg);
  border: 1px solid var(--phone-card-border);
  border-radius: 8px;
}

.rq-account-stat-val {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--phone-font);
}

.rq-account-stat-label {
  font-size: 8px;
  color: var(--phone-text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

.rq-account-winbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.rq-account-winbar-label {
  font-size: 9px;
  color: var(--phone-text-dim);
  flex-shrink: 0;
}

.rq-account-winbar-track {
  flex: 1;
  height: 6px;
  background: var(--phone-active-bg);
  border-radius: 3px;
  overflow: hidden;
}

.rq-account-winbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--phone-accent), #22c55e);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.rq-account-winbar-pct {
  font-size: 10px;
  font-weight: 600;
  color: var(--phone-accent);
  flex-shrink: 0;
}

/* ===== Messages App — Conversation List ===== */
.rq-dm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--phone-card-border);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.rq-dm-item:hover { background: var(--phone-hover-bg); }
.rq-dm-item:active { background: var(--phone-card-bg); }

.rq-dm-item.rq-dm-unread {
  background: rgba(0,102,204,0.06);
}

.rq-dm-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  font-family: var(--phone-font);
  position: relative;
}

.rq-dm-group-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: rgba(100, 116, 139, 0.9);
  border: 2px solid var(--phone-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rq-dm-info {
  flex: 1;
  min-width: 0;
}

.rq-dm-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--phone-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-dm-preview {
  font-size: 11px;
  color: var(--phone-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.rq-dm-unread .rq-dm-name { color: var(--phone-accent); }
.rq-dm-unread .rq-dm-preview { color: var(--phone-text); }

.rq-dm-meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.rq-dm-time {
  font-size: 10px;
  color: var(--phone-text-dim);
}

.rq-dm-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--phone-accent);
}

/* ===== Messages App — Chat Bubbles ===== */
.rq-chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  min-height: 100%;
}

.rq-chat-date-sep {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--phone-text-dim);
  padding: 8px 0 4px;
  letter-spacing: 0.3px;
}

.rq-chat-bubble {
  max-width: 78%;
  padding: 7px 10px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--phone-text);
  font-family: var(--phone-font);
  word-break: break-word;
}

.rq-chat-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, #0066cc, #0088ee);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.rq-chat-bubble.received {
  align-self: flex-start;
  background: var(--phone-active-bg);
  border-bottom-left-radius: 4px;
}

/* Chat message row with avatar */
.rq-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  align-self: flex-start;
  max-width: 85%;
}
.rq-chat-row .rq-chat-bubble {
  align-self: auto;
  min-width: 0;
}
.rq-chat-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.rq-chat-sender {
  font-size: 10px;
  font-weight: 600;
  color: #4da6ff;
  margin-bottom: 2px;
}

.rq-chat-bubble.sent .rq-chat-sender {
  color: rgba(255,255,255,0.7);
}

.rq-chat-text {
  /* inherits font from bubble */
}

.rq-chat-bubble-time {
  font-size: 9px;
  opacity: 0.5;
  margin-top: 3px;
  text-align: right;
}

/* Chat images */
.rq-chat-img-wrap {
  margin: 2px 0;
}

.rq-chat-img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
  object-fit: cover;
}

.rq-chat-bubble.sent .rq-chat-img {
  border: 1px solid rgba(0,0,0,0.1);
}

.rq-chat-bubble.received .rq-chat-img {
  border: 1px solid var(--phone-card-border);
}

/* Force flex column layout when chat is open so input bar sticks to bottom */
.rq-app-content:has(.rq-chat-input-bar),
.rq-app-content:has(#rq-game-input-bar) {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  min-height: 0 !important;
  height: 100% !important;
}

/* ===== Chat Input Bar ===== */
.rq-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--phone-card-border);
  background: var(--phone-overlay-bg);
  flex-shrink: 0;
}

.rq-chat-media-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--phone-card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.rq-chat-media-btn:hover { background: var(--phone-toggle-track); }
.rq-chat-media-btn:active { transform: scale(0.92); }

.rq-chat-media-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--phone-text-dim);
}

.rq-chat-input {
  flex: 1;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1px solid var(--phone-card-border);
  background: var(--phone-input-bg);
  color: var(--phone-text);
  font-size: 13px;
  font-family: var(--phone-font);
  outline: none;
  min-width: 0;
}

.rq-chat-input:focus {
  border-color: #0066cc;
}

.rq-chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0066cc, #0088ee);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.rq-chat-send-btn:active { transform: scale(0.9); }

.rq-chat-send-btn svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

.rq-typing-indicator {
  font-size: 11px;
  color: var(--phone-text-dim);
  padding: 2px 12px;
  font-style: italic;
}

/* ===== Image Preview Bar ===== */
.rq-chat-img-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--phone-overlay-bg);
  border-top: 1px solid var(--phone-card-border);
  flex-shrink: 0;
}

.rq-chat-preview-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.rq-chat-preview-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--phone-card-border);
}

.rq-chat-preview-actions {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.rq-chat-preview-cancel,
.rq-chat-preview-send {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--phone-font);
  transition: transform 0.1s ease;
}

.rq-chat-preview-cancel {
  background: var(--phone-active-bg);
  color: var(--phone-text);
}

.rq-chat-preview-send {
  background: linear-gradient(135deg, #0066cc, #0088ee);
  color: #ffffff;
}

.rq-chat-preview-cancel:active,
.rq-chat-preview-send:active {
  transform: scale(0.95);
}

/* ===== Image Modal (full-screen) ===== */
.rq-chat-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.rq-chat-modal-overlay.rq-chat-modal-closing {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.rq-chat-modal-img {
  max-width: 95%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 8px;
}

.rq-chat-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--phone-toggle-track);
  border: none;
  color: white;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== Leaderboard Styles ===== */
.rq-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--phone-card-border);
}

.rq-lb-rank {
  width: 28px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: var(--phone-text-dim);
  font-family: var(--phone-font);
}

.rq-lb-rank.gold { color: #0066cc; }
.rq-lb-rank.silver { color: #C0C0C0; }
.rq-lb-rank.bronze { color: #CD7F32; }

.rq-lb-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.rq-lb-name {
  flex: 1;
  font-size: 13px;
  color: var(--phone-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-lb-coins {
  font-size: 13px;
  font-weight: 600;
  color: var(--phone-accent);
  font-family: var(--phone-font);
}

.rq-lb-me-bar {
  position: sticky;
  bottom: 0;
  background: rgba(240, 240, 245, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--phone-card-border);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Quest Tracker Styles ===== */
.rq-quest-item {
  padding: 12px;
  border-radius: 12px;
  background: var(--phone-card-bg);
  border: 1px solid var(--phone-card-border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.rq-quest-item:active {
  border-color: var(--phone-accent);
}

.rq-quest-item.completed {
  opacity: 0.5;
}

.rq-quest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.rq-quest-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--phone-text);
}

.rq-quest-reward {
  font-size: 12px;
  font-weight: 700;
  color: var(--phone-accent);
}

.rq-quest-desc {
  font-size: 11px;
  color: var(--phone-text-dim);
  margin-bottom: 8px;
}

.rq-quest-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rq-quest-progress-text {
  font-size: 11px;
  color: var(--phone-text-dim);
  flex-shrink: 0;
}

/* ===== Daily Reward / Scratch Card Styles ===== */
.rq-scratch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
}

.rq-scratch-card {
  position: relative;
  width: 200px;
  height: 130px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.rq-scratch-reward {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1e3a, #2a2a5a);
}

.rq-scratch-reward-amount {
  font-size: 36px;
  font-weight: 700;
  color: #FFD700;
  font-family: var(--phone-font);
}

.rq-scratch-reward-label {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

.rq-scratch-canvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  border-radius: 16px;
}

.rq-scratch-streak {
  text-align: center;
  margin-bottom: 12px;
}

.rq-scratch-streak-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--phone-accent);
}

.rq-scratch-streak-label {
  font-size: 12px;
  color: var(--phone-text-dim);
}

.rq-scratch-countdown {
  text-align: center;
  padding: 40px 20px;
}

.rq-scratch-countdown-time {
  font-size: 28px;
  font-weight: 700;
  color: var(--phone-accent);
  font-family: var(--phone-font);
  margin-top: 8px;
}

/* Confetti animation */
.rq-confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}

.rq-confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confettiFall 2s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(600px) rotate(720deg); opacity: 0; }
}

/* ===== Customization App Styles ===== */
.rq-custom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.rq-custom-item {
  border-radius: 12px;
  border: 2px solid var(--phone-card-border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.rq-custom-item:active {
  transform: scale(0.96);
}

.rq-custom-item.rarity-common { border-color: rgba(156,163,175,0.4); }
.rq-custom-item.rarity-rare { border-color: rgba(59,130,246,0.5); }
.rq-custom-item.rarity-epic { border-color: rgba(168,85,247,0.5); }
.rq-custom-item.rarity-legendary {
  border-color: rgba(255,215,0,0.6);
  animation: legendaryShimmer 2s ease infinite;
}

@keyframes legendaryShimmer {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.2); }
  50% { box-shadow: 0 0 16px rgba(255,215,0,0.5); }
}

.rq-custom-preview {
  width: 100%;
  aspect-ratio: 1;
  background: var(--phone-card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.rq-custom-info {
  padding: 8px;
}

.rq-custom-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--phone-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rq-custom-price {
  font-size: 11px;
  color: var(--phone-accent);
  font-weight: 600;
  margin-top: 2px;
}

/* ===== Call Screen Styles ===== */
.rq-call-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--phone-bg) 0%, var(--phone-modal-bg) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  padding: 40px 20px;
}

.rq-call-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

.rq-call-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--phone-text);
  margin-bottom: 4px;
}

.rq-call-status {
  font-size: 14px;
  color: var(--phone-text-dim);
  margin-bottom: 40px;
}

.rq-call-actions {
  display: flex;
  gap: 24px;
}

.rq-call-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.rq-call-btn:active {
  transform: scale(0.9);
}

.rq-call-btn svg {
  width: 24px;
  height: 24px;
  fill: white;
}

.rq-call-btn.accept { background: #22c55e; }
.rq-call-btn.decline { background: #ef4444; }
.rq-call-btn.mute { background: var(--phone-toggle-track); }
.rq-call-btn.mute.active { background: var(--phone-accent); }
.rq-call-btn.mute.active svg { fill: #ffffff; }
.rq-call-btn.speaker { background: var(--phone-toggle-track); }
.rq-call-btn.speaker.active { background: var(--phone-accent); }
.rq-call-btn.speaker.active svg { fill: #ffffff; }

/* Ringing animation */
.rq-call-ringing .rq-call-avatar {
  animation: ringPulse 1.5s ease infinite;
}

/* ===== Group Call Member Grid ===== */
.rq-call-members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 280px;
  margin-bottom: 20px;
}

.rq-call-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  position: relative;
  transition: opacity 0.3s ease;
}

.rq-call-member .rq-call-avatar {
  width: 56px;
  height: 56px;
  font-size: 24px;
  margin-bottom: 8px;
}

.rq-call-member-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--phone-text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rq-call-member-status {
  font-size: 10px;
  color: var(--phone-text-dim);
  margin-top: 2px;
}

.rq-call-member-status.connected {
  color: #22c55e;
}

.rq-call-member-status.declined {
  color: #ef4444;
}

.rq-call-member.declined {
  opacity: 0.4;
}

/* Group call screen adjustments */
.rq-call-screen.rq-call-group {
  padding: 24px 16px;
  justify-content: flex-start;
  padding-top: 36px;
}

.rq-call-screen.rq-call-group .rq-call-name {
  font-size: 16px;
  margin-bottom: 4px;
}

.rq-call-screen.rq-call-group .rq-call-status {
  margin-bottom: 16px;
}

.rq-call-screen.rq-call-group .rq-call-actions {
  margin-top: auto;
  padding-bottom: 12px;
}

/* Ringing pulse for group member avatars */
.rq-call-member.ringing .rq-call-avatar {
  animation: ringPulse 1.5s ease infinite;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 20px rgba(34, 197, 94, 0); }
}

/* ===== Loading spinner ===== */
.rq-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--phone-card-border);
  border-top-color: var(--phone-accent);
  border-radius: 50%;
  animation: rqSpin 0.8s linear infinite;
}

@keyframes rqSpin {
  to { transform: rotate(360deg); }
}

.rq-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* ===== Pull to refresh ===== */
.rq-pull-indicator {
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--phone-text-dim);
  transition: opacity 0.2s ease;
}

/* ===== Amount display with animation ===== */
.rq-amount-animate {
  transition: transform 0.3s ease;
}

.rq-amount-animate.bump {
  animation: amountBump 0.4s ease;
}

@keyframes amountBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Phone position: left side */
.rq-phone-container.position-left {
  right: auto;
  left: 24px;
}

.rq-phone-fab.position-left {
  right: auto;
  left: 24px;
}

/* ===== DARK MODE ===== */
.rq-phone-container.dark-mode {
  --phone-bg: #0a0a14;
  --phone-text: #ffffff;
  --phone-text-dim: rgba(255,255,255,0.5);
  --phone-text-faint: rgba(255,255,255,0.3);
  --phone-card-bg: rgba(255,255,255,0.06);
  --phone-card-border: rgba(255,255,255,0.10);
  --phone-hover-bg: rgba(255,255,255,0.04);
  --phone-active-bg: rgba(255,255,255,0.08);
  --phone-input-bg: rgba(255,255,255,0.05);
  --phone-overlay-bg: rgba(0,0,0,0.35);
  --phone-modal-bg: #12121e;
  --phone-toggle-track: rgba(255,255,255,0.12);
  --phone-toggle-knob: #ffffff;
  --phone-slider-track: rgba(255,255,255,0.12);
}

.rq-phone-container.dark-mode .rq-phone-screen {
  background: var(--phone-bg);
}

/* Status bar */
.rq-phone-container.dark-mode .rq-phone-statusbar {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-phone-statusbar svg {
  fill: var(--phone-text);
}

/* App header */
.rq-phone-container.dark-mode .rq-app-header {
  color: var(--phone-text);
  border-bottom-color: var(--phone-card-border);
}
.rq-phone-container.dark-mode .rq-app-back svg {
  fill: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-app-title {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-app-action svg {
  fill: var(--phone-text);
}

/* Home screen app names */
.rq-phone-container.dark-mode .rq-phone-app-name {
  color: var(--phone-text);
}

/* Section headers */
.rq-phone-container.dark-mode .rq-section-header {
  color: var(--phone-text-dim);
}

/* Settings */
.rq-phone-container.dark-mode .rq-settings-label {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-settings-desc {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode select {
  background: var(--phone-input-bg);
  color: var(--phone-text);
}

/* Select dropdown styling (light + dark) */
.rq-phone-container select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.rq-phone-container select:hover {
  border-color: var(--phone-accent);
  background-color: var(--phone-card-bg);
}
.rq-phone-container select:focus {
  border-color: var(--phone-accent);
  background-color: var(--phone-card-bg);
}
.rq-phone-container select option {
  background: var(--phone-bg);
  color: var(--phone-text);
  padding: 6px 10px;
}

/* List items */
.rq-phone-container.dark-mode .rq-list-name {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-list-sub {
  color: var(--phone-text-dim);
}

/* Empty states */
.rq-phone-container.dark-mode .rq-empty-text {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-empty-sub {
  color: var(--phone-text-faint);
}

/* Inputs */
.rq-phone-container.dark-mode .rq-input {
  color: var(--phone-text);
  border-color: var(--phone-card-border);
}
.rq-phone-container.dark-mode .rq-input::placeholder {
  color: var(--phone-text-faint);
}

/* Toast notifications */
.rq-phone-container.dark-mode .rq-toast {
  background: rgba(12, 12, 20, 0.92);
  border-color: rgba(255,255,255,0.08);
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-toast-title {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-toast-message {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-toast-app-name {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-toast-time {
  color: var(--phone-text-faint);
}
.rq-phone-container.dark-mode .rq-toast-close {
  background: rgba(255, 255, 255, 0.1);
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-toast-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--phone-text);
}

/* Modal */
.rq-phone-container.dark-mode .rq-modal-title {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-modal-message {
  color: var(--phone-text-dim);
}

/* Cards */
.rq-phone-container.dark-mode .rq-card {
  background: var(--phone-card-bg);
  border-color: var(--phone-card-border);
}

/* DM conversations */
.rq-phone-container.dark-mode .rq-dm-name {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-dm-preview {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-dm-time {
  color: var(--phone-text-faint);
}
.rq-phone-container.dark-mode .rq-dm-item {
  border-bottom-color: var(--phone-card-border);
}

/* Chat messages */
.rq-phone-container.dark-mode .rq-chat-bubble.received {
  background: var(--phone-card-bg);
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-chat-sender {
  color: #4da6ff;
}
.rq-phone-container.dark-mode .rq-chat-bubble-time {
  color: var(--phone-text-faint);
}
.rq-phone-container.dark-mode .rq-chat-input {
  color: var(--phone-text);
  border-color: var(--phone-card-border);
}
.rq-phone-container.dark-mode .rq-chat-input::placeholder {
  color: var(--phone-text-faint);
}
.rq-phone-container.dark-mode .rq-chat-input-bar {
  background: var(--phone-overlay-bg);
}

/* Typing indicator */
.rq-phone-container.dark-mode .rq-typing-indicator {
  color: var(--phone-text-dim);
}

/* Bank / Exchange */
.rq-phone-container.dark-mode .rq-bank-section-header {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-exchange-tab {
  color: var(--phone-text-dim);
}

/* Account page */
.rq-phone-container.dark-mode .rq-account-username {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-account-stat-value {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-account-stat-label {
  color: var(--phone-text-dim);
}

/* Leaderboard */
.rq-phone-container.dark-mode .rq-lb-name {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-lb-value {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-lb-rank {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-lb-me-bar {
  background: rgba(10,10,20,0.95);
  border-top-color: var(--phone-card-border);
}

/* Slider */
.rq-phone-container.dark-mode .rq-slider {
  background: var(--phone-slider-track);
}

/* Customization grid */
.rq-phone-container.dark-mode .rq-custom-name {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-custom-price {
  color: var(--phone-text-dim);
}

/* Tabs */
.rq-phone-container.dark-mode .rq-tab {
  color: var(--phone-text-dim);
}
.rq-phone-container.dark-mode .rq-tab.active {
  color: var(--phone-accent);
}

/* Call screen */
.rq-phone-container.dark-mode .rq-call-screen {
  background: linear-gradient(180deg, #0a0a14 0%, #060610 100%);
}
.rq-phone-container.dark-mode .rq-call-name {
  color: var(--phone-text);
}
.rq-phone-container.dark-mode .rq-call-status {
  color: var(--phone-text-dim);
}

/* SVG icons in app grid (keep white on colored backgrounds) */
/* These stay white because they're on colored icon backgrounds */

/* Scrollbar */
.rq-phone-container.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
}
.rq-phone-container.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== RiskBot Floating Chat Widget ===== */
.riskbot-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  cursor: pointer;
  z-index: 99997;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  will-change: transform;
}
.riskbot-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55), 0 3px 12px rgba(0,0,0,0.3);
}
.riskbot-fab:active { transform: scale(0.95); }
.riskbot-fab.open { opacity: 0; pointer-events: none; transform: scale(0.5); }

/* Chat panel */
.riskbot-panel {
  position: fixed;
  bottom: 16px;
  left: 82px;
  width: 340px;
  height: 480px;
  max-height: calc(100vh - 48px);
  background: #0e0e1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  z-index: 99997;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 4px 16px rgba(99,102,241,0.15);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.riskbot-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.riskbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  flex-shrink: 0;
}
.riskbot-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.riskbot-header-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.riskbot-header-status {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.riskbot-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.riskbot-close:hover { background: rgba(255,255,255,0.3); }

/* Avatar */
.riskbot-avatar-small {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Messages area */
.riskbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.riskbot-messages::-webkit-scrollbar { width: 4px; }
.riskbot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* Bubbles */
.riskbot-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.riskbot-bubble-row.user {
  justify-content: flex-end;
}
.riskbot-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 78%;
  word-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.riskbot-bubble.bot {
  background: rgba(255,255,255,0.08);
  color: #e2e2f0;
  border-bottom-left-radius: 4px;
}
.riskbot-bubble.user {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing animation */
.riskbot-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}
.riskbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  animation: riskbot-bounce 1.2s infinite ease-in-out;
}
.riskbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.riskbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes riskbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Suggestions */
.riskbot-suggestions {
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.riskbot-suggestion {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #c4c4d8;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.riskbot-suggestion:hover {
  background: rgba(99,102,241,0.2);
  color: #fff;
}
.riskbot-suggestion:active { transform: scale(0.96); }

/* Input bar */
.riskbot-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.riskbot-input {
  flex: 1;
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 13px;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.riskbot-input::placeholder { color: rgba(255,255,255,0.35); }
.riskbot-input:focus { border-color: rgba(99,102,241,0.5); }
.riskbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.riskbot-send-btn:active { transform: scale(0.9); }

/* Responsive: mobile chatbot layout — no sidebar, panel floats freely */
@media (max-width: 768px) {
  .riskbot-panel {
    width: min(300px, calc(100vw - 32px)) !important;
    left: 16px !important;
    bottom: 86px !important;
    right: auto !important;
    height: min(420px, calc(100vh - 100px));
    max-height: calc(100vh - 100px);
    border-radius: 14px;
  }

  .riskbot-panel.rq-sidebar-mode {
    left: 16px !important;
  }

  .riskbot-fab {
    display: none !important;
  }

  .riskbot-header {
    padding: 10px 14px;
  }

  .riskbot-header-name {
    font-size: 13px;
  }

  .riskbot-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .riskbot-messages {
    padding: 10px 10px;
    gap: 8px;
  }

  .riskbot-bubble {
    font-size: 13px;
    padding: 9px 12px;
    max-width: 82%;
    line-height: 1.45;
  }

  .riskbot-suggestions {
    padding: 6px 10px;
    gap: 6px;
  }

  .riskbot-suggestion {
    padding: 6px 10px;
    font-size: 11px;
  }

  .riskbot-input-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .riskbot-input {
    padding: 9px 14px;
    font-size: 13px;
  }

  .riskbot-send-btn {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 480px) {
  .riskbot-panel {
    width: min(280px, calc(100vw - 24px)) !important;
    left: 12px !important;
    bottom: 80px !important;
    right: auto !important;
    height: min(380px, calc(100vh - 100px));
    max-height: calc(100vh - 100px);
  }

  .riskbot-fab {
    display: none !important;
  }

  .riskbot-suggestion {
    padding: 7px 12px;
    font-size: 12px;
  }
}
