/* Insulin lesson. All rules scoped under .inu-* */
.inu-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* one cell: pancreas top left, blood across the middle, the cell below */
.inu-sc { position: relative; width: min(100%, 330px); height: 250px; }
.inu-pan { position: absolute; left: 0; top: 0; width: 84px; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.inu-pan img { width: 66px; height: 66px; object-fit: contain; transition: filter .4s, opacity .4s; }
.inu-pan span { font: 700 12px/1.2 var(--sans); color: var(--dim); }
.inu-hard img { animation: inuWork .7s ease-in-out 4 alternate; filter: drop-shadow(0 0 10px rgba(169,155,255,.85)); }
.inu-tired .inu-pan img { filter: grayscale(.7) brightness(.7); opacity: .75; animation: none; }
.inu-badge { position: absolute; left: 66px; top: 6px; min-width: 34px; padding: 3px 7px; border-radius: 10px; text-align: center;
  font: 800 14px/1.1 var(--sans); color: #fff; background: var(--violet); box-shadow: 0 4px 10px rgba(123,92,253,.4); opacity: 0; transform: scale(.7); transition: opacity .25s, transform .25s; }
.inu-badge.inu-on { opacity: 1; transform: none; }
@keyframes inuWork { to { transform: scale(1.08); } }

.inu-vein { position: absolute; left: 0; right: 0; top: 92px; height: 58px; border-radius: 29px; overflow: hidden;
  background: linear-gradient(180deg, #7d1f30, #4a0f1b); border: 2px solid rgba(255,255,255,.14); box-shadow: inset 0 -10px 18px rgba(0,0,0,.3); }
.inu-vein > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 12px/1 var(--sans); color: rgba(255,255,255,.6); }
.inu-s { position: absolute; width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3cf, var(--gold)); box-shadow: 0 0 6px rgba(252,192,80,.8);
  animation: inuDrift 2.2s ease-in-out infinite alternate; }
@keyframes inuDrift { from { transform: translate(-5px, -2px); } to { transform: translate(5px, 2px); } }

.inu-test { position: absolute; right: 0; top: 4px; width: 138px; padding: 6px 8px; border-radius: 12px; text-align: center; background: var(--raised); border: 1.5px solid var(--line-strong);
  opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s, border-color .3s; }
.inu-test.inu-on { opacity: 1; transform: none; }
.inu-test span { display: block; font: 700 12px/1.2 var(--sans); color: var(--dim); }
.inu-test b { display: block; font: 800 15px/1.2 var(--sans); color: var(--text); }
.inu-test[data-k="ok"] { border-color: var(--mint); } .inu-test[data-k="ok"] b { color: var(--mint); }
.inu-test[data-k="hi"] { border-color: var(--gold); } .inu-test[data-k="hi"] b { color: var(--gold); }
.inu-test[data-k="bad"] { border-color: var(--red); } .inu-test[data-k="bad"] b { color: #ff8a8a; }

.inu-cell { position: absolute; left: 50%; bottom: 0; width: 230px; margin-left: -115px; height: 82px; border-radius: 26px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, #3a2a5e, #251a40); border: 3px solid #8f7ce8; box-shadow: 0 10px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.2); }
.inu-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(255,216,138,.85), rgba(201,140,27,.85)); transition: height .4s ease-out; }
.inu-cl { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font: 700 13px/1 var(--sans); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.inu-door { position: absolute; top: 0; width: 34px; height: 12px; margin-left: -17px; border-radius: 0 0 8px 8px; background: #8f7ce8; transition: background .3s, box-shadow .3s, height .3s; }
.inu-door:nth-of-type(1) { left: 25%; } .inu-door:nth-of-type(2) { left: 50%; } .inu-door:nth-of-type(3) { left: 75%; }
.inu-door::after { content: ''; position: absolute; left: 50%; top: 2px; width: 2px; height: 7px; margin-left: -1px; background: #3a2a5e; border-radius: 1px; }
.inu-door.inu-open { height: 18px; background: var(--mint); box-shadow: 0 0 12px rgba(63,214,154,.8); }
.inu-door.inu-open::after { width: 14px; margin-left: -7px; height: 9px; border-radius: 0 0 5px 5px; }
.inu-shake { animation: inuShake .38s ease-in-out; }
@keyframes inuShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* flying specks: insulin violet, sugar gold, fat cream */
.inu-k, .inu-g, .inu-f { position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; z-index: 2; }
.inu-k { background: radial-gradient(circle at 35% 35%, #e3dcff, var(--violet)); box-shadow: 0 0 8px rgba(169,155,255,.9); transition: opacity .5s; }
.inu-g { background: radial-gradient(circle at 35% 35%, #fff3cf, var(--gold)); box-shadow: 0 0 6px rgba(252,192,80,.9); }
.inu-f { background: radial-gradient(circle at 35% 35%, #fffaf0, #f2d9a6); box-shadow: 0 0 6px rgba(242,217,166,.8); }
.inu-gone { opacity: 0; }

/* three places at once */
.inu-three { position: relative; width: min(100%, 330px); height: 250px; }
.inu-three .inu-pan { left: 0; top: 0; }
.inu-v3 { left: 92px; top: 8px; height: 62px; }
.inu-orgs { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; }
.inu-org { width: 100px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.inu-org > img, .inu-fatc { width: 84px; height: 84px; object-fit: contain; transition: filter .35s, transform .35s; }
.inu-org > span { font: 700 13px/1.2 var(--sans); color: var(--text); }
.inu-fatc { display: flex; align-items: center; justify-content: center; }
.inu-fatc i { width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fffaf0, #f2d9a6 55%, #c9a35f); box-shadow: inset 0 -6px 12px rgba(120,80,20,.35), 0 6px 14px rgba(0,0,0,.3);
  transition: transform .4s ease-out; }
.inu-bar { position: relative; width: 70px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.inu-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: var(--gold); transition: width .4s ease-out; }
.inu-lit > img, .inu-lit .inu-fatc { filter: drop-shadow(0 0 12px rgba(169,155,255,.9)); transform: scale(1.05); }
.inu-burn > img { filter: drop-shadow(0 0 12px rgba(251,150,121,.95)) brightness(1.1); }

.inu-note { margin: 8px 16px 0; text-align: center; font: 500 12px/1.35 var(--sans); color: var(--dim); }

@media (max-height: 700px) {
  .inu-sc, .inu-three { height: 226px; }
  .inu-pan img { width: 56px; height: 56px; }
  .inu-badge { left: 60px; }
  .inu-vein { top: 80px; height: 52px; }
  .inu-v3 { top: 6px; height: 54px; }
  .inu-cell { height: 76px; }
  .inu-org > img, .inu-fatc { width: 72px; height: 72px; }
  .inu-fatc i { width: 64px; height: 64px; }
  .inu-note { margin-top: 4px; }
}
