/* Two visual layers from the design document: the organic world (parchment,
   bark, moss, Alegreya) and the cold System (ice-blue panels, sharp edges,
   Chakra Petch). Mobile first, designed at about 390 px wide. */

:root {
  color-scheme: dark;
  --bg: #12170f;
  --bg-deep: #0d110b;
  --surface: #182014;
  --line: #2a3322;
  --bark: #2b2219;
  --bark-line: #4a3d2c;
  --text: #e7dcc2;
  --text-muted: #b9ae94;
  --leaf: #a7c47f;
  --danger: #ef9a85;
  --system: #8fe3ef;
  --system-text: #d6f6fa;
  --system-line: rgba(143, 227, 239, 0.55);
  --system-fill: rgba(143, 227, 239, 0.07);
  --bark-active: #3a2e22;
  --accent: #c9a14a;
  --gold: #d9b45a;
  --hp: #c8553d;
  --hp-track: #2a1c17;
  --mana: #4f8fc0;
  --mana-track: #172231;
  --xp: #d9b45a;
  --xp-track: #2a2414;
  --class-xp: #a986e8;
  --class-xp-track: #241c33;
  --icon-muted: #6f6656;
  --src-class: #7d9a5a;
  --src-character: #e7dcc2;
  --src-professions: #c9a14a;
  --src-equipment: #5f86b0;
  --src-core: #8fe3ef;
  --nav-height: 68px;
  --font-world: 'Alegreya', Georgia, serif;
  --font-system: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --gutter: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 70% at 50% 0%, rgba(143, 227, 239, 0.05), transparent 60%),
    repeating-linear-gradient(125deg, transparent 0 6px, rgba(37, 48, 31, 0.45) 6px 7px);
  color: var(--text);
  font-family: var(--font-world);
  font-size: 17px;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--system);
  outline-offset: 2px;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.screen--center {
  min-height: 100vh;
  min-height: 100dvh;
  justify-content: center;
}

/* World layer */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 20px;
  text-align: center;
}

.emblem {
  width: 52px;
  height: 52px;
  color: var(--system);
}

.hero-title {
  margin: 8px 0 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
}

