@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #f2f2f7;
  --white: #ffffff;
  --gray-light: #e5e5ea;
  --gray-mid: #8e8e93;
  --gray-soft: #aeaeb2;
  --gray-dark: #3a3a3c;
  --black: #1c1c1e;
  --blue: #007aff;
  --blue-check: #1e6fd9;
  --red: #e53935;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
  --radius: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

html, body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--black);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
}

.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  position: relative;
  overflow-x: clip;
}

/* ── SYSTEM BAR ─────────────────────────────────── */
.system-bar {
  background: var(--white);
  padding: 14px 20px 0;
}

@supports (padding-top: env(safe-area-inset-top)) {
  .system-bar { padding-top: calc(14px + env(safe-area-inset-top)); }
}

.system-bar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-light);
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-mid);
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.close-btn svg { width: 18px; height: 18px; }

.username {
  font-size: 13px;
  color: var(--gray-mid);
  font-weight: 500;
  flex: 1;
  text-align: center;
}

.spacer {
  width: 28px;
  flex-shrink: 0;
}

/* ── NAV HEADER ─────────────────────────────────── */
.nav-header {
    background: #f2f2f7;
    display: flex;
    align-items: center;
    /* padding: 4px 14px 14px; */
}

.nav-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  width: 36px;
  height: 40px;
  flex-shrink: 0;
  text-decoration: none;
  padding: 0;
}

.nav-back-btn svg { width: 22px; height: 22px; }

.nav-title {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.5px;
}

.nav-spacer {
  width: 36px;
  flex-shrink: 0;
}

/* ── TABS (centered) ────────────────────────────── */
.tabs {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--gray-light);
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 0;
}


.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-mid);
  padding: 10px 14px;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}

.tab-btn.active {
  color: var(--black);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--black);
  border-radius: 2px 2px 0 0;
}

/* ── ACTION BAR ─────────────────────────────────── */
.action-bar {
  padding: 12px 16px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.all-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
}

.action-btn {
  background: var(--gray-light);
  border: none;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.action-btn:active {
  transform: scale(0.96);
  background: #d1d1d6;
}

/* ── MESSAGE LIST ───────────────────────────────── */
.message-list {
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-card {
  background: #f2f2f7;
  border-radius: 14px;
  box-shadow: none;
  border: 1px solid #e0e0e0;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
  -webkit-user-select: none;
  user-select: none;
}

.message-card:active {
  transform: scale(0.98);
  opacity: 0.85;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Decorative checkbox square (left side of card) */
.card-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: transparent;
  border: 2px solid #ffffff;
  flex-shrink: 0;
}

.card-meta { flex: 1; min-width: 0; }

.card-sender-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-bottom: 5px;
}

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
}

.card-handle {
  font-size: 13px;
  color: var(--gray-mid);
  white-space: nowrap;
}

.card-date {
  font-size: 12px;
  color: var(--gray-soft);
  white-space: nowrap;
  margin-left: 2px;
}

.card-preview {
  font-size: 14px;
  color: var(--gray-dark);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── ROBLOX VERIFIED BADGE ───────────────────────── */
.roblox-verified {
  width: 16px;
  height: 16px;
  min-width: 16px;
  background: #0066ff;
  transform: rotate(15deg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  margin: 0 3px;
}

.roblox-verified svg {
  width: 10px;
  height: 10px;
  transform: rotate(-15deg);
}

/* ── DETAIL ──────────────────────────────────────── */
.detail-content {
  padding: 14px 16px 32px;
}

.detail-card {
  background: #f2f2f7;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.detail-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.4;
  margin-bottom: 18px;
}

.detail-sender-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-light);
}

.detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-avatar img,
.detail-avatar svg { width: 44px; height: 44px; }

.detail-sender-info { flex: 1; }

.detail-sender-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.detail-sender-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
}

.detail-username {
  font-size: 13px;
  color: var(--gray-mid);
  margin-bottom: 2px;
}

.detail-date {
  font-size: 12px;
  color: var(--gray-soft);
}

.detail-body {
  font-size: 15px;
  color: var(--gray-dark);
  line-height: 1.65;
}

.detail-body p { margin-bottom: 14px; }
.detail-body p:last-child { margin-bottom: 0; }

/* ── EDIT FORM ───────────────────────────────────── */
.edit-page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
  padding: 14px 20px 6px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 20px 4px;
}

.form-group {
  background: var(--white);
  margin: 0 16px 4px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-field {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--gray-light);
}

