@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,560;1,9..144,520&family=Outfit:wght@380;520;640&display=swap");

html,
body {
  margin: 0;
  height: 100%;
  background: #120e22;
}

.lh-root {
  --ink: #1a1433;
  --cream: #f6edd9;
  --gold: #e7b15a;
  --rose: #e7a0b4;
  --muted: #5c5470;
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #120e22;
  color: var(--cream);
  font-family: Outfit, "Segoe UI", sans-serif;
  user-select: none;
  touch-action: none;
}

.lh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.lh-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.lh-top > * {
  pointer-events: auto;
}

.lh-pill,
.lh-actions button,
.lh-tools button,
.lh-cats button,
.lh-item,
.lh-enter {
  transition: scale 150ms ease-out, background-color 160ms ease, border-color 160ms ease;
}

.lh-pill:active,
.lh-actions button:active,
.lh-tools button:active,
.lh-cats button:active,
.lh-item:active,
.lh-enter:active {
  scale: 0.96;
}

.lh-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(18, 14, 32, 0.62);
  border: 1px solid rgba(246, 237, 217, 0.18);
  backdrop-filter: blur(10px);
  color: var(--cream);
  font-size: 14px;
  line-height: 1.2;
}

.lh-word {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.lh-who {
  color: var(--gold);
}

.lh-dew-n,
.lh-ruhe-n {
  font-variant-numeric: tabular-nums;
  font-weight: 640;
}

.lh-dew-n.is-pulse {
  animation: lh-pop 420ms ease;
}

.lh-dew-n.is-shake {
  animation: lh-shake 320ms ease;
}

@keyframes lh-pop {
  50% { color: var(--gold); }
}

@keyframes lh-shake {
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.lh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.lh-actions button,
.lh-tools button,
.lh-cats button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(246, 237, 217, 0.2);
  background: rgba(18, 14, 32, 0.62);
  color: var(--cream);
  font: 520 14px/1 Outfit, sans-serif;
}

.lh-actions button:hover,
.lh-tools button:hover,
.lh-cats button:hover,
.lh-item:hover {
  border-color: rgba(231, 177, 90, 0.7);
}

.lh-hint,
.lh-toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  max-width: min(560px, calc(100% - 24px));
  text-align: center;
  pointer-events: none;
}

.lh-hint {
  bottom: calc(168px + env(safe-area-inset-bottom));
  color: var(--cream);
  font-size: 15px;
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(10, 8, 20, 0.8);
}

.lh-toast {
  top: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(246, 237, 217, 0.94);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.lh-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(246, 237, 217, 0.94);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(8, 6, 20, 0.35);
}

.lh-cats,
.lh-items,
.lh-tools {
  display: flex;
  gap: 8px;
}

.lh-cats {
  overflow-x: auto;
}

.lh-cats button {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}