.hero-tagline {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* A report: the title on the left, a large "Powrót" on the right. */
.page-heading--back {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-heading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* After .button in specificity, so the button keeps its own width. */
.page-heading--back .back-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 52px;
  padding: 0 18px 0 12px;
  font-size: 16px;
  text-decoration: none;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.page-title:focus {
  outline: none;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.status-list {
  margin: 0;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.status-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.status-row dt {
  color: var(--text-muted);
  font-size: 15px;
}

.status-row dd {
  margin: 0;
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
}

.status-ok {
  color: var(--leaf);
}

.status-error {
  color: var(--danger);
}

/* System layer */

.system-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--system-line);
  /* Ice-blue tint over a mostly opaque base, so the forest hatch stays faint. */
  background: linear-gradient(var(--system-fill), var(--system-fill)), rgba(18, 23, 15, 0.85);
  font-family: var(--font-system);
}

.system-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.system-label {
  margin: 0;
  color: var(--system);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.system-text {
  margin: 0;
  color: var(--system-text);
  font-size: 15px;
  line-height: 1.4;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--system-line);
}

.segmented-option {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented-option + .segmented-option {
  border-left: 1px solid var(--system-line);
}

.segmented-option[aria-pressed='true'] {
  background: rgba(143, 227, 239, 0.14);
  color: var(--system-text);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.optional {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--bark-line);
  border-radius: 0;
  background: var(--bg-deep);
  color: var(--text);
  /* 16 px keeps iOS from zooming in on focus. */
  font-family: var(--font-system);
  font-size: 16px;
}

.field input:focus {
  outline: none;
  border-color: var(--system);
  box-shadow: 0 0 0 1px var(--system);
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.password {
  position: relative;
}

.password input {
  padding-right: 80px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  min-width: 68px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--bark-line);
  background: transparent;
  color: var(--system);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(239, 154, 133, 0.6);
  background: rgba(239, 154, 133, 0.08);
  color: var(--danger);
  font-family: var(--font-system);
  font-size: 14px;
  line-height: 1.4;
}

.button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 0;
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button--system {
  border: 1px solid var(--system);
  background: rgba(143, 227, 239, 0.16);
  color: var(--system-text);
}

.button--system:active:not(:disabled) {
  background: rgba(143, 227, 239, 0.26);
}

.button--world {
  border: 1px solid var(--bark-line);
  border-radius: 4px;
  background: var(--bark);
  color: var(--text);
  font-family: var(--font-world);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.button--world:active:not(:disabled) {
  background: #3a2e22;
}

.badge {
  padding: 5px 8px;
  border: 1px solid;
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.badge--system {
  border-color: var(--system-line);
  color: var(--system);
  text-transform: uppercase;
}

.badge--world {
  max-width: 60%;
  overflow: hidden;
  border-color: var(--bark-line);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* Game frame: top bar, screen and the two bottom bars */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 10px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

/* The character and class level, one over the other, so gold and Punkty
   Systemu fit beside them on a phone. */
.topbar-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.topbar-badges .badge {
  max-width: 100%;
  padding: 2px 6px;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}

.topbar-badges .badge--world {
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* The gold is a button: it opens the camp's resources under it. */
.gold {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--gold);
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 600;
}

.gold[aria-expanded='true'] {
  background: var(--bark-active);
}

/* Punkty Systemu next to the gold, in the System's colours. */
.points {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  color: var(--system);
}

/* Narrow phones: a little tighter, so the level badges keep their room. */
@media (max-width: 374px) {
  .gold {
    font-size: 13px;
  }

  .camp-button {
    min-width: 42px;
  }
}

.wallet-list {
  position: absolute;
  top: calc(max(8px, env(safe-area-inset-top)) + 48px);
  right: var(--gutter);
  z-index: 30;
  min-width: 210px;
  margin: 0;
  padding: 4px 12px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--bark-line);
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 14px;
}

.wallet-item + .wallet-item {
  border-top: 1px solid var(--line);
}

.wallet-name {
  flex: 1;
  color: var(--text);
}

.wallet-amount {
  color: var(--gold);
  font-weight: 600;
}

/* The camp in the top right corner, with the time left of an upgrade. */
.camp-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  height: 44px;
  padding: 0 4px;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.camp-button--busy {
  color: var(--system);
}

/* A full store waits in the camp: a gold dot on the tent. */
.camp-button--ready {
  position: relative;
  color: var(--gold);
}

.camp-button--ready::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--bg-deep);
}

.wallet-item--system .wallet-name,
.wallet-item--system .wallet-amount,
.wallet-item--system svg {
  color: var(--system);
}

/* The materials under the two currencies. */
.wallet-item + .wallet-item--materials {
  border-top-color: var(--bark-line);
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
}

.meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.meter-value {
  color: var(--text);
}

.meter-track,
.meter-fill {
  height: 6px;
}

.meter-fill {
  transition: width 0.4s ease;
}

.meter--hp .meter-track {
  background: var(--hp-track);
}

.meter--hp .meter-fill {
  background: var(--hp);
}

.meter--mana .meter-track {
  background: var(--mana-track);
}

.meter--mana .meter-fill {
  background: var(--mana);
}

.meter--xp .meter-track {
  background: var(--xp-track);
}

.meter--xp .meter-fill {
  background: var(--xp);
}

.meter--class-xp .meter-track {
  background: var(--class-xp-track);
}

.meter--class-xp .meter-fill {
  background: var(--class-xp);
}

.meter-label {
  white-space: nowrap;
}

.meter-value {
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--system-line);
  background: var(--system-fill);
  font-family: var(--font-system);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.activity-label {
  overflow: hidden;
  color: var(--system-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  flex-shrink: 0;
  color: var(--system);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.activity--done {
  border-color: var(--system);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    background: rgba(143, 227, 239, 0.18);
  }
}

.screen--game {
  padding-top: 16px;
  padding-bottom: calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
  gap: 16px;
}

.screen-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.screen--game:has(.pending-bar) {
  padding-bottom: calc(var(--nav-height) + 96px + env(safe-area-inset-bottom));
}

.nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid;
}

.nav--main {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--bg-deep);
  border-top-color: var(--line);
}

/* The character bar has its own bark background, as in the mockup. */
.nav--character {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bark);
  border-top-color: var(--bark-line);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-world);
  font-size: 13px;
  line-height: 1.1;
  text-decoration: none;
}

