/* Hemma i Göteborg, Resekistan, Märken, Mina resor. Klasser börjar med hm- eller mt- */

.hm-card { --pack: #c8452b; --cover: #7a5230; }
.hm-hall { width: 100%; height: auto; display: block; border: 3px solid var(--ink); border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px; background: var(--paper-2); }
.hm-title { text-align: center; font-size: 3rem !important; }
.hm-lead { text-align: center; margin-top: -.4rem; }
.hm-menu { gap: .55rem; }
.hm-menu button small { margin-top: .1rem; }
.hm-menu > button { padding: .6rem .9rem; }
.hm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.hm-grid button { text-align: left; }
.hm-next { text-align: center; font-family: 'Caveat', cursive; font-size: 1.35rem; color: var(--accent-2); }
.hm-card button:focus-visible, .hm-card input:focus-visible, .hm-card textarea:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
html.high-contrast .hm-card button:focus-visible { outline-color: var(--accent); outline-width: 4px; }

.hm-slots button { display: grid; gap: .1rem; }
.hm-slots button b { font-size: 1.05rem; }

/* Resekistan */
.hm-pass { --cover: #7a5230; }
.hm-cover { background: var(--cover); color: #f6e7c4; border: 3px solid var(--ink); border-radius: 12px; padding: .6rem 1rem; display: flex; justify-content: space-between; align-items: baseline; box-shadow: inset 0 0 0 3px rgba(246, 231, 196, .25); }
.hm-cover h3 { font-family: 'Caveat', cursive; font-size: 2rem; line-height: 1; letter-spacing: .02em; }
.hm-cover span { font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; opacity: .85; }
.hm-bar { height: 14px; border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--paper-2); }
.hm-bar i { display: block; height: 100%; background: var(--accent-2); }
.hm-certs { display: flex; flex-wrap: wrap; gap: .35rem; }
.hm-cert { font-size: .85rem; padding: .1rem .7rem; border: 2px dashed var(--ink-soft); border-radius: 99px; color: var(--ink-soft); }
.hm-cert.on { border: 2px solid var(--accent-2); color: var(--accent-2); background: var(--paper-2); font-weight: 700; }
.hm-h { margin: .4rem 0 0; font-family: 'Caveat', cursive; font-size: 1.5rem; color: var(--accent); font-weight: 700; }
.hm-stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr)); gap: .4rem; }
.hm-stamp { border: 2px dashed var(--ink-soft); border-radius: 10px; padding: .25rem .5rem; opacity: .6; transform: rotate(-.6deg); }
.hm-stamp:nth-child(even) { transform: rotate(.7deg); }
.hm-stamp b { display: block; font-size: .92rem; font-weight: 600; }
.hm-stamp.on { opacity: 1; border: 2.5px solid var(--accent); color: var(--accent); background: var(--paper-2); }
.hm-stamp.on small { color: var(--ink-soft); }
html.high-contrast .hm-stamp { opacity: 1; }

/* Märken */
.hm-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.hm-badges li { display: flex; gap: .6rem; align-items: center; padding: .35rem .5rem; border: 2px dashed var(--ink-soft); border-radius: 12px; }
.hm-badges li.on { border-style: solid; background: var(--paper-2); }
.hm-badges li > div { display: grid; gap: .05rem; min-width: 0; }
.hm-badges li span { font-size: .85rem; color: var(--ink-soft); }
.hm-badges li:not(.on) b { color: var(--ink-soft); }
.hm-patch { flex: none; }
.hm-badges li.on .hm-patch { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); transform: rotate(-4deg); }
.hm-cos { display: grid; gap: .3rem; }
.hm-cos > span { font-weight: 700; font-size: .9rem; }
.hm-cos [role=radiogroup] { display: flex; gap: .4rem; flex-wrap: wrap; }
.hm-cos button { display: grid; justify-items: center; gap: .1rem; padding: .3rem .5rem; min-width: 5.2rem; box-shadow: none; }
.hm-cos button.on { background: var(--accent-2); color: #fff; }
.hm-cos button.on small { color: #fff; }
.hm-cos button i { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--ink); display: block; }

/* Mina resor */
.hm-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .4rem; }
.hm-facts div { border: 2px solid var(--ink); border-radius: 12px; padding: .3rem .6rem; background: var(--paper-2); }
.hm-facts dt { font-size: .75rem; color: var(--ink-soft); }
.hm-facts dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.hm-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; max-height: 40dvh; overflow: auto; }
.hm-runs button { width: 100%; text-align: left; }
.hm-map { width: 100%; height: auto; background: var(--sea); border: 2px solid var(--ink); border-radius: 10px; }
.hm-spark { width: 100%; height: 44px; display: block; }
.hm-legs { margin: 0; padding-left: 1.4rem; display: grid; gap: .15rem; font-size: .92rem; max-height: 24dvh; overflow: auto; }
.hm-legs span { color: var(--ink-soft); margin-left: .5rem; }
.hm-legs li.slow { color: var(--bad); font-weight: 700; }
.hm-legs li.slow span { color: var(--bad); }
.route.ghost { stroke: var(--accent-2); stroke-dasharray: 8 6; opacity: .55; }

