/* Rozmiary fontu tylko 20 / 30 / 40 px - Dreamling jest pikselowy i w innych rozmiarach się rozmywa.
   Dream Guardians - strona. Kolory i ramki jak okna gry (UiTheme): granatowo-fioletowe tło,
   złote akcenty, font Dreamling. Grafiki pikselowe skalujemy bez rozmycia. */

@font-face { font-family: "Dreamling"; src: url("/game/fonts/Dreamling-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "DreamlingTitle"; src: url("/game/fonts/DreamlingTitle-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0d0819;
  --bg2: #150d28;
  --panel: rgba(24, 15, 46, 0.94);
  --panel2: rgba(34, 22, 64, 0.94);
  --frame: #5a46a0;
  --frame-strong: #8f78e6;
  --gold: #ffd27a;
  --gold-dim: #c99b4a;
  --text: #ece6ff;
  --dim: #a99fd0;
  --accent: #8ef6ff;
  --danger: #ff6b8a;
  --ok: #8dff9f;
  --radius: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg) url("/game/backgrounds/dreamland/sky.png") top center / 1600px auto repeat-x fixed;
  color: var(--text);
  font: 20px/1.45 "Dreamling", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(13, 8, 25, 0.35) 0, rgba(13, 8, 25, 0.9) 340px, var(--bg) 620px);
}
img.px, .px img { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }
h1, h2, h3 { font-family: "DreamlingTitle", "Dreamling", serif; font-weight: normal; color: var(--gold); margin: 0.2em 0 0.5em; text-wrap: balance; }
h1 { font-size: 40px; text-shadow: 0 0 18px rgba(143, 120, 230, 0.55), 0 3px 0 #1d1036; }
h2 { font-size: 30px; }
h3 { font-size: 30px; color: var(--text); }
p { margin: 0 0 0.8em; }
small, .dim { color: var(--dim); }
.ok { color: var(--ok); }
.danger { color: var(--danger); }

/* --- układ ------------------------------------------------------------------------------ */

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
header.site { padding-block: 18px 0; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-family: "DreamlingTitle", serif; font-size: 40px; color: var(--gold); text-shadow: 0 0 16px rgba(255, 210, 122, 0.35), 0 3px 0 #1d1036; white-space: nowrap; }
.logo:hover { text-decoration: none; color: #fff3cf; }
nav.main { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav.main a { padding: 6px 12px; border-radius: var(--radius); color: var(--text); }
nav.main a:hover, nav.main a.on { background: rgba(143, 120, 230, 0.22); text-decoration: none; }
.userbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); margin-right: 6px; box-shadow: 0 0 8px currentColor; }
.status-dot.on { background: var(--ok); }
main { flex: 1; padding-block: 24px 40px; }
footer.site { border-top: 1px solid rgba(143, 120, 230, 0.25); padding-block: 18px; color: var(--dim); }
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 820px) { .grid.two { grid-template-columns: 1fr; } }

/* --- okna jak w grze --------------------------------------------------------------------- */

.panel {
  position: relative; background: var(--panel); border: 2px solid var(--frame); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(255, 210, 122, 0.6);
}
.panel::before { top: -6px; left: 50%; margin-left: -5px; }
.panel::after { bottom: -6px; left: 50%; margin-left: -5px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.hero { text-align: center; padding: 34px 20px 28px; }
.hero p { font-size: 20px; color: var(--dim); max-width: 60ch; margin: 0 auto 18px; }

/* --- przyciski i formularze -------------------------------------------------------------- */

.btn, button {
  display: inline-block; font: inherit; color: var(--text); background: linear-gradient(180deg, #3b2a73, #2a1d55);
  border: 2px solid var(--frame-strong); border-radius: var(--radius); padding: 7px 16px; cursor: pointer;
  box-shadow: 0 3px 0 #120a24;
}
.btn:hover, button:hover { background: linear-gradient(180deg, #4b3790, #33246a); color: #fff; text-decoration: none; }
.btn.gold { border-color: var(--gold-dim); color: #1d1036; background: linear-gradient(180deg, #ffe3a3, #e9b85c); }
.btn.gold:hover { background: linear-gradient(180deg, #fff0c8, #f3c873); color: #1d1036; }
.btn.danger, button.danger { border-color: #b8445f; background: linear-gradient(180deg, #5a1d33, #3d1224); }
.btn.small, button.small { padding: 2px 10px; }
form.inline { display: inline; }
label { display: block; margin: 10px 0 4px; color: var(--dim); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: #0f0920; border: 2px solid var(--frame);
  border-radius: var(--radius); padding: 7px 10px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(142, 246, 255, 0.15); }
textarea { min-height: 160px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.check input { margin-top: 6px; }
.form-narrow { max-width: 460px; margin: 0 auto; }
.alert { border: 2px solid var(--danger); background: rgba(255, 107, 138, 0.1); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.alert.ok { border-color: var(--ok); background: rgba(141, 255, 159, 0.08); color: var(--ok); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* --- tabele, listy, kafelki ---------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid rgba(143, 120, 230, 0.18); vertical-align: middle; }
th { color: var(--gold); font-weight: normal; }
tr:hover td { background: rgba(143, 120, 230, 0.07); }
td.num, th.num { text-align: right; }
.rank-1 td:first-child { color: #ffd27a; } .rank-2 td:first-child { color: #dfe6ff; } .rank-3 td:first-child { color: #e2a372; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 4px 12px; border: 2px solid var(--frame); border-radius: var(--radius); color: var(--text); }
.tabs a.on { border-color: var(--gold-dim); color: var(--gold); background: rgba(255, 210, 122, 0.08); }
.icon32 { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; }
.icon64 { width: 64px; height: 64px; image-rendering: pixelated; }
.slot { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: #0f0920; border: 2px solid var(--frame); border-radius: 4px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { background: var(--panel2); border: 2px solid var(--frame); border-radius: var(--radius); padding: 12px; display: flex; gap: 12px; align-items: center; }
.card .meta { min-width: 0; }
.card .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; padding: 0 8px; border: 1px solid var(--frame); border-radius: 10px; color: var(--dim); margin-right: 4px; }
.news-item + .news-item { border-top: 1px solid rgba(143, 120, 230, 0.2); padding-top: 14px; margin-top: 14px; }
.news-body h3 { color: var(--gold); }
.news-body ul { padding-left: 1.2em; }
.stat-line { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted rgba(143, 120, 230, 0.25); padding: 3px 0; }
.portrait { display: flex; align-items: flex-end; justify-content: center; height: 200px; background: radial-gradient(circle at 50% 70%, rgba(143, 120, 230, 0.35), transparent 65%); }
.portrait img { width: auto; height: 180px; image-rendering: pixelated; }
.dream-week { display: flex; gap: 16px; align-items: center; }
.bubble-skin { display: inline-block; padding: 8px 14px; border-radius: 14px; border: 2px solid; }

/* --- mapa świata ------------------------------------------------------------------------- */

.map-view { position: relative; height: 70vh; min-height: 420px; overflow: hidden; border: 2px solid var(--frame); border-radius: var(--radius); background: #070412; cursor: grab; touch-action: none; }
.map-view.drag { cursor: grabbing; }
.map-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map-layer .sky { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.map-layer .island { position: absolute; image-rendering: pixelated; transform: translate(-50%, -50%); }
.map-layer .label { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; color: #fff3cf; text-shadow: 0 2px 0 #1d1036, 0 0 6px #1d1036; pointer-events: none; }
.map-layer .label small { display: block; text-align: center; color: var(--ok); font-size: 13px; }
.map-hint { position: absolute; right: 10px; bottom: 8px; color: var(--dim); background: rgba(13, 8, 25, 0.7); padding: 2px 8px; border-radius: 4px; }
