@font-face { font-family: Familjen; src: url('assets/familjen-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Familjen; src: url('assets/familjen-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
* { box-sizing: border-box; }
:root { font-family: Familjen, ui-sans-serif, system-ui, sans-serif; color: #263e35; background: #eee9dd; color-scheme: light; --ink: #263e35; --muted: #697668; --orange: #b85b36; --line: #d9d8c8; --paper: #fffcf3; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 5% 0, #f9f5e9, transparent 65%), #eee9dd; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #b85b36; outline-offset: 4px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.app { width: min(1240px, 100%); margin: 0 auto; padding: 0 26px; }
.app-header { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px 13px 13px 3px; background: var(--orange); color: #fff5dd; font-size: 30px; font-weight: 700; }
.brand b { display: block; font-size: 22px; letter-spacing: -.7px; line-height: 1.1; }
.brand div > span { display: block; color: var(--muted); font-size: 8px; letter-spacing: 2.1px; margin-top: 5px; }
.header-actions { display: flex; gap: 8px; }
.header-actions button { border: 1px solid transparent; background: transparent; padding: 9px 12px; display: flex; align-items: center; gap: 8px; border-radius: 8px; font-size: 12px; }
.header-actions button:hover { background: #e2e1d1; border-color: #d4d4c1; }
.header-actions button > span:first-child { font-size: 18px; }
.header-actions #help-open > span:first-child { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; }
.header-actions [aria-pressed="true"] { background: #dce5d3; }
.workspace { display: grid; grid-template-columns: 285px minmax(0, 1fr); gap: 26px; align-items: start; }
.sidebar { min-width: 0; }
.mission-card { padding: 4px 2px 20px; }
.eyebrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 16px; color: #787b60; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.eyebrow #level-count { color: var(--orange); white-space: nowrap; letter-spacing: 1px; }
h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 39px; line-height: 1.08; letter-spacing: -1.4px; margin: 0 0 15px; }
.brief { color: #556657; line-height: 1.6; font-size: 14px; margin: 0 0 18px; }
.stop-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }
.stop-chip { display: grid; place-items: center; min-width: 29px; height: 29px; border-radius: 50%; border: 1px solid #c5caba; color: #78836d; font-size: 11px; font-weight: 700; background: #f4f2e8; }
.stop-chip.planned { color: #fff8e6; background: #3d6654; border-color: #3d6654; }
.stop-arrow { color: #9da38e; font-size: 12px; margin: 0 2px; }
.coach { display: flex; gap: 10px; border-left: 2px solid #d3b272; padding: 9px 10px; background: #f6f1df; border-radius: 0 7px 7px 0; }
.coach > span { display: grid; place-items: center; flex: 0 0 15px; height: 15px; border: 1px solid #bda16a; border-radius: 50%; font-size: 10px; color: #92713c; margin-top: 2px; }
.coach p { font-size: 11px; line-height: 1.65; margin: 0; color: #7a6b4b; }
.control-card { padding: 19px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 5px 14px #49553905; }
.resource > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.resource span { font-size: 9px; color: #71806c; letter-spacing: 1.5px; font-weight: 700; }
.resource b { font-size: 23px; font-weight: 400; font-variant-numeric: tabular-nums; }
.meter { height: 5px; border-radius: 5px; background: #e7e9dd; margin-top: 9px; overflow: hidden; }
.meter i { height: 100%; display: block; background: #53735a; border-radius: inherit; width: 0; transition: width .15s; }
.meter i.tight { background: #b36a37; }
.small-resources { display: grid; gap: 8px; margin: 18px 0; }
.small-resources p { display: flex; align-items: center; gap: 9px; font-size: 12px; margin: 0; color: #677562; }
.small-resources b { margin-left: auto; color: #344b3e; font-size: 13px; font-variant-numeric: tabular-nums; }
.resource-symbol { color: #749084; font-size: 18px; width: 18px; text-align: center; }
.edit-actions { display: flex; gap: 5px; padding: 13px 0 16px; border-top: 1px solid #e2e3d7; }
.edit-actions button { background: transparent; border: 0; border-radius: 5px; font-size: 10px; padding: 5px 3px; white-space: nowrap; }
.edit-actions button:hover:enabled { background: #ececdd; }
.edit-actions button:disabled { opacity: .35; }
.edit-actions #hint { margin-left: auto; text-decoration: underline; text-underline-offset: 3px; color: #88643d; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 15px; width: 100%; padding: 14px 17px; background: #294f3e; color: #fff8e5; border: 1px solid #294f3e; border-radius: 8px; font-size: 14px; font-weight: 700; box-shadow: 0 2px 0 #173b2c; }
.primary > span:last-child { font-size: 20px; line-height: 1; }
.primary:hover:enabled { background: #38664d; }
.primary:active:enabled { transform: translateY(1px); box-shadow: none; }
.primary:disabled { background: #e5e8db; color: #98a38a; border-color: #dce1d0; box-shadow: none; }
.departure-note { font-size: 10px; text-align: center; line-height: 1.5; color: #88917b; margin: 12px 0 0; }
.skip { background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; color: #65755f; display: block; margin: 12px auto 0; font-size: 11px; padding: 5px; }
.medal-card { display: flex; gap: 12px; padding: 19px 2px 0; }
.medal-icon { color: #b08b4b; font-size: 27px; line-height: 1; }
.medal-card h2 { font-size: 12px; font-weight: 700; margin: 0 0 5px; }
.medal-card p { margin: 0; font-size: 11px; line-height: 1.6; color: #7d826c; }
.medal-card #personal-best { display: block; margin-top: 7px; font-size: 10px; font-weight: 700; color: #8b713e; }
.map-card { min-width: 0; background: var(--paper); border: 1px solid #d6dac8; border-radius: 17px; box-shadow: 0 12px 35px #4852370b; padding: 0 16px; }
.map-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 3px 15px; color: #80856b; font-size: 8px; font-weight: 700; letter-spacing: 1.5px; }
.map-header > span:first-child { display: flex; align-items: center; gap: 8px; }
.map-header i { width: 6px; height: 6px; border-radius: 50%; background: #d68a4c; }
.map-wrap { display: grid; place-items: center; border: 1px solid #d7ddca; background: #e5e9d5; border-radius: 10px; overflow: hidden; }
.board { position: relative; width: 100%; max-width: calc((100dvh - 310px) * 7 / 6); aspect-ratio: 7 / 6; touch-action: none; user-select: none; -webkit-user-select: none; background: #e5e9d5; }
.landscape, .tracks, .train-layer { position: absolute; width: 100%; height: 100%; inset: 0; pointer-events: none; }
.landscape { z-index: 0; }
.tracks { z-index: 1; overflow: visible; }
.train-layer { z-index: 3; overflow: visible; }
.cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); z-index: 2; }
.cell { position: relative; min-width: 0; padding: 0; background: transparent; border: 0; border-radius: 0; cursor: pointer; }
.cell:focus-visible { outline-offset: -5px; outline-width: 3px; z-index: 4; }
.cell.available::after { content: ''; position: absolute; inset: 14%; border: 1.5px dashed #af8b52; border-radius: 15%; background: #f4e6b43d; pointer-events: none; }
.cell.head::before { content: ''; position: absolute; inset: 22%; border: 2px solid #bb6d3b; border-radius: 50%; background: #fff2c640; }
.cell.hinted::after { content: ''; position: absolute; inset: 8%; border: 3px solid #b95c32; border-radius: 12%; background: #fff3c962; box-shadow: 0 0 0 3px #fff8e585; }
.cell .marker { position: absolute; inset: 24%; display: grid; place-items: center; border-radius: 50%; background: #fffcf0; border: 2px solid #677c60; color: #53654a; font-size: clamp(12px, 1.6vw, 19px); font-weight: 700; box-shadow: 0 3px 0 #4b56301a; }
.cell.station.planned .marker { background: #3d6951; border-color: #f6f3dc; color: #fff8e4; }
.cell.goal .marker { background: #d28a4a; border-color: #fff4d8; color: #fffaf0; border-radius: 9px; }
.cell.start .marker { background: #406c54; border-color: #f7f4df; color: #fff8e4; border-radius: 9px; }
.cell.postcard .marker { inset: 31% 26%; font-size: clamp(14px, 2vw, 24px); border-radius: 4px; border: 1px solid #ceac5d; background: #fff4ce; color: #a67f31; transform: rotate(-9deg); }
.cell.postcard.planned .marker { background: #e9bd62; border-color: #fff7e1; color: #614f2c; }
.cell.start .marker { transform: translateY(-65%); inset: 34%; font-size: 10px; }
.cell[aria-disabled="true"] { cursor: default; }
#sleepers { fill: none; stroke: #9b8c67; stroke-width: 31; stroke-dasharray: 4 12; }
#rail-outer { fill: none; stroke: #fdf4d9; stroke-width: 23; stroke-linecap: round; stroke-linejoin: round; }
#rail-inner { fill: none; stroke: #476450; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
#bridge-path { fill: none; stroke: #9c7958; stroke-width: 48; stroke-linecap: butt; stroke-dasharray: 7 5; }
#hint-path { fill: none; stroke: #b05b39; stroke-width: 3; stroke-dasharray: 8 7; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 15px; padding: 15px 0; color: #7c846e; font-size: 9px; }
.map-legend > span { display: flex; align-items: center; gap: 5px; }
.map-legend b { display: grid; place-items: center; width: 17px; height: 17px; font-size: 9px; }
.legend-start { background: #406c54; color: #fff8e4; border-radius: 4px; }
.legend-stop { border: 1px solid #82917b; color: #6b7d61; border-radius: 50%; }
.legend-goal { background: #d28a4a; color: #fff8e4; border-radius: 4px; }
.map-legend .legend-mail { color: #ad8848; font-size: 17px; }
.map-legend .legend-water { color: #719ba0; font-size: 18px; }
.feedback { display: flex; gap: 9px; align-items: center; min-height: 50px; padding: 11px 3px; border-top: 1px solid #e0e3d4; font-size: 11px; line-height: 1.5; color: #71816a; }
.feedback-dot { width: 5px; height: 5px; border-radius: 50%; background: #91a081; flex: 0 0 5px; }
.feedback.error { color: #a65d35; }
.feedback.error .feedback-dot { background: #b97040; }
.feedback.success { color: #376347; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px 1px; font-size: 8px; color: #9a9d85; letter-spacing: 1.4px; }
.app-footer > span:first-child { font-weight: 700; }
.app-footer > span:last-child { letter-spacing: .5px; }
.app-footer i { font-style: normal; padding: 0 7px; }
.dialog { width: min(500px, calc(100% - 28px)); max-height: calc(100dvh - 32px); overflow: auto; color: var(--ink); background: var(--paper); border: 1px solid #d8dccb; border-radius: 19px; padding: 32px; box-shadow: 0 30px 100px #1c312f40; }
.dialog::backdrop { background: #213b35a8; backdrop-filter: blur(5px); }
.dialog .close { position: absolute; right: 12px; top: 10px; background: transparent; border: 0; border-radius: 50%; width: 32px; height: 32px; color: #929985; font-size: 25px; }
.dialog .close:hover { background: #eeeede; }
.dialog h2 { font-family: Georgia, serif; font-size: 33px; line-height: 1.1; font-weight: 400; letter-spacing: -.7px; margin: 0 0 16px; }
.dialog > p:not(.eyebrow) { color: #6c7a65; font-size: 13px; line-height: 1.65; }
.help-dialog .eyebrow { margin-top: 6px; font-size: 8px; }
.help-steps { padding-left: 19px; margin: 24px 0; }
.help-steps li { font-size: 12px; line-height: 1.65; padding: 0 0 12px 7px; color: #69775e; }
.help-steps b { color: #42573f; }
.keyboard-guide { display: flex; gap: 12px; flex-wrap: wrap; background: #eef0e2; padding: 13px; border-radius: 8px; font-size: 10px; line-height: 2; }
kbd { display: inline-block; padding: 0 4px; margin-right: 2px; border: 1px solid #cdd4bf; border-radius: 3px; background: #fffcf1; font: inherit; color: #65745a; }
.help-dialog > .help-note { font-size: 10px !important; margin: 16px 0 22px; }
.campaign-dialog { width: min(680px, calc(100% - 28px)); }
.campaign-dialog > .eyebrow { margin-top: 5px; }
.campaign-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.campaign-levels button { display: grid; grid-template-columns: 29px 1fr; text-align: left; gap: 3px 9px; background: #f3f2e6; border: 1px solid #d9dfcb; border-radius: 10px; padding: 13px; }
.campaign-levels button:hover { background: #e5ebd8; }
.campaign-levels button[aria-current="true"] { border: 2px solid #617f5d; padding: 12px; }
.campaign-levels .number { grid-row: span 3; font-size: 14px; color: #a08b64; padding-top: 2px; }
.campaign-levels strong { font-size: 12px; font-weight: 700; }
.campaign-levels small { color: #8c947d; font-size: 9px; }
.campaign-levels .stars { color: #b58f49; font-size: 10px; letter-spacing: 2px; }
.ticket-top { display: flex; justify-content: space-between; gap: 12px; font-size: 7px; font-weight: 700; letter-spacing: 1px; color: #92977d; border-bottom: 1px dashed #d8d9c7; padding: 4px 0 18px; }
.arrival-art { display: block; width: min(100%, 320px); height: auto; margin: 17px auto 7px; }
.arrival-dialog { text-align: center; }
.arrival-dialog > .arrival-medal { color: #a77b34 !important; font-size: 10px !important; font-weight: 700; letter-spacing: 2px; margin: 8px 0 13px; }
.arrival-dialog h2 { font-size: 38px; margin-bottom: 9px; }
.arrival-dialog > #arrival-message { margin: 0 auto; max-width: 30ch; }
.arrival-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 0; border-top: 1px dashed #d9deca; border-bottom: 1px dashed #d9deca; margin-top: 23px; }
.arrival-stats p { margin: 0; }
.arrival-stats b { display: block; font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.arrival-stats span { font-size: 9px; color: #92977f; }
.arrival-advice { font-size: 11px !important; margin: 18px 0 23px; }
.secondary { border: 0; background: transparent; color: #72816a; font-size: 12px; padding: 12px; margin-top: 7px; }
.secondary:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 980px) and (min-width: 781px) {
  .app { padding: 0 18px; }
  .workspace { grid-template-columns: 245px minmax(0, 1fr); gap: 18px; }
  h1 { font-size: 33px; }
  .control-card { padding: 15px; }
  .map-card { padding: 0 12px; }
  .map-legend { gap: 9px; }
  .app-header { min-height: 76px; margin-bottom: 18px; }
}
@media (max-width: 780px) {
  .app { padding: 0 13px; max-width: 570px; }
  .app-header { min-height: 76px; margin-bottom: 18px; gap: 8px; }
  .brand-icon { width: 35px; height: 35px; border-radius: 10px 10px 10px 2px; font-size: 24px; }
  .brand { gap: 8px; }
  .brand b { font-size: 19px; }
  .brand div > span { font-size: 6px; letter-spacing: 1.1px; }
  .header-actions { gap: 2px; }
  .header-actions button { padding: 8px 9px; min-height: 44px; min-width: 38px; justify-content: center; }
  .header-actions button > span:last-child { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 15px; }
  .sidebar { display: contents; }
  .mission-card { order: 1; width: 100%; padding: 0; }
  .mission-card .eyebrow { margin-bottom: 9px; font-size: 8px; }
  h1 { font-size: 30px; margin-bottom: 9px; }
  .brief { font-size: 13px; margin-bottom: 11px; }
  .stop-list { margin-bottom: 12px; }
  .coach { padding: 7px 9px; }
  .coach p { font-size: 10px; }
  .map-card { order: 2; width: 100%; padding: 0 9px; border-radius: 13px; }
  .map-header { padding: 13px 3px 11px; font-size: 7px; letter-spacing: 1px; }
  .board { max-width: none; }
  .map-legend { gap: 10px; padding: 11px 0; font-size: 8px; }
  .map-legend b { width: 14px; height: 14px; font-size: 8px; }
  .feedback { min-height: 46px; font-size: 10px; padding: 9px 3px; }
  .control-card { order: 3; width: 100%; padding: 16px; }
  .small-resources { display: flex; justify-content: space-between; gap: 18px; margin: 14px 0; }
  .small-resources p { flex: 1; }
  .edit-actions { padding: 11px 0 13px; }
  .edit-actions button { font-size: 12px; padding: 6px; min-height: 40px; }
  .medal-card { order: 4; padding: 2px 3px; }
  .app-footer { padding-top: 22px; font-size: 7px; letter-spacing: 1px; }
  .cell .marker { font-size: 13px; }
  .cell.postcard .marker { font-size: 17px; }
  .dialog { padding: 26px 22px; }
  .campaign-levels { grid-template-columns: 1fr; }
  .campaign-levels button { grid-template-columns: 30px 1fr auto; align-items: center; }
  .campaign-levels .number { grid-row: span 2; }
  .campaign-levels .stars { grid-column: 3; grid-row: 1 / span 2; }
  .dialog h2 { font-size: 29px; }
  .arrival-dialog h2 { font-size: 34px; }
}
@media (max-height: 650px) and (min-width: 781px) {
  .app-header { min-height: 62px; margin-bottom: 16px; }
  .board { max-width: calc((100dvh - 230px) * 7 / 6); }
  .mission-card { padding-bottom: 13px; }
  h1 { font-size: 31px; }
  .brief { font-size: 12px; margin-bottom: 12px; }
  .coach { display: none; }
  .medal-card { padding-top: 14px; }
  .app-footer { padding: 13px 1px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