.lh-cats button.is-on {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.lh-items {
  overflow-x: auto;
  padding-bottom: 2px;
}

.lh-item {
  flex: 0 0 156px;
  min-height: 76px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(26, 20, 51, 0.12);
  background: rgba(255, 252, 246, 0.7);
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lh-item.is-on {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.lh-item.is-poor {
  opacity: 0.55;
}

.lh-item:disabled {
  opacity: 0.4;
}

.lh-item-name {
  font-weight: 640;
  font-size: 14px;
  line-height: 1.3;
}

.lh-item-cost {
  color: #8a6230;
  font-size: 12px;
  font-weight: 640;
}

.lh-item-blurb {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 380;
}

.lh-tools {
  flex-wrap: wrap;
}

.lh-tools button {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.lh-gate {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  overflow: auto;
  pointer-events: none;
}

.lh-gate[hidden],
.lh-top[hidden],
.lh-dock[hidden],
.lh-hint[hidden],
.lh-toast[hidden] {
  display: none;
}

.lh-card {
  pointer-events: auto;
  width: min(440px, 100%);
  padding: 28px 24px 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(246, 237, 217, 0.96), rgba(246, 237, 217, 0.9));
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(8, 6, 20, 0.45);
  border: 1px solid rgba(255, 250, 240, 0.8);
}

.lh-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a6230;
  font-weight: 640;
}

.lh-card h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-style: italic;
  font-size: 64px;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.lh-lead,
.lh-fine,
.lh-err {
  font-size: 15px;
  line-height: 1.45;
}

.lh-lead {
  margin: 12px 0 16px;
  color: var(--muted);
}

.lh-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 640;
}

.lh-card input {
  min-height: 48px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(26, 20, 51, 0.16);
  background: #fffaf1;
  color: var(--ink);
  font: 520 16px/1.4 Outfit, sans-serif;
  user-select: text;
}

.lh-card input:focus {
  outline: 2px solid var(--gold);
  border-color: transparent;
}

.lh-err {
  min-height: 1.2em;
  margin: 0 0 8px;
  color: #8d3d52;
}

.lh-enter {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  color: var(--cream);
  font: 640 16px/1 Outfit, sans-serif;
}

.lh-enter:hover {
  background: #2a2148;
}

.lh-fine {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stagger {
  animation: lh-in 520ms ease both;
}

.stagger:nth-child(1) { animation-delay: 0ms; }
.stagger:nth-child(2) { animation-delay: 70ms; }
.stagger:nth-child(3) { animation-delay: 140ms; }
.stagger:nth-child(4) { animation-delay: 210ms; }
.stagger:nth-child(5) { animation-delay: 280ms; }
.stagger:nth-child(6) { animation-delay: 350ms; }
.stagger:nth-child(7) { animation-delay: 420ms; }

@keyframes lh-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stagger,
  .lh-dew-n.is-pulse,
  .lh-dew-n.is-shake {
    animation: none;
  }
}

@media (max-width: 720px) {
  .lh-card h1 { font-size: 52px; }
  .lh-word { display: none; }
  .lh-hint { bottom: calc(210px + env(safe-area-inset-bottom)); font-size: 14px; }
  .lh-actions { margin-left: 0; }
}

@media (max-height: 700px) {
  .lh-card { padding: 18px 16px 14px; }
  .lh-card h1 { font-size: 44px; }
  .lh-lead { margin: 8px 0 10px; }
}

/* Königreich-Erweiterung */
.lh-kingdom {
  position:absolute; z-index:3; top:82px; right:12px; width:min(300px,calc(100% - 24px));
  padding:13px; border:1px solid rgba(246,237,217,.22); border-radius:18px;
  background:rgba(20,16,35,.88); color:#f6edd9; backdrop-filter:blur(12px);
  box-shadow:0 12px 35px rgba(0,0,0,.28); font-size:12px; touch-action:pan-y;
}
.lh-kingdom[hidden]{display:none}
.lh-kingdom-head,.lh-stats{display:flex;justify-content:space-between;gap:8px;align-items:center}
.lh-kingdom-head strong{font:560 19px Fraunces,Georgia,serif;color:#f4d99d}
.lh-level{font-weight:640;color:#e7b15a}
.lh-progress{height:7px;margin:9px 0;border-radius:9px;background:#51465e;overflow:hidden}
.lh-progress-fill{display:block;height:100%;width:0;background:linear-gradient(90deg,#8dc99b,#e7b15a);transition:width .25s}
.lh-stats{font-weight:640;color:#f5dba7}
.lh-terrain{margin:9px 0;padding:7px 9px;border-radius:9px;background:rgba(231,177,90,.13);color:#f5dba7;font-weight:640}
.lh-actions-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.lh-actions-grid button{min-height:48px;border:1px solid rgba(246,237,217,.16);border-radius:10px;background:rgba(246,237,217,.1);color:#fff7e9;font:520 12px Outfit,sans-serif}
.lh-actions-grid button:active{background:rgba(231,177,90,.28);transform:scale(.97)}
.lh-actions-grid small{color:#e7b15a}
.lh-inventory,.lh-king-list{margin-top:9px;line-height:1.5;color:#e8dfcc}
@media(max-width:720px){
 .lh-kingdom{top:66px;right:8px;width:min(270px,calc(100% - 16px));padding:10px}
 .lh-kingdom-head strong{font-size:17px}
 .lh-actions-grid button{min-height:43px;font-size:11px}
 .lh-top{right:8px;left:8px;gap:5px}
 .lh-pill{min-height:38px;padding:0 10px;font-size:12px}
}