.nav-icon {
  position: relative;
  display: flex;
  color: var(--text);
}

.nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-lock {
  position: absolute;
  top: -4px;
  right: -9px;
  color: var(--text-muted);
}

.nav-hint {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.nav-item--locked .nav-icon,
.nav-item--locked .nav-label {
  opacity: 0.55;
}

.nav-item--system .nav-icon {
  color: var(--system);
}

.nav--main .nav-item[aria-current='page'] {
  background: rgba(143, 227, 239, 0.08);
  box-shadow: inset 0 2px 0 var(--system);
  color: var(--system-text);
  font-weight: 700;
}

.nav--character .nav-item[aria-current='page'] {
  background: var(--bark-active);
  box-shadow: inset 0 2px 0 var(--accent);
  color: var(--text);
  font-weight: 700;
}

/* Common pieces */

a.button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.button--small {
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
}

.button--world.button--small {
  font-size: 15px;
}

.button--danger {
  border: 1px solid rgba(239, 154, 133, 0.7);
  background: rgba(239, 154, 133, 0.12);
  color: var(--danger);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.section-count {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 400;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge--tall {
  padding: 6px 10px;
  background: var(--system-fill);
}

.badge--gentle {
  border-color: rgba(167, 196, 127, 0.6);
  color: var(--leaf);
  font-size: 11px;
}

.badge--hard {
  border-color: rgba(239, 154, 133, 0.6);
  color: var(--danger);
  font-size: 11px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--bark-line);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.chip--dashed {
  border-style: dashed;
  color: var(--text-muted);
}

.chip--safe,
.chip--success {
  border-color: rgba(167, 196, 127, 0.6);
  color: var(--leaf);
}

.chip--fainted {
  border-color: rgba(239, 154, 133, 0.6);
  color: var(--danger);
}

.chip--escaped {
  border-color: rgba(217, 180, 90, 0.6);
  color: var(--gold);
}

.lock-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.segmented--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

a.segmented-option {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.segmented-option[aria-current='page'] {
  background: rgba(143, 227, 239, 0.14);
  color: var(--system-text);
}

.segmented-option:disabled {
  cursor: default;
  opacity: 0.6;
}

.bar {
  height: 6px;
  background: var(--line);
}

.bar-fill {
  height: 6px;
  background: var(--text);
  transition: width 0.4s ease;
}

.bar-fill--class {
  background: var(--src-class);
}

.bar--system {
  background: rgba(143, 227, 239, 0.15);
}

.bar-fill--system {
  background: var(--system);
  transition: width 1s linear;
}

.system-hint {
  margin: 0;
  color: rgba(214, 246, 250, 0.75);
  font-size: 13px;
  line-height: 1.4;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
  left: var(--gutter);
  z-index: 50;
  max-width: 408px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--system-line);
  background: rgba(13, 17, 11, 0.97);
  color: var(--system-text);
  font-family: var(--font-system);
  font-size: 14px;
  line-height: 1.4;
}

/* Bottom sheet */

.sheet {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  max-height: 85dvh;
  margin: 0 auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-top: 1px solid var(--bark-line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  color: var(--text);
}

.sheet::backdrop {
  background: rgba(5, 8, 4, 0.72);
}

.sheet-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
}

.sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
}

.sheet-title {
  margin: 0;
  padding-right: 44px;
  font-size: 22px;
  font-weight: 700;
}

.sheet-text {
  margin: 0;
}

.sheet-actions {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 10px;
}

/* Character creation */

.hero--small {
  padding-top: 8px;
}

.hero--small .hero-title {
  font-size: 34px;
}

.class-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.class-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.class-card[aria-checked='true'] {
  border-color: var(--system);
  background: linear-gradient(var(--system-fill), var(--system-fill)), var(--surface);
  box-shadow: inset 0 0 0 1px var(--system);
}

.class-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.class-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--bark-line);
  color: var(--text);
}

