:root {
  color-scheme: dark;
  --bg: #050a13;
  --bg-soft: #091321;
  --panel: rgba(11, 24, 41, 0.9);
  --panel-strong: #0d1d31;
  --line: rgba(139, 191, 255, 0.16);
  --line-strong: rgba(139, 191, 255, 0.34);
  --text: #edf6ff;
  --muted: #91a8c0;
  --cyan: #59d8ff;
  --blue: #7e9dff;
  --violet: #ba8cff;
  --gold: #f6c76f;
  --green: #72e0ae;
  --red: #ff879c;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(77, 120, 255, 0.16), transparent 30rem),
    radial-gradient(circle at 90% 12%, rgba(188, 111, 255, 0.12), transparent 32rem),
    linear-gradient(145deg, #04070e 0%, var(--bg) 48%, #07101e 100%);
  overscroll-behavior-x: none;
}

button { font: inherit; touch-action: manipulation; }

.app-shell {
  width: min(1700px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) env(safe-area-inset-right) calc(48px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(17, 35, 59, 0.92), rgba(7, 16, 29, 0.92));
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 34px;
  overflow: visible;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: 8%;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89, 216, 255, 0.18), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.02; letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: 1.12rem; letter-spacing: -0.02em; }
h3 { margin-bottom: 6px; font-size: 0.98rem; }

.hero-copy { min-width: 0; }
.hero-lead { margin-bottom: 0; max-width: 690px; color: var(--muted); font-size: 1rem; }
.hero-right { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 12px; min-width: 260px; position: relative; z-index: 30; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; z-index: 1; }
.hero-primary-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.hero-secondary-actions { display: flex; justify-content: flex-end; }

.button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--text);
  background: rgba(13, 31, 53, 0.9);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--cyan); background: rgba(22, 52, 83, 0.95); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: 0.45; }
