:root {
  --bg: #050f1c;
  --panel: #0c1c2e;
  --panel2: #132945;
  --cyan: #49dbe8;
  --cyan2: #63eff1;
  --green: #9ddd5b;
  --blue: #1483d1;
  --text: #c7d4e2;
  --muted: #8da3b9;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--text);
  background: #020b15;
}

button, input { font: inherit; }

.space {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 14%, rgba(0, 117, 132, .18), transparent 23%),
    radial-gradient(circle at 70% 17%, rgba(0, 62, 93, .22), transparent 28%),
    linear-gradient(180deg, #071725 0%, #030c17 75%);
}

.space::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    radial-gradient(circle at 10% 20%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 32% 12%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 25%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 89% 62%, #fff 0 1px, transparent 1.5px);
  background-size: 170px 170px, 240px 240px, 310px 310px, 390px 390px;
}

.nebula {
  position: fixed;
  width: 600px;
  height: 260px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .13;
  pointer-events: none;
  transform: rotate(-20deg);
}
.nebula-a { left: -150px; top: 50px; background: #00aab5; }
.nebula-b { right: -150px; top: 160px; background: #00517c; }

.stars { position: fixed; inset: 0; pointer-events: none; opacity: .65; }
.star {
  position: absolute;
  width: 2px; height: 2px; background: white; border-radius: 50%;
}

.snow { position: fixed; color: #fff; opacity: .7; z-index: 1; pointer-events: none; }
.snow-a { left: 14%; top: 24%; }
.snow-b { right: 14%; top: 26%; }
.snow-c { left: 10%; top: 78%; }
.snow-d { right: 9%; top: 79%; }

.topbar {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 3;
}

.back-btn {
  border: 0;
  background: var(--green);
  color: #13210d;
  font-weight: 900;
  border-radius: 28px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.login {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}
.login strong { display: block; color: #d8e4ee; }
.login small { color: #a7d9e1; font-weight: 800; font-size: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 3px;
  background: #ad8e39; color: #172233;
  display: grid; place-items: center; font-weight: 900;
}

.hero {
  width: min(1080px, calc(100% - 40px));
  margin: 35px auto 0;
  min-height: 320px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.logo-text {
  text-align: center;
  font-size: clamp(56px, 8vw, 88px);
  line-height: .78;
  font-weight: 900;
  letter-spacing: -5px;
  color: #55e8ee;
  text-shadow: 0 6px 0 #2c8894, 0 12px 30px rgba(0,0,0,.6);
  transform: skew(-2deg);
}

/* ===== Logo personalizado ===== */
.brand-logo {
  display: block;
  width: min(390px, 76vw);
  max-height: 165px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.45));
}
.logo-fallback {
  text-align: center;
}

.logo-mc {
  color: #f1f5f6;
  text-shadow: 0 6px 0 #83a5ab, 0 12px 30px rgba(0,0,0,.6);
  font-size: .82em;
  margin-top: 8px;
}

.minecraft-head {
  display: none;
  width: 80px; height: 70px;
  position: absolute;
  top: 38px;
  transform: rotate(-2deg);
}
.minecraft-head .hair {
  position: absolute; inset: 0 5px 14px;
  background: #15191c;
  border: 2px solid #87929a;
  clip-path: polygon(0 0, 100% 3%, 100% 75%, 88% 75%, 88% 57%, 72% 57%, 72% 75%, 55% 75%, 55% 56%, 35% 56%, 35% 75%, 0 75%);
}
.face {
  position: absolute; left: 10px; right: 10px; bottom: 2px; height: 35px;
  background: #eee; border: 2px solid #c9d5da;
}
.eye { position: absolute; width: 7px; height: 9px; background: #111; top: 10px; }
.eye.left { left: 18px; }
.eye.right { right: 18px; }
.mouth { position: absolute; width: 20px; height: 5px; background: #111; left: 50%; transform: translateX(-50%); bottom: 7px; }

.server-info {
  position: absolute;
  top: 225px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
}
.server-info.left { left: 6%; }
.server-info.right { right: 3%; }
.server-info b { display: block; font-size: 13px; }
.server-info small { display: block; color: #d0e3e7; font-size: 8px; font-weight: 800; }
.server-info .count, .play, .discord {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--cyan);
  color: #071521;
  font-weight: 900;
  border-radius: 50%;
}
.play { font-size: 15px; }
.discord { border-radius: 4px; }

.layout {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.sidebar, .content {
  background: rgba(9, 25, 41, .96);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

.sidebar { min-height: 160px; }
.side-title {
  padding: 26px 28px;
  color: var(--cyan);
  font-weight: 900;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.category {
  width: 100%;
  padding: 20px;
  background: transparent;
  color: #a9bfd3;
  border: 0;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
}
.category.active { background: rgba(255,255,255,.025); }

.content { padding: 20px 16px 16px; }

.content-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 0 5px;
}
.content-head small { color: #b4c7d8; font-weight: 800; font-size: 10px; }
.content-head h1 {
  color: var(--cyan);
  margin: 7px 0 0;
  font-size: 19px;
  letter-spacing: 1px;
}
.goal {
  background: #132845;
  color: #6be3ea;
  padding: 16px;
  font-size: 11px;
  font-weight: 900;
  width: 300px;
  align-self: start;
}

.intro { padding: 14px 0 0; }
.intro p { font-size: 11px; line-height: 1.55; color: #afc0d0; }
.intro h2 {
  color: #17e7b1;
  font-size: 18px;
  margin: 22px 0 3px;
}
.intro h2.blue { color: #1c83d0; }

.widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}
.widget, .packages {
  background: #132845;
  min-height: 130px;
  padding: 16px 12px;
  border-radius: 4px;
}
.widget h3, .packages h3 {
  color: #61dce5;
  font-size: 12px;
  margin: 0 0 18px;
}
.donor { display: flex; align-items: center; gap: 12px; }
.skin {
  width: 34px; height: 34px; background: #ef9a9a; color: #543d48;
  display: grid; place-items: center; font-weight: 900;
}
.donor b { display: block; color: #d7e3ee; font-size: 12px; }
.donor small { font-size: 9px; color: #a9bfd1; }

.payments { font-size: 11px; color: #d3dce5; white-space: pre-line; }
.payment-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}

.giftcard { grid-column: 1 / -1; min-height: 100px; }
.gift-form { display: flex; gap: 5px; }
.gift-form input {
  flex: 1; min-width: 0;
  background: #071523; border: 1px solid #0c2238; color: #e1edf5;
  border-radius: 3px; padding: 10px;
  outline: none;
}
.gift-form button {
  border: 0; background: #55bd6c; color: #fff;
  font-weight: 900; border-radius: 4px; padding: 0 18px; cursor: pointer;
}
.gift-result { margin-top: 7px; font-size: 10px; }

.packages { grid-column: 1 / -1; }
.packages-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px;
}
.package {
  background: #09192a;
  border: 1px solid rgba(96,224,233,.12);
  border-radius: 5px;
  padding: 12px;
}
.package img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; background: #071320; }
.package h4 { margin: 9px 0 5px; color: #e3edf4; }
.package p { font-size: 9px; line-height: 1.4; color: #94a9bc; min-height: 28px; }
.buy {
  width: 100%; border: 0; border-radius: 4px;
  background: #52c56b; color: white; font-weight: 900;
  padding: 9px; cursor: pointer;
}
.loading-card { color: #91a8bb; font-size: 11px; }

footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 45px;
  color: #8198ad;
  font-size: 10px;
  position: relative;
  z-index: 2;
}
footer span, footer small { display: block; }
footer small { margin-top: 3px; }

@media (max-width: 820px) {
  .topbar { padding-top: 25px; }
  .hero { min-height: 270px; }
  .server-info { top: 210px; }
  .server-info.left { left: 0; }
  .server-info.right { right: 0; }
  .layout { grid-template-columns: 1fr; }
  /* En celulares, las categorías quedan arriba de los productos. */
  .sidebar { order: 1; }
  .content { order: 2; }
  .widgets { grid-template-columns: 1fr; }
  .giftcard, .packages { grid-column: auto; }
  .packages-grid { grid-template-columns: 1fr; }
  .goal { width: 220px; }
}

@media (max-width: 560px) {
  .brand-logo {
    width: min(315px, 82vw);
    max-height: 125px;
  }
  .topbar, .hero, .layout, footer { width: min(100% - 22px, 1080px); }
  .login-wrap { gap: 5px; }
  .logout-button { padding: 7px 8px; font-size: 8px; }
  .login small { display: none; }
  .logo-text { font-size: 55px; }
  .minecraft-head { top: 42px; }
  .server-info b { font-size: 10px; }
  .server-info small { font-size: 7px; }
  .server-info .count { display: none; }
  .content-head { flex-direction: column; }
  .goal { width: 100%; }
}

/* ===== Category accordion + catalog ===== */
.category-list { padding: 7px 0 12px; }
.category-loading, .category-empty {
  padding: 18px 16px;
  color: #829ab0;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
}
.category-group { border-bottom: 1px solid rgba(255,255,255,.035); }
.category-parent-row { display: grid; grid-template-columns: 1fr 42px; align-items: stretch; }
.category-item {
  width: 100%; min-height: 50px; border: 0; background: transparent;
  color: #b4c8da; cursor: pointer; display: flex; align-items: center;
  gap: 10px; padding: 12px 14px; text-align: left; font-weight: 800;
  font-size: 11px; transition: background .18s, color .18s;
}
.category-item:hover { background: rgba(78,220,231,.06); color: #67e6ed; }
.category-item.active { background: rgba(78,220,231,.09); color: #67e6ed; }
.category-icon { width: 17px; text-align: center; color: #5bdce5; font-size: 12px; }
.category-parent-toggle {
  border: 0; background: transparent; color: #5bdce5; cursor: pointer;
  font-size: 18px; transition: transform .2s, background .18s;
}
.category-parent-toggle:hover { background: rgba(78,220,231,.06); }
.category-group.open > .category-parent-row .category-parent-toggle { transform: rotate(180deg); }
.category-children {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .28s ease, opacity .2s ease;
  background: rgba(1, 10, 20, .18);
}
.category-group.open > .category-children { max-height: 900px; opacity: 1; }
.category-children .category-item { padding-left: 39px; min-height: 43px; font-size: 10px; font-weight: 700; }
.category-children .category-group { margin-left: 12px; }

.catalog { padding: 18px !important; }
.catalog-heading { display: flex; justify-content: space-between; margin-bottom: 13px; }
.catalog-heading h3 { margin-bottom: 5px !important; }
.catalog-heading p { margin: 0; color: #8fa8bc; font-size: 10px; }
.packages-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.package { overflow: hidden; padding: 0; display: flex; flex-direction: column; min-height: 236px; background: #0b1b2d; }
.package-image-box { width: 100%; height: 132px; min-height: 132px; display: grid; place-items: center; overflow: hidden; background: #0a1828; border-bottom: 1px solid rgba(96,224,233,.08); }
.package img, .package-image-placeholder { width: 100%; height: 132px; object-fit: contain; border-radius: 0; }
.package-image-placeholder {
  display: grid; place-items: center; align-content: center; text-align: center;
  background: radial-gradient(circle at 50% 35%, #19425b, #071523 70%);
  color: #53e6ee; font-size: 20px; font-weight: 900; letter-spacing: 2px;
}
.package-image-placeholder span { color: white; font-size: 14px; }
.package-body { padding: 11px 10px 10px; display: flex; flex-direction: column; flex: 1; text-align: center; }
.package h4 { margin: 0; color: #e5eef5; font-size: 10px; line-height: 1.35; min-height: 28px; display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere; }
.package-price { color: #67e6ed; font-size: 11px; font-weight: 900; margin-top: 5px; }
.package-footer { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; }
.package-actions { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 5px; }
.buy { width: 100%; padding: 8px 9px; }
.catalog-placeholder {
  grid-column: 1 / -1; min-height: 190px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 7px;
  border: 1px dashed rgba(91,220,229,.15); border-radius: 6px; color: #8ea5b9;
}
.catalog-placeholder b { color: #60dce5; font-size: 13px; }
.catalog-placeholder span { max-width: 390px; font-size: 10px; line-height: 1.5; }
.catalog-placeholder-icon { font-size: 30px; margin-bottom: 3px; }
.spinner { width: 25px; height: 25px; border: 3px solid rgba(91,220,229,.15); border-top-color: #5bdce5; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Login session controls ===== */
.login-wrap { display: flex; align-items: center; gap: 7px; }
.logout-button {
  border: 1px solid #2a4054; background: #0b1724; color: #b8c8d5;
  border-radius: 6px; padding: 8px 10px; font-size: 9px; font-weight: 900;
  letter-spacing: .4px; cursor: pointer; text-transform: uppercase;
}
.logout-button:hover { background: #102235; color: #fff; }

/* ===== Login / Minecraft name modal ===== */
.login {
  border: 0; padding: 6px 0 6px 10px; background: transparent; color: inherit;
  display: flex; align-items: center; gap: 12px; text-align: right; cursor: pointer;
  border-radius: 8px; transition: background .18s, transform .18s;
}
.login:hover { background: rgba(78,220,231,.06); transform: translateY(-1px); }
.login-copy strong { display: block; color: #dce9f2; font-size: 12px; }
.login-copy small { display: block; color: #73d9e2; font-weight: 900; font-size: 8px; margin-top: 3px; }
.avatar { box-shadow: 0 5px 18px rgba(0,0,0,.35); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(1,7,14,.78); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.modal-backdrop.show { opacity: 1; visibility: visible; }
.login-modal {
  width: min(430px, 100%); position: relative; padding: 30px;
  background: linear-gradient(160deg, #122945, #081827); border: 1px solid rgba(91,220,229,.18);
  border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.6); transform: translateY(12px) scale(.98); transition: transform .22s;
}
.modal-backdrop.show .login-modal { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: transparent;
  color: #7890a5; font-size: 27px; cursor: pointer; line-height: 1;
}
.modal-avatar {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 13px;
  background: #55dce5; color: #08202a; border-radius: 8px; font-size: 25px;
  box-shadow: 0 10px 25px rgba(63,218,229,.15);
}
.modal-kicker { color: #58dce5; font-size: 9px; font-weight: 900; letter-spacing: 1.3px; }
.login-modal h2 { color: #eef8fb; font-size: 22px; margin: 6px 0; }
.login-modal p { color: #8fa7ba; font-size: 10px; line-height: 1.55; margin: 0 0 20px; }
.login-modal label { display: block; color: #b9ccdc; font-size: 10px; font-weight: 800; margin-bottom: 7px; }
.login-modal input:not([type="hidden"]) {
  width: 100%; padding: 13px 14px; border-radius: 6px; border: 1px solid #1b3b56;
  outline: none; background: #061320; color: #eff9fb; font-size: 13px; font-weight: 700;
}
.login-modal input:focus { border-color: #55dce5; box-shadow: 0 0 0 3px rgba(85,220,229,.08); }
.login-error { min-height: 17px; color: #ff8585; font-size: 9px; padding-top: 6px; }
.modal-actions { display: flex; gap: 8px; margin-top: 7px; }
.modal-actions button { flex: 1; border: 0; border-radius: 6px; padding: 12px; font-weight: 900; font-size: 10px; cursor: pointer; }
.modal-secondary { background: #0a1929; color: #91a8bc; border: 1px solid #19334b !important; }
.modal-primary { background: #51c96c; color: white; }
.modal-note { display: block; color: #667e92; font-size: 8px; line-height: 1.5; margin-top: 14px; text-align: center; }
body.modal-open { overflow: hidden; }

@media (max-width: 820px) {
  .packages-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .packages-grid { grid-template-columns: 1fr; }
  .login-copy small { display: none; }
  .login-modal { padding: 24px; }
}

/* ===== Página Inicio / Páginas de categoría ===== */
.home-link {
  width: calc(100% - 18px);
  margin: 8px 9px 4px;
  padding: 12px 14px;
  border: 1px solid rgba(96,224,233,.10);
  border-radius: 4px;
  background: transparent;
  color: #a9bfd3;
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: .15s ease;
}
.home-link:hover, .home-link.active {
  background: rgba(96,224,233,.08);
  color: var(--cyan);
  border-color: rgba(96,224,233,.22);
}
.home-link span { margin-left: 6px; }

.category-view {
  padding: 20px 4px 10px;
}
.category-page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 2px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 18px;
}
.category-page-head small {
  color: #8ea8bc;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .7px;
}
.category-page-head h2 {
  color: var(--cyan);
  font-size: 21px;
  margin: 6px 0 4px;
  letter-spacing: 1px;
}
.category-page-head p {
  color: #8fa8bc;
  font-size: 10px;
  margin: 0;
}
.back-home {
  flex: 0 0 auto;
  border: 1px solid rgba(96,224,233,.15);
  background: #132845;
  color: #bcd0df;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}
.back-home:hover {
  color: var(--cyan);
  border-color: rgba(96,224,233,.35);
}
.category-packages-grid {
  min-height: 180px;
}
.category-packages-grid .catalog-placeholder {
  grid-column: 1 / -1;
  min-height: 180px;
}

@media (max-width: 560px) {
  .category-page-head { flex-direction: column; }
  .back-home { width: 100%; }
}


/* ===== Package actions / info modal / Minecraft skin ===== */
.package-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.info-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid rgba(91,220,229,.35);
  border-radius: 4px;
  background: #0b2035;
  color: #67e6ed;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  transition: .18s ease;
}
.info-btn:hover {
  background: #163a55;
  transform: translateY(-1px);
}
.buy:disabled {
  opacity: .55;
  cursor: wait;
}

/* Información del paquete: todo el contenido de Tebex se conserva,
   pero se adapta a una sola columna para leer siempre hacia abajo. */
.package-info-modal {
  width: min(700px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  background: #0b1b2d;
  border: 1px solid rgba(103,230,237,.18);
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #31546b #081522;
}
.package-info-image-wrap {
  width: 100%;
  height: 215px;
  min-height: 215px;
  background: radial-gradient(circle at 50% 35%, #19425b, #071523 72%);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(103,230,237,.10);
}
.package-info-image {
  display: block;
  width: 100%;
  height: 215px;
  object-fit: contain;
  padding: 12px;
}
.package-info-image-placeholder {
  color: #5be4ec;
  font-size: 38px;
  font-weight: 900;
  text-align: center;
  line-height: .9;
}
.package-info-image-placeholder span {
  display: block;
  color: #fff;
  font-size: 27px;
  margin-top: 7px;
}
.package-info-content {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 28px 28px;
}
.package-info-content h2 {
  color: #e5f1f6;
  margin: 8px 0 7px;
  font-size: 25px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.package-info-price {
  color: #67e6ed;
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 20px;
}
.package-info-description {
  color: #a9bbca;
  font-size: 12px;
  line-height: 1.65;
  margin: 0 0 24px;
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.package-info-description p { margin: 0 0 12px; }
.package-info-description ul,
.package-info-description ol { padding-left: 20px; margin-top: 8px; }
.package-info-description li { margin-bottom: 5px; }
.package-info-description strong { color: #dce8ef; }
.package-info-description img,
.package-info-description video,
.package-info-description iframe,
.package-info-description table {
  max-width: 100% !important;
}
.package-info-description img,
.package-info-description video,
.package-info-description iframe {
  height: auto !important;
}
.package-info-description table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  word-break: break-word;
}
.package-info-description td,
.package-info-description th {
  max-width: 100%;
  word-break: break-word;
}
.package-info-description pre,
.package-info-description code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 3px;
  object-fit: cover;
  image-rendering: pixelated;
  background: #162b40;
  border: 1px solid rgba(103,230,237,.18);
}
.login-modal .modal-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 4px;
  object-fit: cover;
  image-rendering: pixelated;
  display: grid;
  place-items: center;
  background: #132945;
}
.login-modal .modal-avatar.has-skin {
  display: block;
}
@media (max-width: 1050px) {
  .packages-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .packages-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .package-info-modal { width: min(700px, calc(100vw - 18px)); max-height: calc(100vh - 18px); }
  .package-info-image-wrap { height: 180px; min-height: 180px; }
  .package-info-image { height: 180px; }
  .package-info-content { padding: 20px 16px 22px; }
}
@media (max-width: 480px) {
  .packages-grid { grid-template-columns: 1fr; }
}

/* ===== Package information modal — layout inspired by the supplied SnowMC reference ===== */
.package-info-modal {
  width: min(720px, calc(100vw - 34px));
  height: min(690px, calc(100vh - 54px));
  max-height: calc(100vh - 54px);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  overflow: hidden;
  background: #0b1a2c;
  border: 1px solid rgba(104, 205, 235, .12);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0,0,0,.68);
  position: relative;
}

.package-info-sidebar {
  min-width: 0;
  background: #0a192b;
  border-right: 1px solid rgba(111, 209, 239, .08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.package-info-image-wrap {
  width: 100%;
  height: 225px;
  min-height: 225px;
  background: radial-gradient(circle at 50% 38%, #1c425a 0%, #0b1d31 62%, #081525 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(103,230,237,.08);
}

.package-info-image {
  display: block;
  width: 100%;
  height: 225px;
  object-fit: contain;
  padding: 10px;
  image-rendering: auto;
}

.package-info-image-placeholder {
  color: #5be4ec;
  font-size: 34px;
  font-weight: 900;
  text-align: center;
  line-height: .9;
}

.package-info-image-placeholder span {
  display: block;
  color: #fff;
  font-size: 24px;
  margin-top: 6px;
}

.package-info-summary {
  padding: 18px 16px 20px;
  text-align: center;
}

.package-info-summary h2 {
  color: #edf7fb;
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.18;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.package-info-price {
  color: #5bd7ee;
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 18px;
}

.package-info-buy {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: #4fc0f2;
  color: white;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: .18s ease;
}

.package-info-buy:hover { filter: brightness(1.08); transform: translateY(-1px); }
.package-info-buy:disabled { opacity: .55; cursor: wait; transform: none; }

.package-info-details {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #11253d;
}

.package-info-details-head {
  flex: 0 0 auto;
  padding: 22px 24px 13px;
  background: #122941;
  border-bottom: 1px solid rgba(104, 205, 235, .07);
}

.package-info-description {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 24px 28px;
  color: #d2dde5;
  font-size: 12px;
  line-height: 1.65;
  scrollbar-width: thin;
  scrollbar-color: #3c6078 #0b1b2d;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.package-info-description p { margin: 0 0 13px; }
.package-info-description ul,
.package-info-description ol { margin: 8px 0 14px; padding-left: 20px; }
.package-info-description li { margin-bottom: 5px; }
.package-info-description strong,
.package-info-description b { color: #f0f7fa; }
.package-info-description a { color: #63dff0; overflow-wrap: anywhere; }
.package-info-description img,
.package-info-description video,
.package-info-description iframe,
.package-info-description table { max-width: 100% !important; }
.package-info-description img,
.package-info-description video,
.package-info-description iframe { height: auto !important; display: block; }
.package-info-description img { object-fit: contain; margin: 8px auto; }
.package-info-description table {
  width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 8px 0 16px;
}
.package-info-description td,
.package-info-description th {
  max-width: 100%;
  padding: 5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.package-info-description pre,
.package-info-description code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.package-info-modal > .modal-close {
  z-index: 5;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(6,18,31,.72);
  border-color: rgba(255,255,255,.08);
}

@media (max-width: 650px) {
  .package-info-modal {
    width: min(520px, calc(100vw - 18px));
    height: min(760px, calc(100vh - 22px));
    max-height: calc(100vh - 22px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .package-info-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(111, 209, 239, .08);
    display: grid;
    grid-template-columns: 145px minmax(0,1fr);
    align-items: center;
  }
  .package-info-image-wrap,
  .package-info-image { height: 145px; min-height: 145px; }
  .package-info-summary { padding: 14px 16px; }
  .package-info-details-head { padding: 18px 18px 10px; }
  .package-info-description { padding: 8px 18px 22px; }
}