.class-name {
  font-size: 20px;
  font-weight: 700;
}

.class-meta {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.class-description {
  font-size: 15px;
  line-height: 1.4;
}

/* Character screen */

.portrait-wrap {
  display: flex;
  justify-content: center;
}

.portrait {
  position: relative;
  width: 100%;
  max-width: 336px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--bark-line);
  border-radius: 4px;
  background: #1a2316;
}

.portrait-art {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  transition: opacity 0.25s;
}

.portrait--bare .portrait-art {
  opacity: 1;
}

.portrait--bare .slots {
  display: none;
}

.portrait-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.slots {
  position: absolute;
  top: 18%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slots--left {
  left: 10px;
}

.slots--right {
  right: 10px;
}

.slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid var(--rarity, var(--bark-line));
  border-radius: 6px;
  background: rgba(13, 17, 11, 0.85);
  color: var(--text);
}

.slot--empty {
  border-style: dashed;
  border-color: var(--bark-line);
  background: rgba(13, 17, 11, 0.6);
  color: var(--icon-muted);
}

.slot--core {
  border-color: var(--system);
  border-radius: 0;
  background: rgba(18, 40, 44, 0.85);
  color: var(--system);
}

.slot--locked {
  border-style: dashed;
  opacity: 0.55;
}

/* The number in the corner is the upgrade level (from the upgrades stage on). */
.slot-level {
  position: absolute;
  right: -5px;
  bottom: -5px;
  padding: 0 3px;
  border: 1px solid var(--bark-line);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-system);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
}

.eye-toggle {
  position: absolute;
  top: 10px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid var(--bark-line);
  border-radius: 22px;
  background: rgba(13, 17, 11, 0.85);
  color: var(--text);
}

.bag {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 48px);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Items */

.item-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-title {
  margin: 0;
  padding-right: 44px;
  color: var(--rarity, var(--text));
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.item-details--small .item-title {
  padding-right: 0;
  font-size: 17px;
}

.item-meta {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.item-properties {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-family: var(--font-system);
  font-size: 14px;
  list-style: none;
}

.compare {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.compare-title {
  margin: 0;
  color: var(--system);
  font-family: var(--font-system);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--text-muted);
  text-align: left;
}

.item-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-name {
  color: var(--rarity, var(--text));
  font-weight: 700;
}

/* Stats screen */

.levels {
  gap: 14px;
}

.level-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
}

.num {
  font-family: var(--font-system);
  font-weight: 600;
}

.level-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 8px;
  color: var(--system);
  font-family: var(--font-system);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.level-note span:last-child {
  color: var(--text-muted);
}

.level-professions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.stat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: -6px;
  color: var(--text-muted);
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.swatch {
  display: block;
  width: 10px;
  height: 10px;
}

.swatch--class,
.segment--class {
  background: var(--src-class);
}

.swatch--character,
.segment--character {
  background: var(--src-character);
}

.swatch--professions,
.segment--professions {
  background: var(--src-professions);
}

.swatch--equipment,
.segment--equipment {
  background: var(--src-equipment);
}

.swatch--core,
.segment--core {
  background: var(--src-core);
}

.stat-list {
  display: flex;
  flex-direction: column;
}

.stat-row {
  border-bottom: 1px solid var(--line);
}

.stat-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.stat-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.stat-name {
  font-size: 17px;
}

.stat-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-system);
  font-size: 17px;
  font-weight: 600;
}

.stat-extra {
  color: var(--system);
  font-size: 12px;
}

.stat-effect {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.3;
}

.source-bar {
  display: flex;
  width: 100%;
  height: 6px;
  background: #1d2519;
}

.segment {
  display: block;
  height: 6px;
}

