/* Pengamånaden – spelspecifik stil. Bygger på ../shared/pengasmart-core.css */

#hud {
  flex: none; padding: calc(10px + var(--safe-top)) 14px 8px;
  background: linear-gradient(180deg, rgba(3, 18, 13, 0.92), rgba(3, 18, 13, 0.55));
  border-bottom: 1px solid rgba(255, 193, 48, 0.22);
  position: relative; z-index: 5;
}
#hud[hidden] { display: none; }
.hud-top { display: flex; align-items: center; gap: 8px; }
.hud-month { font-weight: 800; font-size: 15px; color: var(--mint-hi); letter-spacing: 0.02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pips { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.pips i { width: 14px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); transition: background 0.3s; }
.pips i.on { background: var(--gold); box-shadow: 0 0 8px rgba(255, 193, 48, 0.6); }
.pips i.done { background: var(--mint); }
.hud-btn { min-width: 42px; min-height: 42px; border-radius: 12px; border: 1px solid rgba(255, 193, 48, 0.4); background: rgba(6, 30, 22, 0.8); font-size: 18px; font-weight: 800; }
.hud-btn:active { transform: scale(0.94); }
.hud-money { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 0 8px; }
.hud-money .lab { font-size: 11px; letter-spacing: 0.16em; color: #8ee0b4; font-weight: 700; }
#h-money { font-size: clamp(34px, 10vw, 46px); font-weight: 900; color: var(--gold); text-shadow: 0 3px 0 #04261b; line-height: 1; font-variant-numeric: tabular-nums; display: inline-block; }
#h-money.low { color: #ff9aa8; }
#h-perweek { font-size: 13px; color: var(--muted); text-align: right; }
#h-perweek b { color: var(--mint-hi); }
.hud-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hchip { flex: 1 1 0; min-width: 0; padding: 6px 9px; border-radius: 12px; background: rgba(6, 36, 26, 0.9); border: 1px solid rgba(255, 255, 255, 0.12); }
.hchip .l { font-size: 10px; letter-spacing: 0.12em; color: #8ee0b4; font-weight: 700; display: block; white-space: nowrap; }
.hchip .v { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hchip .ps-bar { height: 7px; margin-top: 4px; }
.hchip.debt { border-color: rgba(255, 93, 115, 0.6); }
.hchip.debt .v { color: #ff9aa8; }
.hchip[hidden] { display: none; }
.bump { animation: ps-pulse 0.4s ease; }

#stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 14px calc(18px + var(--safe-bottom));
  display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: rgba(255, 193, 48, 0.4) transparent;
}
.view.enter { animation: view-in 0.35s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes view-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
.view.center > :first-child { margin-top: auto; }
.view.center > :last-child { margin-bottom: auto; }
.spacer { flex: 1; min-height: 8px; }

/* ---------- Meny ---------- */
.menu { align-items: center; text-align: center; justify-content: center; gap: 10px; }
.menu .logo-coin { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 52px; margin-bottom: 6px;
  background: radial-gradient(circle at 35% 30%, #fff3c9, var(--gold) 45%, var(--gold-lo)); border: 3px solid #fff2c4; box-shadow: 0 0 40px rgba(255, 193, 48, 0.45), 0 10px 0 #6b4a05;
  animation: coin-float 3.4s ease-in-out infinite; color: #5a3d00; font-weight: 900; }
@keyframes coin-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.menu .tag { font-size: 18px; color: var(--ink); }
.menu .stack { width: min(100%, 360px); display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.menu .lvl { width: min(100%, 360px); margin-top: 10px; }
.menu .lvl .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.menu .fine { font-size: 12px; color: #9fc4b1; max-width: 340px; line-height: 1.45; margin-top: 8px; }
.drift { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.drift i { position: absolute; bottom: -40px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c9, var(--gold) 50%, var(--gold-lo)); opacity: 0.18; animation: drift linear infinite; }
@keyframes drift { to { transform: translateY(-110vh) rotate(360deg); } }
.menu > *:not(.drift) { position: relative; z-index: 1; }

/* ---------- Titelrad för vyer ---------- */
.vhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vhead h2 { font-size: 24px; color: var(--gold); flex: 1; }
.back { min-height: 42px; min-width: 42px; }

/* ---------- Karaktärsval ---------- */
.persona { position: relative; display: flex; gap: 12px; text-align: left; width: 100%; padding: 14px; margin-bottom: 12px; align-items: flex-start; }
.persona:not(.locked):hover { filter: brightness(1.08); }
.persona:not(.locked):active { transform: scale(0.985); }
.persona .art, .medal { flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 36px;
  background: radial-gradient(circle at 35% 30%, rgba(70, 224, 160, 0.4), rgba(6, 59, 42, 0.9)); border: 2px solid var(--gold); box-shadow: 0 0 22px rgba(11, 155, 90, 0.35); }
.persona h3 { font-size: 20px; color: var(--gold); }
.persona .meta { font-size: 13px; color: var(--mint-hi); font-weight: 700; margin: 2px 0 4px; }
.persona p { font-size: 14px; color: var(--ink); line-height: 1.4; }
.persona .inc { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.persona.locked { opacity: 0.6; filter: grayscale(0.5); cursor: not-allowed; }
.persona .lock { position: absolute; right: 12px; top: 12px; font-size: 13px; font-weight: 800; color: #3b2a00; background: var(--gold); border-radius: 999px; padding: 3px 10px; }
.diff { letter-spacing: 2px; color: var(--gold); }

.goal-btn { width: 100%; display: flex; gap: 12px; align-items: center; padding: 14px; margin-bottom: 10px; text-align: left; }
.goal-btn:active { transform: scale(0.985); }
.goal-btn b { display: block; font-size: 18px; }
.goal-btn span.p { font-size: 15px; color: var(--gold-hi); font-weight: 800; }

/* ---------- Planering ---------- */
.plan .ledger { padding: 14px; margin-bottom: 12px; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.12); font-size: 15px; opacity: 0; animation: line-in 0.35s ease forwards; }
.line .n { display: flex; gap: 6px; align-items: center; min-width: 0; }
.line .info { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 193, 48, 0.6); font-size: 12px; font-weight: 900; color: var(--gold); background: transparent; display: grid; place-items: center; flex: none; padding: 0; }
.line .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line .amt.in { color: var(--mint-hi); }
.line .amt.out { color: #ff9aa8; }
.line.total { border: 0; padding-top: 12px; font-size: 18px; font-weight: 900; }
.line.total .amt { color: var(--gold); font-size: 24px; }
.line small { display: block; font-size: 12px; color: var(--muted); }
@keyframes line-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sec { font-size: 11px; letter-spacing: 0.16em; color: #8ee0b4; font-weight: 800; margin: 6px 0 2px; }
.sliders { padding: 14px; margin-bottom: 12px; }
.sl { margin-bottom: 14px; }
.sl .t { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 4px; }
.sl .t span:last-child { color: var(--gold); font-variant-numeric: tabular-nums; }
.sl small { color: var(--muted); font-size: 12px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--mint), var(--mint-hi)); border: 1px solid rgba(255, 255, 255, 0.12); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--mint), var(--mint-hi)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; margin-top: -11px; background: radial-gradient(circle at 35% 30%, #fff3c9, var(--gold) 55%, var(--gold-lo)); border: 2px solid #fff2c4; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); border: 2px solid #fff2c4; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.presets button { flex: 1 1 90px; }
.free { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 14px; background: rgba(255, 193, 48, 0.1); border: 1px solid rgba(255, 193, 48, 0.4); }
.free b { font-size: 24px; color: var(--gold); font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* ---------- Kort ---------- */
.cardview { align-items: stretch; }
.ev { padding: 16px 16px 14px; position: relative; animation: card-in 0.42s cubic-bezier(.2, .9, .3, 1.1) both; transform-origin: 50% 100%; }
@keyframes card-in { from { opacity: 0; transform: translateX(60px) rotate(4deg) scale(0.96); } to { opacity: 1; transform: none; } }
.ev.out { animation: card-out 0.25s ease both; }
@keyframes card-out { to { opacity: 0; transform: translateX(-60px) rotate(-4deg) scale(0.96); } }
.ev .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.cat { font-size: 12px; font-weight: 900; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 999px; color: #04140f; text-transform: uppercase; }
.count { font-size: 12px; color: var(--muted); font-weight: 700; }
.ev .medal { width: 96px; height: 96px; font-size: 54px; margin: 2px auto 8px; position: relative; animation: medal-glow 2.6s ease-in-out infinite; }
@keyframes medal-glow { 0%, 100% { box-shadow: 0 0 22px rgba(11, 155, 90, 0.35); } 50% { box-shadow: 0 0 36px rgba(255, 193, 48, 0.5); } }
.ev h2 { text-align: center; font-size: clamp(21px, 6vw, 25px); color: var(--gold); margin-bottom: 6px; }
.ev p.txt { text-align: center; font-size: 16px; line-height: 1.45; margin-bottom: 14px; color: var(--ink); }
.choices { display: flex; flex-direction: column; gap: 9px; }
.choice { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; min-height: 60px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(11, 155, 90, 0.22), rgba(8, 116, 67, 0.28)); border: 1.5px solid rgba(255, 193, 48, 0.55);
  transition: transform 0.08s, filter 0.15s, border-color 0.15s; width: 100%; }
.choice:hover:not(:disabled) { filter: brightness(1.12); border-color: var(--gold); }
.choice:active:not(:disabled) { transform: scale(0.975); }
.choice .num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; background: rgba(255, 193, 48, 0.2); color: var(--gold); border: 1px solid rgba(255, 193, 48, 0.5); }
.choice .body { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; line-height: 1.25; }
.choice .fx { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.choice.poor { opacity: 0.45; filter: grayscale(0.6); }
.choice.poor .body::after { content: " · Inte råd"; font-weight: 600; font-size: 12px; color: #ff9aa8; }

/* ---------- Resultat ---------- */
.result { padding: 18px 16px 16px; animation: ps-pop 0.4s cubic-bezier(.2, .9, .3, 1.15) both; }
.result .react { font-size: 56px; text-align: center; animation: ps-pop 0.5s 0.05s both; }
.result h2 { text-align: center; font-size: 24px; margin: 2px 0 10px; }
.result h2.smart { color: var(--mint-hi); }
.result h2.ok { color: var(--gold); }
.result h2.bad { color: #ff9aa8; }
.deltas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; min-height: 36px; }
.deltas .ps-chip { font-size: 16px; padding: 6px 12px; animation: ps-pop 0.4s both; }
.warn { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 93, 115, 0.14); border: 1px solid rgba(255, 93, 115, 0.5); font-size: 14px; line-height: 1.4; }
.lesson { padding: 12px 14px; border-radius: 14px; background: rgba(70, 224, 160, 0.1); border: 1px solid rgba(70, 224, 160, 0.5); margin-bottom: 14px; }
.lesson .lab { font-size: 11px; letter-spacing: 0.16em; color: var(--mint-hi); font-weight: 900; display: block; margin-bottom: 3px; }
.lesson p { font-size: 15px; line-height: 1.45; }

/* ---------- Veckointro ---------- */
.weekintro { text-align: center; align-items: center; justify-content: center; gap: 8px; }
.weekintro .big { font-size: clamp(44px, 14vw, 72px); font-weight: 900; color: var(--gold); text-shadow: 0 5px 0 #04261b; animation: ps-pop 0.5s both; }
.weekintro .sub { font-size: 18px; color: var(--ink); }
.weekintro .sub b { color: var(--mint-hi); }

/* ---------- Månadsslut ---------- */
.stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0 12px; }
.star { font-size: 54px; filter: grayscale(1) brightness(0.4); transition: filter 0.3s; }
.star.on { filter: none; animation: ps-pop 0.55s cubic-bezier(.2, .9, .3, 1.3) both; text-shadow: 0 0 20px rgba(255, 193, 48, 0.7); }
.sumgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sumcell { padding: 10px 12px; border-radius: 14px; background: rgba(6, 36, 26, 0.9); border: 1px solid rgba(255, 255, 255, 0.12); }
.sumcell .l { font-size: 11px; letter-spacing: 0.1em; color: #8ee0b4; font-weight: 800; display: block; }
.sumcell .v { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.spendbar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, 0.4); margin: 6px 0; border: 1px solid rgba(255, 255, 255, 0.1); }
.spendbar i { display: block; height: 100%; }
.legend { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; background: var(--c); vertical-align: -1px; }
.criteria { margin: 0 0 12px; padding: 0; list-style: none; }
.criteria li { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed rgba(255, 255, 255, 0.1); }
.criteria li .ok { width: 22px; text-align: center; }
.xp { padding: 12px 14px; margin-bottom: 12px; }
.xp .row { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 6px; font-size: 14px; }
.lessons-sm { padding-left: 18px; margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btnrow .ps-btn { flex: 1 1 140px; }

/* ---------- Samling ---------- */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.bg { text-align: center; padding: 10px 6px; border-radius: 14px; border: 1px solid rgba(255, 193, 48, 0.5); background: rgba(11, 155, 90, 0.16); }
.bg .a { font-size: 32px; display: block; }
.bg b { font-size: 12px; display: block; line-height: 1.2; margin-top: 2px; }
.bg.locked { opacity: 0.45; filter: grayscale(1); border-color: rgba(255, 255, 255, 0.15); }
.lessonlist { list-style: none; padding: 0; margin: 0; }
.lessonlist li { padding: 8px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.12); font-size: 14px; line-height: 1.4; }

/* ---------- Kontoutdrag ---------- */
.stmt li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.12); font-size: 14px; }
.stmt { list-style: none; padding: 0; margin: 0; }
.stmt .a { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stmt .a.in { color: var(--mint-hi); }
.stmt .a.out { color: #ff9aa8; }

.goalmodal { text-align: center; padding: 10px 0 4px; }
.goalmodal .big { font-size: 64px; }

@media (max-height: 640px) {
  .ev .medal { width: 70px; height: 70px; font-size: 38px; margin-bottom: 4px; }
  .ev p.txt { margin-bottom: 8px; font-size: 15px; }
  .choice { min-height: 52px; }
  #h-money { font-size: 30px; }
}
@media (min-width: 700px) {
  .view { padding: 18px 22px 22px; }
}

.presets button { font-size: 14px; padding: 0 6px; }
.result .ps-btn { width: 100%; }
.sumcell .sm { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }

/* Liggande mobil: komprimera HUD så att kortet får plats */
@media (max-height: 520px) {
  #hud { padding: calc(6px + var(--safe-top)) 12px 6px; }
  .hud-money { margin: 0 0 4px; }
  #h-money { font-size: 26px; }
  .hud-money .lab { display: none; }
  #h-perweek { font-size: 12px; }
  .hchip { padding: 3px 8px; }
  .hchip .l { display: none; }
  .hchip .v { font-size: 13px; }
  .hchip .ps-bar { margin-top: 2px; height: 5px; }
  .hud-btn { min-height: 36px; min-width: 38px; }
  .ev .medal { display: none; }
  .ev { padding: 12px; }
  .ev p.txt { margin-bottom: 8px; }
  .weekintro .big { font-size: 42px; }
}
.hchip { overflow: hidden; }
.hchip .l { overflow: hidden; text-overflow: ellipsis; }
.hud-chips { flex-wrap: wrap; }
.hchip { flex: 1 1 28%; }

.line .amt.unpaid { color: #ff9aa8; font-size: 13px; }
.explain { font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; margin: 0 0 10px; }
.recon { padding: 12px 14px; margin-bottom: 12px; }
.recon .rrow { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 14px; border-bottom: 1px dashed rgba(255,255,255,.08); }
.recon .rrow:last-of-type { font-weight: 800; border-bottom: 0; }
