/* ==========================================================================
   FFF Skin Tool & Emotes — Native Android App Experience in Browser
   Centered mobile app shell (max-width: 412px) with pinned Android header,
   fixed gaming background, inner scroll view, and tactile press feedback.
   ========================================================================== */

:root {
  --bg-main: #020805;
  --bg-card: #071A11;
  --neon-green: #00FF78;
  --primary-green-dark: #00C96B;
  --secondary-green: #00F57A;
  --accent-gold: #FFD700;
  --text-primary: #FFFFFF;
  --text-secondary: #C8D5CD;
  --text-muted: #B0BEC5;
  --text-hint: #4E695B;
  --stroke-card: #1B4A2D;
  --green-alpha-20: rgba(0, 255, 120, 0.2);

  --font-display: 'Arial Black', 'Impact', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
}

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

html,
body {
  height: 100%;
  background-color: #010402;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Outer Desktop Backdrop (Centers the 412px Android App Shell) */
body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  background-image: radial-gradient(circle at 50% 20%, rgba(0, 255, 120, 0.08) 0%, rgba(1, 4, 2, 0.98) 65%);
}

/* Mobile-Only App Frame */
.app-shell {
  width: 100%;
  max-width: 412px;
  height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  background-image: var(--page-bg, url("../assets/images/backgrounds/bg_home_gaming.webp"));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
  transition: opacity 0.14s ease;
}

@media (min-width: 430px) {
  .app-shell {
    border-left: 1px solid rgba(0, 255, 120, 0.22);
    border-right: 1px solid rgba(0, 255, 120, 0.22);
    box-shadow: 0 0 46px rgba(0, 0, 0, 0.94);
  }
}

.app-shell.nav-leaving {
  opacity: 0.72;
}

/* Exact Android Screen Background Variants */
body.bg-home .app-shell { --page-bg: url("../assets/images/backgrounds/bg_home_gaming.webp"); }
body.bg-settings .app-shell { --page-bg: url("../assets/images/backgrounds/bg_settings_gaming.webp"); }
body.bg-calc .app-shell { --page-bg: url("../assets/images/backgrounds/bg_diamond_calc_gaming.png"); }
body.bg-basic-calc .app-shell { --page-bg: url("../assets/images/backgrounds/bg_basic_calc_gaming.png"); }
body.bg-tips .app-shell { --page-bg: url("../assets/images/backgrounds/bg_tips_gaming.png"); }
body.bg-unique-name .app-shell { --page-bg: url("../assets/images/backgrounds/bg_unique_name_gaming.png"); }
body.bg-redeem .app-shell { --page-bg: url("../assets/images/backgrounds/bg_screen_redeem_diamond.png"); }
body.bg-redeem-rewards .app-shell { --page-bg: url("../assets/images/backgrounds/bg_screen_redeem_rewards.png"); }
body.bg-gun-code .app-shell { --page-bg: url("../assets/images/backgrounds/bg_screen_gun_code_diamond.png"); }
body.bg-code-gun-skin .app-shell { --page-bg: url("../assets/images/backgrounds/bg_screen_code_gun_skin.png"); }

img,
svg {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  color: inherit;
  text-decoration: none;
  user-select: none;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  user-select: none;
}

