:root {
  color-scheme: dark;
  --bg: #0d100d;
  --panel: #171914;
  --panel-soft: #22251d;
  --text: #e8e0d0;
  --muted: #9f9a88;
  --accent: #c99a4a;
  --accent-strong: #7f5f2e;
  --border: #4b4a3c;
  --danger: #b76b58;
  --ok: #b9a05f;
}

* {
  box-sizing: border-box;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes detailsOpen {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(94, 107, 72, 0.28), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(87, 65, 38, 0.24), transparent 30rem),
    linear-gradient(135deg, #050604, var(--bg));
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 20% 10%, rgba(185, 160, 95, 0.08), transparent 28rem);
  mix-blend-mode: screen;
}

.main-menu,
.coming-soon-screen,
.auth-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 7, 6, 0.88), rgba(17, 20, 15, 0.68), rgba(4, 7, 6, 0.9)),
    url("assets/main-menu-bg.jpg") center / cover no-repeat,
    radial-gradient(circle at center, rgba(41, 48, 31, 0.85), #050604);
  animation: softFadeIn 420ms ease both;
}

.main-menu::before,
.coming-soon-screen::before,
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent, rgba(0, 0, 0, 0.56)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.56));
  pointer-events: none;
}

.main-menu-card,
.coming-soon-card,
.auth-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 48px);
  background: rgba(13, 16, 13, 0.56);
  border: 1px solid rgba(214, 199, 158, 0.16);
  border-radius: 8px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  animation: fadeSlideIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.main-menu-card h1,
.coming-soon-card h1 {
  max-width: 700px;
  font-family: "Arial Narrow", Impact, "Arial Black", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.86);
}

.main-menu-card h1 {
  font-size: clamp(38px, 7vw, 72px);
}

.main-menu-actions {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 30px;
}

.auth-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  color: var(--muted);
}

