/* ---------- PAPERWASTE — Sims-flavored, chunky & cozy ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1e1a; font-family: 'Trebuchet MS', 'Segoe UI', sans-serif; }
#app, #app canvas { position: absolute; inset: 0; display: block; }
.hidden { display: none !important; }

#vignette { position: absolute; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 140px rgba(20, 30, 15, 0.55); }

/* ---------- HUD ---------- */
#hud { position: absolute; top: 14px; left: 14px; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.hud-box { background: rgba(250, 248, 238, 0.92); border: 3px solid #2e6f4e; border-radius: 12px;
  padding: 6px 14px; font-weight: 700; color: #22331f; font-size: 18px; box-shadow: 0 4px 0 rgba(30,50,25,0.35); width: max-content; }
.bar-box { display: flex; align-items: center; gap: 8px; }
.bar-label { font-size: 18px; }
.bar-wrap { position: relative; width: 190px; height: 20px; background: #3a3f36; border-radius: 10px; overflow: hidden; }
.bar-wrap > div { position: absolute; inset: 0; width: 5%; border-radius: 10px; transition: width 0.3s; }
#tm-pct { position: absolute; inset: 0; text-align: center; font-size: 13px; line-height: 20px; color: #fff; text-shadow: 0 1px 2px #000; }

/* carrying chip: what's in your hands and where it needs to go */
#carry-chip { background: #eaf6da; border: 3px solid #39c46a; color: #22512f; font-size: 15px;
  padding: 6px 14px; border-radius: 12px; animation: carry-pulse 1.6s ease-in-out infinite; }
@keyframes carry-pulse { 50% { box-shadow: 0 4px 0 rgba(30,50,25,0.35), 0 0 14px rgba(57,196,106,0.55); } }

#objective { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: rgba(250, 248, 238, 0.94); border: 3px solid #2e6f4e; border-radius: 14px;
  padding: 8px 18px; font-size: 15px; color: #22331f; max-width: 62%; text-align: center;
  box-shadow: 0 4px 0 rgba(30,50,25,0.35); }
.obj-tag { background: #2e6f4e; color: #fff; border-radius: 8px; padding: 2px 8px; font-weight: 900; margin-right: 8px; font-size: 12px; }

#prompt { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: rgba(30, 40, 28, 0.88); color: #ffd97a; padding: 8px 18px; border-radius: 10px;
  font-size: 16px; pointer-events: none; }

#hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  color: rgba(255,255,255,0.75); font-size: 13px; text-shadow: 0 1px 3px #000; pointer-events: none; }
#mute-indicator { position: absolute; bottom: 34px; right: 16px; z-index: 5; color: #fff;
  background: rgba(0,0,0,0.5); padding: 4px 10px; border-radius: 8px; font-size: 13px; }

/* ---------- toasts ---------- */
#toasts { position: absolute; top: 90px; right: 16px; z-index: 6; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: rgba(30, 40, 28, 0.92); color: #f0ead8; padding: 10px 16px; border-radius: 12px;
  max-width: 340px; font-size: 15px; border-left: 6px solid #888; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease-out; transition: opacity 0.4s, transform 0.4s; }
