/* Aharion karakterlap — sűrű, pergamen-szerű sheet */

body:has(.sheet) .wrap {
  width: min(1200px, calc(100% - 2rem));
}

.sheet {
  --sheet-ink: #ebe4d6;
  --sheet-muted: #9a9080;
  --sheet-accent: #c9a86a;
  --sheet-line: rgba(180, 150, 100, 0.35);
  --sheet-fill: #1f1a15;
  --sheet-cell: #171310;
  --sheet-value: #f0e6d0;
  background:
    linear-gradient(180deg, rgba(40, 34, 28, 0.97), rgba(24, 20, 16, 0.98)),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 3px);
  border: 1px solid var(--sheet-line);
  box-shadow: 0 2px 0 rgba(0,0,0,.4), inset 0 0 0 1px rgba(180,150,100,.08);
  padding: .85rem;
  margin-bottom: 1.25rem;
  position: relative;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(180, 150, 100, 0.14);
  pointer-events: none;
}
.sheet > * { position: relative; z-index: 1; }

.sheet-label {
  display: block;
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sheet-muted);
  margin-bottom: .15rem;
}
.sheet-value {
  font-family: var(--font-display);
  color: var(--sheet-value);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
}
.sheet-value.lg { font-size: 1.45rem; color: var(--sheet-accent); }

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) auto;
  gap: .45rem .55rem;
  padding-bottom: .75rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--sheet-line);
  align-items: end;
}
.sheet-head .sheet-field { min-width: 0; }
.sheet-head input,
.sheet-head select {
  width: 100%;
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  border-radius: 1px;
  color: var(--sheet-value);
  padding: .35rem .45rem;
  font-family: var(--font-display);
  font-size: .95rem;
}
.sheet-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.sheet-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1.15fr) minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
}

.sheet-col {
  display: grid;
  gap: .55rem;
  min-width: 0;
}

.sheet-box {
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(180,150,100,.22);
  padding: .55rem .6rem;
}
.sheet-box h3 {
  margin: 0 0 .45rem;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sheet-accent);
  border-bottom: 1px solid rgba(180,150,100,.2);
  padding-bottom: .3rem;
  font-weight: 600;
}

.sheet-portrait {
  width: 150px;
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  overflow: hidden;
  padding: 0;
  margin: 0 auto;
}
.sheet-portrait img {
  width: 150px;
  height: 150px;
  max-width: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.sheet-stats { display: grid; gap: .35rem; }
.sheet-stat {
  display: grid;
  grid-template-columns: 1fr 2.6rem auto;
  gap: .35rem;
  align-items: center;
}
.sheet-stat .btn-row { gap: .25rem; }
.sheet-stat .sheet-label { margin: 0; }
.sheet-stat .num {
  display: grid;
  place-items: center;
  min-height: 2rem;
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--sheet-accent);
  font-weight: 700;
}
.sheet-stat .btn-tiny { white-space: nowrap; }

.sheet-weapon {
  display: grid;
  gap: .35rem;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(180,150,100,.12);
}
.sheet-weapon:last-child { border-bottom: 0; }
.sheet-weapon-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .3rem;
}
.sheet-mini {
  background: var(--sheet-cell);
  border: 1px solid rgba(180,150,100,.18);
  padding: .25rem .35rem;
  text-align: center;
}
.sheet-mini .sheet-label { margin-bottom: .1rem; }
.sheet-mini strong {
  font-family: var(--font-display);
  color: var(--sheet-value);
  font-size: .9rem;
}

.sheet-derived {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}
.sheet-derived .cell {
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  padding: .4rem .45rem;
  text-align: center;
}
.sheet-derived .cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--sheet-accent);
  margin-top: .1rem;
}
.sheet-derived .cell small {
  display: block;
  color: var(--sheet-muted);
  font-size: .7rem;
  margin-top: .15rem;
  line-height: 1.25;
}

.sheet-bars { display: grid; gap: .45rem; }
.sheet-bar-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: .4rem;
  align-items: center;
  font-size: .88rem;
}
.sheet-bar-row .track {
  height: .55rem;
  background: #0e0c0a;
  border: 1px solid rgba(180,150,100,.2);
  overflow: hidden;
}
.sheet-bar-row .fill { height: 100%; }
.sheet-bar-row .fill.hp { background: #8a4540; }
.sheet-bar-row .fill.mp { background: #5a7a7e; }
.sheet-bar-row .fill.tp { background: #c9a86a; }

.sheet-resource {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}
.sheet-resource .cell {
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  padding: .5rem;
  text-align: center;
}
.sheet-resource .cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--sheet-accent);
}

.sheet-trait {
  font-size: .9rem;
  color: #d2c8b4;
  line-height: 1.45;
}
.sheet-trait p { margin: 0 0 .4rem; }
.sheet-bio {
  max-height: 8rem;
  overflow: auto;
  font-size: .9rem;
  color: #d2c8b4;
}

.sheet-inv { margin-top: .7rem; }
.sheet-inv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .4rem;
}
.sheet-inv-list li {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  align-items: start;
  padding: .45rem .55rem;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(180,150,100,.14);
}
.sheet-inv-list .meta { color: var(--sheet-muted); font-size: .85rem; }

/* Create mode */
.sheet-create .avatar-grid {
  max-height: 240px;
}
.sheet-create .sheet-portrait {
  width: 150px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0;
}
.sheet-create .sheet-portrait img,
.sheet-preview-avatar {
  width: 150px !important;
  height: 150px !important;
  object-fit: cover;
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  display: block;
}
.sheet-stat-edit {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: .3rem;
  align-items: center;
  margin-bottom: .35rem;
}
.sheet-stat-edit input[type="number"] {
  width: 3.2rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sheet-accent);
  background: var(--sheet-cell);
  border: 1px solid var(--sheet-line);
  padding: .25rem;
}
.sheet-points {
  font-family: var(--font-display);
  color: var(--sheet-accent);
  margin: .35rem 0 0;
}
.sheet-foot {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--sheet-line);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 960px) {
  .sheet-head {
    grid-template-columns: 1fr 1fr;
  }
  .sheet-grid {
    grid-template-columns: 1fr;
  }
  .sheet-portrait { max-width: 180px; }
}
@media (max-width: 560px) {
  .sheet-head { grid-template-columns: 1fr; }
  .sheet-weapon-meta { grid-template-columns: 1fr 1fr; }
  .sheet-derived { grid-template-columns: 1fr; }
}