.font-gaming {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-neon { color: var(--neon-green); }
.text-gold { color: var(--accent-gold); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* ==========================================================================
   Pinned Android Action Bar (48px)
   ========================================================================== */
.app-topbar {
  height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  user-select: none;
}

.topbar-title-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  max-width: calc(100% - 108px);
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.topbar-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.22rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.topbar-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.topbar-icon-btn:active {
  transform: scale(0.9);
  background-color: rgba(0, 255, 120, 0.18);
}

.topbar-icon-btn img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.topbar-spacer {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* Diamond Balance Pill */
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(7, 26, 17, 0.92);
  border: 1.5px solid var(--neon-green);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: #FFFFFF;
}

.balance-pill img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

/* ==========================================================================
   Android NestedScrollView Body (Hidden Scrollbars, Smooth Activity Enter)
   ========================================================================== */
@keyframes androidScreenIn {
  from {
    opacity: 0.45;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-body,
.home-stack {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  animation: androidScreenIn 0.16s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.screen-body::-webkit-scrollbar,
.home-stack::-webkit-scrollbar {
  display: none;
}

.screen-body {
  padding: 4px 12px 20px;
  display: flex;
  flex-direction: column;
}

.screen-subtitle {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.35;
}

/* ==========================================================================
   AngularGamingCardView (45° Chamfered Corners + #00FF78 Border)
   ========================================================================== */
.angular-card {
  --cut: 10px;
  position: relative;
  display: block;
  padding: 1.5px;
  background: var(--neon-green);
  clip-path: polygon(
    var(--cut) 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut)),
    0 var(--cut)
  );
  transition: transform 0.12s ease, filter 0.12s ease;
}

.angular-card:active {
  transform: scale(0.975);
  filter: brightness(1.12);
}

.angular-card-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(8, 32, 21, 0.94) 0%, rgba(2, 8, 4, 0.98) 100%);
  clip-path: polygon(
    calc(var(--cut) - 1px) 0,
    calc(100% - var(--cut) + 1px) 0,
    100% calc(var(--cut) - 1px),
    100% calc(100% - var(--cut) + 1px),
    calc(100% - var(--cut) + 1px) 100%,
    calc(var(--cut) - 1px) 100%,
    0 calc(100% - var(--cut) + 1px),
    0 calc(var(--cut) - 1px)
  );
  overflow: hidden;
  position: relative;
}

/* Rounded Gaming Card */
.gaming-card {
  background: linear-gradient(180deg, rgba(9, 34, 23, 0.94) 0%, rgba(5, 20, 13, 0.96) 55%, rgba(2, 7, 4, 0.98) 100%);
  border: 1.5px solid var(--neon-green);
  border-radius: 14px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

a.gaming-card:active,
button.gaming-card:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

.neon-border-card {
  background: rgba(4, 18, 9, 0.92);
  border: 1.5px solid var(--neon-green);
  border-radius: 14px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

a.neon-border-card:active,
button.neon-border-card:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

/* Tactile Android Buttons */
.btn-neon-pill {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00E66B 0%, #00FF78 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #020804;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 255, 120, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-neon-pill:active {
  transform: scale(0.975);
  filter: brightness(0.94);
}

.btn-neon-pill:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-neon-rect {
  width: 100%;
  height: 45px;
  border-radius: 12px;
  background: linear-gradient(90deg, #00C96B 0%, #00FF78 100%);
  color: #020804;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease;
}

.btn-neon-rect:active {
  transform: scale(0.975);
}

.btn-outline-rect {
  width: 100%;
  height: 43px;
  border-radius: 12px;
  background: rgba(7, 26, 17, 0.85);
  border: 1.5px solid var(--neon-green);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.btn-outline-rect:active {
  transform: scale(0.975);
  background-color: rgba(0, 255, 120, 0.16);
}

.btn-copy-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00C96B, #00FF78);
  color: #020804;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.btn-copy-pill:active {
  transform: scale(0.94);
}

/* ==========================================================================
   Home Screen (index.html — Exact activity_main.xml Proportions)
   ========================================================================== */
.home-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 2px 12px 18px;
}

.home-hero-card {
  --cut: 11px;
  height: 112px;
  flex-shrink: 0;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero-text {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 16px;
}

.home-hero-text span {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.44rem;
  line-height: 1.05;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.85);
}

.home-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  flex-shrink: 0;
}

.home-portrait-card {
  --cut: 9px;
  height: 120px;
}

.home-portrait-card img.bg-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.home-portrait-vignette {
  position: absolute;
  inset: auto 0 0 0;
  height: 42px;
  background: linear-gradient(180deg, transparent 0%, rgba(2, 8, 5, 0.94) 85%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding-bottom: 7px;
}

.home-portrait-vignette span {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
}

.home-wide-row {
  --cut: 8px;
  height: 54px;
  flex-shrink: 0;
}

.home-half-row {
  --cut: 8px;
  height: 54px;
}

.home-row-flex {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
}

.home-row-flex img.cat-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.home-row-flex img.cat-icon-lg {
  width: 40px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.home-row-label {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.72rem;
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: #FFFFFF;
}

.home-wide-row .home-row-label {
  font-size: 0.82rem;
}

.chevron-green {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ==========================================================================
   2-Column & 3-Column Catalog Grids
   ========================================================================== */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.catalog-tile {
  --cut: 8px;
}

.catalog-tile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  text-align: center;
}

.catalog-tile-body img {
  width: 100%;
  height: 104px;
  object-fit: contain;
}

.catalog-tile-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skin Tools Hub Cards */
.skin-tool-banner {
  --cut: 10px;
  height: 134px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.skin-tool-banner-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 18px;
}

.skin-tool-banner-inner img {
  width: 55%;
  height: 100%;
  object-fit: contain;
}

.skin-tool-square {
  --cut: 9px;
  height: 156px;
}

.skin-tool-square-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}

.skin-tool-square-inner img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Inputs, Lists, Pills, Modals & Toast
   ========================================================================== */
.neon-input-box {
  height: 46px;
  border-radius: 12px;
  background: rgba(4, 18, 9, 0.92);
  border: 1.5px solid var(--neon-green);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.neon-input-box input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-size: 0.94rem;
}

.neon-input-box input::placeholder {
  color: var(--text-hint);
}

.list-row-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 18, 9, 0.92);
  border: 1.5px solid var(--neon-green);
  margin-bottom: 9px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

a.list-row-card:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

.wallpaper-tile {
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(0, 255, 120, 0.7);
  aspect-ratio: 9 / 16;
  display: block;
}

.wallpaper-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 350px;
  background: rgba(7, 26, 17, 0.98);
  border: 1.5px solid var(--neon-green);
  border-radius: 18px;
  padding: 20px 18px;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 140;
  background: rgba(7, 26, 17, 0.97);
  border: 1.5px solid var(--neon-green);
  color: #FFFFFF;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 350px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