.button-primary { border-color: rgba(89, 216, 255, 0.62); background: linear-gradient(135deg, #126182, #3447a1); }
.button-danger { color: #ffd4dc; border-color: rgba(255, 135, 156, 0.35); }

.notice {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid rgba(114, 224, 174, 0.32);
  border-radius: 12px;
  color: #b9f4d6;
  background: rgba(22, 79, 63, 0.28);
}

.completion-notice {
  border-color: rgba(246, 199, 111, 0.46);
  color: #ffe2a4;
  background: linear-gradient(135deg, rgba(86, 64, 25, 0.42), rgba(22, 79, 63, 0.28));
}

.account-anchor { position: relative; z-index: 50; }
.account-trigger {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  min-width: 232px;
  padding: 8px 10px 8px 9px;
  border: 1px solid rgba(139, 191, 255, 0.3);
  border-radius: 12px;
  color: var(--text);
  background: rgba(8, 22, 39, 0.86);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.account-trigger:hover { transform: translateY(-1px); border-color: rgba(89, 216, 255, 0.78); background: rgba(15, 39, 65, 0.96); }
.account-trigger.is-open { border-color: rgba(89, 216, 255, 0.82); background: rgba(17, 47, 76, 0.98); }
.account-trigger-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(89, 216, 255, 0.45); border-radius: 10px; color: var(--cyan); background: rgba(24, 76, 107, 0.48); }
.account-trigger-icon svg { width: 20px; height: 20px; }
.account-trigger-copy { min-width: 0; display: grid; gap: 2px; }
.account-trigger-label { color: var(--text); font-size: 0.8rem; font-weight: 800; }
.account-trigger-status { overflow: hidden; color: var(--muted); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger-status.account-online { color: var(--green); }
.account-trigger-chevron { width: 17px; height: 17px; color: var(--muted); transition: transform 140ms ease; }
.account-trigger.is-open .account-trigger-chevron { transform: rotate(180deg); color: var(--cyan); }
.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(620px, calc(100vw - 48px));
  max-height: min(760px, calc(100dvh - 28px));
  overflow: auto;
  margin: 0;
  padding: 19px;
  z-index: 100;
  overscroll-behavior: contain;
}
.account-panel {
  padding: 19px;
  border-color: rgba(89, 216, 255, 0.28);
  background: linear-gradient(145deg, rgba(14, 35, 59, 0.96), rgba(8, 19, 34, 0.96));
}
.account-popover.account-panel { padding: 19px; }
.account-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr); gap: 24px; align-items: start; }
.account-intro { color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
.account-intro p:last-child { margin-bottom: 0; }
.account-forms { min-width: 0; }
.account-tabs { display: flex; gap: 8px; margin-bottom: 13px; }
.account-tab { padding: 8px 11px; color: var(--muted); font-size: 0.78rem; }
.account-tab.is-active { color: var(--text); border-color: rgba(89, 216, 255, 0.56); background: rgba(31, 76, 105, 0.65); }
[hidden] { display: none !important; }
.account-form { display: grid; gap: 10px; }
.account-form[hidden] { display: none !important; }
.account-form label { display: grid; gap: 5px; color: #d6e9ff; font-size: 0.76rem; }
.account-form input, .account-form select { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 11px; color: var(--text); background: rgba(3, 10, 19, 0.62); font: inherit; }
.account-form input:focus, .account-form select:focus { outline: 2px solid rgba(89, 216, 255, 0.28); outline-offset: 1px; border-color: var(--cyan); }
.account-form-help { margin: 0 0 2px; font-size: 0.78rem; line-height: 1.5; }
.account-link { width: fit-content; padding: 0; border: 0; color: var(--cyan); background: transparent; font: inherit; font-size: 0.74rem; cursor: pointer; text-align: left; }
.account-link:hover { color: #d7f6ff; text-decoration: underline; }
.account-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.account-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-check { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 8px !important; line-height: 1.35; }
.account-check input { width: auto; margin-top: 2px; }
.account-message { margin-bottom: 14px; padding: 10px 12px; border: 1px solid rgba(89, 216, 255, 0.28); border-radius: 10px; color: #ccefff; background: rgba(16, 70, 96, 0.24); font-size: 0.78rem; }
.account-message[data-kind="success"] { color: #b9f4d6; border-color: rgba(114, 224, 174, 0.35); background: rgba(22, 79, 63, 0.28); }
.account-message[data-kind="error"] { color: #ffd4dc; border-color: rgba(255, 135, 156, 0.4); background: rgba(90, 26, 45, 0.3); }
.account-online { color: var(--green); border-color: rgba(114, 224, 174, 0.35); }
.account-user { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid rgba(114, 224, 174, 0.3); border-radius: 13px; background: rgba(15, 73, 58, 0.22); }
.account-user h3 { margin: 5px 0 2px; }
.account-user p { margin-bottom: 0; font-size: 0.78rem; }
.account-user-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.player-management { margin-top: 16px; padding: 15px; border: 1px solid rgba(89, 216, 255, 0.24); border-radius: 13px; background: rgba(3, 15, 29, 0.42); }
.player-management-heading { margin-bottom: 8px; }
.player-management-heading h3 { margin: 4px 0 0; }
.player-management-copy { margin: 0 0 13px; font-size: 0.78rem; line-height: 1.5; }
.player-core-actions, .player-advanced-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.player-core-actions .button { min-width: 150px; }
.player-advanced { margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(131, 173, 211, 0.16); }
.player-advanced summary { cursor: pointer; color: #c9e7ff; font-size: 0.78rem; font-weight: 700; }
.player-advanced[open] summary { margin-bottom: 10px; }
.player-management-note { margin: 9px 0 0; font-size: 0.72rem; line-height: 1.45; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.resource-card {
  min-height: 116px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(16, 36, 62, 0.94), rgba(8, 18, 32, 0.96));
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.resource-card.is-locked { opacity: 0.56; }
.resource-copy { min-width: 0; }
.resource-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.resource-name { color: #d6e9ff; font-size: 0.88rem; font-weight: 700; }
.resource-value { margin: 13px 0 3px; font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.resource-rate { color: var(--green); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.resource-lock { color: var(--muted); font-size: 0.76rem; }

.entity-visual {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(139, 191, 255, 0.24);
  border-radius: 14px;
  background: radial-gradient(circle, rgba(52, 94, 150, 0.36), rgba(4, 12, 23, 0.85) 72%);
  box-shadow: inset 0 0 18px rgba(89, 216, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.2);
}
.entity-visual::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, transparent 38%, rgba(3, 10, 19, 0.34) 100%); pointer-events: none; }
.entity-visual img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(89, 216, 255, 0.28)); transition: transform 180ms ease, filter 180ms ease; }
.entity-visual:hover img { transform: scale(1.06); filter: drop-shadow(0 0 12px rgba(186, 140, 255, 0.42)); }
.entity-visual-compact { width: 46px; height: 46px; border-radius: 12px; }
.entity-visual-large { width: 86px; height: 86px; border-radius: 18px; }
.entity-glyph { position: absolute; right: 3px; bottom: 3px; z-index: 1; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(246, 199, 111, 0.55); border-radius: 50%; color: var(--gold); background: rgba(5, 10, 19, 0.82); box-shadow: 0 0 10px rgba(246, 199, 111, 0.3); }
.entity-glyph svg { width: 12px; height: 12px; }
.entity-visual-resource { border-color: rgba(114, 224, 174, 0.3); }
.entity-visual-system { border-color: rgba(89, 216, 255, 0.35); }
.entity-visual-technology { border-color: rgba(89, 216, 255, 0.3); }
.entity-visual-project { border-color: rgba(186, 140, 255, 0.38); }
.entity-visual-milestone { border-color: rgba(246, 199, 111, 0.5); }

.main-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.left-column, .center-column, .right-column { display: grid; gap: 16px; min-width: 0; }
.panel { padding: 19px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pill, .tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}
.tag.core { color: var(--cyan); border-color: rgba(89, 216, 255, 0.28); }
.tag.applied { color: var(--violet); border-color: rgba(186, 140, 255, 0.28); }
.tag.complete { color: var(--green); border-color: rgba(114, 224, 174, 0.3); }

.system-list { display: grid; gap: 8px; }
.system-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px;
  color: var(--muted);
  background: rgba(5, 13, 24, 0.48);
  cursor: pointer;
}
.system-button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.system-button.active { border-color: rgba(89, 216, 255, 0.5); color: var(--text); background: linear-gradient(135deg, rgba(31, 76, 105, 0.72), rgba(29, 37, 91, 0.6)); }
.system-button:disabled { cursor: not-allowed; opacity: 0.52; }
.system-button .entity-visual-compact { width: 38px; height: 38px; border-radius: 10px; }
.system-button .entity-glyph { display: none; }
.system-marker { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(145, 168, 192, 0.08); flex: 0 0 auto; }
.system-button.active .system-marker { background: var(--cyan); box-shadow: 0 0 13px rgba(89, 216, 255, 0.8); }
.system-button.unlocked .system-marker { background: var(--green); }
.system-copy { min-width: 0; }
.system-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.83rem; }
.system-copy small { display: block; margin-top: 3px; color: inherit; font-size: 0.7rem; }

.system-detail { overflow: hidden; position: relative; }
.system-detail::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  top: -120px;
  right: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(186, 140, 255, 0.2), transparent 66%);
  pointer-events: none;
}
.system-title-row { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; position: relative; }
.system-heading-with-art { display: flex; align-items: center; gap: 13px; min-width: 0; }
.system-title-row h2 { font-size: clamp(1.35rem, 2.6vw, 2rem); }
.system-description { max-width: 850px; margin: 11px 0 0; color: var(--muted); line-height: 1.6; }
.status-badge { color: var(--green); font-size: 0.76rem; white-space: nowrap; }
.counter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 20px; }
.counter-box { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(3, 10, 19, 0.4); }
.counter-label { color: var(--muted); font-size: 0.74rem; }
.counter-value { margin-top: 5px; color: var(--gold); font-size: 1.12rem; font-variant-numeric: tabular-nums; }

.item-list { display: grid; gap: 9px; }
.item-card { border: 1px solid var(--line); border-radius: 13px; background: rgba(3, 10, 19, 0.42); overflow: hidden; }
.item-card.locked { opacity: 0.64; }
.item-card.complete { border-color: rgba(114, 224, 174, 0.35); background: linear-gradient(135deg, rgba(15, 73, 58, 0.34), rgba(3, 20, 26, 0.45)); }
.item-card.running { border-color: rgba(246, 199, 111, 0.48); }
.item-main { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 13px; }
.item-copy { min-width: 0; }
.item-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-title strong { font-size: 0.91rem; }
.item-description { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.item-meta { margin-top: 9px; display: flex; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 0.72rem; }
.item-action { flex: 0 0 auto; align-self: center; }
.item-action .button { padding: 8px 10px; font-size: 0.76rem; }
.cost-line { color: var(--muted); font-size: 0.73rem; line-height: 1.5; }
.cost-line strong { color: #e5f1ff; font-weight: 600; }
.requirements { padding: 10px 13px; border-top: 1px solid rgba(139, 191, 255, 0.1); color: var(--muted); font-size: 0.72rem; }
.requirements.ok { color: var(--green); }
.requirements.warn { color: var(--gold); }

.activity-list, .log-list { display: grid; gap: 9px; }
.activity-card { padding: 12px; border: 1px solid rgba(246, 199, 111, 0.35); border-radius: 12px; background: rgba(80, 59, 25, 0.19); }
.activity-card.empty { border-style: dashed; border-color: var(--line); color: var(--muted); background: transparent; }
.activity-card-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.activity-card-heading .entity-visual-compact { width: 38px; height: 38px; border-radius: 10px; }
.activity-name { font-size: 0.84rem; font-weight: 700; }
.activity-type { color: var(--gold); font-size: 0.69rem; text-transform: uppercase; letter-spacing: 0.11em; }
.progress-track { height: 6px; margin: 10px 0 7px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--cyan)); transition: width 250ms linear; }
.activity-time { color: var(--muted); font-size: 0.72rem; }

@media (min-width: 901px) {
  .left-column {
    align-self: stretch;
    align-content: start;
  }

  .activity-panel {
    position: sticky;
    top: 12px;
    z-index: 20;
    background: linear-gradient(150deg, rgba(17, 35, 59, 0.98), rgba(7, 16, 29, 0.98));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.milestone-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3, 10, 19, 0.42); }
.milestone-card + .milestone-card { margin-top: 9px; }
.milestone-card.complete { border-color: rgba(114, 224, 174, 0.36); }
.milestone-name { font-size: 0.84rem; font-weight: 700; }
.milestone-status { margin-top: 6px; color: var(--muted); font-size: 0.71rem; }
.milestone-card.complete .milestone-status { color: var(--green); }

.log-list { max-height: 350px; overflow: auto; padding-right: 3px; }
.log-entry { padding: 9px 10px; border-left: 2px solid rgba(89, 216, 255, 0.35); color: var(--muted); font-size: 0.73rem; line-height: 1.4; background: rgba(3, 10, 19, 0.28); }
.log-time { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 0.66rem; }
.design-note p { margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.muted { color: var(--muted); }
.empty-state { padding: 14px 0; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 1320px) {
  .main-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .right-column { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}

@media (max-width: 900px) {
  .app-shell { width: min(100% - 20px, 720px); padding-top: calc(10px + env(safe-area-inset-top)); }
  .hero { display: block; padding: 24px; }
  .hero-right { align-items: stretch; min-width: 0; margin-top: 20px; }
  .account-anchor { width: 100%; }
  .account-trigger { width: 100%; min-width: 0; }
  .hero-actions { align-items: flex-start; justify-content: flex-start; margin-top: 0; }
  .hero-primary-actions { width: 100%; justify-content: flex-start; }
  .hero-primary-actions .button { min-height: 44px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-grid { grid-template-columns: 1fr; }
  .right-column { grid-column: auto; grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 520px) {
  .app-shell { width: calc(100% - 12px); }
  .hero { padding: 20px 16px; }
  .account-popover { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .hero-primary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-primary-actions .button { width: 100%; padding-inline: 8px; font-size: 0.78rem; }
  .hero-secondary-actions { width: 100%; margin-top: 8px; }
  .hero-secondary-actions .button { width: 100%; min-height: 44px; }
  .resource-grid { grid-template-columns: 1fr; }
  .counter-grid { grid-template-columns: 1fr; }
  .account-form-grid { grid-template-columns: 1fr; }
  .account-user { align-items: flex-start; flex-direction: column; }
  .account-user-actions { justify-content: flex-start; }
  .player-core-actions, .player-advanced-actions { align-items: stretch; }
  .player-core-actions .button, .player-advanced-actions .button { flex: 1 1 180px; }
  .item-main { display: block; }
  .item-main > .entity-visual { margin-bottom: 10px; }
  .item-action { margin-top: 12px; }
  .item-action .button { width: 100%; }
  .hero-actions .button { flex: 1 1 auto; }
}

/* Universecraft technology branches. */
.tag.branch { border-color: rgba(186, 140, 255, 0.55); color: #e0c9ff; background: rgba(125, 75, 190, 0.16); }
/* UCF-MOBILE-ACCOUNT-SHEET-V1: na telefonie panel konta jest przewijanym arkuszem na calym ekranie. */
.account-sheet-bar { display: none; }
@media (max-width: 900px) {
  .account-popover,
  .account-popover.account-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    left: 8px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 16px 16px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    z-index: 1000;
  }
  .account-popover[hidden] { display: none; }
  .account-sheet-bar {
    display: flex;
    justify-content: flex-end;
    position: sticky;
    top: -16px;
    z-index: 3;
    margin: -16px -16px 10px;
    padding: 8px 8px 6px;
    border-bottom: 1px solid rgba(89, 216, 255, 0.18);
    background: rgba(10, 26, 45, 0.97);
  }
  .account-sheet-close { min-width: 44px; min-height: 44px; }
  body.ucf-account-sheet-open { overflow: hidden; }
}


/* UNIVERSECRAFT_LAYOUT_LEFT_COLUMN_FIX_V1
   Panele lewej kolumny nie mogą rozpychać siatki i nachodzić na środkową kolumnę.
   Długie nazwy systemów zawijają się do dwóch linii zamiast wymuszać szerokość. */
.left-column, .center-column { grid-template-columns: minmax(0, 1fr); }
.left-column > .panel, .center-column > .panel { min-width: 0; }
.system-list { grid-template-columns: minmax(0, 1fr); }
.system-button { min-width: 0; }
.system-copy { flex: 1 1 0; min-width: 0; }
.system-copy strong { white-space: normal; text-overflow: clip; line-height: 1.25; overflow-wrap: anywhere; }

/* UCF-MOBILE-ACCOUNT-SHEET-V2: na telefonie pelne, nieprzezroczyste tlo panelu konta. */
@media (max-width: 900px) {
  .account-popover,
  .account-popover.account-panel,
  .panel.account-panel.account-popover {
    background-color: #0b1b2f;
    background-image: linear-gradient(145deg, #0e233b, #081322);
    opacity: 1;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    isolation: isolate;
    box-shadow: 0 0 0 100vmax rgba(2, 7, 14, 0.72), 0 18px 48px rgba(0, 0, 0, 0.55);
  }
  .account-popover::before,
  .account-popover::after { opacity: 0; }
  .account-sheet-bar {
    background-color: #0a1a2d;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* UNIVERSECRAFT_RESOURCE_CLICKS_V1: klikalne zasoby z paskiem postępu poziomu. */
.resource-card-clickable { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 80ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.resource-card-clickable:hover { border-color: rgba(89, 216, 255, 0.45); box-shadow: 0 0 0 1px rgba(89, 216, 255, 0.12), 0 10px 28px rgba(0, 0, 0, 0.22); }
.resource-card-clickable:active { transform: scale(0.985); }
.resource-card-clickable:focus-visible { outline: 2px solid rgba(89, 216, 255, 0.6); outline-offset: 2px; }
.resource-click { margin-top: 8px; }
.resource-click-track { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.resource-click-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width 120ms linear; }
.resource-click-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 0.66rem; font-variant-numeric: tabular-nums; }
.resource-click-float { position: fixed; z-index: 2000; pointer-events: none; color: var(--cyan); font-size: 0.85rem; font-weight: 800; text-shadow: 0 0 8px rgba(89, 216, 255, 0.6); transform: translate(-50%, -50%); animation: ucClickFloat 800ms ease-out forwards; }
@keyframes ucClickFloat { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, -170%); } }
@media (prefers-reduced-motion: reduce) { .resource-click-float { animation-duration: 1ms; } .resource-card-clickable:active { transform: none; } }

/* UNIVERSECRAFT_PREMIUM_V1: kolejka badań, drugi tor, Obserwatorium i motywy. */
html[data-theme="nebula"] { --bg: #0b0716; --bg-soft: #140c26; --panel: rgba(24, 14, 44, 0.9); --panel-strong: #1c1236; --line: rgba(196, 150, 255, 0.18); --line-strong: rgba(196, 150, 255, 0.36); --cyan: #d59bff; --blue: #a68bff; --violet: #ff8fd8; }
html[data-theme="solar"] { --bg: #110a04; --bg-soft: #1b1108; --panel: rgba(38, 24, 10, 0.9); --panel-strong: #2a1a0b; --line: rgba(255, 196, 120, 0.18); --line-strong: rgba(255, 196, 120, 0.36); --cyan: #ffc46b; --blue: #ff9f5a; --violet: #ff7a6b; }
html[data-theme="aurora"] { --bg: #03100e; --bg-soft: #071a17; --panel: rgba(8, 32, 29, 0.9); --panel-strong: #0b2622; --line: rgba(120, 255, 210, 0.16); --line-strong: rgba(120, 255, 210, 0.34); --cyan: #6dffc9; --blue: #5fd3ff; --violet: #9bff8a; }
.item-action { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.button-queue { font-size: 0.74rem; padding-block: 5px; opacity: 0.9; }
.button-queue.queued { border-color: var(--gold); color: var(--gold); }
.queue-card .queue-list { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 0.78rem; }
.queue-card .queue-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; }
.queue-card .queue-wait, .queue-card .queue-empty { color: var(--muted); font-size: 0.7rem; }
.queue-remove { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.queue-remove:hover { color: var(--red); }
.premium-panel { margin-top: 14px; }
.premium-list { display: grid; gap: 10px; }
.premium-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.02); }
.premium-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.premium-row strong { font-size: 0.86rem; }
.premium-row span { color: var(--muted); font-size: 0.72rem; }
.premium-owned { color: var(--green) !important; font-weight: 700; }
.premium-locked { color: var(--muted); font-style: italic; }
.premium-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.premium-actions .button small { color: var(--muted); font-weight: 400; }
.premium-actions input { min-width: 0; width: 150px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-soft); color: var(--text); }
.theme-chip { border: 1px solid var(--line-strong); background: transparent; color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 0.72rem; cursor: pointer; }
.theme-chip.active { border-color: var(--cyan); color: var(--cyan); }
