/* ============================================================
   LUTHER'S WORLD — SHELL + COMPONENT LAYER
   Apple-native surface model: white rail, light gray content
   area, shadow-lifted cards, no visible borders on containers.
   ============================================================ */

/* ── app frame ─────────────────────────────────────────────── */
body.lw-shelled { background: var(--page); }
.lw-app { display: block; }
.lw-content { min-width: 0; background: var(--page); }
.lw-main { max-width: 820px; margin: 0 auto; padding: 0 24px 96px; }

/* ── rail (desktop and tablet) ─────────────────────────────── */
.lw-rail { display: none; }
.lw-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 6px 8px 22px; }
.lw-mark { width: 32px; height: 32px; flex: none; display: block; }
.lw-mark svg { width: 100%; height: 100%; display: block; }
.lw-bname { font-size: 1.02rem; font-weight: 700; line-height: 1.2; }
.lw-nav { display: flex; flex-direction: column; gap: 2px; }
.lw-navsep { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink4); padding: 20px 8px 6px; }
.lw-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink2); font-weight: 700; font-size: .92rem; min-height: 42px; transition: background .15s, color .15s; }
.lw-link:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.lw-link.on { background: rgba(91, 42, 84, .08); color: var(--site-acc); }
.lw-ico { font-size: 1rem; line-height: 1; width: 1.4em; text-align: center; flex: none; }

.lw-railfoot { margin-top: auto; padding-top: 18px; position: relative; }
.lw-pill { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: var(--page); border: none; border-radius: var(--radius-md); cursor: pointer; font-family: var(--body); text-align: left; min-height: 54px; transition: background .15s; }
.lw-pill:hover { background: rgba(0,0,0,.04); }
.lw-pill .av { font-size: 1.4rem; line-height: 1; flex: none; }
.lw-pill .pt { display: flex; flex-direction: column; min-width: 0; }
.lw-pill .nm { font-weight: 700; font-size: .88rem; color: var(--ink); }
.lw-pill .ct { font-size: .74rem; font-weight: 700; color: var(--ink3); }
.lw-setbtn { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 10px 12px; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--ink3); font-family: var(--body); font-weight: 700; font-size: .85rem; cursor: pointer; min-height: 42px; }
.lw-setbtn:hover { background: rgba(0,0,0,.04); color: var(--ink); }

/* ── mobile top strip ──────────────────────────────────────── */
.lw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(0,0,0,.06); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.lw-topbrand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; }
.lw-topbrand .lw-mark { width: 26px; height: 26px; }
.lw-topright { display: flex; align-items: center; gap: 6px; position: relative; }
.lw-toppill { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--page); border: none; border-radius: 999px; font-family: var(--body); font-weight: 700; font-size: .82rem; color: var(--ink); cursor: pointer; min-height: 36px; transition: background .15s; }
.lw-toppill:hover { background: rgba(0,0,0,.06); }
.lw-toppill .av { font-size: 1rem; line-height: 1; }
.lw-topset { width: 36px; height: 36px; border-radius: 50%; background: var(--page); border: none; cursor: pointer; font-size: .9rem; transition: background .15s; }
.lw-topset:hover { background: rgba(0,0,0,.06); }

/* ── mobile bottom bar ─────────────────────────────────────── */
.lw-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: rgba(255,255,255,.92); border-top: 1px solid rgba(0,0,0,.06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding-bottom: env(safe-area-inset-bottom); }
.lw-barlink { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; text-decoration: none; color: var(--ink3); font-size: .65rem; font-weight: 700; min-height: 52px; text-align: center; line-height: 1.2; transition: color .15s; }
.lw-barlink .lw-ico { font-size: 1.1rem; }
.lw-barlink.on { color: var(--site-acc); }

