:root{
  --bg:#0b0d0a;
  --panel: rgba(10,12,10,.64);
  --panel2: rgba(10,12,10,.78);
  --text:#e7d7b1;
  --muted: rgba(231,215,177,.75);
  --accent:#8daa5b;
  --warn:#c2a36b;
  --danger:#b05b4a;
  --line: rgba(231,215,177,.14);
  --shadow: 0 14px 50px rgba(0,0,0,.55);
  --r: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  overflow:hidden;
  touch-action:none;
  user-select:none;
}
.hud{
  position:fixed;
  inset:0;
  pointer-events:none;
}
.hud__top{
  position:absolute;
  top:14px;
  left:14px;
  right:14px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  pointer-events:none;
}
.brand{
  pointer-events:none;
  padding:10px 12px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
}
.brand__title{
  font-weight:800;
  letter-spacing:.08em;
  font-size:14px;
}
.brand__sub{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  font-family:var(--mono);
}
.clock{
  pointer-events:none;
  padding:10px 12px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  font-family:var(--mono);
  font-weight:700;
  letter-spacing:.08em;
}
.hud__bottom{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  display:flex;
  gap:12px;
  align-items:flex-end;
  justify-content:space-between;
  pointer-events:none;
}
.toolbar{
  pointer-events:auto;
  display:flex;
  gap:10px;
  padding:10px;
  background:var(--panel2);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
}
.tool{
  appearance:none;
  border:1px solid rgba(231,215,177,.18);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:14px;
  padding:10px 10px 9px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width:58px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.tool:hover{transform: translateY(-1px); border-color: rgba(231,215,177,.28); background: rgba(255,255,255,.09);}
.tool:active{transform: translateY(0px) scale(.98);}
.tool.is-active{
  border-color: rgba(141,170,91,.7);
  background: rgba(141,170,91,.12);
}
.tool--alt.is-active{
  border-color: rgba(194,163,107,.8);
  background: rgba(194,163,107,.12);
}
.tool__icon{font-size:18px; line-height:1}
.tool__label{font-size:10px; letter-spacing:.12em; font-family:var(--mono); color:var(--muted)}
.inventory{
  pointer-events:auto;
  width: min(320px, 44vw);
  padding:10px;
  background:var(--panel2);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
}
.inventory__title{
  font-size:10px;
  letter-spacing:.14em;
  font-family:var(--mono);
  color:var(--muted);
  margin-bottom:8px;
}
.inventory__grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:6px;
}
.inv{
  position:relative;
  height:44px;
  border-radius:12px;
  border:1px solid rgba(231,215,177,.16);
  background: rgba(255,255,255,.05);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}
.inv__qty{
  position:absolute;
  right:6px;
  bottom:4px;
  font-size:10px;
  font-family:var(--mono);
  color:var(--text);
  opacity:.85;
}
.hint{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:128px;
  max-width:min(680px, 92vw);
  padding:10px 12px;
  border-radius:14px;
  background: rgba(0,0,0,.55);
  border:1px solid rgba(231,215,177,.16);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  pointer-events:none;
  font-family:var(--mono);
  font-size:12px;
  letter-spacing:.02em;
  opacity:0;
  transition: opacity .15s ease;
}
.hint.is-on{opacity:1}
.joy{
  position:absolute;
  bottom:130px;
  left:14px;
  width:150px;
  height:150px;
  pointer-events:auto;
}
.joy__base{
  position:absolute;
  inset:14px;
  border-radius:999px;
  border:1px solid rgba(231,215,177,.18);
  background: rgba(255,255,255,.04);
}
.joy__stick{
  position:absolute;
  left:50%;
  top:50%;
  width:54px;
  height:54px;
  transform: translate(-50%, -50%);
  border-radius:999px;
  border:1px solid rgba(231,215,177,.22);
  background: rgba(255,255,255,.10);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.joy__stick.is-active{
  border-color: rgba(141,170,91,.65);
  background: rgba(141,170,91,.16);
}
.joy__label{
  position:absolute;
  left:50%;
  bottom:-22px;
  transform:translateX(-50%);
  font-family:var(--mono);
  letter-spacing:.12em;
  font-size:10px;
  color:var(--muted);
}
@media (max-width: 900px){
  .inventory{width: min(260px, 48vw)}
  .joy{width:130px; height:130px; bottom:160px}
  .hint{bottom:160px}
}
@media (max-width: 640px){
  .hud__bottom{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .inventory{width:auto}
  .inventory__grid{grid-template-columns: repeat(6, 1fr)}
  .toolbar{justify-content:space-between}
  .tool{min-width:54px; padding:10px 8px 9px}
  .joy{bottom:260px}
  .hint{bottom:260px}
}

.overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index:9999;
  pointer-events:auto;
}
.overlay[hidden]{display:none}
.overlay__panel{
  width: min(520px, 92vw);
  padding:18px 16px 14px;
  border-radius:18px;
  background: rgba(10,12,10,.88);
  border:1px solid rgba(231,215,177,.20);
  box-shadow: 0 22px 80px rgba(0,0,0,.65);
}
.overlay__title{
  font-weight:900;
  letter-spacing:.08em;
  font-size:14px;
}
.overlay__body{
  margin-top:10px;
  font-family: var(--mono);
  color: var(--muted);
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
}
.overlay__actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.btn{
  appearance:none;
  border:1px solid rgba(231,215,177,.22);
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-radius:14px;
  padding:10px 12px;
  font-family: var(--mono);
  letter-spacing:.08em;
  font-size:12px;
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.11); border-color: rgba(231,215,177,.30);}
.btn:active{transform: scale(.99);}