/* Profil: export och import */
.hm-card textarea { width: 100%; font: .8rem/1.3 ui-monospace, monospace; background: var(--paper-2); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: .5rem; user-select: text; resize: vertical; }
.hm-file { display: block; border: 2.5px dashed var(--ink); border-radius: 12px; padding: .5rem .9rem; cursor: pointer; }
.hm-file input { max-width: 100%; margin-top: .2rem; }

/* Slutkortet */
.hm-fin-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.hm-fin-b { display: flex; align-items: center; gap: .4rem; font-weight: 700; }
.hm-fin-b > span { display: grid; }

/* Ghost och kamrat i HUD:en */
.hm-ghost { opacity: .85; gap: .3rem; font-size: .85rem; }
.hm-ghost span { color: var(--ink-soft); }
.hm-ghost small { display: inline; }
.hud .brand[data-companion]:not([data-companion=""])::after { content: attr(data-companion); font-family: system-ui, sans-serif; font-size: 1.1rem; margin-left: .3rem; vertical-align: .1em; }

/* Ej blockerande märkesnotis */
.mt-toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translate(-50%, 24px); z-index: 60; display: flex; gap: .7rem; align-items: center; max-width: min(92vw, 26rem); padding: .55rem .9rem; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow), 0 8px 24px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s cubic-bezier(.2, 1.3, .4, 1); }
.mt-toast.show { opacity: 1; transform: translate(-50%, 0); }
.mt-toast > div { display: grid; gap: .05rem; min-width: 0; }
.mt-toast b { font-size: 1.05rem; }
.mt-toast span { font-size: .82rem; color: var(--ink-soft); }
.mt-toast small { color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
html.reduce-motion .mt-toast { transform: translate(-50%, 0); transition: opacity .01ms; }

@media (max-width: 520px) {
  .hm-title { font-size: 2.4rem !important; }
  .hm-grid { grid-template-columns: 1fr 1fr; }
  .hm-badges { grid-template-columns: 1fr; }
}

/* Kort ska aldrig bli bredare än skärmen, inte ens med extra stor text */
.hm-card, .settings-card { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.hm-card > *, .settings-card > * { min-width: 0; }
.hm-grid button, .hm-menu button { overflow-wrap: break-word; }
html.text-xlarge .hm-grid { grid-template-columns: minmax(0, 1fr); }

/* Har du en kod?, medaljer, upplåsningar och Nästa steg */
.hm-code { display: grid; gap: .3rem; margin: .4rem 0; }
.hm-code label { font-family: 'Caveat', cursive; font-size: 1.35rem; color: var(--ink-soft); }
.hm-code > div { display: flex; gap: .5rem; }
.hm-code input { flex: 1; min-width: 0; font: inherit; padding: .4rem .6rem; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); color: var(--ink); text-transform: uppercase; }
.hm-code input::placeholder { text-transform: none; }
.hm-code-msg { min-height: 1.2em; margin: 0; }
.hm-code-msg.bad { color: var(--bad, #a62f2f); }
.hm-medals { border-collapse: collapse; width: 100%; font-size: .9rem; }
.hm-medals th, .hm-medals td { padding: .2rem .4rem; text-align: center; border-bottom: 1px dashed var(--ink-soft); }
.hm-medals th[scope="row"] { text-align: left; font-weight: 700; }
.hm-locks { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .15rem; font-size: .9rem; }
.hm-locks li.on { color: var(--accent-2); }
.hm-step { border: 2px dashed var(--accent-2); border-radius: 10px; padding: .3rem .8rem; margin: .5rem 0; }
.hm-step h4 { margin: 0 0 .2rem; font-family: 'Caveat', cursive; font-size: 1.4rem; color: var(--accent-2); }
.hm-step ul { margin: 0; padding-left: 1.1rem; }
.hm-locks small { display: inline; margin-left: .3rem; }
