/* Living tavern hall: 0–3 columns, chalkboard, rain, memorial. No arena chrome. */

@font-face {
  font-family: "Cinzel";
  src: url("/webapp/assets/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/webapp/assets/fonts/manrope-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("/webapp/assets/fonts/rajdhani-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body.page-tavern.living-hall .tavern-tabs-wrap,
body.page-tavern.living-hall #tavern-hire-footer,
body.page-tavern.living-hall .tab-panel {
  display: none !important;
}

#tavern-living-root {
  display: none;
}

body.page-tavern.living-hall #tavern-living-root {
  display: block;
  position: relative;
  z-index: 3;
  padding: 10px 12px 88px;
}

.tavern-living-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}
.tavern-living-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.04em;
}
.tavern-living-head .sub {
  color: var(--ash);
  font-size: 12px;
}

.tavern-living-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.living-col {
  position: relative;
  min-height: 210px;
  border-radius: 12px;
  background: rgba(18, 14, 11, 0.72);
  border: 1px solid rgba(200, 146, 42, 0.18);
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.living-col[data-kind="empty"],
.living-col[data-kind="memorial"] {
  cursor: default;
}
.living-col-hire {
  cursor: pointer;
}
.living-frame.hire-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  color: var(--amber-glow);
  border-style: dashed;
  background: rgba(18, 14, 11, 0.55);
}
.living-col.scar {
  box-shadow: inset 0 0 0 1px rgba(180, 70, 40, 0.55);
}

.living-frame {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1410;
  border: 2px solid rgba(160, 110, 50, 0.55);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.living-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.living-frame.hood {
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 32, 28, 0.9), #0d0a08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ash);
  font-size: 12px;
}

.living-hood-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin-top: -14px;
  position: relative;
  z-index: 1;
}
.living-hood {
  width: 44px;
  height: 44px;
  margin-top: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(232, 184, 75, 0.35);
  background: #221a14;
  z-index: 1;
}
.living-hood img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.living-loyalty {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin-bottom: 2px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
}

.living-col .name {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  text-align: center;
}
.living-col .meta {
  font-size: 10px;
  color: var(--ash);
  text-align: center;
}
.living-col .who-sub {
  font-size: 10px;
  color: rgba(239, 232, 214, 0.55);
  text-align: center;
}
.living-cta {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-glow);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.living-refuse {
  margin-top: 4px;
  font-size: 10px;
  color: var(--ash);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tavern-chalk {
  margin-top: 14px;
  background: #2a3230;
  border-radius: 10px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(180, 190, 170, 0.18);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}
.tavern-chalk h2 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d8d2c0;
  font-weight: 700;
}
.tavern-chalk ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tavern-chalk li {
  font-size: 12px;
  color: #efe8d6;
  padding: 4px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  line-height: 1.35;
}
.tavern-chalk li:first-child {
  border-top: 0;
}
.tavern-chalk li.severe {
  color: #f0c9a0;
}
.tavern-chalk .empty {
  color: rgba(239, 232, 214, 0.55);
  font-size: 12px;
}