.stat-add,
.stat-add-space {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.stat-add {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--system-line);
  background: var(--system-fill);
  color: var(--system);
}

.stat-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--system-line);
  background: var(--system-fill);
  color: var(--system-text);
  font-family: var(--font-system);
  font-size: 13px;
}

.stat-detail-title {
  margin: 0;
  color: var(--system);
}

.stat-detail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat-detail-sources {
  margin: 0;
  color: rgba(214, 246, 250, 0.7);
  font-size: 12px;
}

.combat-values {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.value-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.value-label,
.value-note {
  color: var(--text-muted);
  font-size: 13px;
}

.value-note {
  font-size: 12px;
}

.value-number {
  font-family: var(--font-system);
  font-size: 17px;
  font-weight: 600;
}

.pending-bar {
  position: fixed;
  right: 0;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  left: 0;
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px var(--gutter);
  border-top: 1px solid var(--system-line);
  background: rgba(13, 17, 11, 0.97);
}

.pending-text {
  flex: 1;
  color: var(--system-text);
  font-family: var(--font-system);
  font-size: 13px;
}

/* Walka: hunts */

.region-card {
  gap: 10px;
}

.region-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.region-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  font-style: italic;
}

.region-trait,
.region-warning {
  margin: 0;
  font-size: 15px;
}

.region-warning {
  color: var(--gold);
}

/* A region on the main Walka view opens its inner regions. */
.region-link {
  color: inherit;
  text-decoration: none;
}

.region-link:active {
  background: var(--bark-active);
}

.region-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.region-foot > svg {
  flex: none;
  color: var(--accent);
}

/* Inner regions as circles with a picture of the place, two in a row and
   the odd last one in the middle. */
.area-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 12px;
  padding-top: 4px;
}

.area-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.area-tile:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.area-circle {
  position: relative;
  display: block;
  width: min(136px, 38vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg-deep);
  box-shadow: 0 0 0 4px rgba(13, 17, 11, 0.7), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.area-tile:active .area-circle {
  box-shadow: 0 0 0 4px var(--system-line);
}

.area-art {
  display: block;
  width: 100%;
  height: 100%;
}

.area-tile-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.area-tile--locked {
  color: var(--text-muted);
}

.area-tile--locked .area-circle {
  border-color: var(--bark-line);
}

.area-tile--locked .area-art {
  filter: grayscale(1) brightness(0.45);
}

.area-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
}

.area-levels {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* The chosen inner region: its picture above the length and the start. */
.area-card {
  gap: 10px;
}

.area-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 2px;
}

.area-circle--large {
  width: min(176px, 48vw);
}


/* Hunt length: a slider in 5-minute steps with a button for one step on each side. */
.duration-picker {
  display: grid;
  gap: 6px;
}

.duration-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-family: var(--font-system);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.duration-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

/* The length's name: "bardzo krótka", "średnia"… */
.duration-kind {
  color: var(--system);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.duration-value {
  color: var(--system-text);
  font-size: 20px;
  font-weight: 700;
}

.duration-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.duration-step {
  min-height: 48px;
  padding: 0;
  font-family: var(--font-system);
  font-size: 24px;
  line-height: 1;
}

.duration-step:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.duration-slider {
  --fill: 0%;
  width: 100%;
  height: 48px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.duration-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--system) var(--fill), var(--bark-line) var(--fill));
}

.duration-slider::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 2px solid var(--system);
  border-radius: 50%;
  background: var(--bg-deep);
  box-shadow: 0 0 10px rgba(143, 227, 239, 0.45);
  -webkit-appearance: none;
  appearance: none;
}

.duration-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bark-line);
}

.duration-slider::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--system);
}

.duration-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid var(--system);
  border-radius: 50%;
  background: var(--bg-deep);
  box-shadow: 0 0 10px rgba(143, 227, 239, 0.45);
}

.duration-slider:focus-visible {
  outline: 2px solid var(--system);
  outline-offset: 2px;
}

.duration-scale {
  display: flex;
  justify-content: space-between;
  margin: 0 58px;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
}

