/* front screens: title, camp, hero, map */
.fr-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fr-logo { position: absolute; top: 5%; left: 50%; width: 82%; height: 30%; transform: translateX(-50%); animation: frDrop .6s cubic-bezier(.3, 1.5, .5, 1) both; pointer-events: none; }
.fr-logo-in { position: absolute; inset: 0; animation: frFloat 3.2s ease-in-out .6s infinite alternate; }
.fr-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(20, 10, 30, .5)); }
.fr-shine { position: absolute; inset: 0; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%) 200% 0 / 250% 100% no-repeat; animation: frShine 3.6s ease-in-out 1s infinite; }
@keyframes frDrop { from { transform: translate(-50%, -140%); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes frFloat { to { transform: translateY(8px); } }
@keyframes frShine { 0% { background-position: 200% 0; } 60%, 100% { background-position: -100% 0; } }
.fr-prompt { position: absolute; left: 24px; right: 24px; bottom: 12%; white-space: normal; overflow-wrap: anywhere; text-align: center; font-size: 19px; animation: frPulse 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes frPulse { 50% { opacity: .45; transform: scale(.96); } }
.fr-title-btns { position: absolute; left: 0; right: 0; bottom: 20%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fr-title-btns .btn.primary { min-width: 62%; }
.fr-avatar { position: absolute; top: 10px; left: 10px; opacity: .75; }

.fr-hud { position: absolute; top: 10px; left: 10px; right: 76px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; animation: frSlide .35s ease-out; }
@keyframes frSlide { from { transform: translateY(-20px); opacity: 0; } }
.fr-hero-chip { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border-radius: 999px; background: rgba(42, 26, 18, .62); border: 2px solid var(--brass); }
.fr-hero-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--brass); background: #d9c79c; }
.fr-hero-chip b { font-size: 16px; font-weight: 900; color: var(--cream); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.fr-caption { flex: 0 0 100%; padding-left: 4px; font-size: 14px; font-weight: 800; color: var(--cream); text-shadow: 0 2px 0 var(--ink), 0 0 6px var(--ink); }
.fr-bottom { position: absolute; left: 3%; right: 3%; bottom: 3%; display: flex; flex-direction: column; gap: 10px; animation: frUp .35s ease-out; }
@keyframes frUp { from { transform: translateY(40px); opacity: 0; } }
.fr-bottom .primary { width: 100%; }
.fr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fr-grid .btn { flex-direction: column; gap: 2px; padding: 4px 4px; min-width: 0; min-height: 68px; }
.fr-grid .btn-icon { width: 32px; height: 32px; }
.fr-grid .btn-label { font-size: 15px; }

.fr-bag { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fr-bag-it { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; background: rgba(255, 255, 255, .45); border: 2px solid var(--brass); border-radius: 12px; font-size: 13px; font-weight: 800; text-align: center; }
.fr-bag-it img { width: 38px; height: 38px; object-fit: contain; }
.fr-bag-it b { font-size: 16px; }
.fr-h { margin: 10px 0 6px; font-size: 18px; text-align: center; }

.fr-back { position: absolute; top: 10px; left: 10px; z-index: 5; }
.fr-page { position: absolute; inset: 0; background: linear-gradient(rgba(28, 16, 36, .55), rgba(28, 16, 36, .75)); }
.fr-head { position: absolute; top: 12px; left: 72px; right: 76px; text-align: center; font-size: 24px; }
.fr-body { position: absolute; top: 68px; left: 3%; right: 3%; bottom: 2%; padding-bottom: 12px; }
.fr-hero-top { display: flex; gap: 10px; align-items: center; }
.fr-hero-top img { width: 78px; height: 78px; object-fit: cover; object-position: top; border-radius: 14px; border: 3px solid var(--brass); background: #d9c79c; }
.fr-hero-top .info { flex: 1; min-width: 0; }
.fr-name { font-size: 20px; font-weight: 900; }
.fr-bar { height: 12px; border-radius: 6px; background: rgba(58, 36, 20, .35); border: 2px solid var(--brass-d); overflow: hidden; margin: 4px 0; }
.fr-bar i { display: block; height: 100%; background: linear-gradient(#a6e06a, #5b9a3a); transition: width .3s; }
.fr-small { font-size: 14px; font-weight: 700; }
.fr-stat { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 6px; background: rgba(255, 255, 255, .4); border-radius: 10px; }
.fr-stat .nm { flex: 0 0 auto; font-weight: 900; font-size: 15px; width: 3.2em; }
.fr-stat .ds { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; }
.fr-stat .val { font-weight: 900; font-size: 18px; min-width: 1.6em; text-align: center; }
.fr-plus { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; font-size: 26px; font-weight: 900; color: var(--cream); background: radial-gradient(#8dc455, var(--moss)); box-shadow: 0 3px 0 var(--moss-d); cursor: pointer; font-family: var(--font); }
.fr-plus:disabled { filter: grayscale(1) brightness(.8); opacity: .5; cursor: default; }
.fr-derived { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; text-align: center; font-size: 12px; font-weight: 700; }
.fr-derived b { display: block; font-size: 17px; }
.fr-weapon { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px; background: rgba(255, 255, 255, .4); border-radius: 10px; flex-wrap: wrap; }
.fr-weapon > img { width: 48px; height: 48px; object-fit: contain; }
.fr-weapon .tx { flex: 1; min-width: 120px; font-size: 13px; line-height: 1.3; }
.fr-weapon .tx b { font-size: 16px; display: block; }
.fr-price { display: inline-flex; align-items: center; gap: 4px; }
.fr-price img { width: 22px; height: 22px; object-fit: contain; }

.fr-map { position: absolute; top: 68px; left: 0; right: 0; bottom: 0; padding: 8px 4% 40px; display: flex; flex-direction: column; }
.fr-node { position: relative; width: 88%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 0 30px; background: linear-gradient(#fff6df, #eedcb4); border: 3px solid var(--brass); border-radius: 16px; box-shadow: 0 4px 0 var(--brass-d); cursor: pointer; font-family: var(--font); color: var(--ink); text-align: left; animation: frUp .35s ease-out both; }
.fr-node:nth-child(odd) { align-self: flex-start; }
.fr-node:nth-child(even) { align-self: flex-end; }
.fr-node:not(:last-child)::after { content: ""; position: absolute; top: 100%; left: 36px; height: 30px; border-left: 4px dashed var(--brass); }
.fr-node:nth-child(even):not(:last-child)::after { left: auto; right: 36px; }
.fr-node.locked { filter: grayscale(.85) brightness(.8); cursor: default; }
.fr-node.next { animation: frNext 1.2s ease-in-out infinite; border-color: #fff0a0; }
@keyframes frNext { 50% { transform: scale(1.04); box-shadow: 0 0 16px 4px rgba(255, 224, 120, .8), 0 4px 0 var(--brass-d); } }
.fr-badge { flex: 0 0 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: var(--cream); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; background: radial-gradient(circle at 35% 30%, #f5cf6c, var(--brass-d)); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px #ffe9a8; }
.fr-node .tx { flex: 1; min-width: 0; }
.fr-node .tx b { display: block; font-size: 17px; line-height: 1.2; margin-bottom: 2px; }
/* every level fits on one page of the map (no scrolling under the header): compact notes, 2-line notes text (1 line on short phones) */
.fr-mapscreen .fr-map { padding: 6px 4% 8px; justify-content: space-evenly; overflow: hidden; }
.fr-mapscreen .fr-node { flex-shrink: 0; margin: 0; padding: 5px 10px; gap: 8px; }
.fr-mapscreen .fr-node:not(:last-child)::after { height: 12px; }
.fr-mapscreen .fr-badge { flex-basis: 44px; height: 44px; font-size: 21px; }
.fr-mapscreen .fr-node .tx b { font-size: 16px; }
.fr-mapscreen .fr-node .tx span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; line-height: 1.25; }
.fr-mapscreen .fr-tags { margin-top: 2px; }
.fr-mapscreen .fr-check { font-size: 22px; }
@media (max-height: 660px) { .fr-mapscreen .fr-node .tx span { -webkit-line-clamp: 1; } }
.fr-node .tx span { display: block; font-size: 13px; line-height: 1.3; }
.fr-tags { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: 13px; font-weight: 800; }
.fr-tag { padding: 0 8px; border-radius: 999px; background: var(--moss); color: var(--cream); font-size: 12px; }
.fr-tag.boss { background: var(--red); }
.fr-check { font-size: 26px; color: #3e8f2a; font-weight: 900; }
/* the level map: a faded parchment map, levels as inked notes pinned on it */
.fr-page.fr-parch { background: linear-gradient(rgba(60, 38, 18, .18), rgba(60, 38, 18, .32)), url("../assets/map-parchment.webp") center / cover no-repeat, #e9d6ab; }
.fr-mapscreen .fr-node { background: rgba(250, 238, 208, .88); border: 2px solid #8a6a3e; border-radius: 6px 14px 8px 12px; box-shadow: 2px 4px 0 rgba(90, 60, 30, .35); transform: rotate(-.6deg); }
.fr-mapscreen .fr-node:nth-child(even) { transform: rotate(.7deg); }
.fr-mapscreen .fr-node:not(:last-child)::after { border-left: 3px dotted #6b4a26; height: 12px; }
.fr-mapscreen .fr-node.locked { filter: sepia(.6) brightness(.85); opacity: .8; }
.fr-mapscreen .fr-badge { background: radial-gradient(circle at 35% 30%, #d9584a, #7a1f18); box-shadow: inset 0 0 0 2px #f08a7a; }
.fr-mapscreen .fr-check { color: #7a1f18; }
