/* =============================================
   VARIABLES
   ============================================= */
:root {
  --bg:       #07070f;
  --bg2:      #0d0d1a;
  --bg3:      #12122a;
  --bd:       rgba(255,255,255,0.06);
  --bd2:      rgba(168,85,247,0.22);
  --accent:   #a855f7;
  --accent-l: #c084fc;
  --accent-d: #7c3aed;
  --accent-g: rgba(168,85,247,0.25);
  --accent-g2:rgba(168,85,247,0.08);
  --pink:     #ec4899;
  --pink-g:   rgba(236,72,153,0.2);
  --green:    #22c55e;
  --red:      #ef4444;
  --txt:      #f1f5f9;
  --txt2:     #cbd5e1;
  --txt3:     #64748b;
  --card:     rgba(255,255,255,0.025);
  --r:        18px;
  --r-sm:     12px;
  --nav-h:    64px;
  --top-h:    60px;
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 100dvh;
}

/* =============================================
   BACKGROUND
   ============================================= */
.bg-orb {
  position: fixed; border-radius: 50%;
  filter: blur(90px); pointer-events: none; z-index: 0;
}
.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.14) 0%, transparent 70%);
  top: -160px; left: -180px;
  animation: orb1 9s ease-in-out infinite alternate;
}
.bg-orb-2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
  bottom: 80px; right: -120px;
  animation: orb2 11s ease-in-out infinite alternate;
}
@keyframes orb1 { to { transform: translate(40px, 50px); } }
@keyframes orb2 { to { transform: translate(-25px, -35px); } }

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(168,85,247,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* =============================================
   TOPBAR
   ============================================= */
.topbar {
  position: sticky; top: 0; z-index: 500;
  height: var(--top-h);
  background: rgba(7,7,15,0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--bd);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}

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

.hlogo {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-d), var(--accent-l));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px var(--accent-g), inset 0 1px 0 rgba(255,255,255,0.18);
  animation: logoPulse 3s ease-in-out infinite alternate;
}
.hlogo span {
  font-family: 'Orbitron', sans-serif;
  font-size: .7rem; font-weight: 800; color: #fff; letter-spacing: 1px;
}
@keyframes logoPulse {
  from { box-shadow: 0 0 14px var(--accent-g); }
  to   { box-shadow: 0 0 28px rgba(168,85,247,.5), 0 0 50px rgba(168,85,247,.12); }
}

.htitle {
  font-family: 'Orbitron', sans-serif;
  font-size: .9rem; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(to right, var(--accent-l), #e879f9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hsubtitle { font-size: .58rem; color: var(--txt3); font-weight: 500; margin-top: -1px; }

.hbadge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.18);
  border-radius: 20px;
  font-size: .62rem; font-weight: 600; color: #4ade80; letter-spacing: .5px;
}


/* =============================================
   LAYOUT & CONTAINER
   ============================================= */