.duration-lock {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Test mode: a tool to skip the waiting, set apart from the game's own buttons. */
.test-tools {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--gold);
}

.test-tools-text {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-system);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.button--test {
  border: 1px dashed var(--gold);
  background: rgba(224, 160, 60, 0.12);
  color: var(--gold);
}

/* The scrapper: one button per rarity, with what it would sell. */
.scrap-options {
  display: grid;
  gap: 8px;
}

.scrap-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.scrap-option:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.scrap-detail {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 13px;
}

.chip--tough {
  border-color: var(--system-line);
  color: var(--system);
}

.item-classes,
.item-price {
  color: var(--text-muted);
}

.threat-note {
  margin: 0;
  font-size: 14px;
}

.threat {
  margin: 0;
  font-family: var(--font-system);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.threat--low strong {
  color: var(--leaf);
}

.threat--moderate strong {
  color: var(--gold);
}

.threat--high strong {
  color: #e69a5c;
}

.threat--very-high strong {
  color: var(--danger);
}

.countdown {
  margin: 6px 0 2px;
  color: var(--system-text);
  font-family: var(--font-system);
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Report */

.report-summary {
  gap: 4px;
}

.result {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.result--success {
  color: var(--leaf);
}

.result--fainted {
  color: var(--danger);
}

.result--escaped {
  color: var(--gold);
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arena-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arena {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 8px;
  border: 1px solid var(--bark-line);
  border-radius: 4px;
  background: #141b11;
}

.arena-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.arena-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  padding: 18px 3px 3px;
  border: 1px dashed rgba(74, 61, 44, 0.7);
}

.arena-field-label {
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.unit {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 6px 6px 5px;
  border: 1px solid var(--bark-line);
  border-radius: 4px;
  background: rgba(13, 17, 11, 0.9);
}

.unit--elite {
  border-color: #e0a03c;
}

.unit-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.unit-icon {
  display: flex;
  color: var(--text);
}

.unit-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.unit-level,
.unit-hp-text {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 10px;
}

.unit-hp {
  height: 5px;
  margin-top: 2px;
  background: var(--hp-track);
}

.unit-hp-fill {
  height: 5px;
  background: var(--hp);
  transition: width 0.35s ease;
}

.unit--ally .unit-hp-fill {
  background: var(--leaf);
}

.unit-hp-text {
  text-align: right;
}

.unit-status {
  overflow: hidden;
  color: var(--gold);
  font-family: var(--font-system);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-status:empty {
  display: none;
}

.unit--down {
  filter: grayscale(1);
  opacity: 0.4;
}

.unit--down::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 30px;
  font-weight: 700;
  pointer-events: none;
}

/* The attacker is drawn above the others while it lunges. */
.unit--acting {
  z-index: 3;
}

.arena {
  position: relative;
  touch-action: pan-y;
}

.arena-fx {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}

.projectile {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.projectile--arrow {
  width: 26px;
  height: 2px;
  margin: -1px 0 0 -13px;
  background: linear-gradient(90deg, rgba(231, 220, 194, 0), #e7dcc2 40%, #e7dcc2);
}

.projectile--arrow::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -2px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #e7dcc2;
}

.projectile--magic {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0, var(--fx, #8fe3ef) 45%, rgba(0, 0, 0, 0) 72%);
  box-shadow: 0 0 14px 4px var(--fx, #8fe3ef);
}

.slash {
  position: absolute;
  width: 46px;
  height: 46px;
  pointer-events: none;
}

.slash::before,
.slash::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  right: 4px;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: #ffd8cc;
  box-shadow: 0 0 6px rgba(239, 154, 133, 0.9);
  transform: rotate(-35deg);
}

/* One cut for a hit, two parallel cuts for a critical one; a cross would look
   like the mark of a fallen unit. */
.slash::after {
  display: none;
}

.slash--strong::before,
.slash--strong::after {
  height: 4px;
  background: #ffe2a8;
  box-shadow: 0 0 10px rgba(224, 160, 60, 0.95);
}

.slash--strong::before {
  margin-top: -7px;
}

.slash--strong::after {
  display: block;
  margin-top: 4px;
  opacity: 0.75;
}

.float {
  position: absolute;
  z-index: 5;
  font-family: var(--font-system);
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}

.float--hit {
  color: #ffb3a3;
}

.float--crit {
  color: var(--gold);
  font-size: 22px;
}

.float--tick,
.float--effect {
  color: #c5e38f;
  font-size: 13px;
}

.float--dodge {
  color: var(--system);
  font-size: 14px;
}

.arena-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  padding: 8px 16px;
  border: 1px solid var(--system-line);
  background: rgba(13, 17, 11, 0.92);
  color: var(--system-text);
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.arena-banner--shown {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.arena-banner[data-result='true'] {
  border-color: rgba(167, 196, 127, 0.7);
  color: var(--leaf);
}

.arena-banner[data-result='false'] {
  border-color: rgba(239, 154, 133, 0.7);
  color: var(--danger);
}

.fight-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fight-tabs {
  display: flex;
  gap: 6px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.fight-tabs::-webkit-scrollbar {
  display: none;
}

.fight-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--bark-line);
  border-bottom: 3px solid var(--leaf);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
}

.fight-tab--false {
  border-bottom-color: var(--danger);
}

.fight-tab--null {
  border-bottom-color: var(--gold);
}

.fight-tab[aria-selected='true'] {
  border-color: var(--system);
  background: rgba(143, 227, 239, 0.14);
  color: var(--system-text);
}

.fight-tab-key {
  position: absolute;
  top: 1px;
  right: 3px;
  color: var(--gold);
  font-size: 10px;
}

.fight-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fight-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.fight-meta,
.fight-outcome {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.fight-outcome {
  font-family: var(--font-system);
  font-size: 12px;
}

.fight-outcome--true {
  color: var(--leaf);
}

.fight-outcome--false {
  color: var(--danger);
}

.fight-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fight-pager .button {
  width: 100%;
}

.chip--key {
  border-color: rgba(217, 180, 90, 0.6);
  color: var(--gold);
  font-size: 11px;
}

.chip--elite {
  border-color: rgba(224, 160, 60, 0.7);
  color: #e0a03c;
  font-size: 11px;
}

.link-button {
  padding: 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: none;
  font: inherit;
  text-align: right;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--system-line);
  background: var(--system-fill);
}

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-family: var(--font-system);
  font-size: 14px;
  list-style: none;
}

.preview-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.preview-up .num {
  color: var(--leaf);
}

.preview-down .num {
  color: var(--danger);
}

.toggle {
  min-width: 112px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--bark-line);
  background: var(--bg-deep);
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
}

.toggle[aria-checked='true'] {
  border-color: var(--system);
  background: rgba(143, 227, 239, 0.14);
  color: var(--system-text);
}

.arena-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fight-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  margin: 0;
  padding: 10px 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  font-size: 15px;
  line-height: 1.35;
  list-style: none;
}

.log-line--crit {
  color: var(--gold);
}

.log-line--kill {
  color: var(--text-muted);
  font-style: italic;
}

.log-line--effect,
.log-line--tick {
  color: #d8c49a;
}

.participants-scroll {
  overflow-x: auto;
}

.participants-table {
  border-collapse: collapse;
  font-family: var(--font-system);
  font-size: 12px;
}

.participants-table th,
.participants-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.participants-table thead th {
  color: var(--text);
}

.participants-table tbody th {
  color: var(--text-muted);
  font-weight: 400;
}

.fight-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fight-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
}

.fight-time {
  grid-row: span 2;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
}

.fight-result {
  color: var(--leaf);
  font-family: var(--font-system);
  font-size: 12px;
}

.fight-item--lost .fight-result {
  color: var(--danger);
}

.account {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 15px;
  list-style: none;
}

.account li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
}

.account-time {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
  line-height: 1.8;
}

/* Journal */

.report-list,
.system-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.report-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.report-row-title {
  font-weight: 700;
}

.report-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 12px;
}