.form-field:last-child {
  border-bottom: none;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.field-input {
  width: 100%;
  border: none;
  background: #f7f7f7;
  font-family: var(--font);
  font-size: 15px;
  color: var(--black);
  padding: 8px 10px;
  outline: none;
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus {
  background: #efefef;
}

.field-textarea {
  width: 100%;
  border: none;
  background: #f7f7f7;
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
  padding: 8px 10px;
  outline: none;
  border-radius: 8px;
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.field-textarea:focus {
  background: #efefef;
}

/* Icon picker row */
.icon-field { padding: 0; }

.icon-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
}

.icon-preview {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e5ea;
}

.icon-preview img,
.icon-preview svg {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.icon-picker-text { flex: 1; }

.icon-picker-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  display: block;
  margin-bottom: 2px;
}

.icon-picker-sub {
  font-size: 12px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
  display: block;
}

.icon-chevron {
  width: 18px;
  height: 18px;
  color: var(--gray-light);
  flex-shrink: 0;
}

/* Buttons */
.save-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 14px 16px 8px;
  padding: 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
}

.save-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 15px;
  background: var(--white);
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.reset-btn:active {
  opacity: 0.8;
  transform: scale(0.98);
}

.add-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 32px);
  margin: 4px 16px 10px;
  padding: 13px;
  background: var(--white);
  color: var(--blue);
  border: 1.5px dashed var(--blue);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.add-option-btn:active {
  background: #e8f3ff;
}

.remove-option-btn {
  background: none;
  border: none;
  color: var(--red);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.robux-edit-item + .robux-edit-item {
  border-top: 1px solid var(--gray-light);
}

/* ── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.88);
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 999;
  transition: opacity 0.5s;
  white-space: nowrap;
}

.toast-success { background: rgba(52,199,89,0.92); }

/* ── PAGE TRANSITIONS ────────────────────────────── */
.page      { animation: slideIn   0.28s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.page-exit { animation: slideOut  0.22s cubic-bezier(0.55,0,1,0.45) both; }
.page-back { animation: slideInBack 0.28s cubic-bezier(0.25,0.46,0.45,0.94) both; }

@keyframes slideIn     { from{opacity:0;transform:translateX(36px)}  to{opacity:1;transform:translateX(0)} }
@keyframes slideOut    { from{opacity:1;transform:translateX(0)}  to{opacity:0;transform:translateX(-36px)} }
@keyframes slideInBack { from{opacity:0;transform:translateX(-36px)} to{opacity:1;transform:translateX(0)} }

/* ── SAFE AREA ───────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .app-wrapper { padding-bottom: env(safe-area-inset-bottom); }
}

::-webkit-scrollbar { width: 0; background: transparent; }

/* ── ROBUX SELECTOR ──────────────────────────────── */
.robux-section {
  padding: 0 16px 8px;
}

.robux-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
}

/* Inside the detail card */
.robux-card-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-light);
}

.robux-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
}

.robux-grid {
  display: flex;
  flex-direction: row;
  overflow-x: scroll;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.robux-grid::-webkit-scrollbar {
  display: none;
}

.robux-option {
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  font-family: var(--font);
  flex-shrink: 0;
  width: 76px;
}

.robux-option:active {
  transform: scale(0.95);
}

.robux-option.selected {
  border-color: var(--blue);
  background: #e8f3ff;
}

.robux-option img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.robux-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  line-height: 1;
}

.robux-currency {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-mid);
  line-height: 1;
}

.reclamar-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--gray-light);
  color: var(--gray-mid);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: not-allowed;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.reclamar-btn.active {
  background: var(--blue);
  color: white;
  cursor: pointer;
}

.reclamar-btn.active:active {
  transform: scale(0.98);
  opacity: 0.88;
}

/* ── ROBUX POPUP MODAL ───────────────────────────── */
.robux-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.robux-modal.open {
  display: flex;
  animation: modalFadeIn 0.22s ease both;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.modal-card {
  position: relative;
  background: var(--white);
  border-radius: 22px;
  padding: 32px 28px 28px;
  width: min(320px, calc(100vw - 48px));
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideUp 0.28s cubic-bezier(0.34,1.3,0.64,1) both;
}

.modal-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Spinner */
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid #e5e5ea;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 4px;
}

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

.modal-loading-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  margin: 0;
}

.modal-loading-sub {
  font-size: 14px;
  color: var(--gray-mid);
  margin: 0;
}

/* Success */
.modal-check-wrap {
  margin-bottom: 4px;
}

.modal-check {
  width: 64px;
  height: 64px;
  animation: checkPop 0.4s cubic-bezier(0.34,1.5,0.64,1) both;
}

@keyframes checkPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-success-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  margin: 0;
}

.modal-success-sub {
  font-size: 14px;
  color: var(--gray-mid);
  text-align: center;
  margin: 0;
}

.modal-accept-btn {
  margin-top: 8px;
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal-accept-btn:active { opacity: 0.85; }

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

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
