/* Stylesheet des Prototyps (FromDungToGlory 12.11.26.html, Z. 9–47), unverändert übernommen. */
:root {
  --bg: rgba(28, 22, 16, 0.9);
  --line: #6b5433;
  --ink: #f4ead2;
  --dim: #c9b993;
  --acc: #e6b84a;
  --bad: #ff7a66;
  --ok: #8fe08f;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #16241a;
  color: var(--ink);
  font:
    13px/1.3 -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}
#cv {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}
button {
  font: inherit;
  color: var(--ink);
  background: #3b2f20;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  touch-action: manipulation;
}
button:active {
  background: #5a4630;
}
button.on {
  background: #7a5a1e;
  border-color: var(--acc);
}
button:disabled,
button.off {
  opacity: 0.45;
}
input {
  font: inherit;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #1d1710;
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
  min-width: 0;
}
#top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 38px;
  padding: 3px 6px;
  padding-top: max(3px, env(safe-area-inset-top));
  padding-left: max(6px, env(safe-area-inset-left));
  padding-right: max(6px, env(safe-area-inset-right));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 4px 10px;
  flex-wrap: wrap;
  z-index: 5;
}
#top .res {
  display: flex;
  gap: 9px;
  flex-wrap: nowrap;
}
#top .res span {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#top .res small {
  color: var(--dim);
}
#top .sp {
  flex: 1;
}
#top .info {
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#top button {
  padding: 4px 9px;
  min-width: 34px;
}
#tools {
  position: fixed;
  left: max(6px, env(safe-area-inset-left));
  top: 52px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
#tools button {
  width: 46px;
  height: 42px;
  padding: 0;
  font-size: 11px;
  background: var(--bg);
}
#tools button b {
  display: block;
  font-size: 16px;
  font-weight: normal;
}
#bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 6px;
  padding-bottom: max(5px, env(safe-area-inset-bottom));
  padding-left: max(6px, env(safe-area-inset-left));
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 5px;
  overflow-x: auto;
  z-index: 5;
  touch-action: pan-x;
}
#bar button {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 4px 6px;
  text-align: center;
  line-height: 1.2;
}
#bar button b {
  font-size: 18px;
  font-weight: normal;
  display: block;
}
#bar button small {
  color: var(--dim);
  display: block;
  font-size: 10px;
  white-space: nowrap;
}
#bar button .n {
  font-size: 11px;
}
#mini {
  position: fixed;
  left: max(6px, env(safe-area-inset-left));
  bottom: 74px;
  width: 176px;
  height: 88px;
  z-index: 4;
  touch-action: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}
#panel {
  position: fixed;
  right: max(6px, env(safe-area-inset-right));
  top: 48px;
  width: 236px;
  max-height: calc(100% - 48px - 78px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  z-index: 6;
  touch-action: pan-y;
  display: none;
}
#panel h3 {
  margin: 0 0 2px;
  font-size: 15px;
}
#panel p {
  margin: 3px 0;
  color: var(--dim);
}
#panel .row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}
#panel .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}
#panel .grid button {
  text-align: left;
  padding: 5px 6px;
}
#panel .grid small,
#panel button small {
  display: block;
  color: var(--dim);
  font-size: 10.5px;
}
#panel .q {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-top: 1px solid rgba(107, 84, 51, 0.5);
}
#panel .q span {
  flex: 1;
}
#panel .q button {
  padding: 2px 8px;
}
#panel .pb {
  height: 6px;
  background: #1d1710;
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0;
}
#panel .pb i {
  display: block;
  height: 100%;
  background: var(--acc);
  width: 0;
}
#panel .warn {
  color: var(--bad);
}
#panel .x {
  position: absolute;
  right: 6px;
  top: 5px;
  padding: 1px 8px;
}
#hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 82px;
  background: rgba(0, 0, 0, 0.78);
  padding: 6px 12px;
  border-radius: 14px;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 86%;
  text-align: center;
}
#hint.bad {
  color: var(--bad);
}
#hint.show {
  opacity: 1;
}
#toasts {
  position: fixed;
  left: 60px;
  top: 50px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 4;
  max-width: min(320px, 55%);
}
#toasts div {
  background: rgba(0, 0, 0, 0.72);
  border-left: 3px solid var(--acc);
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}
#toasts div.bad {
  border-color: var(--bad);
}
#menu {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 8, 0.5);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  touch-action: pan-y;
}
#menu .card {
  background: rgba(28, 22, 16, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  width: min(640px, 100%);
  max-height: 100%;
  overflow-y: auto;
  touch-action: pan-y;
}
#menu h1 {
  margin: 0;
  font-size: 26px;
  color: var(--acc);
  letter-spacing: 0.5px;
}
#menu h2 {
  font-size: 14px;
  margin: 12px 0 5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
#menu .maps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 6px;
}
#menu .maps button {
  padding: 6px;
  text-align: left;
}
#menu .maps canvas {
  width: 100%;
  display: block;
  margin-bottom: 3px;
}
#menu .maps small {
  color: var(--dim);
  display: block;
  font-size: 10.5px;
}
#menu .row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
#menu .big {
  font-size: 15px;
  padding: 9px 16px;
  background: #7a5a1e;
  border-color: var(--acc);
}
#menu .code {
  font-size: 30px;
  letter-spacing: 6px;
  color: var(--acc);
  font-weight: bold;
  user-select: text;
  -webkit-user-select: text;
}
#menu p {
  color: var(--dim);
  margin: 5px 0;
}
#menu .err {
  color: var(--bad);
  min-height: 1.3em;
}
body.menu #top,
body.menu #tools,
body.menu #bar,
body.menu #mini,
body.menu #panel,
body.menu #toasts,
body.menu #hint {
  display: none !important;
}
body.mp .sponly {
  display: none;
}
@media (max-height: 460px) {
  #bar button {
    min-width: 66px;
  }
  #bar button small.c {
    display: none;
  }
  #mini {
    width: 132px;
    height: 66px;
    bottom: 58px;
  }
  #panel {
    max-height: calc(100% - 48px - 60px);
    width: 220px;
  }
  #hint {
    bottom: 62px;
  }
  #tools button {
    height: 36px;
  }
}
@media (orientation: portrait) {
  #tools {
    top: 86px;
  }
  #panel {
    left: 6px;
    right: 6px;
    top: auto;
    bottom: 76px;
    width: auto;
    max-height: 42%;
  }
  #mini {
    bottom: auto;
    top: 236px;
    width: 132px;
    height: 66px;
  }
  #hint {
    bottom: auto;
    top: 92px;
    left: 62%;
    max-width: 68%;
  }
  #toasts {
    top: 132px;
    left: 64px;
  }
}