.toast.fact { border-left-color: #39c46a; }
.toast.cash { border-left-color: #ffd35c; }
.toast.bad { border-left-color: #d23b2e; }
.toast.out { opacity: 0; transform: translateX(30px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }

/* ---------- overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 10; background: rgba(18, 26, 16, 0.72);
  display: flex; align-items: center; justify-content: center; }
.panel { background: #faf8ee; border: 5px solid #2e6f4e; border-radius: 20px; padding: 26px 30px;
  max-width: 640px; width: 92%; max-height: 88vh; overflow-y: auto; box-shadow: 0 10px 0 rgba(20,35,18,0.4); }
.panel h2 { color: #2e6f4e; margin-bottom: 14px; }

/* intro */
.intro-panel { background: #faf8ee; border: 5px solid #2e6f4e; border-radius: 24px; padding: 34px 40px;
  max-width: 620px; width: 92%; text-align: center; box-shadow: 0 10px 0 rgba(20,35,18,0.4); }
.intro-panel h1 { color: #2e6f4e; font-size: 52px; letter-spacing: 2px; }
.tagline { color: #6d6a58; font-style: italic; margin: 6px 0 14px; }
.story { color: #3a4034; line-height: 1.55; margin-bottom: 18px; text-align: left; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left;
  background: #eef0e2; border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; color: #3a4034; font-size: 14px; }
.big-btn { background: #2e6f4e; color: #fff; border: none; border-radius: 14px; padding: 14px 30px;
  font-size: 20px; font-weight: 900; cursor: pointer; box-shadow: 0 5px 0 #1d4a32; font-family: inherit; }
.big-btn:hover { transform: translateY(-2px); }
.big-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1d4a32; }
.sdg { margin-top: 16px; color: #6d6a58; font-size: 13px; }

/* shop */
.shop-money { font-size: 20px; font-weight: 900; color: #b8860b; margin-bottom: 14px; }
.shop-item { display: flex; align-items: center; gap: 14px; background: #eef0e2; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 10px; }
.shop-item .icon { font-size: 30px; }
.shop-item .info { flex: 1; }
.shop-item .name { font-weight: 900; color: #22331f; }
.shop-item .desc { font-size: 13px; color: #6d6a58; }
.shop-item .buy { background: #2e6f4e; color: #fff; border: none; border-radius: 10px; padding: 10px 16px;
  font-weight: 900; font-size: 16px; cursor: pointer; box-shadow: 0 3px 0 #1d4a32; font-family: inherit; }
.shop-item .buy:disabled { background: #9aa79a; box-shadow: none; cursor: not-allowed; }
.shop-item .owned { color: #2e6f4e; font-weight: 900; }
#btn-shop-close { margin-top: 8px; }

/* notes */
#notes-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.card { background: #eef0e2; border-radius: 12px; padding: 10px 14px; text-align: left; }
.card-title { font-weight: 900; color: #2e6f4e; }
.card-body { font-size: 14px; color: #3a4034; line-height: 1.45; }
.notes-empty, .notes-tip { color: #6d6a58; font-style: italic; }
.notes-tip { text-align: center; margin-top: 6px; }

/* ending */
#ending-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-box { background: #eef0e2; border-radius: 12px; padding: 12px; text-align: center; }
.stat-box .v { font-weight: 900; font-size: 19px; color: #22331f; }
.stat-box .k { font-size: 11px; color: #6d6a58; letter-spacing: 1px; }
.ending-facts { background: #e4ecdc; border-radius: 12px; padding: 14px 18px; line-height: 1.6;
  color: #2c3a2a; margin-bottom: 16px; text-align: left; }

/* ---------- mini-games ---------- */
.mg-panel { background: #faf8ee; border: 5px solid #2e6f4e; border-radius: 20px; padding: 24px 28px;
  width: min(560px, 92%); text-align: center; box-shadow: 0 10px 0 rgba(20,35,18,0.4); }
.mg-title { font-size: 22px; font-weight: 900; color: #2e6f4e; margin-bottom: 6px; }
.mg-sub { color: #6d6a58; font-size: 14px; margin-bottom: 14px; }
.mg-score { font-size: 16px; color: #3a4034; margin-top: 14px; }
.mg-hint { color: #9aa79a; font-size: 13px; margin-top: 6px; }
.mg-result { font-size: 18px; font-weight: 900; margin-top: 14px; }
.mg-result.win { color: #2e6f4e; }
.mg-result.lose { color: #d23b2e; }
.mg-btn { background: #2e6f4e; color: #fff; border: none; border-radius: 12px; padding: 12px 26px;
  font-size: 17px; font-weight: 900; cursor: pointer; margin-top: 12px; box-shadow: 0 4px 0 #1d4a32; font-family: inherit; }

/* sorting */
.sort-panel { width: min(520px, 92%); }
.sort-score { color: #3a4034; margin-bottom: 8px; }
.sort-area { position: relative; height: 250px; background: #eef0e2; border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.sort-item { position: absolute; top: 2%; left: 50%; transform: translateX(-50%); font-size: 46px; line-height: 1; }
.sort-bins { display: flex; gap: 10px; }
.bin { flex: 1; border: none; border-radius: 12px; padding: 14px 6px; font-weight: 900; font-size: 15px;
  cursor: pointer; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); font-family: inherit; box-shadow: 0 4px 0 rgba(0,0,0,0.3); }
.bin span { display: block; font-size: 12px; opacity: 0.85; margin-bottom: 4px; }
.bin:active { transform: translateY(2px); }
.bin-paper { background: #2e6f9e; box-shadow: 0 4px 0 #1d4a6e; }
.bin-plastic { background: #c9a227; box-shadow: 0 4px 0 #8a6e12; }
.bin-compost { background: #3e8f3e; box-shadow: 0 4px 0 #275e27; }

/* timing */
.timing-bar { position: relative; height: 42px; background: #3a3f36; border-radius: 10px; cursor: pointer; overflow: hidden; }
.timing-zone { position: absolute; top: 0; bottom: 0; background: rgba(57, 196, 106, 0.55); border: 2px solid #39c46a; border-radius: 8px; }
.timing-marker { position: absolute; top: 4px; bottom: 4px; width: 8px; margin-left: -4px; background: #ffd35c; border-radius: 4px; }

/* persuasion */
.duel-excuse { background: #eef0e2; border-radius: 12px; padding: 14px 16px; font-style: italic;
  color: #3a4034; margin-bottom: 12px; font-size: 16px; }
.duel-options { display: flex; flex-direction: column; gap: 10px; }
.duel-opt { background: #fff; border: 3px solid #2e6f4e; border-radius: 12px; padding: 12px 16px;
  font-size: 15px; cursor: pointer; text-align: left; font-family: inherit; color: #22331f; }
.duel-opt:hover { background: #e4ecdc; transform: translateX(4px); }