.report-row-meta .chip {
  padding: 1px 6px;
  font-size: 11px;
}

.report-row-date {
  color: var(--text-muted);
  font-family: var(--font-system);
  font-size: 11px;
  text-align: right;
}

.system-history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--system-line);
  background: var(--system-fill);
  font-family: var(--font-system);
}

.system-history-date {
  color: var(--system);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* With reduced motion the pulsing and sliding stop; the fight playback stays,
   in a calmer form (see arena.js). */
@media (prefers-reduced-motion: reduce) {
  .activity--done,
  .camp-bubble--full {
    animation: none;
  }

  .camp-plot-art {
    transition: none;
  }

  .meter-fill,
  .bar-fill,
  .portrait-art,
  .arena-banner {
    transition: none;
  }
}

/* Obóz: the materials, the board with a plot for each building, and a
   building's screen. */
.camp-materials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Icon, then the name over the amount. */
.camp-material {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid var(--bark-line);
  color: var(--text-muted);
  font-family: var(--font-system);
}

.camp-material svg {
  grid-row: span 2;
}

.camp-material span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp-material strong {
  color: var(--gold);
  font-size: 14px;
}

/* The board keeps the 360 × 400 shape of its picture; plots sit on it in
   percent of its size (camp-art.js). */
.camp-board {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 360 / 400;
  overflow: hidden;
  border: 1px solid var(--bark-line);
  border-radius: 6px;
  background: #151d12;
}

.camp-board-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camp-plot-wrap {
  position: absolute;
}

.camp-plot {
  position: relative;
  display: block;
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.camp-plot-art {
  display: block;
  width: 100%;
  aspect-ratio: 100 / 80;
  transition: transform 0.12s ease;
}

.camp-plot:active .camp-plot-art {
  transform: scale(0.95);
}

.camp-plot:focus-visible {
  outline: 2px solid var(--system);
  outline-offset: 2px;
}

/* The name and level under a plot; it may reach past the plot's width. */
.camp-plot-label {
  position: absolute;
  top: 100%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  transform: translate(-50%, -9px);
  background: rgba(13, 17, 11, 0.86);
  border: 1px solid var(--bark-line);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.camp-plot-level {
  color: var(--gold);
  font-weight: 700;
}

.camp-plot--empty .camp-plot-label {
  border-style: dashed;
  color: var(--text-muted);
}

/* The time left of the building being built, over its plot. */
.camp-plot-timer {
  position: absolute;
  top: 0;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  transform: translateX(-50%);
  background: rgba(13, 17, 11, 0.88);
  border: 1px solid var(--system-line);
  color: var(--system);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

/* What a production building's store holds: a tap collects it. */
.camp-bubble {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(13, 17, 11, 0.9);
  color: var(--gold);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 700;
}

.camp-bubble[hidden] {
  display: none;
}

.camp-bubble--full {
  background: var(--gold);
  color: var(--bg-deep);
  animation: bubble-pulse 1.6s ease-in-out infinite;
}

@keyframes bubble-pulse {
  50% {
    box-shadow: 0 0 0 5px rgba(217, 180, 90, 0.25);
  }
}

.camp-hint {
  text-align: center;
}

.building-view {
  gap: 10px;
}

.building-art {
  margin: -4px -4px 0;
  background: radial-gradient(ellipse at 50% 60%, #2d3b24, #1a2416 70%);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.building-art svg {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.building-next-card {
  gap: 10px;
}

.building-effect,
.building-next,
.building-time {
  margin: 0;
  font-size: 15px;
}

.building-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.cost-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--bark-line);
  color: var(--text);
  font-family: var(--font-system);
  font-size: 13px;
}

.cost strong {
  color: var(--leaf);
}

.cost--missing strong {
  color: var(--danger);
}

.section-count--full {
  color: var(--danger);
}

/* The store of a production building. */
.store {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--bark-line);
}

.store-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-system);
  font-size: 14px;
}

.store-head span {
  flex: 1;
}

.store-head strong {
  color: var(--gold);
}

.store-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.bar-fill--gold {
  background: var(--gold);
  transition: width 1s linear;
}