.living-modal {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--attic-bar-height, 58px) + env(safe-area-inset-top, 0px));
  bottom: calc(min(100vw, 1024px) / 8 + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  height: auto;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 10px;
}
.living-modal.open {
  display: flex;
}
.living-sheet {
  --gold: #e2a93f;
  --gold-bright: #ffd97a;
  --gold-dim: rgba(226, 169, 63, 0.16);
  --ember: #e2543f;
  --ember-bright: #ff8a65;
  --rune-bright: #7ff0dd;
  --bond: #f472b6;
  --bond-bright: #fbb6d9;
  --line: rgba(226, 169, 63, 0.2);
  --display: "Cinzel", serif;
  --sheet-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hud: "Rajdhani", var(--sheet-body);
  width: min(360px, 100%);
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: linear-gradient(165deg, #221912, #140d08 65%);
  border-radius: 18px;
  border: 1px solid rgba(226, 169, 63, 0.4);
  padding: 0;
  color: #ecdfc6;
  font-family: var(--sheet-body);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
.living-sheet::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 5;
  pointer-events: none;
  --cc: var(--gold-bright);
  --cs: 14px;
  background:
    linear-gradient(var(--cc), var(--cc)) top left / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) top left / 2px var(--cs) no-repeat,
    linear-gradient(var(--cc), var(--cc)) top right / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) top right / 2px var(--cs) no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom left / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom left / 2px var(--cs) no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom right / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom right / 2px var(--cs) no-repeat;
  opacity: 0.8;
  filter: drop-shadow(0 0 3px rgba(226, 169, 63, 0.4));
}
.living-sheet.scar {
  border-color: rgba(226, 84, 63, 0.55);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(180, 70, 40, 0.45);
}
.living-hero {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 15%, rgba(255, 217, 122, 0.22), transparent 60%),
    linear-gradient(160deg, #3a2a1c 0%, #150e09 70%);
}
.living-hero-rays {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 380px;
  height: 380px;
  margin-left: -190px;
  border-radius: 50%;
  opacity: 0.35;
  pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 217, 122, 0.12) 0deg 3deg, transparent 3deg 12deg);
}
.living-hero-art,
.living-hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.living-hero-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}
.living-hero-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.living-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 7, 5, 0.55);
  backdrop-filter: blur(4px);
  color: #ecdfc6;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.living-circle-btn:active {
  transform: scale(0.9);
}
.living-dismiss-ico.confirming {
  border-color: rgba(226, 84, 63, 0.75);
  background: var(--ember);
  color: #2a0b06;
}
.living-hero-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 12px;
  background: linear-gradient(0deg, rgba(8, 5, 3, 0.95) 20%, transparent 100%);
}
.living-hero-identity {
  min-width: 0;
  flex: 1;
}
.living-hero-identity h2,
.living-hero-identity .living-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.living-hero-status {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.living-hero-status .living-stat {
  max-width: 42vw;
  backdrop-filter: blur(4px);
  background: rgba(10, 7, 5, 0.55);
}
.living-hero-status .living-ico {
  width: 13px;
  height: 13px;
}
.living-sheet h2 {
  margin: 0;
  font: 700 22px/1.1 var(--display);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.living-sheet h2.can-rename {
  cursor: pointer;
  text-decoration: underline dotted rgba(255, 217, 122, 0.55);
  text-underline-offset: 3px;
}
.living-who {
  margin-top: 3px;
  font: 700 11.5px/1 var(--sheet-body);
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.living-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.living-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.living-tag-chips {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.living-tag-chip {
  font: 700 10.5px/1 var(--sheet-body);
  color: var(--gold-bright);
  background: var(--gold-dim);
  border: 1px solid rgba(226, 169, 63, 0.4);
  border-radius: 999px;
  padding: 5px 10px;
}
.living-bio-btn {
  flex: 0 0 auto;
  margin-left: auto;
  font: 700 10.5px/1 var(--sheet-body);
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.living-loyalty-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.living-loyalty-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.living-loyalty-lbl {
  font: 700 11.5px/1 var(--sheet-body);
  color: #9c8b76;
}
.living-loyalty-val {
  font: 700 15px/1 var(--hud);
  color: var(--bond-bright);
}
.living-loyalty-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.living-loyalty-bar i {
  display: block;
  height: 100%;
  width: var(--pct, 50%);
  background: linear-gradient(90deg, var(--bond), var(--bond-bright));
  box-shadow: 0 0 6px rgba(244, 114, 182, 0.5);
}
.living-col .hire-cost {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-glow);
}
.living-frame.art-wait {
  animation: living-art-wait 1.6s ease-in-out infinite;
}
@keyframes living-art-wait {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.living-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 10.5px/1 var(--sheet-body);
  color: var(--rune-bright);
  background: rgba(73, 201, 179, 0.12);
  border: 1px solid rgba(73, 201, 179, 0.35);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.living-stat:disabled,
#living-dismiss-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.living-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.living-stat.tone-ok {
  color: var(--rune-bright);
  border-color: rgba(73, 201, 179, 0.35);
  background: rgba(73, 201, 179, 0.12);
}
.living-stat.tone-warn {
  color: #f0d06a;
  border-color: rgba(220, 170, 50, 0.4);
  background: rgba(180, 130, 30, 0.18);
}
.living-stat.tone-bad {
  color: #f08a78;
  border-color: rgba(200, 80, 60, 0.45);
  background: rgba(160, 40, 30, 0.2);
}
.living-bio-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.living-trait-chip {
  font: 600 10px/1 var(--sheet-body);
  color: #6b5c4b;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}
.living-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  flex-shrink: 0;
}
.living-chip {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid rgba(226, 169, 63, 0.28);
  color: #ecdfc6;
}
.living-thread {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #1a1510;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.living-thread.is-empty::after {
  content: "окно диалога";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: rgba(236, 223, 198, 0.28);
  font: 600 13px/1 var(--sheet-body);
  letter-spacing: 0.04em;
}
.living-bubble {
  max-width: 86%;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
}
.living-bubble.me {
  align-self: flex-end;
  background: rgba(200, 146, 42, 0.22);
}
.living-bubble.her {
  align-self: flex-start;
  background: rgba(40, 32, 28, 0.95);
  border: 1px solid rgba(200, 146, 42, 0.16);
}
.living-chat {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 8px 14px 12px;
  flex-shrink: 0;
}
.living-chat input {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1b130c;
  color: #ecdfc6;
  padding: 0 12px;
  font: 600 12px/1 var(--sheet-body);
}
.living-chat input::placeholder {
  color: #6b5c4b;
}
.living-chat button {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(226, 169, 63, 0.4);
  background: linear-gradient(180deg, var(--gold-dim), transparent);
  color: var(--gold-bright);
  font: 700 12px/1 var(--sheet-body);
  cursor: pointer;
}
.living-pop {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 5, 0.72);
  padding: 12px;
}
.living-pop[hidden] {
  display: none;
}
.living-pop-card {
  width: 100%;
  max-height: 70%;
  overflow: auto;
  background: #1a1510;
  border: 1px solid rgba(200, 146, 42, 0.28);
  border-radius: 12px;
  padding: 12px;
}
.living-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.living-pop-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ash);
  font-size: 20px;
  cursor: pointer;
}
.living-pop-body h3 {
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash);
}
.living-pop-body ul,
.living-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.living-pop-body li,
.living-log-list li {
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  color: #d8cbb8;
}
.living-pop-body li:first-child,
.living-log-list li:first-child {
  border-top: 0;
}
.living-pop-body li.ok {
  color: #8ee39a;
}
.living-pop-body .empty {
  color: var(--ash);
  font-size: 13px;
}

@media (max-height: 700px) {
  .living-body {
    gap: 8px;
    padding-top: 10px;
  }
}
@media (max-width: 360px) {
  .living-sheet h2 {
    font-size: 18px;
  }
}
@media (max-width: 420px) {
  .living-frame {
    max-width: 96px;
  }
  .living-col .name {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .living-circle-btn:active {
    transform: none;
  }
}
