/* MINE — styl "niebieski długopis na kartce w kratkę" */
:root {
  --paper: #f8f5ec;
  --grid: #cfdced;
  --ink: #2b3fb0;
  --ink-soft: #8c98d6;
  --panel: #fffdf7;
  --shadow: rgba(43, 63, 176, 0.25);
  --ok: #1f8a4c;
  --bad: #c0392b;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: 'Patrick Hand', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
  font-size: 20px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* HUD */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 16px; pointer-events: none; z-index: 10;
}
#hud > * { pointer-events: auto; }
#hud-right { display: flex; gap: 8px; }
.box {
  background: var(--panel);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  box-shadow: 2px 3px 0 var(--shadow);
}
#money {
  font-size: 30px; line-height: 1; padding: 8px 14px; min-width: 96px; text-align: center;
  transition: transform .15s;
}
#money.bump { transform: scale(1.12); }
.btn {
  font: inherit; font-size: 22px; line-height: 1; padding: 8px 14px;
  cursor: pointer; user-select: none;
}
.btn:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { font-size: 18px; padding: 6px 10px; }

/* Plansza */
#stage { padding: 76px 0 40px; overflow-x: auto; overflow-y: visible; }
#game { display: block; margin: 0 auto; touch-action: pan-y; cursor: pointer; }

/* Panel dolny */
#panel {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  background: var(--panel); border: 2.5px solid var(--ink); border-radius: 10px;
  box-shadow: 3px 4px 0 var(--shadow);
  padding: 14px 16px 16px; z-index: 20;
  max-height: 60vh; overflow: auto;
}
#panel.hidden, #toast.hidden { display: none; }
#panel h2 { margin: 0 44px 6px 0; font-size: 28px; font-weight: normal; }
#panel-close { position: absolute; top: 8px; right: 8px; font-size: 18px; padding: 4px 9px; }
#panel-body { font-size: 20px; line-height: 1.35; }
#panel-body .stat { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1.5px dashed var(--ink-soft); padding: 3px 0; }
#panel-body .hint { color: var(--ink-soft); font-size: 18px; margin-top: 6px; }
#panel-body .ok { color: var(--ok); }
#panel-body .bad { color: var(--bad); }
#panel-body ul { padding-left: 22px; margin: 6px 0; }
#panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
#panel-actions .btn { flex: 1 1 auto; }
#panel-actions .btn .sub { display: block; font-size: 16px; opacity: .85; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 8px; font-size: 22px; z-index: 30;
  box-shadow: 2px 3px 0 var(--shadow);
}
#panel:not(.hidden) ~ #toast { bottom: calc(60vh + 24px); }

@media (max-width: 600px) {
  body { font-size: 18px; }
  #money { font-size: 24px; min-width: 80px; padding: 7px 10px; }
  .btn { font-size: 19px; padding: 7px 11px; }
  #stage { padding-top: 66px; }
  #panel h2 { font-size: 24px; }
  #panel-body { font-size: 18px; }
}

/* Ekran startowy (index.html) */
#start {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 16px 40px; text-align: center; position: relative;
}
#start .start-money { position: absolute; top: 12px; left: 16px; font-size: 30px; line-height: 1; padding: 8px 14px; }
#start h1 { font-size: 84px; margin: 0; line-height: 1; letter-spacing: 6px; font-weight: normal; }
#start .sub { margin: 4px 0 26px; color: var(--ink-soft); font-size: 22px; }
.cards { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; max-width: 920px; }
.card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 270px; padding: 14px 14px 16px;
  text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s; border-radius: 10px;
}
a.card:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--shadow); }
a.card:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.card canvas { width: 220px; height: 120px; display: block; }
.card .name { font-size: 40px; line-height: 1; margin-top: 4px; }
.card .desc { font-size: 18px; color: var(--ink-soft); line-height: 1.25; min-height: 2.5em; }
.card .save { font-size: 17px; border-top: 1.5px dashed var(--ink-soft); padding-top: 6px; margin-top: 2px; width: 100%; }
.card.soon { opacity: .6; border-style: dashed; }
.start-hint { margin-top: 26px; color: var(--ink-soft); font-size: 18px; }
@media (max-width: 600px) {
  #start h1 { font-size: 64px; }
  #start .start-money { font-size: 24px; padding: 7px 10px; }
  .card { width: min(270px, 100%); }
}