.page-content {
  position: relative; z-index: 1;
  animation: fadeUp .45s cubic-bezier(.22,1,.36,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.con {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
}

@media (min-width: 600px) {
  .con { max-width: 580px; padding: 28px 24px calc(var(--nav-h) + 28px); }
}
@media (min-width: 768px) {
  .con { max-width: 660px; padding: 36px 28px calc(var(--nav-h) + 36px); }
}
@media (min-width: 1024px) {
  .con {
    max-width: 780px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    column-gap: 24px;
    align-items: start;
    padding: 40px 32px 60px;
  }
  .hero        { grid-column: 1 / -1; }
  #lookup-card { grid-column: 1; }
  #status      { grid-column: 1; }
  #profile-card{ grid-column: 2; grid-row: 2 / 4; }
  #result-card { grid-column: 2; }
}
@media (min-width: 1280px) {
  .con { max-width: 920px; }
}

/* =============================================
   HERO
   ============================================= */
.hero {
  text-align: center;
  padding: 10px 0 28px;
}
.hero-icon {
  font-size: 2.8rem; margin-bottom: 12px;
  background: linear-gradient(135deg, #fb923c, var(--accent-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block;
  animation: iconPulse 2.5s ease-in-out infinite alternate;
}
@keyframes iconPulse {
  from { filter: drop-shadow(0 0 8px rgba(168,85,247,0.3)); }
  to   { filter: drop-shadow(0 0 22px rgba(168,85,247,0.65)); }
}
.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.9rem; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(to right, #fff 30%, var(--accent-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
}
.hero-sub { font-size: .85rem; color: var(--txt3); font-weight: 400; }

@media (min-width: 768px) {
  .hero-title { font-size: 2.4rem; }
  .hero-sub   { font-size: .95rem; }
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.card:hover {
  border-color: rgba(168,85,247,0.14);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}

.slabel {
  display: flex; align-items: center; gap: 8px;
  color: var(--txt3); font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.6px; margin-bottom: 16px;
}
.slabel i { color: var(--accent); font-size: .72rem; }

/* =============================================
   FORM / INPUT
   ============================================= */
.igrp { margin-bottom: 14px; }

.ibox-wrap { position: relative; display: flex; align-items: center; }

.ibox-icon {
  position: absolute; left: 15px; z-index: 1;
  color: var(--txt3); font-size: .85rem; pointer-events: none;
  transition: color .3s;
}
.igrp:focus-within .ibox-icon { color: var(--accent-l); }

.ibox {
  width: 100%;
  padding: 14px 16px 14px 42px;
  background: rgba(0,0,0,0.38);
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-family: 'Poppins', sans-serif; font-size: .95rem; font-weight: 500;
  transition: all .3s;
}
.ibox:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,0,0,0.55);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12), 0 0 24px rgba(168,85,247,0.07);
}
.ibox::placeholder { color: var(--txt3); font-weight: 400; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 20px;
  border: none; border-radius: var(--r-sm);
  font-family: 'Poppins', sans-serif; font-size: .88rem; font-weight: 700;
  letter-spacing: .4px; cursor: pointer;
  transition: all .25s; text-decoration: none;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background .2s;
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(.97); }
.btn.loading { pointer-events: none; opacity: .6; }
.btn:disabled { pointer-events: none; opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-d) 0%, var(--accent) 50%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 4px 22px rgba(124,58,237,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(168,85,247,.55), inset 0 1px 0 rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

.btn-likes {
  background: linear-gradient(135deg, #be185d 0%, #ec4899 55%, #f472b6 100%);
  color: #fff;
  box-shadow: 0 4px 22px rgba(236,72,153,0.3), inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-likes:hover {
  box-shadow: 0 6px 32px rgba(236,72,153,.55), inset 0 1px 0 rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

/* =============================================
   STATUS / INFO BAR
   ============================================= */
.info-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 12px 16px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-size: .8rem; color: var(--txt3);
  transition: all .3s;
}
.info-bar i { font-size: .88rem; flex-shrink: 0; }

.info-bar.loading {
  border-color: rgba(168,85,247,0.28);
  background: rgba(168,85,247,0.06);
  color: var(--accent-l);
}
.info-bar.error {
  border-color: rgba(239,68,68,0.28);
  background: rgba(239,68,68,0.07);
  color: #fca5a5;
}
.info-bar.success {
  border-color: rgba(34,197,94,0.28);
  background: rgba(34,197,94,0.07);
  color: #86efac;
}

/* =============================================
   FF CARD — Free Fire Max Profile
   ============================================= */
.ff-card {
  background: #12131a;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 12px;
  font-family: 'Poppins', sans-serif;
  position: relative;
  margin-bottom: 16px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* --- Header --- */
.ff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,204,0,0.14);
}
.ff-logo-text {
  font-family: 'Orbitron', sans-serif;
  color: #ffcc00;
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: 2.5px;
  text-shadow: 0 0 14px rgba(255,204,0,0.35);
}
.ff-guild {
  color: #cbd5e1;
  font-size: .65rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  padding: 3px 9px;
  border-radius: 3px;
  letter-spacing: .5px;
}
.ff-guild i { color: #ffcc00; margin-right: 4px; }

/* --- Body grid --- */
.ff-body {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* LEFT COLUMN */
.ff-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 82px;
  flex-shrink: 0;
}

.ff-avatar-frame {
  width: 78px; height: 78px;
  border: 2.5px solid #ffcc00;
  border-radius: 4px;
  background: #1c1d26;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,204,0,0.18),
    0 4px 18px rgba(0,0,0,0.7),
    inset 0 0 14px rgba(0,0,0,0.8);
}
.ff-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ff-avatar-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1c1d26;
  color: #2e3148;
  font-size: 1.7rem;
}

.ff-level-wrap {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}
.ff-level-wrap span {
  font-family: 'Orbitron', sans-serif;
  color: #64748b;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.ff-level-wrap strong {
  font-family: 'Orbitron', sans-serif;
  color: #ffcc00;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

/* RIGHT COLUMN — asymmetric slanted panel */
.ff-right-col {
  flex-grow: 1;
  position: relative;
  /* light gaming card background */
  background: rgba(10,10,20,0.55);
  /*
    Diagonal cut on the top-left edge:
    top-left point starts at 20px inset → creates the slant toward bottom-left corner (0%, 100%)
  */
  clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 0% 100%);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  overflow: hidden;
  min-height: 100px;
}

/* Banner as background texture at reduced opacity */
.ff-banner-bg {
  position: absolute; inset: 0;
  z-index: 1;
  opacity: 0.85;
}
.ff-banner-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ff-banner-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.12);
  font-size: 2rem;
}

/* Player details — name only inside slanted panel */
.ff-player-details {
  position: relative;
  z-index: 2;
  padding: 10px 14px 10px 24px;
  display: flex;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

.ff-name-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ff-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff 40%, var(--accent-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -.2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-lang {
  font-size: .6rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  letter-spacing: .2px;
}

/* Stats row — sits between body and send button */
.ff-stats-row {
  display: flex;
  gap: 8px;
  padding: 12px 2px 4px;
}

/* Shared stat chip */
.ff-uid-display,
.ff-region-badge,
.ff-likes-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-family: 'Poppins', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  min-width: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .25s, background .25s;
}

/* UID chip */
.ff-uid-display {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--txt2);
}
.ff-uid-display i { color: var(--txt3); font-size: .7rem; flex-shrink: 0; }
.ff-uid-display strong {
  font-family: 'Orbitron', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--txt2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Region chip */
.ff-region-badge {
  background: rgba(168,85,247,0.08);
  border: 1px solid var(--bd2);
  color: var(--accent-l);
}
.ff-region-badge i { color: var(--accent); font-size: .7rem; flex-shrink: 0; }

/* Likes chip */
.ff-likes-display {
  background: rgba(236,72,153,0.08);
  border: 1px solid rgba(236,72,153,0.22);
  color: #f9a8d4;
}
.ff-likes-display i { color: #ec4899; font-size: .7rem; flex-shrink: 0; }
.ff-likes-display strong {
  font-family: 'Orbitron', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: #f9a8d4;
}


/* =============================================
   RESULT CARD
   ============================================= */
.result-card { text-align: center; }

.result-success {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 0 12px;
}
.result-icon {
  font-size: 2.8rem; line-height: 1;
  animation: heartBeat .7s ease;
}
@keyframes heartBeat {
  0%   { transform: scale(0.7); opacity: 0; }
  50%  { transform: scale(1.25); }
  75%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}
.result-msg {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem; font-weight: 800; color: var(--green);
  letter-spacing: .5px;
}
.result-detail {
  font-size: .82rem; color: var(--txt3); padding-bottom: 10px;
}
.result-detail strong { color: var(--accent-l); }

/* =============================================
   BOTTOM NAV
   ============================================= */
.bnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(7,7,15,0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--bd);
  display: flex; align-items: stretch; z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.nitem {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 5px; gap: 4px;
  color: var(--txt3); font-size: 1.05rem;
  transition: color .25s;
  cursor: pointer; background: none; border: none;
  font-family: 'Poppins', sans-serif; text-decoration: none;
}
.nitem span { font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
.nitem.active { color: var(--accent); }
.nitem.active .niw {
  background: var(--accent-g2);
  padding: 5px 18px; border-radius: 10px;
  box-shadow: inset 0 0 14px var(--accent-g2);
}

/* =============================================
   TOAST
   ============================================= */
#toast {
  position: fixed; top: -72px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-d), var(--accent));
  color: #fff; padding: 11px 22px;
  border-radius: 30px; font-weight: 700; font-size: .82rem;
  box-shadow: 0 8px 32px rgba(168,85,247,.4);
  z-index: 3000;
  transition: top .4s cubic-bezier(.68,-.55,.265,1.55);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 8px;
}
#toast.show { top: 68px; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.28); border-radius: 10px; }
