/* =============================================
   SWORDIE PORTAL — portal.css
   MapleStory v232 Private Server
   ============================================= */

:root {
  --bg-deep: #050a14;
  --bg-card: rgba(10, 18, 35, 0.85);
  --bg-blur: rgba(15, 25, 50, 0.7);
  --gold: #f5c842;
  --gold2: #ffd700;
  --gold-dark: #c9a227;
  --blue: #4a9eff;
  --blue-dark: #1a5fcb;
  --red: #e05252;
  --green: #52c07e;
  --text: #e8eaf0;
  --text-dim: #8a9bb5;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(245, 200, 66, 0.3);
  --glow-blue: 0 0 30px rgba(74, 158, 255, 0.3);
  --glow-gold: 0 0 30px rgba(245, 200, 66, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Outfit', 'Noto Sans Thai', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- PARTICLES BG ---- */
#particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(30, 80, 200, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(245, 200, 66, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(5, 10, 20, 1) 0%, transparent 100%);
  background-color: var(--bg-deep);
  animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    background-position: 0% 0%, 100% 100%, 50% 50%;
  }

  100% {
    background-position: 10% 10%, 90% 90%, 50% 50%;
  }
}

/* ---- NAVBAR ---- */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 10, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.logo-accent {
  color: var(--gold);
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 1;
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(245, 200, 66, 0.2), rgba(74, 158, 255, 0.2));
  color: var(--gold);
  border: 1px solid var(--border-glow);
}

.nav-tab i {
  font-size: 0.95rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(224, 82, 82, 0.15);
  border: 1px solid rgba(224, 82, 82, 0.3);
  color: var(--red);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.btn-logout:hover {
  background: rgba(224, 82, 82, 0.3);
}

/* ---- MAIN ---- */
.portal-main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 64px);
}

/* ---- PAGES ---- */
.portal-page {
  display: none;
}

.portal-page.active {
  display: block;
}

/* ---- HERO ---- */
.page-hero {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-hero.short-hero {
  height: 260px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.55) saturate(1.2);
  transform: scale(1.05);
  transition: transform 8s ease;
}

.page-hero:hover .hero-bg {
  transform: scale(1.0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 10, 20, 0.3) 0%, var(--bg-deep) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1rem;
}

.maple-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(245, 200, 66, 0.2), rgba(245, 200, 66, 0.05));
  border: 1px solid var(--border-glow);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
  animation: fadeUp 0.7s 0.1s ease both;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.75rem;
  animation: fadeUp 0.7s 0.2s ease both;
}

.gradient-gold {
  background: linear-gradient(135deg, #f5c842, #ffd700, #e8a500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- FORM CONTAINER ---- */
.form-container {
  max-width: 520px;
  margin: -60px auto 0;
  padding: 0 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ---- GLASS CARD ---- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: cardIn 0.5s ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- FORM HEADER ---- */
.form-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.form-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.3), rgba(26, 95, 203, 0.2));
  border: 1px solid rgba(74, 158, 255, 0.3);
  box-shadow: 0 0 20px rgba(74, 158, 255, 0.2);
}

.form-icon.register-icon {
  background: linear-gradient(135deg, rgba(82, 192, 126, 0.3), rgba(30, 120, 70, 0.2));
  border-color: rgba(82, 192, 126, 0.3);
  box-shadow: 0 0 20px rgba(82, 192, 126, 0.2);
}

.form-icon.gift-icon {
  background: linear-gradient(135deg, rgba(245, 200, 66, 0.3), rgba(200, 160, 30, 0.2));
  border-color: var(--border-glow);
  box-shadow: var(--glow-gold);
}

.form-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.form-header p {
  color: var(--text-dim);
  font-size: 0.875rem;
}

/* ---- FIELDS ---- */
.field-group {
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.portal-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.portal-input:focus {
  border-color: rgba(74, 158, 255, 0.5);
  background: rgba(74, 158, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.12);
}

.portal-input::placeholder {
  color: rgba(138, 155, 181, 0.6);
}

.portal-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M6 8L0 0h12z' fill='%238a9bb5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.portal-select option {
  background: #0d1b35;
  color: var(--text);
}

.code-input {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.15em;
  font-size: 1.1rem;
  text-align: center;
  text-transform: uppercase;
}

.input-eye-wrap {
  position: relative;
}

.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.eye-btn:hover {
  color: var(--text);
}

.input-addon-wrap {
  display: flex;
}

.input-addon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 1rem;
  color: var(--gold);
}

