/* Енотим вперед — тёплый летний лес */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1c2410; }
body { font-family: 'Neucha', cursive; color: #e8ddc0; user-select: none; }
#game { display: block; position: fixed; inset: 0; }
.hidden { display: none !important; }

/* виньетка */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(10,12,4,.42) 100%);
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#stats { position: absolute; top: 14px; left: 16px; display: flex; gap: 12px; }
.stat { position: relative; width: 58px; height: 58px; }
.stat .ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#c0392b 360deg, #2a241c 0deg);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.stat .ring::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: rgba(22,28,15,.94); }
.stat .ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; z-index: 2; }
.stat .num {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  font-size: 13px; color: #dce3b4; text-shadow: 0 1px 2px #000;
}
.stat.low .ico { animation: pulse .7s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.25); } }

#dayWrap { position: absolute; top: 10px; right: 16px; text-align: center; }
#clock { width: 84px; height: 84px; }
#dayNum { font-size: 15px; color: #ecdcae; text-shadow: 0 1px 3px #000; margin-top: -6px; }
#wth { font-size: 12.5px; color: #b9c49a; }

/* ---------- кооп-HUD: логово и еноты ---------- */
#coopHud {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#roomTag {
  pointer-events: auto; cursor: pointer;
  background: rgba(22,28,15,.88); border: 2px solid #5c6c3c; border-radius: 999px;
  padding: 3px 14px; font-size: 15px; color: #dce3b4;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#roomTag b { color: #ffe08a; letter-spacing: 2px; }