.menu-button,
.back-button {
  min-height: 54px;
  color: var(--text);
  background: rgba(23, 25, 20, 0.82);
  border: 1px solid rgba(214, 199, 158, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.menu-button:hover,
.back-button:hover {
  border-color: var(--accent);
  background: rgba(68, 57, 35, 0.82);
  box-shadow: 0 12px 34px rgba(201, 154, 74, 0.14);
  transform: translateX(6px);
}

.primary-menu-button {
  background: linear-gradient(135deg, rgba(85, 67, 35, 0.96), rgba(157, 119, 56, 0.78));
}

.admin-menu-button {
  border-color: rgba(185, 160, 95, 0.48);
}

.locked-menu-button {
  opacity: 0.54;
}

.locked-menu-button::after {
  content: "ожидает доступа";
  float: right;
  color: var(--danger);
  font-size: 12px;
  text-transform: uppercase;
}

.text-button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.music-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: rgba(13, 16, 13, 0.88);
  border: 1px solid rgba(214, 199, 158, 0.18);
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.music-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.music-controls input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}

.music-toggle {
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(23, 25, 20, 0.82);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

.music-toggle:hover {
  border-color: var(--accent);
  background: rgba(68, 57, 35, 0.82);
}

.danger-button {
  color: #fff4f4;
  background: rgba(122, 46, 39, 0.92);
  border-color: rgba(183, 107, 88, 0.7);
}

.danger-button:hover {
  background: rgba(153, 55, 45, 0.96);
  border-color: var(--danger);
}

.auth-card {
  width: min(920px, 100%);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.auth-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.auth-form h2 {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
}

.auth-message {
  min-height: 24px;
  color: var(--accent);
  font-weight: 800;
}

.coming-soon-screen {
  backdrop-filter: blur(10px);
}

.coming-soon-card {
  width: min(680px, 100%);
  text-align: center;
}

.coming-soon-card h1 {
  margin-bottom: 0;
  font-size: clamp(50px, 10vw, 112px);
  color: rgba(232, 224, 208, 0.92);
}

.lore-screen {
  min-height: 100vh;
  padding: 84px 24px 32px;
  background:
    radial-gradient(circle at top left, rgba(94, 107, 72, 0.2), transparent 34rem),
    linear-gradient(135deg, #050604, var(--bg));
  animation: softFadeIn 360ms ease both;
}

.members-screen {
  min-height: 100vh;
  padding: 84px 24px 32px;
  background:
    radial-gradient(circle at top left, rgba(94, 107, 72, 0.2), transparent 34rem),
    linear-gradient(135deg, #050604, var(--bg));
  animation: softFadeIn 360ms ease both;
}

.lore-page {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.members-page {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.member-card {
  display: grid;
  gap: 10px;
  justify-items: start;
  min-height: 420px;
  padding: 14px;
  color: var(--text);
  background: rgba(23, 25, 20, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: left;
}

.member-card:hover {
  border-color: var(--accent);
  background: rgba(55, 55, 39, 0.86);
}

.member-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 8, 5, 0.72), rgba(34, 37, 29, 0.72));
  border: 1px solid var(--border);
  border-radius: 4px;
}

.member-photo.large {
  min-height: 320px;
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-photo.missing-member-photo::before {
  content: "NO PHOTO";
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.member-rank,
.member-callsign {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.member-card strong {
  font-size: 22px;
}

.member-profession {
  display: inline-block;
  width: fit-content;
  padding: 4px 8px;
  color: var(--bg);
  background: var(--ok);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.member-modal-card {
  width: min(1080px, 100%);
}

.member-story {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.member-story-side {
  display: grid;
  align-content: start;
  gap: 10px;
}

.member-story-side h3 {
  margin-bottom: 0;
  color: var(--accent);
}

.member-story-side strong {
  font-size: 24px;
}

.member-story-text {
  max-height: min(680px, calc(100vh - 180px));
  overflow: auto;
  padding-right: 8px;
}

.member-story-text h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--accent);
  text-transform: uppercase;
}

.member-story-text h3:first-child {
  margin-top: 0;
}

.member-story-text p {
  color: var(--muted);
  line-height: 1.6;
}

.member-coming-soon {
  display: grid;
  place-items: center;
  min-height: 360px;
  text-align: center;
}

.member-coming-soon h3 {
  margin-bottom: 8px;
  font-family: "Arial Narrow", Impact, "Arial Black", sans-serif;
  font-size: clamp(42px, 8vw, 88px);
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-users-list {
  display: grid;
  gap: 12px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.admin-user-card strong,
.admin-user-card span {
  display: block;
}

.admin-user-card span {
  color: var(--muted);
}

.permission-toggle {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.recruitment-panel {
  width: min(860px, 100%);
  margin: 0 auto;
}

.recruitment-form {
  display: grid;
  gap: 14px;
}

.recruitment-form textarea {
  resize: vertical;
}

.application-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.application-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
}

.application-head strong,
.application-head span {
  display: block;
}

.application-head span {
  color: var(--muted);
}

.application-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.application-details div {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.application-details dt {
  margin-bottom: 4px;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.application-details dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.warehouse-report-panel {
  width: min(940px, 100%);
  margin: 0 auto 16px;
}

.warehouse-report-form {
  display: grid;
  gap: 14px;
}

.warehouse-report-form textarea {
  resize: vertical;
}

.clipboard-zone {
  display: grid;
  gap: 5px;
  padding: 14px;
  color: var(--muted);
  background: rgba(7, 8, 5, 0.42);
  border: 1px dashed rgba(201, 154, 74, 0.42);
  border-radius: 6px;
}

.clipboard-zone:focus,
.clipboard-zone:hover {
  border-color: var(--accent);
  background: rgba(68, 57, 35, 0.26);
  outline: none;
}

.clipboard-zone strong {
  color: var(--accent);
  text-transform: uppercase;
}

.clipboard-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.clipboard-preview div {
  display: grid;
  gap: 3px;
}

.clipboard-preview strong {
  color: var(--accent);
  text-transform: uppercase;
}

.clipboard-preview span {
  color: var(--muted);
  font-size: 13px;
}

.clipboard-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.warehouse-reports-list {
  display: grid;
  gap: 14px;
}

.warehouse-report-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.warehouse-report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.warehouse-report-head strong,
.warehouse-report-head span {
  display: block;
}

.warehouse-report-head span {
  color: var(--muted);
  font-size: 13px;
}

.warehouse-report-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.warehouse-report-image {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.warehouse-report-image img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.34);
}

.lore-hero {
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 38px);
  background: rgba(13, 16, 13, 0.62);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.lore-hero h1 {
  max-width: 850px;
  font-family: "Arial Narrow", Impact, "Arial Black", sans-serif;
  font-size: clamp(42px, 7vw, 82px);
  text-transform: uppercase;
}

.lore-hero p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.lore-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lore-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lore-card p {
  color: var(--muted);
  line-height: 1.55;
}

.lore-card p:last-child {
  margin-bottom: 0;
}

.lore-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.lore-facts div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.lore-facts dt {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
}

.lore-facts dd {
  margin: 0;
  color: var(--text);
}

.lore-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div,
.lore-mini {
  padding: 12px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.timeline strong,
.lore-mini strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  text-transform: uppercase;
}

.lore-mini p {
  margin-bottom: 0;
}

.back-button {
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 24px;
  padding: 0 18px;
}

.craft-back-button {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 30;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 330px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: min(1600px, calc(100% - 80px));
  margin: 0 auto;
  padding: 72px 0 24px;
  animation: fadeSlideIn 360ms ease both;
}

.app {
  min-width: 0;
}

.profession-panel,
.inventory-panel {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 48px);
  padding: 16px;
  background: rgba(13, 16, 13, 0.94);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  animation: fadeSlideIn 420ms ease both;
}

.profession-list-sidebar {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.profession-button {
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(23, 25, 20, 0.82);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: left;
}

.profession-button:hover,
.profession-button.selected {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.profession-items {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-right: 4px;
}

.profession-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: left;
}

.profession-item:hover {
  border-color: var(--accent);
  background: rgba(68, 57, 35, 0.64);
}

.profession-item .item-icon {
  width: 38px;
  height: 38px;
}

.inventory-head,
.modal-head,
.picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-head h2,
.modal-head h2 {
  margin-bottom: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  width: 42px;
  padding: 0;
  border-radius: 4px;
  font-size: 24px;
}

.secondary-icon {
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  font-size: 18px;
}

.search-input {
  width: 100%;
  margin: 14px 0;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.inventory-item,
.picker-item {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 116px;
  padding: 10px 8px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.inventory-item:hover,
.picker-item:hover {
  border-color: var(--accent);
  background: rgba(55, 55, 39, 0.86);
  box-shadow: 0 12px 28px rgba(201, 154, 74, 0.12);
  transform: translateY(-3px);
}

.picker-item {
  cursor: pointer;
}

.picker-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 154, 74, 0.2);
}

.item-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: rgba(5, 6, 4, 0.58);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-icon-fallback {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.item-icon.missing-icon::before {
  content: attr(data-letter);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.item-name {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-qty {
  color: var(--ok);
  font-weight: 900;
}

.hero {
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
  letter-spacing: 0.015em;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
  letter-spacing: 0.015em;
}

.subtitle,
.section-title p {
  color: var(--muted);
}

.subtitle {
  max-width: 620px;
  margin-bottom: 0;
  font-size: 16px;
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
  background: rgba(23, 25, 20, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  animation: fadeSlideIn 320ms ease both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.panel:hover {
  border-color: rgba(201, 154, 74, 0.34);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.32);
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
}

.craft-target-field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.target-button {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 9px 12px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.target-button:hover {
  border-color: var(--accent);
  background: rgba(55, 55, 39, 0.86);
  box-shadow: 0 14px 36px rgba(201, 154, 74, 0.12);
  transform: translateY(-2px);
}

#craftTargetName {
  font-size: 18px;
  font-weight: 900;
}

.target-arrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

select,
input,
button {
  min-height: 44px;
  border-radius: 4px;
  font: inherit;
}

select,
input {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

select:focus,
input:focus,
button:focus-visible {
  outline: 2px solid rgba(201, 154, 74, 0.42);
  outline-offset: 2px;
}

button {
  padding: 0 22px;
  color: #f2ead8;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 170ms ease, filter 170ms ease, box-shadow 170ms ease, background 170ms ease, border-color 170ms ease;
}

button:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(201, 154, 74, 0.16);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0) scale(0.98);
}

.secondary-button {
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.section-title {
  margin-bottom: 10px;
}

.section-title p {
  margin-bottom: 0;
}

.hidden {
  display: none;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice-card {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.choice-card label {
  color: var(--text);
}

.choice-card select {
  margin-top: 8px;
}

.recipe-panel {
  border-color: rgba(201, 154, 74, 0.34);
  background: linear-gradient(135deg, rgba(34, 37, 29, 0.98), rgba(23, 25, 20, 0.94));
}

.original-recipe-panel {
  border-color: rgba(201, 154, 74, 0.22);
}

.original-recipe {
  display: grid;
  gap: 12px;
}

.original-recipe-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.original-recipe-head strong {
  display: block;
  margin-bottom: 3px;
}

.original-recipe-head span {
  color: var(--muted);
  font-size: 13px;
}

.original-components {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.original-component {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.original-component .item-icon {
  width: 42px;
  height: 42px;
}

.original-component span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.original-component strong {
  color: var(--ok);
}

.recipe-choice-list {
  display: grid;
  gap: 12px;
}

.recipe-group {
  padding: 12px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.recipe-group h3 {
  margin-bottom: 10px;
  color: var(--accent);
}

.recipe-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.recipe-option {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 12px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.recipe-option:hover {
  border-color: var(--accent);
  background: rgba(55, 55, 39, 0.86);
  box-shadow: 0 12px 30px rgba(201, 154, 74, 0.12);
  transform: translateY(-3px);
}

.recipe-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 154, 74, 0.18);
}

.recipe-option-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.recipe-option-head strong {
  color: var(--accent);
}

.recipe-option-head em {
  color: var(--ok);
  font-style: normal;
  font-weight: 900;
}

.recipe-option-name {
  font-weight: 800;
}

.recipe-components {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-components span {
  padding: 4px 7px;
  color: var(--muted);
  background: rgba(5, 6, 4, 0.46);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.craft-button {
  width: 100%;
  margin-bottom: 14px;
}

.craft-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.number {
  text-align: right;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.profession-list {
  display: grid;
  gap: 10px;
}

.profession-card {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.profession-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--accent);
}

.profession-card h3 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.simple-list {
  display: grid;
  gap: 8px;
}

.simple-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  animation: fadeSlideIn 240ms ease both;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.simple-row:hover {
  border-color: rgba(201, 154, 74, 0.38);
  background: rgba(55, 55, 39, 0.74);
  transform: translateX(4px);
}

.simple-row strong {
  color: var(--ok);
  white-space: nowrap;
}

.simple-row.covered {
  opacity: 0.62;
}

.simple-row.covered strong {
  color: var(--muted);
}

.warehouse-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px auto auto;
  gap: 12px;
  align-items: end;
}

.stock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.stock-pill button {
  min-height: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 6, 4, 0.78);
  backdrop-filter: blur(8px);
  animation: softFadeIn 180ms ease both;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  padding: 18px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
  animation: fadeSlideIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.picker-actions {
  position: sticky;
  bottom: -18px;
  margin: 16px -18px -18px;
  padding: 14px 18px;
  background: rgba(23, 25, 20, 0.96);
  border-top: 1px solid var(--border);
}

.picker-actions label {
  width: 130px;
}

.muted-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.compact-list {
  display: grid;
  gap: 6px;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.compact-row span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.craft-steps {
  display: grid;
  gap: 10px;
}

.craft-step {
  padding: 10px;
  background: rgba(7, 8, 5, 0.45);
  border: 1px solid var(--border);
  border-radius: 4px;
  animation: fadeSlideIn 260ms ease both;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.craft-step:hover {
  border-color: rgba(201, 154, 74, 0.34);
  background: rgba(55, 55, 39, 0.36);
  transform: translateX(3px);
}

.craft-step-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 800;
}

.craft-step-title strong {
  color: var(--ok);
  white-space: nowrap;
}

.craft-step ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.craft-step li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.craft-step li strong {
  color: var(--text);
  white-space: nowrap;
}

.mini-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  color: #fff4f4;
  background: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.stock-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  color: #2a1200;
  background: var(--ok);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.details-panel {
  padding: 0;
  overflow: hidden;
}

.details-panel summary {
  padding: 16px;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, letter-spacing 180ms ease;
}

.details-panel summary:hover {
  background: rgba(201, 154, 74, 0.08);
  letter-spacing: 0.01em;
}

.details-panel[open] {
  padding-bottom: 16px;
}

.details-panel[open] summary {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.details-panel > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

.details-panel[open] > :not(summary) {
  animation: detailsOpen 260ms ease both;
}

.details-note {
  color: var(--muted);
}

.tree ul {
  margin: 8px 0 8px 24px;
  padding: 0;
}

.tree li {
  margin: 7px 0;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  color: #fff4f4;
  background: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.warning {
  color: var(--danger);
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100%, calc(100% - 32px));
    grid-template-columns: 1fr;
    padding-top: 84px;
  }

  .craft-back-button {
    top: 16px;
    left: 16px;
  }

  .profession-panel,
  .inventory-panel {
    position: static;
    min-height: auto;
  }

  .auth-grid,
  .admin-user-card,
  .application-head,
  .warehouse-report-head,
  .controls,
  .warehouse-controls,
  .grid,
  .lore-grid,
  .lore-grid.three {
    grid-template-columns: 1fr;
  }

  .lore-facts div {
    grid-template-columns: 1fr;
  }

  .member-story {
    grid-template-columns: 1fr;
  }

  .member-story-text {
    max-height: none;
  }

  .picker-actions {
    display: grid;
  }

  .music-controls {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
