/* Lootle: walkable scenes (town square, guild hall), place cards, and the parchment quest board */
main:has(.hub), main:has(.hall) { max-width: 640px; }

.herostrip { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 3px solid var(--edge); padding: 6px 10px; cursor: pointer; margin: 4px 0 8px;
  box-shadow: 0 4px 0 #120d1c; }
.herostrip:hover { border-color: #6fd6f0; }
.hsinfo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hsinfo b { font-size: 17px; color: var(--ink); }
.hsinfo span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hsgold .gold { font-size: 17px; }

.scenewrap { position: relative; border: 4px solid #1b1424; box-shadow: 0 0 0 2px #3a2f55, 0 8px 0 #0a0812; background: #07060c; line-height: 0; }
.scenewrap canvas { width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; display: block; touch-action: manipulation; }
.sover { position: absolute; inset: 0; pointer-events: none; overflow: hidden; line-height: 1.15; }
.stag { position: absolute; transform: translate(-50%, 0); font-family: 'Silkscreen', monospace; font-size: 9px; letter-spacing: .5px; white-space: nowrap; color: #f4efe2;
  background: rgba(13, 11, 22, .92); border: 1px solid #4a3f68; padding: 1px 4px; transition: transform .15s, opacity .15s; }
.stag em { font-style: normal; color: var(--muted); margin-left: 3px; }
.stag i { font-style: normal; display: inline-block; background: #e04a3f; color: #fff; border-radius: 6px; padding: 0 4px; margin-left: 4px; animation: blink 1s steps(2) infinite; }
.stag.big { font-size: 11px; border-color: #6a5a8a; }
.stag.go { color: #ffe370; border-color: #b57cf0; animation: gopulse 1.2s ease-in-out infinite; }
@keyframes gopulse { 50% { box-shadow: 0 0 10px rgba(181,124,240,.8); } }
.stag.quiet { font-size: 8px; }
.stag.hot { opacity: 1; transform: translate(-50%, 0) scale(1.15); border-color: #ffe370; color: #ffe370; z-index: 2; }
.sbubble { position: absolute; transform: translate(-50%, -100%); background: #f4efe2; color: #1b1424; font-size: 12px; padding: 5px 8px; border: 2px solid #1b1424;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4); white-space: nowrap; animation: fadein .2s; text-align: center; }
.sbubble em { font-style: normal; color: #5d3a9a; font-size: 11px; }
.scenehint { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0; }

/* the card that opens under a scene when you tap a place */
.placecard:empty { display: none; }
.placecard.pop > * { animation: cardin .3s ease-out; }
@keyframes cardin { from { transform: translateY(-8px); opacity: 0; } }
.pcard { background: #2a2014; border: 3px solid #5a3f28; box-shadow: inset 0 0 0 2px #3a2a1a, 0 5px 0 #120d1c; padding: 10px 12px; margin-bottom: 10px; }
.pcard h3 { color: var(--gold); margin-top: 4px; }
.pcard p { margin: 6px 0; line-height: 1.4; }
.pchead { display: flex; align-items: center; gap: 10px; }
.pchead h3 { margin: 0; }
.pchead > div:nth-child(2) { flex: 1; }
.pchead span { font-size: 12px; color: var(--muted); }
.pcnext { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); padding: 6px 8px; margin: 6px 0; }
.pcnext span { flex: 1; font-size: 13px; }
.code { font-style: normal; font-family: 'Silkscreen', monospace; color: #6fd6f0; letter-spacing: 1px; }
.merchant { display: flex; align-items: center; gap: 10px; background: #2a2014; border: 3px solid #5a3f28; padding: 8px 10px; margin-bottom: 8px; }
.merchant p { margin: 0; font-size: 14px; font-style: italic; }
.merchant span { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 3px; }

/* the quest board: pinned parchment notes */
.parch { background: #3a2a1a; border: 4px solid #5a3f28; box-shadow: inset 0 0 0 3px #2a1a10, 0 6px 0 #120d1c; padding: 10px 12px 14px; margin-bottom: 10px;
  background-image: radial-gradient(#4a3624 1px, transparent 1px); background-size: 6px 6px; }
.parch h3 { color: #f2c14e; text-shadow: 2px 2px 0 #1b1424; margin-top: 8px; }
.parch .sub { color: #c9b896; }
.qnotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.qnote { position: relative; background: #efe3c4; color: #3a2a1a; padding: 12px 10px 8px; box-shadow: 2px 3px 0 rgba(0,0,0,.4); transform: rotate(-.6deg); display: flex; flex-direction: column; gap: 4px; }
.qnote:nth-child(2n) { transform: rotate(.8deg); }
.qnote b { color: #3a2a1a; font-size: 15px; font-weight: 600; }
.qnote span { font-size: 12px; color: #6a5a3a; }
.qnote .pin { position: absolute; top: -4px; left: 50%; width: 9px; height: 9px; background: #c0504a; border: 2px solid #6e2424; transform: translateX(-50%); }
.qnote.weekly .pin { background: #3b6fb0; border-color: #22426e; }
.qnote.ready { box-shadow: 0 0 0 2px #f2c14e, 0 0 14px rgba(242,193,78,.6), 2px 3px 0 rgba(0,0,0,.4); }
.qnote.claimed { opacity: .7; }
.qnote .btn.small { align-self: flex-start; }
.qnote .rw .gold, .deed .rw .gold { color: #a8761c; }
.qbar { height: 6px; background: #c9b896; border: 1px solid #8a7a5a; }
.qbar i { display: block; height: 100%; background: #3f8a4a; }
.stamp { font-style: normal; font-family: 'Silkscreen', monospace; color: #3f8a4a; border: 2px solid #3f8a4a; padding: 0 6px; align-self: flex-start; transform: rotate(-6deg); font-size: 12px; }
.deeds { display: flex; flex-direction: column; gap: 6px; }
.deed { display: flex; align-items: center; gap: 10px; background: #efe3c4; color: #3a2a1a; padding: 7px 10px; box-shadow: 2px 3px 0 rgba(0,0,0,.35); }
.deed > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.deed b { color: #3a2a1a; font-weight: 600; }
.deed .sub { color: #6a5a3a; font-size: 12px; }
.deed.ready { box-shadow: 0 0 0 2px #f2c14e, 0 0 12px rgba(242,193,78,.5); }
.ranks { display: inline-flex; gap: 2px; margin-left: 6px; }
.ranks i { font-style: normal; font-family: 'Silkscreen', monospace; font-size: 9px; padding: 0 3px; border: 1px solid #b8a98a; color: #b8a98a; }
.ranks i.on { background: #a8761c; color: #fff3c0; border-color: #a8761c; }
.titles { display: flex; flex-wrap: wrap; gap: 6px; }
.tbtn { background: #efe3c4; border: 2px solid #8a7a5a; color: #3a2a1a; font-family: 'Lootle Digits', 'Pixelify Sans', monospace; font-size: 13px; padding: 4px 8px; cursor: pointer; }
.tbtn.on { background: #f2c14e; border-color: #a8761c; }
.deeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.deed { padding: 6px 8px; gap: 8px; }
.deed b { font-size: 14px; }
.deed .qbar { height: 5px; }
@media (max-width: 480px) {
  .stag { font-size: 8px; padding: 0 3px; }
  .stag.big { font-size: 9px; }
  .stag.quiet { display: none; }
  .stag.quiet.hot { display: block; }
}
.stag.hoveronly { display: none; }
.stag.hoveronly.hot { display: block; }
main:has(.bazscene), main:has(.musscene), main:has(.liftscene) { max-width: 640px; }

/* ---------- World Ages ---------- */
.ageband { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; padding: 6px 10px; cursor: pointer; background: linear-gradient(90deg, #241a3a, #1b1424);
  border: 2px solid #4a3f68; box-shadow: 0 3px 0 #0a0812; font-family: 'Silkscreen', monospace; }
.ageband:hover { border-color: #f2c14e; }
.agetitle { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.agetitle span { font-size: 9px; letter-spacing: 2px; color: var(--muted); }
.agetitle b { font-size: 16px; color: #f2c14e; letter-spacing: 1px; }
.agetitle em { font-style: normal; font-size: 10px; color: #f4efe2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenext { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--muted); min-width: 0; }
.agenext span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f4efe2; }
.agenext small { font-size: 9px; text-align: right; }
.agenext .pbar { height: 7px; }
.agecur { border: 2px solid #f2c14e; padding: 8px; margin: 8px 0; background: rgba(242,193,78,.06); }
.agecur p { margin: 4px 0 6px; }
.ages { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.agerow { display: flex; gap: 8px; align-items: flex-start; padding: 5px 6px; border: 1px solid #3a2f55; background: rgba(13,11,22,.5); }
.agerow > i { font-style: normal; font-family: 'Silkscreen', monospace; min-width: 22px; height: 22px; display: grid; place-items: center; background: #2a2238; color: var(--muted); }
.agerow b { display: block; font-size: 13px; }
.agerow span { display: block; font-size: 12px; color: var(--muted); }
.agerow.done > i { background: #3f6e33; color: #fff; }
.agerow.done b { color: #9fe07a; }
.agerow.cur { border-color: #f2c14e; }
.agerow.cur > i { background: #f2c14e; color: #1b1424; }
.agerow.locked { opacity: .7; }
.agerow.soon { opacity: .6; border-style: dashed; }
.agerow.soon span { font-style: italic; }
.tallies { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.tallies div { background: rgba(13,11,22,.5); border: 1px solid #3a2f55; padding: 5px; text-align: center; }
.tallies b { display: block; font-family: 'Silkscreen', monospace; color: #f2c14e; font-size: 14px; }
.tallies span { font-size: 11px; color: var(--muted); }
.newage { text-align: center; }
.newage h2 { color: #f2c14e; text-shadow: 0 0 12px rgba(242,193,78,.6); animation: gopulse 1.2s ease-in-out infinite; }
.newage .agerow { text-align: left; margin: 8px 0; }
.caravancard h3 { margin-top: 8px; }
.toplist { margin: 4px 0 8px 18px; padding: 0; font-size: 13px; }
.evrow b { font-family: 'Silkscreen', monospace; }

/* ---------- Adventure Rating on the results screen ---------- */
.arating { margin: 12px 0; padding: 10px 12px; border: 2px solid #4a3f68; background: linear-gradient(180deg, #241a3a, #1b1424); box-shadow: 0 3px 0 #0a0812; }
.arhead { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; font-family: 'Silkscreen', monospace; }
.argr { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.argr span { font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.argr em { font-style: normal; font-size: 15px; color: #f4efe2; }
.argr small { font-size: 11px; color: #c9b8ff; }
.argr small b { color: #ffe370; font-weight: normal; }
/* the grade: a chunky stamp in the tier's colour, tilted like it was banged onto a guild card */
.grade { --gc: #8d8798; flex: none; min-width: 76px; height: 76px; padding: 0 10px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font-family: 'Silkscreen', monospace; font-size: 46px; line-height: 1; color: var(--gc); letter-spacing: -3px;
  border: 3px solid var(--gc); background: radial-gradient(circle, rgba(255,255,255,.06), rgba(0,0,0,.35)); box-shadow: 0 3px 0 #0a0812, inset 0 0 0 2px rgba(0,0,0,.45);
  text-shadow: 0 2px 0 #0a0812, 0 0 14px var(--gc); transform: rotate(-6deg); }
.grade sup { font-size: 24px; align-self: flex-start; margin: 8px 0 0 3px; line-height: 1; }
.grade.tick { animation: grtick .14s ease-out; }
.grade.slam { animation: grslam .55s cubic-bezier(.2,1.6,.4,1); }
@keyframes grtick { 0% { transform: rotate(-6deg) translateY(-5px); opacity: .55; } 100% { transform: rotate(-6deg); opacity: 1; } }
@keyframes grslam { 0% { transform: rotate(-14deg) scale(2.2); opacity: .2; } 45% { transform: rotate(-4deg) scale(.9); opacity: 1; } 70% { transform: rotate(-7deg) scale(1.06); } 100% { transform: rotate(-6deg) scale(1); } }
/* SSS shimmers */
.grade.slam[style*="#ff5d8f"] { background: linear-gradient(120deg, #3a1030, #10284a, #3a2a08); }
.arbar { display: grid; grid-template-columns: 70px 1fr 30px 64px; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; }
.arbar span { font-family: 'Silkscreen', monospace; font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.arfill { height: 8px; background: #1b1424; border: 1px solid #3a2f55; }
.arfill i { display: block; height: 100%; background: #b57cf0; border-radius: 0 4px 4px 0; }
.arbar b { font-family: 'Silkscreen', monospace; color: #f4efe2; text-align: right; }
.arbar small { font-size: 10px; color: #9fe07a; white-space: nowrap; }
.arcurve { display: block; width: 100%; height: auto; margin: 8px 0 2px; }