.input-addon-wrap .portal-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ---- BUTTONS ---- */
.btn-portal {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-glow {
  background: linear-gradient(135deg, #1a5fcb, #4a9eff);
  color: #fff;
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.35);
}

.btn-primary-glow:hover {
  background: linear-gradient(135deg, #2068d8, #5aaeff);
  box-shadow: 0 6px 28px rgba(74, 158, 255, 0.55);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.btn-gold {
  background: linear-gradient(135deg, #c9a227, #f5c842);
  color: #1a1200;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #dab52e, #ffd700);
  box-shadow: 0 6px 28px rgba(245, 200, 66, 0.5);
  transform: translateY(-1px);
}

/* ---- DIVIDER ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- ALERTS ---- */
.portal-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  animation: alertIn 0.3s ease;
}

@keyframes alertIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.portal-alert.error {
  background: rgba(224, 82, 82, 0.15);
  border-color: rgba(224, 82, 82, 0.3);
  color: #ff9999;
}

.portal-alert.success {
  background: rgba(82, 192, 126, 0.15);
  border-color: rgba(82, 192, 126, 0.3);
  color: #90f0b8;
}

.portal-alert.info {
  background: rgba(74, 158, 255, 0.12);
  border-color: rgba(74, 158, 255, 0.3);
  color: #90c8ff;
}

/* ---- STATS BAR ---- */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 400px;
  margin: 0 auto 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 14px 32px;
  animation: fadeUp 0.8s 0.4s ease both;
}

.stat-item {
  text-align: center;
  padding: 0 24px;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ---- AUTH GUARD ---- */
.auth-guard {
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.auth-guard h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.auth-guard p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.auth-guard .btn-portal {
  max-width: 220px;
  margin: 0 auto;
}

/* ---- REDEEM SUCCESS ---- */
.redeem-success {
  text-align: center;
  padding: 2.5rem 2rem;
}

.success-burst {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.burst-ring {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0.6;
  animation: burstRing 1.5s ease-out infinite;
}

@keyframes burstRing {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.burst-icon {
  font-size: 3rem;
  position: relative;
  z-index: 1;
  animation: bounce 0.8s ease;
}

@keyframes bounce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }
}

.redeem-success h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
}

.redeem-success p {
  color: var(--text);
  margin: 0.5rem 0;
}

.hint-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---- HISTORY LIST ---- */
.section-mini-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dim);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.history-item .h-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.history-item .h-info {
  flex: 1;
}

.history-item .h-name {
  font-weight: 600;
}

.history-item .h-date {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.history-item .h-qty {
  color: var(--gold);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}

/* ---- ADMIN PANEL ---- */
.form-icon.admin-icon {
  background: linear-gradient(135deg, rgba(165, 100, 255, 0.3), rgba(100, 50, 200, 0.2));
  border-color: rgba(165, 100, 255, 0.4);
  box-shadow: 0 0 20px rgba(165, 100, 255, 0.25);
}

.gen-code-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 2px dashed rgba(245, 200, 66, 0.4);
  margin: 1.5rem 0;
  text-shadow: 0 0 15px rgba(245, 200, 66, 0.3);
}

.marketplace-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.market-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
}

.market-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.filter-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

.filter-chip.active {
  background: rgba(245, 200, 66, 0.18);
  border-color: var(--border-glow);
  color: var(--gold);
}

.filter-chip.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge-soon {
  font-size: 0.65rem;
  background: var(--gold);
  color: #14100a;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}

.market-search-wrap {
  flex: 1;
  position: relative;
  min-width: 180px;
}

.market-search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.market-search {
  padding-left: 42px !important;
}

.market-controls .btn-portal {
  width: auto;
  flex-shrink: 0;
  padding: 10px 20px;
}

/* ---- LISTINGS GRID ---- */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
  animation: cardIn 0.4s ease both;
}

.listing-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-gold);
  transform: translateY(-3px);
}

.listing-banner {
  height: 120px;
  position: relative;
  background: linear-gradient(135deg, #0d2060, #1a5fcb);
  overflow: hidden;
}

.listing-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.listing-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(245, 200, 66, 0.9);
  color: #14100a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.listing-body {
  padding: 1.25rem;
}

.listing-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
}

.listing-amount span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 4px;
}

.listing-seller {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 4px 0 12px;
}

.listing-seller strong {
  color: var(--text);
}

.listing-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
}

.listing-rate {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.listing-actions {
  display: flex;
  gap: 8px;
}

.listing-actions .btn-portal {
  flex: 1;
  padding: 9px;
  font-size: 0.85rem;
}

.btn-cancel-listing {
  background: rgba(224, 82, 82, 0.12);
  border: 1px solid rgba(224, 82, 82, 0.25);
  color: rgba(224, 82, 82, 0.85);
  font-weight: 600;
  border-radius: 8px;
  padding: 9px;
  flex: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  font-family: var(--font);
}

.btn-cancel-listing:hover {
  background: rgba(224, 82, 82, 0.25);
  color: var(--red);
}

.empty-market {
  text-align: center;
  padding: 4rem 1rem;
  width: 100%;
}

.empty-market img {
  width: 120px;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-market h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.empty-market p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.empty-market .btn-portal {
  display: inline-flex;
  width: auto;
}

/* ---- PRICE PREVIEW ---- */
.price-preview {
  background: rgba(245, 200, 66, 0.08);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 1rem;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin: 4px 0;
}

.preview-row.bold {
  font-weight: 700;
  border-top: 1px solid var(--border-glow);
  padding-top: 8px;
  margin-top: 8px;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay[style*="display:none"] {
  display: none !important;
}

.modal-box {
  max-width: 480px;
  width: 100%;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close,
.buy-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(224, 82, 82, 0.2);
  color: var(--red);
  border-color: rgba(224, 82, 82, 0.3);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 1.25rem;
}

.modal-actions .btn-portal {
  flex: 1;
}

.buy-summary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ---- TOAST ---- */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 12px 18px;
  min-width: 240px;
  max-width: 340px;
  font-size: 0.875rem;
  pointer-events: all;
  animation: toastIn 0.4s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.toastOut {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

.toast.success {
  border-color: rgba(82, 192, 126, 0.4);
}

.toast.error {
  border-color: rgba(224, 82, 82, 0.4);
}

.toast-icon {
  margin-right: 8px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 680px) {
  .nav-inner {
    gap: 0.75rem;
  }

  .nav-tab span {
    display: none;
  }

  .nav-tab {
    padding: 8px 12px;
    flex: none;
  }

  .nav-tabs {
    flex: none;
  }

  .page-hero {
    height: 320px;
  }

  .page-hero.short-hero {
    height: 200px;
  }

  .market-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .market-controls .btn-portal {
    width: auto;
    align-self: flex-end;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }
}