/* Juragan Kos — mockup design system v0.1 (static, no scripts) */
:root {
  /* Colors */
  --c-bg: #FFF8EE;
  --c-surface: #FFFFFF;
  --c-ink: #2B2A33;
  --c-muted: #6E6A7C;
  --c-line: #E7DECF;
  --c-primary: #E07A2F;
  --c-primary-dark: #B85E1C;
  --c-primary-soft: #FDE7D3;
  --c-money: #2F9E6A;
  --c-money-soft: #DDF3E8;
  --c-gold: #F2B705;
  --c-gold-soft: #FFF3C4;
  --c-danger: #D64545;
  --c-danger-soft: #FBE1E1;
  --c-info: #3B7DD8;
  --c-info-soft: #DFEBFB;
  --c-ground: #BFE3A4;
  --c-tile-empty: #EFE8DA;
  --c-tile-room: #FCE3C4;
  --c-tile-facility: #CFE7F5;
  --c-tile-stairs: #DDD5EC;
  --c-tile-garden: #A9DB8E;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-xxl: 28px;

  /* Spacing */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 4px 14px rgba(60, 40, 10, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background: #F3EBDD;
  font-size: var(--fs-md);
  line-height: 1.4;
}
a { color: var(--c-info); }
h1, h2, h3, h4 { margin: 0 0 var(--s2); line-height: 1.2; }

/* ---------- Mockup site chrome (not part of the game) ---------- */
.site-nav {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--c-ink);
}
.site-nav a {
  color: #fff; text-decoration: none; font-size: var(--fs-sm);
  padding: var(--s1) var(--s3); border-radius: 999px; background: rgba(255,255,255,.08);
}
.site-nav a.on { background: var(--c-primary); }
.site-nav .ver { margin-left: auto; color: #bbb; font-size: var(--fs-xs); align-self: center; }

.wrap { max-width: 1280px; margin: 0 auto; padding: var(--s5) var(--s4); }
.page-title { font-size: var(--fs-xl); }
.page-sub { color: var(--c-muted); margin: 0 0 var(--s5); }

.board { display: flex; flex-wrap: wrap; gap: var(--s6); align-items: flex-start; }
.shot { display: flex; flex-direction: column; gap: var(--s2); }
.shot-label {
  font-size: var(--fs-sm); font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .04em;
}

.notes {
  flex: 1 1 320px; max-width: 460px;
  background: var(--c-surface); border-radius: var(--r-md); padding: var(--s4);
  box-shadow: var(--shadow); font-size: var(--fs-sm);
}
.notes h3 { font-size: var(--fs-md); margin-top: var(--s4); }
.notes h3:first-child { margin-top: 0; }
.ac { border-left: 3px solid var(--c-primary); padding: var(--s1) var(--s3); margin: var(--s2) 0; background: #FFFBF5; }
.ac b { color: var(--c-primary-dark); }
.notes ul { padding-left: 18px; margin: var(--s2) 0; }
.tag { display: inline-block; font-size: var(--fs-xs); padding: 1px 6px; border-radius: 6px; background: var(--c-info-soft); color: var(--c-info); font-weight: 700; }
.tag.p0 { background: var(--c-danger-soft); color: var(--c-danger); }
.tag.p1 { background: var(--c-gold-soft); color: #8a6a00; }
.tag.ex { background: #eee; color: #555; }

/* ---------- Phone frame ---------- */
.phone {
  position: relative; width: 360px; height: 760px;
  background: var(--c-bg); border-radius: 36px; overflow: hidden;
  border: 10px solid #1E1D24; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.phone .body { flex: 1; overflow: hidden; position: relative; padding: var(--s3); }
.dim::after { content: ""; position: absolute; inset: 0; background: rgba(30, 20, 10, .45); }

/* ---------- HUD ---------- */
.hud {
  display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap;
  padding: var(--s3) var(--s3) var(--s2); background: var(--c-surface); border-bottom: 1px solid var(--c-line);
}
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: var(--fs-sm);
  background: var(--c-tile-empty);
}
.pill.money { background: var(--c-money-soft); color: var(--c-money); }
.pill.gold { background: var(--c-gold-soft); color: #8a6a00; }
.pill.star { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.pill.lv { background: var(--c-info-soft); color: var(--c-info); }
.hud .time { width: 100%; font-size: var(--fs-xs); color: var(--c-muted); display: flex; justify-content: space-between; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--s1); margin: var(--s2) 0; }
.tab {
  flex: 1; text-align: center; padding: 6px 4px; border-radius: var(--r-sm);
  background: var(--c-tile-empty); font-size: var(--fs-sm); font-weight: 700; color: var(--c-muted);
}
.tab.on { background: var(--c-ink); color: #fff; }
.tab.locked { opacity: .55; }

/* ---------- Kos grid map ---------- */
.plot {
  background: var(--c-ground); border-radius: var(--r-md); padding: var(--s3);
  transform: perspective(900px) rotateX(28deg); transform-origin: 50% 100%;
  box-shadow: inset 0 0 0 3px #a8d48c;
}
.grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 84px; gap: 6px; }
.tile {
  position: relative; border-radius: 10px; padding: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700; text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.12);
}
.tile .ico { font-size: 22px; line-height: 1; }
.tile.span2 { grid-column: span 2; }
.tile.room { background: var(--c-tile-room); }
.tile.facility { background: var(--c-tile-facility); }
.tile.garden { background: var(--c-tile-garden); }
.tile.stairs { background: var(--c-tile-stairs); }
.tile.empty { background: rgba(255,255,255,.35); color: var(--c-muted); box-shadow: none; border: 2px dashed rgba(0,0,0,.12); }
.tile.can-build { background: rgba(47,158,106,.18); border: 2px dashed var(--c-money); color: var(--c-money); }
.tile.selected { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.tile.blocked { background: rgba(0,0,0,.06); color: #999; border: 2px dashed rgba(0,0,0,.08); box-shadow: none; }
.tile.ghost { opacity: .35; }
.tile.building { background: repeating-linear-gradient(45deg, #FCE3C4, #FCE3C4 8px, #f5d2a8 8px, #f5d2a8 16px); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; font-size: 11px; line-height: 20px; color: #fff; background: var(--c-danger);
}
.badge.ok { background: var(--c-money); }
.badge.info { background: var(--c-info); }
.badge.gold { background: var(--c-gold); color: #4a3800; }
.mood { position: absolute; top: 2px; left: 4px; font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-md);
  font-weight: 800; font-size: var(--fs-md); border: 0; text-decoration: none;
  background: var(--c-primary); color: #fff; box-shadow: 0 3px 0 var(--c-primary-dark);
}
.btn.block { display: flex; width: 100%; }
.fab-row .btn, .sheet .btn, .modal .btn { font-size: var(--fs-sm); white-space: nowrap; }
.btn.sec { background: var(--c-surface); color: var(--c-ink); box-shadow: 0 0 0 2px var(--c-line) inset, 0 3px 0 var(--c-line); }
.btn.ghost { background: transparent; color: var(--c-primary-dark); box-shadow: none; }
.btn.money { background: var(--c-money); box-shadow: 0 3px 0 #1f7a50; }
.btn.danger { background: var(--c-danger); box-shadow: 0 3px 0 #a33232; }
.btn.gold { background: var(--c-gold); color: #4a3800; box-shadow: 0 3px 0 #c39300; }
.btn.disabled, .btn[aria-disabled="true"] { background: #DDD7CC; color: #9a9488; box-shadow: none; }
.btn.sm { min-height: 34px; font-size: var(--fs-sm); padding: 0 var(--s3); }
.row { display: flex; gap: var(--s2); align-items: center; }
.row > .grow { flex: 1; }
.stack > * + * { margin-top: var(--s2); }

/* ---------- Cards, sheets ---------- */
.card { background: var(--c-surface); border-radius: var(--r-md); padding: var(--s3); box-shadow: 0 1px 0 var(--c-line), 0 2px 8px rgba(0,0,0,.04); }
.card.hl { box-shadow: 0 0 0 2px var(--c-primary); }
.card.muted { opacity: .55; }
.card h4 { font-size: var(--fs-md); margin: 0; }
.meta { color: var(--c-muted); font-size: var(--fs-sm); }
.price { font-weight: 800; color: var(--c-money); }
.price.gold { color: #8a6a00; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  background: var(--c-surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: var(--s4); box-shadow: 0 -6px 20px rgba(0,0,0,.15);
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--c-line); margin: -6px auto var(--s3); }
.modal {
  position: absolute; left: var(--s4); right: var(--s4); top: 50%; transform: translateY(-50%); z-index: 2;
  background: var(--c-surface); border-radius: var(--r-lg); padding: var(--s5) var(--s4); box-shadow: var(--shadow);
}
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; background: var(--c-tile-empty); margin: 2px 2px 0 0; }
.chip.ok { background: var(--c-money-soft); color: var(--c-money); }
.chip.no { background: var(--c-danger-soft); color: var(--c-danger); }
.chip.info { background: var(--c-info-soft); color: var(--c-info); }
.chip.gold { background: var(--c-gold-soft); color: #8a6a00; }

.bar { height: 8px; border-radius: 8px; background: var(--c-tile-empty); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c-money); }
.bar.warn > i { background: var(--c-gold); }
.bar.bad > i { background: var(--c-danger); }

.toast {
  position: absolute; left: var(--s4); right: var(--s4); top: 110px; z-index: 3;
  background: var(--c-ink); color: #fff; padding: var(--s3); border-radius: var(--r-md); font-size: var(--fs-sm);
}
.toast.ok { background: var(--c-money); }
.toast.bad { background: var(--c-danger); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm); }
.list li:last-child { border-bottom: 0; }

/* ---------- Floating actions and bottom nav ---------- */
.fab-row { position: absolute; left: var(--s3); right: var(--s3); bottom: var(--s3); display: flex; gap: var(--s2); z-index: 1; }
.navbar { display: flex; background: var(--c-surface); border-top: 1px solid var(--c-line); }
.navbar > a, .navbar > span {
  flex: 1; text-align: center; padding: 8px 0 10px; font-size: var(--fs-xs); font-weight: 700;
  color: var(--c-muted); text-decoration: none; position: relative;
}
.navbar .ico { display: block; font-size: 20px; }
.navbar .on { color: var(--c-primary); }
.navbar .badge { top: 4px; right: calc(50% - 22px); }

.scr-title { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); background: var(--c-surface); border-bottom: 1px solid var(--c-line); font-weight: 800; }
.scr-title .back { font-size: 20px; text-decoration: none; color: var(--c-ink); }

/* ---------- Design system page ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.sw { border-radius: var(--r-sm); overflow: hidden; background: var(--c-surface); box-shadow: var(--shadow); font-size: var(--fs-xs); }
.sw i { display: block; height: 56px; }
.sw div { padding: var(--s2); }
.ds-section { background: var(--c-surface); border-radius: var(--r-md); padding: var(--s5); margin-bottom: var(--s5); box-shadow: var(--shadow); }
.ds-row { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; margin: var(--s3) 0; }
.ds-cap { font-size: var(--fs-xs); color: var(--c-muted); display: block; margin-top: 4px; text-align: center; }
.space-demo { display: flex; align-items: flex-end; gap: var(--s4); }
.space-demo i { display: block; background: var(--c-primary); }
.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.index-grid a { text-decoration: none; color: inherit; }
table.t { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); background: var(--c-surface); }
table.t th, table.t td { border-bottom: 1px solid var(--c-line); padding: var(--s2); text-align: left; vertical-align: top; }
table.t th { background: #FFF3E3; }
