*{box-sizing:border-box}
:root{
  color-scheme:dark;
  --ink:#efe5c8;
  --muted:#b9ad8f;
  --panel:rgba(24,20,16,.94);
  --line:rgba(230,199,123,.25);
  --gold:#e8c06a
}

html,body{margin:0;min-height:100%}

body{
  min-height:100vh;
  font-family:Georgia,"Times New Roman",serif;
  color:var(--ink);
  background:
    radial-gradient(circle at top,rgba(118,63,32,.35),transparent 38rem),
    linear-gradient(#15130f,#090807)
}

a{color:#e8c06a}

button,.button-link{
  display:inline-block;
  border:1px solid #c49950;
  border-radius:5px;
  padding:.62rem .9rem;
  color:#fff7df;
  background:linear-gradient(#7f3b2b,#4b211c);
  font:inherit;
  text-decoration:none;
  cursor:pointer
}

button:hover,.button-link:hover{filter:brightness(1.15)}
button.secondary{background:#302922}
button:disabled{opacity:.55;cursor:default}

.small-button{
  width:100%;
  padding:.42rem .55rem;
  font-size:.75rem
}

.shell{
  width:min(1040px,96vw);
  margin:0 auto;
  padding:.45rem 0 .7rem
}

.topbar{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:end;
  padding:.15rem .15rem .55rem
}

.title-block{min-width:0}

.eyebrow{
  margin:0 0 .12rem;
  text-transform:uppercase;
  letter-spacing:.16em;
  font-size:.68rem;
  color:var(--muted)
}

h1,h2,p{margin-top:0}

h1{
  margin-bottom:.15rem;
  font-size:clamp(1.75rem,3.3vw,2.65rem);
  line-height:1
}

.player-line{
  margin:0;
  color:var(--muted);
  font-size:.9rem
}

.wallet{
  display:flex;
  gap:.5rem;
  font-family:system-ui,sans-serif
}

.wallet div{
  min-width:112px;
  padding:.48rem .65rem;
  border:1px solid var(--line);
  background:var(--panel);
  text-align:right
}

.wallet span{
  display:block;
  color:var(--muted);
  font-size:.65rem;
  text-transform:uppercase
}

.wallet strong{
  color:var(--gold);
  font-size:1.05rem
}

.game-card{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(222,188,111,.35);
  box-shadow:0 18px 48px rgba(0,0,0,.5);
  background:#0d0f0b
}

canvas{
  display:block;
  width:100%;
  height:auto;
  background:#26301f
}

.quest-panel,.status-panel,.inventory-panel{
  position:absolute;
  padding:.62rem .72rem;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:0 8px 20px rgba(0,0,0,.33)
}

.quest-panel{
  top:.75rem;
  left:.75rem;
  width:232px
}

.status-panel{
  left:.75rem;
  bottom:.75rem;
  width:232px;
  font-family:system-ui,sans-serif;
  font-size:.74rem
}

.inventory-panel{
  top:.75rem;
  right:.75rem;
  width:185px;
  max-height:245px;
  overflow:auto
}

.quest-panel h2,.inventory-panel h2{
  margin-bottom:.32rem;
  font-size:.9rem;
  color:var(--gold)
}

.quest-panel p{
  margin-bottom:.4rem;
  font-size:.79rem;
  line-height:1.28
}

.hint{
  margin-bottom:0!important;
  color:var(--muted);
  font-size:.67rem!important
}

.progress,.bar{
  height:7px;
  overflow:hidden;
  border:1px solid #5e5139;
  background:#15130f
}

.progress span,.bar span{
  display:block;
  width:0;
  height:100%;
  transition:width .25s
}

.progress span,.xp-bar span{
  background:linear-gradient(90deg,#8a3a2b,#e3bd68)
}

.hp-bar span{
  background:linear-gradient(90deg,#72352d,#b74b3f)
}

.status-heading{
  display:flex;
  justify-content:space-between;
  margin-bottom:.38rem;
  color:var(--gold)
}

.status-panel label{
  display:flex;
  justify-content:space-between;
  margin:.3rem 0 .15rem;
  color:#d9ccad
}

.status-save{margin-top:.5rem}

.inventory-list{
  display:grid;
  gap:.25rem;
  margin-bottom:.45rem;
  font:.72rem system-ui,sans-serif
}

.inventory-row{
  display:flex;
  justify-content:space-between;
  gap:.4rem;
  padding:.26rem .34rem;
  border:1px solid rgba(230,199,123,.15);
  background:rgba(0,0,0,.16)
}

.rare-item{
  color:#f0a09a;
  font-weight:700
}

.dialog{
  position:absolute;
  left:50%;
  bottom:.85rem;
  transform:translateX(-50%);
  width:min(620px,90%);
  display:grid;
  grid-template-columns:62px 1fr;
  gap:.8rem;
  padding:.8rem;
  border:1px solid #b48643;
  background:rgba(24,18,13,.97);
  box-shadow:0 18px 36px rgba(0,0,0,.55);
  z-index:5
}

.dialog p{
  margin:.25rem 0 .6rem;
  line-height:1.35
}

.portrait{
  display:grid;
  place-items:center;
  width:56px;
  height:56px;
  border:1px solid #8e6e39;
  background:#31271e;
  color:var(--gold);
  font-size:1.7rem
}

.hidden{display:none!important}

.toast{
  position:absolute;
  top:.75rem;
  right:205px;
  max-width:330px;
  padding:.65rem .8rem;
  border:1px solid #8e6e39;
  background:rgba(22,18,13,.97);
  box-shadow:0 10px 24px rgba(0,0,0,.4);
  z-index:7
}

/* Anmeldung und Installation */
.auth-body{display:grid;place-items:center;padding:1rem}

.auth-card{
  width:min(520px,96vw);
  padding:1.5rem;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:0 25px 70px rgba(0,0,0,.55)
}

.intro,.auth-link{color:var(--muted)}

.auth-form{
  display:grid;
  gap:1rem;
  margin:1.2rem 0
}

.auth-form label{
  display:grid;
  gap:.35rem;
  color:#d9ccad
}

.auth-form input{
  width:100%;
  border:1px solid #6f5c3a;
  border-radius:4px;
  padding:.72rem .8rem;
  color:#fff4d5;
  background:#17130f;
  font:1rem system-ui,sans-serif
}

.message{
  margin:1rem 0;
  padding:.8rem 1rem;
  border:1px solid #796641;
  background:#211b14;
  line-height:1.45
}

.message.error{border-color:#9b514d;background:#361c1a}
.message.success{border-color:#66835c;background:#1e2c1b}

code{
  padding:.12rem .28rem;
  border-radius:3px;
  background:#0d0b09;
  color:#f0cf85
}

/* Bei niedrigen Desktop-Fenstern nochmals etwas kompakter */
@media (min-width:761px) and (max-height:900px){
  .shell{width:min(960px,94vw);padding:.3rem 0 .45rem}
  .topbar{padding:0 .1rem .4rem}
  h1{font-size:2.15rem}
  .eyebrow{font-size:.62rem}
  .player-line{font-size:.82rem}
  .wallet div{min-width:104px;padding:.4rem .55rem}
  .quest-panel{width:220px}
  .status-panel{width:220px}
  .inventory-panel{width:176px}
}

/* Kleine Bildschirme */
@media(max-width:760px){
  .shell{width:98vw}
  .topbar{align-items:stretch;flex-direction:column}
  .wallet{width:100%}
  .wallet div{flex:1;min-width:0}
  .quest-panel{width:205px}
  .inventory-panel{width:165px}
  .status-panel{width:205px}
  .toast{right:.75rem;top:9rem}
}
