/* ============================================================
   style.css — うんこ大清掃 の下品でくさそうな見た目
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --poop: #7a4a1e;
  --poop-light: #a56a2e;
  --toilet: #6fce8f;
  --sewer: #b0562f;
  --bg-top: #6b8e5a;
  --bg-bottom: #3c5a34;
  --gold: #d4af37;
}

html, body {
  height: 100%;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: #23301c;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 960px;
  margin: 0 auto;
  background: #1a2415;
}

/* --- 上部バー：タイトル＋拠点HP --- */
#topbar {
  padding: 6px 10px;
  background: linear-gradient(180deg, #4a3a1a, #2e2410);
  border-bottom: 2px solid #000;
}
#topbar h1 {
  font-size: clamp(15px, 4.5vw, 24px);
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000, 2px 2px 0 rgba(0,0,0,.4);
  color: #ffe08a;
}
#topbar h1 .sub {
  font-size: 0.55em;
  color: #c9b06a;
  letter-spacing: 0;
}

#hpbars {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}
.hpwrap { flex: 1; }
.hplabel { font-size: 11px; opacity: .9; }
.hpbar {
  height: 12px;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #555;
}
.hpfill { height: 100%; width: 100%; transition: width .15s linear; }
.ally .hpfill { background: linear-gradient(90deg, #8bd88b, #4caf50); }
.enemy .hpfill { background: linear-gradient(90deg, #ff8a5c, #d0392b); }

/* --- ゲーム画面 --- */
#game {
  flex: 1;
  width: 100%;
  display: block;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  touch-action: none;
}

/* --- くささゲージ＋放屁ビーム --- */
#stink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #2e2410;
  border-top: 2px solid #000;
}
.stinkicon { font-size: 20px; }
.stinkbar {
  flex: 1;
  height: 16px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #6a5a2a;
}
#stinkFill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(45deg, #b8a04a, #b8a04a 8px, #cbb25a 8px, #cbb25a 16px);
  transition: width .1s linear;
}
#stinkText { font-size: 12px; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }

.fart {
  background: linear-gradient(180deg, #9bd, #58a);
  color: #062;
  font-weight: bold;
  border: 2px solid #036;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}
.fart:disabled { filter: grayscale(1) brightness(.6); cursor: default; }
.fart:not(:disabled):active { transform: translateY(1px); }

/* --- 出撃ドック（うんこ選択ボタン） --- */
#dock {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: #241b0c;
  overflow-x: auto;
  border-top: 2px solid #000;
}
.unit-card {
  flex: 0 0 auto;
  width: 82px;
  background: linear-gradient(180deg, #5b4420, #3a2b12);
  border: 2px solid #6a5228;
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .05s;
}
.unit-card:active { transform: scale(.96); }
.unit-card .emoji { font-size: 26px; line-height: 1; display: block; }
.unit-card .uname { font-size: 11px; margin-top: 2px; font-weight: bold; color: #ffe6a8; }
.unit-card .ucost { font-size: 11px; color: #cbb25a; }
.unit-card.disabled { filter: grayscale(.7) brightness(.65); }
/* クールタイムの黒い覆い（下から減っていく） */
.unit-card .cool {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.62);
  pointer-events: none;
}

/* --- 結果オーバーレイ --- */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
#overlay.hidden { display: none; }
.overlay-inner {
  background: linear-gradient(180deg, #4a3a1a, #2a1f0c);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 28px 26px;
  text-align: center;
  max-width: 82%;
}
.overlay-inner h2 { font-size: 30px; margin-bottom: 10px; text-shadow: 2px 2px 0 #000; }
.overlay-inner p { font-size: 15px; margin-bottom: 18px; line-height: 1.5; }
#restartBtn {
  background: linear-gradient(180deg, var(--gold), #a5842a);
  color: #2a1f0c;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
}
#restartBtn:active { transform: translateY(1px); }