/* ── panels (players, settings) ────────────────────────────── */
.lw-panel { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 260px; background: #fff; border: none; border-radius: var(--radius-md); padding: 16px; z-index: 60; box-shadow: var(--shadow-lg); }
.lw-panel-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .92rem; margin-bottom: 12px; }
.lw-panel-x { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--page); cursor: pointer; color: var(--ink2); font-size: .78rem; transition: background .15s; }
.lw-panel-x:hover { background: var(--rule); }
.lw-plist { display: flex; flex-direction: column; gap: 6px; }
.lw-prow { display: flex; align-items: center; gap: 6px; }
.lw-ppick { flex: 1; display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--page); border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--body); text-align: left; min-height: 46px; transition: background .15s; }
.lw-ppick:hover { background: var(--rule); }
.lw-prow.on .lw-ppick { background: var(--site-acc-soft); }
.lw-ppick .av { font-size: 1.2rem; line-height: 1; }
.lw-ppick .nm { font-weight: 700; font-size: .88rem; flex: 1; }
.lw-ppick .ct { font-size: .72rem; font-weight: 700; color: var(--ink3); }
.lw-prename { flex: 1; padding: 10px 12px; border: 2px solid var(--site-acc); border-radius: var(--radius-sm); font-family: var(--body); font-size: .88rem; font-weight: 700; min-height: 46px; outline: none; background: #fff; }
.lw-pmini { padding: 8px 10px; background: var(--page); border: none; border-radius: var(--radius-sm); color: var(--ink3); font-family: var(--body); font-size: .74rem; font-weight: 700; cursor: pointer; min-height: 38px; transition: background .15s, color .15s; }
.lw-pmini:hover { background: var(--rule); color: var(--ink); }
.lw-pmini.danger:hover { background: #fceaea; color: #7a2b2b; }
.lw-padd { width: 100%; margin-top: 8px; padding: 11px; background: var(--page); border: 2px dashed var(--rule); border-radius: var(--radius-sm); color: var(--ink2); font-family: var(--body); font-weight: 700; font-size: .85rem; cursor: pointer; min-height: 46px; transition: border-color .15s; }
.lw-padd:hover { border-color: var(--site-acc); color: var(--ink); }
.lw-pnote { font-size: .76rem; color: var(--ink3); line-height: 1.5; margin-top: 10px; }
.lw-srow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.lw-slabel { font-weight: 700; font-size: .88rem; }
.lw-toggle { padding: 8px 18px; border: none; border-radius: var(--radius-sm); background: var(--page); font-family: var(--body); font-weight: 700; font-size: .82rem; color: var(--ink3); cursor: pointer; min-height: 42px; min-width: 66px; transition: background .15s, color .15s; }
.lw-toggle.on { background: var(--site-acc); color: #fff; }
.lw-seg { display: flex; gap: 4px; }
.lw-sz { width: 42px; min-height: 42px; border: none; border-radius: var(--radius-sm); background: var(--page); cursor: pointer; font-family: var(--body); font-weight: 700; color: var(--ink3); transition: background .15s; }
.lw-sz.s1 { font-size: .76rem; } .lw-sz.s2 { font-size: .92rem; } .lw-sz.s3 { font-size: 1.12rem; }
.lw-sz.on { background: var(--site-acc); color: #fff; }

/* ── shared components ─────────────────────────────────────── */

/* page header */
.lw-head { padding: 28px 0 8px; }
.lw-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--site-acc); margin-bottom: 8px; }
.lw-title { font-family: var(--body); font-size: 1.75rem; font-weight: 700; line-height: 1.22; letter-spacing: -.02em; }
.lw-sub { font-size: .98rem; color: var(--ink2); line-height: 1.6; margin-top: 8px; max-width: 52ch; }

/* section header */
.lw-sec { margin: 30px 0 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lw-sec h2 { font-size: 1.08rem; font-weight: 700; }
.lw-sec .lw-secsub { font-size: .86rem; color: var(--ink3); display: block; }
.lw-sec a { font-size: .86rem; font-weight: 700; color: var(--site-acc); text-decoration: none; }

/* CTA card: full width, tinted, no left border */
.lw-cta { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: #fff; border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s; }
.lw-cta:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lw-cta .lw-ctamotif { font-size: 2.4rem; line-height: 1; flex: none; }
.lw-cta .lw-ctabody { flex: 1; min-width: 0; }
.lw-cta .lw-ctakicker { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); }
.lw-cta .lw-ctaname { display: block; font-family: var(--body); font-size: 1.18rem; font-weight: 700; line-height: 1.25; margin-top: 3px; }
.lw-cta .lw-ctaline { display: block; font-size: .88rem; color: var(--ink2); margin-top: 3px; line-height: 1.45; }
.lw-cta .lw-ctago { font-size: 1.2rem; color: var(--ink4); flex: none; transition: transform .15s; }
.lw-cta:hover .lw-ctago { transform: translateX(2px); }

/* trail stop cards */
.lw-trail { display: grid; gap: 10px; }
@media (min-width: 620px) { .lw-trail { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .lw-trail { grid-template-columns: 1fr 1fr 1fr; } }
.lw-stop { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: #fff; border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s; }
.lw-stop:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lw-stop.earned { box-shadow: 0 0 0 1.5px var(--gold), var(--shadow-sm); }
.lw-stop.earned:hover { box-shadow: 0 0 0 1.5px var(--gold), var(--shadow-md); transform: translateY(-1px); }
.lw-stopmotif { font-size: 1.6rem; line-height: 1; flex: none; margin-top: 2px; }
.lw-stopbody { flex: 1; min-width: 0; }
.lw-stopname { display: block; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.lw-stopline { display: block; font-size: .84rem; color: var(--ink2); line-height: 1.45; margin-top: 4px; }
.lw-stopstamp { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: var(--gold-deep); background: var(--gold-soft); border-radius: 50%; }
.lw-stopnum { position: absolute; top: 16px; right: 16px; font-size: .7rem; font-weight: 700; color: var(--ink4); }

/* the archetype line is suppressed on the trail for cleanliness
   but kept in the data so world pages can use it */
.lw-stoparch { display: none; }

/* game tiles inside a world */
.lw-tiles { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .lw-tiles { grid-template-columns: repeat(3, 1fr); } }
.lw-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; background: #fff; border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s; min-height: 100px; }
.lw-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lw-tileico { font-size: 1.3rem; line-height: 1; }
.lw-tilename { font-weight: 700; font-size: .95rem; }
.lw-tiledesc { font-size: .82rem; color: var(--ink2); line-height: 1.4; }
.lw-tiledone { margin-top: auto; padding-top: 8px; font-size: .72rem; font-weight: 700; color: var(--gold-deep); }

/* universal progress bar */
.lw-prog { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.lw-progtrack { flex: 1; height: 6px; background: var(--page); border-radius: 999px; overflow: hidden; }
.lw-progfill { height: 100%; background: var(--acc, var(--site-acc)); border-radius: 999px; transition: width .3s ease; }
.lw-progtext { font-size: .8rem; font-weight: 700; color: var(--ink3); white-space: nowrap; }

/* game board surface */
.lw-board { background: #fff; border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 20px; }

/* ── desktop layout ────────────────────────────────────────── */
@media (min-width: 900px) {
  .lw-app { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0; align-items: start; }
  .lw-rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 12px; background: #fff; border-right: 1px solid rgba(0,0,0,.06); }
  .lw-top { display: none; }
  .lw-bar { display: none; }
  .lw-main { padding-bottom: 60px; }
  .lw-panel { left: 0; right: 0; }
}
@media (max-width: 899px) {
  .lw-panel { left: auto; right: 0; top: calc(100% + 8px); bottom: auto; width: 300px; }
  .lw-main { padding: 0 16px 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .lw-stop, .lw-cta, .lw-tile, .card, .wc { transition: none; }
  .lw-stop:hover, .lw-cta:hover, .lw-tile:hover, .card:hover, .wc:hover { transform: none; }
}