#roomTag #roomCopy { color: #9aa87c; margin-left: 4px; }
#roomTag:hover { border-color: #8a9a5c; }
#peerRows { display: flex; gap: 8px; }
.peerRow {
  background: rgba(22,28,15,.82); border: 2px solid #4c5a32; border-radius: 10px;
  padding: 3px 9px 5px; min-width: 74px; text-align: center;
}
.peerRow .pname { font-size: 13.5px; color: #ecdcae; text-shadow: 0 1px 2px #000; }
.peerRow .pbar { height: 4px; border-radius: 2px; background: #2a241c; margin-top: 3px; overflow: hidden; }
.peerRow .pbar i { display: block; height: 100%; background: #c0392b; border-radius: 2px; }
.peerRow.pdead .pname { color: #8a7f6a; text-decoration: line-through; }

#inv {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; pointer-events: auto;
  flex-wrap: wrap; justify-content: center; max-width: min(96vw, 1300px);
}
.slot {
  width: 52px; height: 52px; border-radius: 10px; position: relative;
  background: rgba(22,28,15,.88); border: 2px solid #4c5a32;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.slot:hover { transform: translateY(-3px); border-color: #8a9a5c; }
.slot.eq { border-color: #ecdcae; box-shadow: 0 0 10px rgba(236,220,174,.35); }
.slot .n {
  position: absolute; right: 3px; bottom: 1px; font-size: 13px; color: #ffe08a;
  text-shadow: 0 1px 2px #000;
}
.slot canvas { width: 36px; height: 36px; }
.slot .cnt {
  position: absolute; right: 3px; bottom: 1px; font-size: 13px; color: #ffe08a;
  text-shadow: 0 1px 2px #000; z-index: 2; pointer-events: none;
}
.slot .dur {
  position: absolute; left: 5px; right: 5px; bottom: 3px; height: 4px;
  border-radius: 2px; background: #2a241c; overflow: hidden; pointer-events: none;
}
.slot .dur i { display: block; height: 100%; background: #b8d488; border-radius: 2px; }
.slot.empty { opacity: .4; cursor: default; border-style: dashed; }
.slot.empty:hover { transform: none; border-color: #4c5a32; }

/* ---------- живой сундук ---------- */
#chestSlots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 10px; }

#craftList {
  position: absolute; left: 16px; top: 96px; display: flex; flex-direction: column; gap: 6px;
  pointer-events: auto; max-height: calc(100vh - 130px); overflow-y: auto; padding-right: 8px;
  scrollbar-width: thin; scrollbar-color: #4c5a32 rgba(22,28,15,.5);
}
#craftList::-webkit-scrollbar { width: 8px; }
#craftList::-webkit-scrollbar-thumb { background: #4c5a32; border-radius: 4px; }
#craftList::-webkit-scrollbar-track { background: rgba(22,28,15,.5); border-radius: 4px; }
.craftBtn {
  font-family: inherit; font-size: 15px; color: #ecdcae; text-align: left;
  background: rgba(22,28,15,.88); border: 2px solid #4c5a32; border-radius: 10px;
  padding: 5px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: border-color .1s, transform .1s;
}
.craftBtn:hover:not(:disabled) { border-color: #8a9a5c; transform: translateX(3px); }
.craftBtn:disabled { opacity: .45; cursor: default; }
.craftBtn .ccost { font-size: 12.5px; }
.ccost .ok { color: #b8d488; }
.ccost .no { color: #e08a7a; }

#hint {
  position: absolute; bottom: 14px; right: 16px; font-size: 13.5px; color: #b9c49a;
  text-shadow: 0 1px 2px #000; text-align: right;
}

/* ---------- карточки ---------- */
#title, #death, #pause, #coop {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(12,16,6,.45); backdrop-filter: blur(2px);
}
.card {
  background: rgba(22,28,15,.94); border: 3px solid #4c5a32; border-radius: 22px;
  padding: 34px 44px; text-align: center; max-width: 620px;
  box-shadow: 0 12px 48px rgba(0,0,0,.6), inset 0 0 60px rgba(90,110,50,.12);
}
.card h1 {
  font-size: 54px; line-height: 1.02; color: #ecdcae; letter-spacing: 2px;
  text-shadow: 0 3px 0 #3a3418, 0 6px 18px rgba(0,0,0,.5); margin-bottom: 16px;
}
.card h1.dead { color: #e08a7a; }
.card h1.coopH { font-size: 44px; color: #b8d488; }
.card .sub { font-size: 18px; color: #dce3b4; margin-bottom: 10px; }
.card .sub2 { font-size: 14.5px; color: #9aa87c; margin-bottom: 20px; line-height: 1.45; }
.card button {
  font-family: inherit; font-size: 22px; color: #3a3418; background: #ecdcae;
  border: none; border-radius: 14px; padding: 10px 34px; cursor: pointer;
  box-shadow: 0 4px 0 #b8a878, 0 8px 20px rgba(0,0,0,.4);
  transition: transform .1s, box-shadow .1s; margin-top: 6px;
}
.card button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #b8a878, 0 12px 24px rgba(0,0,0,.4); }
.card button:active { transform: translateY(2px); box-shadow: 0 2px 0 #b8a878; }
.card button.coopBtn {
  display: block; margin: 12px auto 0; font-size: 19px;
  background: #b8d488; box-shadow: 0 4px 0 #7a9a52, 0 8px 20px rgba(0,0,0,.4);
}
.card button.coopBtn:hover { box-shadow: 0 6px 0 #7a9a52, 0 12px 24px rgba(0,0,0,.4); }
.card button.coopBtn:active { box-shadow: 0 2px 0 #7a9a52; }
.card button.backBtn {
  background: none; color: #9aa87c; box-shadow: none; font-size: 16px; padding: 6px 10px;
}
.card button.backBtn:hover { color: #dce3b4; transform: none; box-shadow: none; }
.card .keys { margin-top: 18px; font-size: 14px; color: #9aa87c; line-height: 1.5; }
#deathCause { font-size: 20px; color: #e8b0a0; margin-bottom: 4px; }
#deathDays { font-size: 16px; color: #9aa87c; margin-bottom: 14px; }
#deathNote { font-size: 15.5px; color: #b8d488; margin: -6px 0 10px; }
#deathTip {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  border: 2px dashed #6a7a44; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 15px; color: #dce3b4;
}
#deathTip .dtSign { font-size: 22px; }
#deathTip .dtBoard { color: #ffe08a; letter-spacing: 1px; }

/* ---------- форма кооператива ---------- */
.coopForm { margin-top: 8px; }
.coopForm input {
  display: block; width: 100%; margin: 8px 0;
  font-family: inherit; font-size: 19px; color: #ecdcae; text-align: center;
  background: rgba(12,16,6,.6); border: 2px solid #4c5a32; border-radius: 12px;
  padding: 9px 14px; outline: none;
}
.coopForm input:focus { border-color: #8a9a5c; }
.coopForm input::placeholder { color: #6a7a54; }
#coopRoom { text-transform: uppercase; letter-spacing: 4px; }
.coopRow { display: flex; gap: 10px; margin-top: 14px; }
.coopRow button { flex: 1; font-size: 19px; padding: 10px 12px; }
#coopStatus { min-height: 22px; margin-top: 10px; font-size: 15.5px; color: #e8b0a0; }
#coopStatus.ok { color: #b8d488; }

/* ---------- панели (эпос, аптека) ---------- */
.panel {
  position: fixed; z-index: 25; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, 92vw); max-height: 78vh; display: none; flex-direction: column;
  background: rgba(22,28,15,.96); border: 3px solid #5c6c3c; border-radius: 18px;
  padding: 20px 24px; box-shadow: 0 16px 60px rgba(0,0,0,.7);
}
.panel.show { display: flex; }
.panel h3 { color: #ecdcae; font-size: 24px; text-align: center; margin-bottom: 10px; letter-spacing: 1px; }
.panel .shSub { text-align: center; color: #9aa87c; font-size: 14.5px; margin-bottom: 8px; }
.panel p { font-size: 15px; }
.panel button {
  font-family: inherit; font-size: 17px; color: #3a3418; background: #ecdcae;
  border: none; border-radius: 10px; padding: 7px 16px; cursor: pointer; margin-top: 8px;
}
.panel button:disabled { opacity: .45; cursor: default; }
#shopBer { text-align: center; color: #b8d488; }
#epicList { overflow-y: auto; padding-right: 6px; }
.epCh { border-left: 3px solid #6a7a44; padding: 6px 12px; margin-bottom: 12px; }
.epCh h4 { color: #ffe08a; font-size: 17px; margin-bottom: 3px; }
.epCh p { color: #d5ccae; font-size: 14.5px; line-height: 1.4; }
.epCh span { color: #8a9870; font-size: 12.5px; }
.epEmpty { color: #9aa87c; text-align: center; padding: 18px 6px; }

/* ---------- имя енота ---------- */
#soloName {
  display: block; width: 78%; margin: 10px auto 0;
  font-family: inherit; font-size: 19px; color: #ecdcae; text-align: center;
  background: rgba(12,16,6,.6); border: 2px solid #4c5a32; border-radius: 12px;
  padding: 9px 14px; outline: none;
}
#soloName:focus { border-color: #8a9a5c; }
#soloName::placeholder { color: #6a7a54; }

/* ---------- сейвы ---------- */
.saveBtn {
  display: block; margin: 12px auto 0; font-size: 19px;
  background: #9ab8d4; box-shadow: 0 4px 0 #5a7a96, 0 8px 20px rgba(0,0,0,.4);
}
.saveBtn:hover { background: #aac8e4; }
#pauseSolo { margin-top: 4px; }
#pauseSolo button { margin-top: 10px; }

#clothes {
  position: absolute; bottom: 78px; right: 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto;
}
.cslot { width: 52px; height: 52px; }
.cslot .cslotLab {
  font-size: 20px; color: #6a7a52; font-weight: bold; pointer-events: none;
}
.cslot.eq { border-color: #ecdcae; box-shadow: 0 0 10px rgba(236,220,174,.35); }

/* ---------- книга рецептов (крафт-машина и мангал) ---------- */
#book {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 6, .45); pointer-events: auto;
}
#book.hidden { display: none; }
#bookCard {
  position: relative; width: 560px; max-width: 92vw; max-height: 84vh; overflow-y: auto;
  padding: 22px 26px 20px; border-radius: 6px 18px 18px 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 90, 40, .07) 27px 28px),
    linear-gradient(100deg, #e8d9ae 0%, #f4e9c8 48%, #e0cd9c 52%, #efdfae 100%);
  border: 3px solid #6a4f2a; box-shadow: 0 18px 50px rgba(0, 0, 0, .6), inset 0 0 60px rgba(120, 90, 40, .18);
  color: #4a3620; font-family: inherit;
  scrollbar-width: thin; scrollbar-color: #8a6a3c #d8c491;
}
#bookCard::-webkit-scrollbar { width: 8px; }
#bookCard::-webkit-scrollbar-thumb { background: #8a6a3c; border-radius: 4px; }
#bookCard h3 { margin: 0 40px 4px 0; font-size: 22px; color: #5a3a18; text-shadow: 0 1px 0 #fff8; }
#bookSub { margin: 0 0 12px; font-size: 13.5px; color: #7a5c34; font-style: italic; }
#bookClose {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #6a4f2a; background: #c9a86a; color: #4a2e12; font-size: 15px; font-weight: bold;
  cursor: pointer;
}
#bookClose:hover { background: #ddbe82; }
#bookList { display: flex; flex-direction: column; gap: 7px; }
.bookRow {
  display: flex; align-items: center; gap: 10px; text-align: left; font-family: inherit;
  background: rgba(255, 250, 230, .55); border: 2px solid #a5824c; border-radius: 10px;
  padding: 6px 10px; cursor: pointer; color: #4a3620; font-size: 15px;
  transition: transform .08s, border-color .08s;
}
.bookRow:hover:not(:disabled) { border-color: #6a4f2a; transform: translateX(3px); background: rgba(255, 250, 230, .85); }
.bookRow:disabled { opacity: .5; cursor: default; }
.bookRow .cinfo { display: flex; flex-direction: column; gap: 2px; }
.bookRow .cname { font-weight: bold; }
.bookRow .ccost { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.bookRow .ccost .ok { color: #4a7a2a; }
.bookRow .ccost .no { color: #b0402a; }
.bookRow .ccost span { display: inline-flex; align-items: center; gap: 2px; }
.myst {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: radial-gradient(circle at 40% 35%, #5a4a34, #33281a);
  border: 2px dashed #8a6a3c; border-radius: 8px;
  color: #c9a86a; font-size: 22px; font-weight: bold; text-shadow: 0 1px 2px #000;
}

/* ---------- книга леса ---------- */
#btnBeast {
  position: absolute; right: 16px; top: 218px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #4c5a32; background: rgba(22,28,15,.88); font-size: 21px; cursor: pointer; z-index: 5;
}
#btnBeast:hover { border-color: #8a9a5c; transform: scale(1.08); }
#beast { width: min(560px, 92vw); max-height: 80vh; overflow-y: auto; }
#beastList { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.bst { background: rgba(255,250,230,.08); border: 1px solid #4c5a32; border-radius: 10px; padding: 8px 12px; opacity: .45; }
.bst.got { opacity: 1; border-color: #8a9a5c; }
.bst h4 { margin: 0 0 3px; font-size: 15.5px; color: #e8d9a8; }
.bst p { margin: 0; font-size: 13.5px; color: #c9bd9a; line-height: 1.45; }
.bst span { font-size: 11.5px; color: #7a8a5a; }

/* ---------- звёзды качества на слотах ---------- */
.qmark { position: absolute; left: 2px; top: 1px; font-size: 10px; color: #ffd98a; text-shadow: 0 1px 2px #000; pointer-events: none; letter-spacing: -1px; }
.qmark.bad { color: #8a8a7a; }

/* ачивки */
#ach { max-width: 760px; }
#achGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-height: 55vh; overflow-y: auto; padding: 6px; }
.achCell { background: rgba(255,250,235,.08); border: 1px solid rgba(255,240,200,.15); border-radius: 12px; padding: 8px 6px; text-align: center; opacity: .42; filter: grayscale(.9); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.achCell.un { opacity: 1; filter: none; background: rgba(255,230,150,.14); border-color: #e8c24e; box-shadow: 0 0 12px rgba(232,194,78,.25); }
.achCell img { width: 64px; height: 64px; border-radius: 10px; }
.achCell b { font-size: 12px; color: #ffe9b0; line-height: 1.15; }
.achCell span { font-size: 10.5px; color: #cbbd97; line-height: 1.2; }
.achCell i { font-size: 10px; color: #9db98a; font-style: normal; }
#achToast { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center; background: linear-gradient(180deg, rgba(46,36,20,.97), rgba(30,24,14,.97)); border: 2px solid #e8c24e; border-radius: 16px; padding: 10px 18px 10px 10px; box-shadow: 0 6px 30px rgba(0,0,0,.5), 0 0 24px rgba(232,194,78,.35); }
#achToast img { width: 72px; height: 72px; border-radius: 12px; }
.achToastTxt { display: flex; flex-direction: column; }
.achToastTxt b { color: #ffd98a; font-size: 18px; }
.achToastTxt span { color: #cbbd97; font-size: 13px; }
#achToast.pop { animation: achPop 4.2s ease forwards; }
@keyframes achPop { 0% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(.8); } 8% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.05); } 12% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
#btnAch { position: absolute; right: 16px; top: 270px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #7a6420; background: rgba(28,24,12,.88); font-size: 21px; cursor: pointer; z-index: 5; }
#btnAch:hover { border-color: #e8c24e; transform: scale(1.08); }

/* --- панель профессий --- */
#prof { max-width: 720px; }
#profList { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 60vh; padding: 4px; width: 100%; }
.profCard { background: #241f16; border: 2px solid #4a3f2a; border-radius: 12px; padding: 10px 14px; text-align: left; }
.profCard h4 { color: #ecdcae; margin: 0 0 6px; font-size: 17px; letter-spacing: .5px; }
.profRow { color: #c9bd9a; font-size: 14px; padding: 1px 0; }
.profRow.ok { color: #9fdc6e; }
.profRow.ok::after { content: ' ✓'; }
.profToday { color: #8a9ab0; font-size: 13px; margin-top: 6px; border-top: 1px dashed #4a3f2a; padding-top: 5px; }
