/* Layout: the surface (home hero or page hero) and the three classic columns. */
/* Anchored at the bottom: the tile's clean edge row meets the footer (or floor 8, --surface-edge
   above the bottom), so trees are never sliced there whatever the page height. The tile also has a
   clean edge every 128px; js/site.js pads the surface so the hero's bottom meets one of them. */
.surface {
  --surface-edge: 0px;
  position: relative;
  background: var(--scene-surface) center calc(100% - var(--surface-edge)) / 3840px 1536px repeat;
}

/* ---- home hero: the clearing with the logo ---- */
.hero { position: relative; height: 384px; background: transparent; image-rendering: pixelated; }
.hero > * { image-rendering: auto; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #0b1d3666 0, #0b1d3600 20%); }
.logo {
  position: absolute; z-index: 3; left: 50%; top: 128px; width: 400px; height: auto; aspect-ratio: 1100 / 495;
  transform: translateX(-50%); filter: drop-shadow(0 10px 18px #0b1d36cc); animation: rise 1.3s var(--ease) both;
}
.actor { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.actor img { image-rendering: pixelated; }
/* players: the body sits on the bottom-right tile of the 2x2 sprite */
.actor.po > img { margin-top: -40px; }
.actor.po > .gt, .actor.po > .hp, .actor.po > .mana { transform: translateX(28px); }
.fl { position: absolute; z-index: 4; opacity: 0; animation: msg 9s var(--ease) infinite; }
.levelup { left: 0; right: 0; top: 330px; text-align: center; animation-delay: 6.4s; font-size: 15px; }

/* ---- inner page hero: a strip of the same scene with the title ---- */
.pha { position: absolute; top: 84px; width: 128px; height: 128px; image-rendering: pixelated; }
.pha.l { left: calc(50% - 480px); }
.pha.r { right: calc(50% - 480px); }

/* ---- the three columns over the surface ---- */
.cols-wrap { background: transparent; }
.cols-wrap > * { image-rendering: auto; }
.cols {
  position: relative; z-index: 5; max-width: var(--content); margin: 0 auto; padding: 36px 20px 40px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 272px; gap: 22px; align-items: start;
}
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pgmain { gap: 22px; }

@keyframes rise { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes msg { 0% { opacity: 0; transform: translateY(8px); } 6% { opacity: 1; transform: none; } 30% { opacity: 1; transform: translateY(-10px); } 38% { opacity: 0; transform: translateY(-16px); } 100% { opacity: 0; } }

@media (max-width: 1100px) {
  .cols { grid-template-columns: 220px minmax(0, 1fr); }
  .cols > .rc { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cols { display: flex; flex-direction: column; }
  .cols > * { width: 100%; }
  .cols > main { order: 1; }
  .lc { order: 2; }
  .rc { order: 3; display: flex !important; }
  .hero { height: 520px; }
  .logo { top: 90px; width: 300px; }
  .actor.hide-sm, .fl.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
  .fl { animation: none; opacity: 1; }
  .fl.rm-hide { display: none; }
}
.pha.l { left: max(12px, calc(50% - 610px)); }
.pha.r { right: max(12px, calc(50% - 610px)); }
.hero-player { display: block; width: 128px; height: 128px; }
.actor.po > .hero-player { margin-top: -40px; }
.hero-player img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
@media (max-width: 760px) { .hero .actor.po:not(.hide-sm) { left: calc(50% - 64px) !important; top: 310px !important; } }
@media (max-width: 900px) { .pha.hero-player { display: none; } }
/* Quiet collection of Tibia sprites around a truly centered heading. */

.hero-gallery { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 280px; height: 280px; padding: 32px 20px; }
.hero-gallery::before { content: none; }
.hero-brand { position: relative; grid-area: 1 / 1; width: min(420px, 42vw); }
.hero-brand img { display: block; width: 100%; height: auto; transform: translateX(2.8%); }
/* Staggered sprites sit directly on the grass, with open space around the logo. */
.hero-roster { position: absolute; top: 44px; width: 220px; height: 200px; pointer-events: none; }
.roster-left { right: calc(50% + 240px); }
.roster-right { left: calc(50% + 240px); }
.hero-sprite { position: absolute; display: block; width: 96px; height: 96px; }
.hero-sprite img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 1px #17250f80); }
.roster-left .hero-sprite:first-child { left: 8px; top: 8px; }
.roster-left .hero-sprite:last-child { right: 4px; bottom: 0; }
.roster-right .hero-sprite:first-child { left: 0; bottom: 16px; width: 120px; height: 120px; }
.roster-right .hero-sprite:last-child { right: 0; top: 0; width: 104px; height: 104px; }
.phero .roster-left { right: calc(50% + 400px); }
.phero .roster-right { left: calc(50% + 400px); }
.phero .hero-sprite:last-child { display: none; }
@media (max-width: 1100px) {
 .hero-roster { width: 160px; }
 .roster-left { right: calc(50% + 200px); }
 .roster-right { left: calc(50% + 200px); }
 .roster-left .hero-sprite:last-child { bottom: -12px; }
 .roster-right .hero-sprite:last-child { top: -16px; }
 .phero .hero-roster { display: none; }
}
@media (max-width: 760px) {
 .hero-gallery { height: 330px; padding: 12px 16px 130px; }
 .hero-brand { width: min(340px, 88vw); }
 .hero-gallery .hero-roster { top: auto; bottom: 4px; width: 140px; height: 120px; }
 .hero-gallery .roster-left { right: calc(50% + 6px); }
 .hero-gallery .roster-right { left: calc(50% + 6px); }
 .hero-sprite { width: 72px; height: 72px; }
 .roster-left .hero-sprite:first-child { top: 0; left: 0; }
 .roster-left .hero-sprite:last-child { bottom: 0; right: 0; }
 .roster-right .hero-sprite:first-child { width: 88px; height: 88px; bottom: 0; left: -4px; }
 .roster-right .hero-sprite:last-child { width: 76px; height: 76px; top: -8px; right: 0; }
}

/* ---- inner page hero: title centred between the header and the columns ---- */
.phero {
  position: relative; display: grid; place-items: center; height: 232px; padding: 0 20px;
  image-rendering: pixelated; isolation: isolate;
}
.phero > * { image-rendering: auto; }
.phero::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, #071325e6 0, #071325a6 38%, #07132559 70%, #07132500 100%);
}
.is-page .cols { padding-top: 4px; }
.phero .hero-roster { top: 50%; transform: translateY(-50%); }
.pht { position: relative; z-index: 2; display: grid; justify-items: center; gap: 14px; max-width: 860px; text-align: center; }

/* 3D gold title: one solid gold face over a stepped extrusion that darkens as it goes down, then the
   cast shadow. A single text layer, so the face and the depth can never drift apart. */
.pht h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 900; font-size: clamp(42px, 6vw, 76px);
  line-height: 1.08; letter-spacing: .02em; text-wrap: balance; overflow-wrap: anywhere;
  color: #ffd65a;
  text-shadow:
    0 -1px 0 #fff1b0,
    0 1px 0 #e7a92c, 0 2px 0 #d39522, 0 3px 0 #bd7f19, 0 4px 0 #a46a12,
    0 5px 0 #88540d, 0 6px 0 #6a4009, 0 7px 1px #3f2605,
    0 10px 10px #000a, 0 18px 26px #0008;
}
.pht p {
  max-width: 600px; margin: 0; font-family: var(--font-body); font-size: 16px; font-weight: 700; line-height: 1.5;
  color: var(--ice); text-wrap: balance; text-shadow: 0 1px 2px #000, 0 0 12px #071325;
}
/* ornament: a hairline that fades out on both sides of a small gold diamond */
.pht p::before {
  content: ''; display: block; width: 200px; height: 10px; margin: 0 auto 12px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0l5 5-5 5-5-5z' fill='%23ffc847'/%3E%3C/svg%3E") 50% 50% / 10px 10px no-repeat,
    linear-gradient(90deg, #ffc84700, #ffc847cc 42%, #ffc84700 42% 58%, #ffc847cc 58%, #ffc84700) 50% 50% / 100% 1px no-repeat;
}
@media (max-width: 760px) {
  .phero { height: 196px; }
  .pht p::before { width: 150px; margin-bottom: 10px; }
  .pht p { font-size: 14px; }
}
