.cotton-wrap { width: min(57rem, calc(100% - 2 * var(--gutter))); }
.cotton-cabinet { overflow: hidden; border: 1px solid #503d30; border-radius: .85rem; background: #29231f; color: #fff5df; }
.cotton-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; padding: .6rem .65rem; text-align: center; }
.cotton-hud span { display: block; color: #d8c6ad; font: 750 .65rem var(--mono); letter-spacing: .07em; }
.cotton-hud output { display: block; margin-top: .18rem; color: #fff2d2; font: 850 1.02rem var(--mono); }
.cotton-hud progress { display: block; width: min(100%, 6rem); height: .32rem; margin: .2rem auto 0; accent-color: #b9ce9b; }
#cotton-stamina-bar {
  --stamina-fill: #f4cb77;
  appearance: none;
  width: min(100%, 8rem);
  height: .625rem;
  border: 1px solid #997951;
  border-radius: 999px;
  overflow: hidden;
  background: #4b3a2d;
  accent-color: var(--stamina-fill);
}
#cotton-stamina-bar::-webkit-progress-bar { background: #4b3a2d; }
#cotton-stamina-bar::-webkit-progress-value { background: var(--stamina-fill); }
#cotton-stamina-bar::-moz-progress-bar { background: var(--stamina-fill); }
.cotton-cabinet[data-tired="true"] #cotton-stamina-bar { --stamina-fill: #ffaf8c; }
.cotton-cabinet[data-tired="true"] #cotton-stamina { color: #ffaf8c; }
.cotton-cabinet[data-warning="true"] #cotton-timer { color: #ffaf8c; }
.cotton-view { position: relative; isolation: isolate; background: #785e44; touch-action: pan-y; }
.cotton-view:focus-visible { outline: 2px solid #fff1b3; outline-offset: -3px; }
#cotton-canvas { display: block; width: 100%; height: auto; aspect-ratio: 900 / 536; }
.cotton-hurt { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, #8c271e 100%); pointer-events: none; }
.cotton-target { position: absolute; z-index: 1; bottom: .65rem; left: 50%; transform: translateX(-50%); border: 1px solid #ffe7a66b; border-radius: 2rem; padding: .32rem .68rem; background: #271d17cf; color: #fff2cf; white-space: nowrap; font: 750 .72rem var(--mono); pointer-events: none; }
.cotton-overlay { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: .5rem; background: #231a12a8; }
.cotton-message { width: min(100%, 25rem); padding: .85rem 1rem; border: 1px solid #a08060; border-radius: .65rem; background: #322720f7; text-align: center; }
.cotton-kicker { margin: 0; color: #e2b981; font: 800 .63rem var(--mono); letter-spacing: .09em; }
.cotton-message h2 { margin: .3rem 0; font-size: clamp(1.3rem, 4vw, 2rem); line-height: 1.12; letter-spacing: -.04em; }
.cotton-message #cotton-detail { margin: .35rem 0 .55rem; color: #f0e4d2; font-size: .86rem; line-height: 1.35; }
.cotton-note { margin: .25rem 0 .6rem; color: #dfc7a9; font-size: .75rem; line-height: 1.3; }
.cotton-toolbar, .cotton-controls { display: flex; align-items: center; justify-content: space-between; gap: .45rem .65rem; padding: .4rem .65rem; }
.cotton-toolbar { border-bottom: 1px solid #503d30; }
.cotton-toolbar-actions { display: flex; flex: none; gap: .4rem; }
.cotton-toolbar-actions button { white-space: nowrap; }
.cotton-toolbar p, .cotton-controls p { margin: 0; color: #e3d3b9; font-size: .82rem; }
.cotton-controls kbd { background: #443529; border-color: #695342; color: #fff1d6; }
.cotton-primary, .cotton-secondary, .cotton-touch button { min-height: 2.75rem; border-radius: .4rem; padding: .35rem .65rem; font: 800 .77rem var(--mono); touch-action: manipulation; }
.cotton-primary { border: 1px solid #dfcfaa; background: #e9d7ae; color: #2b241e; }
.cotton-primary:not(:disabled):hover { background: #f6e6c1; }
.cotton-secondary, .cotton-touch button { border: 1px solid #63503f; background: #3e3128; color: #fff2d9; }
.cotton-cabinet[data-resting="true"] #cotton-rest { border-color: #e4c184; }
.cotton-cabinet button:disabled { opacity: .55; }
.cotton-touch { display: none; gap: .3rem; }
.cotton-touch button { min-width: 2.55rem; font-size: 1.08rem; }
.cotton-field-actions { display: flex; flex: none; gap: .4rem; }
.cotton-field-actions button { white-space: nowrap; }
#cotton-sprint { display: none; touch-action: none; }
#cotton-sprint:not(:disabled):active { background: #62492f; }
@media (max-width: 36rem), (pointer: coarse) {
  .cotton-touch { display: flex; }
  #cotton-sprint { display: block; }
  .cotton-controls .cotton-keyboard { display: none; }
}
@media (max-width: 30rem) {
  .cotton-controls { flex-direction: column; align-items: stretch; }
  .cotton-touch button, .cotton-field-actions button { flex: 1; }
}
@media (max-width: 27rem) {
  .cotton-message { padding: .5rem .6rem; }
  .cotton-message #cotton-detail { margin-block: .28rem; font-size: .79rem; }
  .cotton-note { margin-block: .25rem .4rem; font-size: .7rem; }
}
