/* Lyloria world game — UI styles (fresh build) */
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }
body{
  margin:0; background:#2b1d33; color:#6b4a3a;
  font-family:"Trebuchet MS","Comic Sans MS",system-ui,sans-serif;
  overflow:hidden; user-select:none; -webkit-user-select:none;
}
#app{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; }
#game{
  image-rendering:pixelated; image-rendering:crisp-edges;
  background:#7ec850; border-radius:8px;
  width:min(98vw, 174vh); height:auto;
}
.hidden{ display:none !important; }

/* HUD */
#hud{
  position:fixed; top:0; left:0; right:0; z-index:20;
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 10px; pointer-events:none;
}
.hud-left,.hud-right{ display:flex; align-items:center; gap:8px; pointer-events:auto; }
.pill{
  background:rgba(255,250,243,.94); border:2px solid #ffd3e0; border-radius:999px;
  padding:4px 12px; font-size:14px; font-weight:bold; color:#8a5a44;
}
.pill.area{ background:rgba(255,240,214,.94); }
.pill.clock{ background:rgba(232,240,255,.94); border-color:#bcd2f5; }
.pill.wx{ background:rgba(255,248,230,.94); border-color:#f0d9a8; }
/* sleep fade overlay */
#fade{
  position:fixed; inset:0; z-index:100; background:#06060f;
  opacity:0; transition:opacity 1.2s ease; pointer-events:none;
}
.xpbar{ width:80px; height:12px; background:rgba(255,255,255,.7); border:2px solid #ffd3e0; border-radius:999px; overflow:hidden; }
.xpbar span{ display:block; height:100%; width:0%; background:linear-gradient(90deg,#ffb3cd,#f76d96); }
.hbtn{
  font-size:20px; background:rgba(255,250,243,.94); border:2px solid #ffd3e0;
  border-radius:14px; padding:6px 10px; cursor:pointer;
}
.hbtn.on{ background:#ffe3ee; border-color:#f76d96; }

/* touch */
#touchUI{ position:fixed; inset:0; z-index:15; pointer-events:none; }
#joy{
  position:absolute; left:18px; bottom:24px; width:110px; height:110px;
  border-radius:50%; background:rgba(255,255,255,.18); border:2px solid rgba(255,255,255,.5);
  pointer-events:auto;
}
#stick{
  position:absolute; left:35px; top:35px; width:40px; height:40px; border-radius:50%;
  background:rgba(255,255,255,.65);
}
#btnAct{
  position:absolute; right:22px; bottom:40px; width:64px; height:64px; border-radius:50%;
  font-size:24px; font-weight:bold; color:#fff; border:3px solid #fff;
  background:linear-gradient(#ff9ebb,#f76d96); pointer-events:auto;
}

/* dialogue */
#dlg{
  position:fixed; left:50%; transform:translateX(-50%); bottom:12px; z-index:25;
  width:min(94vw,560px); background:rgba(255,250,243,.97);
  border:4px solid #fff; border-radius:20px; padding:12px 16px;
  box-shadow:0 8px 30px rgba(0,0,0,.35);
}
#dlgName{ font-weight:bold; color:#d14e7c; margin-bottom:2px; }
#dlgHearts{ font-size:14px; letter-spacing:2px; margin-bottom:4px; }
#dlgText{ font-size:15px; color:#6b4a3a; min-height:40px; }
#dlgBtns{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.dlg-hint{ font-size:11px; color:#c9a08a; text-align:right; margin-top:4px; }

/* modal */
#modal{
  position:fixed; inset:0; z-index:40; background:rgba(60,30,45,.5);
  display:flex; align-items:center; justify-content:center; padding:12px;
}
#modalBox{
  background:#fffaf3; border:5px solid #fff; border-radius:22px;
  padding:16px; width:min(96vw,520px); max-height:88vh; overflow-y:auto;
  box-shadow:0 14px 44px rgba(0,0,0,.4); text-align:center;
}
#modalBox h2{ margin:0 0 10px; color:#d14e7c; }
.mrow{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin:8px 0; }
.btn{
  font-family:inherit; font-weight:bold; font-size:15px; color:#fff;
  background:linear-gradient(#ff9ebb,#f76d96); border:none; border-radius:14px;
  padding:10px 18px; cursor:pointer; box-shadow:0 4px 0 #d14e7c;
}
.btn:active{ transform:translateY(3px); box-shadow:none; }
.btn:disabled{ filter:grayscale(.8); opacity:.55; }
.btn-ghost{
  font-family:inherit; font-weight:bold; font-size:14px; color:#c05a7e;
  background:#fff; border:2px solid #ffd3e0; border-radius:14px; padding:8px 14px; cursor:pointer;
}
.pick{
  border:4px solid transparent; border-radius:16px; background:#fff;
  padding:8px; cursor:pointer; min-width:74px;
}
.pick.sel{ border-color:#f76d96; box-shadow:0 4px 12px rgba(247,109,150,.4); }
.pick.locked{ opacity:.45; }
.pick img{ width:52px; height:52px; image-rendering:pixelated; display:block; margin:0 auto; }
.pick small{ display:block; font-size:11px; color:#a9806a; margin-top:2px; }
.shopitem{
  display:flex; align-items:center; gap:10px; background:#fff;
  border:2px solid #ffe3ee; border-radius:14px; padding:8px; margin:6px 0; text-align:left;
}
.shopitem img{ width:44px; height:44px; image-rendering:pixelated; }
/* Phase 3: tool items use a big emoji instead of a sprite */
.eimg{ font-size:34px; line-height:44px; width:44px; height:44px; display:inline-block; text-align:center; }
.bagslot .eimg{ font-size:26px; line-height:32px; width:32px; height:32px; }
.shopitem .inf{ flex:1; } .shopitem .inf b{ color:#8a5a44; } .shopitem .inf small{ display:block; color:#b89a86; }
.baggrid{ display:grid; grid-template-columns:repeat(6,1fr); gap:8px; margin:10px 0; }
.bagslot{
  background:#fff; border:2px solid #ffe3ee; border-radius:12px; padding:6px 2px;
  cursor:pointer; position:relative; min-height:64px;
}
.bagslot img{ width:36px; height:36px; image-rendering:pixelated; display:block; margin:0 auto; }
.bagslot .n{ position:absolute; top:2px; right:6px; font-size:11px; font-weight:bold; color:#d14e7c; }
.bagslot small{ font-size:9px; color:#b89a86; display:block; }
.bagslot.sel{ border-color:#f76d96; background:#fff0f5; }
#toast{
  position:fixed; left:50%; bottom:120px; transform:translateX(-50%); z-index:60;
  background:#6b4a3a; color:#fff; padding:10px 20px; border-radius:999px;
  font-size:15px; box-shadow:0 6px 18px rgba(0,0,0,.3); max-width:92vw; text-align:center;
}
input.txt{
  font-family:inherit; font-size:16px; padding:10px 14px; border:3px solid #ffd3e0;
  border-radius:14px; text-align:center; width:80%; margin:8px 0; outline:none; color:#6b4a3a;
}

/* title */
#title{
  position:fixed; inset:0; z-index:50; display:none;
  align-items:center; justify-content:center; padding:16px;
  background:linear-gradient(#aee3ff 0%,#cdeec0 55%,#8fd07a 100%);
}
#title.show{ display:flex; }
.title-card{
  background:rgba(255,250,243,.96); border:5px solid #fff; border-radius:28px;
  padding:26px 30px; width:min(94vw,440px); text-align:center;
  box-shadow:0 14px 44px rgba(90,50,20,.3);
}
.logo{ margin:0; font-size:54px; color:#e2547e; text-shadow:2px 2px 0 #ffd9e6; }
.tagline{ color:#a9806a; margin:4px 0 14px; }
.slotbtn{
  display:block; width:100%; margin:8px 0; padding:12px;
  border:3px solid #ffd3e0; background:#fff; border-radius:16px;
  font-family:inherit; cursor:pointer; text-align:left;
}
.slotbtn b{ color:#d14e7c; } .slotbtn small{ color:#b89a86; display:block; }
.slotbtn small, .pick small, .bagslot small{ pointer-events:none; }
.tiny{ font-size:12px; color:#c9a08a; margin-top:12px; }
canvas#doll{ image-rendering:pixelated; width:96px; height:120px; background:#fff; border-radius:14px; border:3px solid #ffe3ee; }
