/* Habit lesson. All rules scoped under .hab-* */
.hab-sc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.hab-note2 { font: 600 12px var(--sans); color: var(--faint); text-align: center; }

/* the fridge */
.hab-fr { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; max-width: 380px; }
.hab-door { position: relative; height: 270px; aspect-ratio: 0.465; flex: none; }
.hab-door img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,0,0,.4)); }
.hab-note { position: absolute; width: 44%; min-height: 34px; padding: 4px 3px; box-sizing: border-box; border-radius: 3px; background: #FFE27A; color: #4A3A10; font: 800 12px var(--sans); line-height: 1.1; font-style: normal; text-align: center; display: flex; align-items: center; justify-content: center; transform: translate(-6%, -50%) rotate(var(--r)); box-shadow: 0 3px 6px rgba(0,0,0,.28); transition: transform .5s cubic-bezier(.5,0,.75,0), opacity .5s; }
.hab-note:nth-child(3n) { background: #FFB3C7; color: #5A1F31; }
.hab-note:nth-child(4n) { background: #A9E8FF; color: #12404F; }
.hab-note.pre { opacity: 0; transform: translate(-6%, -50%) rotate(var(--r)) scale(1.6); transition: none; }
.hab-note.off { opacity: 0; transform: translate(-6%, 140%) rotate(calc(var(--r) * -4)); }
.hab-note.wob { animation: habWob .9s ease-in-out; }
@keyframes habWob { 25% { rotate: 8deg; } 50% { rotate: -6deg; } 75% { rotate: 3deg; } }

.hab-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 120px; }
.hab-dl { font: 700 12.5px var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.hab-day { font: 700 56px/1 var(--serif); color: var(--text); font-variant-numeric: tabular-nums; }
.hab-mk { min-height: 22px; font: 800 12.5px var(--sans); padding: 0; border-radius: 8px; opacity: 0; transition: opacity .3s; }
.hab-mk.on:not(:empty) { opacity: 1; padding: 3px 8px; }
.hab-mk.gold { background: rgba(252,192,80,.16); border: 1px solid rgba(252,192,80,.6); color: var(--gold); }
.hab-mk.mint { background: rgba(63,214,154,.14); border: 1px solid rgba(63,214,154,.55); color: var(--mint); }
.hab-mk.miss { background: rgba(169,155,255,.16); border: 1px solid rgba(169,155,255,.6); color: var(--violet-bright); }
.hab-left { font: 600 13.5px var(--sans); color: var(--dim); max-width: 130px; }
.hab-left b { font: 800 18px var(--sans); color: var(--gold); margin-right: 2px; }
.hab-left.none b { color: var(--mint); }

/* exam week */
.hab-two { display: flex; gap: 12px; width: 100%; max-width: 340px; margin: 0 auto; }
.hab-who { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.hab-who img { width: 96px; height: 96px; object-fit: contain; }
.hab-who b { font: 800 17px var(--sans); color: var(--text); }
.hab-who span { font: 500 14px var(--sans); color: var(--dim); text-align: center; }
.hab-who em { font: 800 12.5px var(--sans); font-style: normal; color: var(--gold); padding: 2px 8px; border-radius: 8px; background: rgba(252,192,80,.14); opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.hab-two.on .hab-who { border-color: rgba(252,192,80,.6); box-shadow: 0 0 16px rgba(252,192,80,.22); }
.hab-two.on .hab-who em { opacity: 1; transform: none; }

.hab-hide { visibility: hidden; }
.hab-pair { display: flex; align-items: center; justify-content: center; gap: 12px; }
.hab-pair div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hab-pair img { width: 110px; height: 110px; object-fit: contain; }
.hab-pair b { font: 800 15px var(--sans); color: var(--text); }
.hab-pair i { font: 700 14px var(--sans); font-style: normal; color: var(--dim); }
.hab-week { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 340px; margin: 0 auto; box-sizing: border-box; }
.hab-week > b { font: 800 16px var(--sans); color: var(--text); }
.hab-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; }
.hab-days span { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 13px var(--sans); color: var(--dim); }
.hab-days i { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; background: rgba(234,227,215,.06); border: 1px solid var(--line); color: var(--text); transition: background .3s, border-color .3s; }
.hab-days .ok i { background: rgba(63,214,154,.16); border-color: rgba(63,214,154,.6); color: var(--mint); }
.hab-days .x i { background: rgba(169,155,255,.16); border-color: rgba(169,155,255,.6); color: var(--violet-bright); }
.hab-week.on .hab-days span:nth-child(n+3) i { background: rgba(63,214,154,.16); border-color: rgba(63,214,154,.6); }

@media (max-height: 700px) {
  .hab-door { height: 236px; }
  .hab-note { min-height: 28px; font-size: 12px; }
  .hab-day { font-size: 46px; }
  .hab-who img { width: 74px; height: 74px; }
  .hab-pair img { width: 92px; height: 92px; }
  .hab-days i { width: 30px; height: 30px; }
}
