:root {
  --floor: #17110d;
  --ink: #f3e6d2;
  --dim: #b4a088;
  --hot: #ffb347;
  --ok: #9be38c;
  --bad: #ff7a5c;
  --panel: rgba(30, 21, 15, 0.95);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--floor);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
}
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}
#floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
[hidden] {
  display: none !important;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}
.chip {
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  border-radius: 3px;
  background: rgba(45, 31, 21, 0.9);
  border: 1px solid rgba(255, 179, 71, 0.3);
  text-transform: uppercase;
}
.keys {
  position: absolute;
  bottom: 6px;
  left: 10px;
  right: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--dim);
}
.caption {
  position: absolute;
  left: 50%;
  top: 72%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 16px;
  letter-spacing: 0.08em;
  width: min(560px, 94vw);
}
.caption .warn {
  color: var(--bad);
  font-weight: 700;
}
.caption .chill {
  color: #9cc3ff;
  font-weight: 700;
}
.caption .good {
  color: var(--ok);
}

.coach {
  position: absolute;
  left: 50%;
  top: 46px;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  padding: 10px 14px;
  border-radius: 4px;
  z-index: 40;
  background: rgba(36, 24, 16, 0.96);
  border-left: 3px solid var(--hot);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}
.coach b {
  color: var(--hot);
}
.toast {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 9px 15px;
  border-radius: 4px;
  background: rgba(70, 30, 14, 0.95);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.sheet {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 20;
  width: min(560px, 94vw);
  padding: 12px 16px 14px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid rgba(255, 179, 71, 0.25);
}
#read {
  max-height: 31vh;
  overflow: auto;
  padding-top: 8px;
}
#shake {
  max-height: 34vh;
  overflow: auto;
}
.sheet-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.sheet h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.1em;
}
.no {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.who {
  margin: 4px 0 2px;
  color: var(--hot);
  font-size: 14px;
}
.body {
  font-size: 14px;
  line-height: 1.45;
  margin: 4px 0;
}
.dimmed {
  color: var(--dim);
}
.plans {
  display: flex;
  gap: 6px;
  margin: 8px 0 4px;
}
.plan {
  flex: 1;
  padding: 8px 4px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.05em;
  border-radius: 4px;
  background: rgba(60, 40, 26, 0.9);
  color: var(--ink);
  border: 1px solid rgba(255, 179, 71, 0.25);
}
.plan.on {
  background: #6a3d16;
  border-color: var(--hot);
}
.plan .k {
  color: var(--dim);
  margin-right: 4px;
}
.plan .x {
  color: var(--bad);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.go-btn,
.ghost-btn {
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 4px;
  background: #8a4a14;
  color: #fff3dd;
  border: 1px solid var(--hot);
  margin-top: 6px;
  width: 100%;
}
.go-btn span,
.ghost-btn span {
  font-weight: 400;
  color: #f0c890;
  font-size: 12px;
  margin-left: 6px;
}
.ghost-btn {
  background: transparent;
  color: var(--ink);
  border-color: rgba(255, 179, 71, 0.4);
}
.btns {
  display: flex;
  gap: 8px;
}
.stars {
  font-size: 26px;
  color: var(--hot);
  letter-spacing: 0.2em;
}
.rows {
  margin: 8px 0;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 179, 71, 0.1);
}
.row span:last-child {
  color: var(--dim);
  text-align: right;
}
.row.bad span:first-child {
  color: var(--bad);
}
.row.good span:first-child {
  color: var(--ok);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  background: rgba(15, 10, 7, 0.82);
}
.panel {
  width: min(560px, 92vw);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
  background: var(--panel);
  border-radius: 6px;
  border: 1px solid rgba(255, 179, 71, 0.25);
}
.panel h1 {
  font-size: 44px;
  letter-spacing: 0.3em;
  margin: 6px 0;
  color: var(--hot);
}
.panel h2 {
  font-size: 24px;
  letter-spacing: 0.12em;
  margin: 6px 0;
}
.tag {
  font-size: 16px;
  color: var(--hot);
  margin: 0 0 8px;
}
.go {
  margin-top: 14px;
  font-size: 14px;
  color: var(--dim);
  text-align: center;
}
.go b {
  color: var(--ink);
}

/* Landscape glass (a desk): the column stays centred, the sheets and Dot's chalk move to the gutters. */
@media (min-aspect-ratio: 11/10) {
  .sheet {
    left: auto;
    right: 2vw;
    top: 15vh;
    bottom: auto;
    transform: none;
    width: min(400px, calc(50vw - 34vh - 3vw));
  }
  #read, #shake { max-height: 80vh; }
  .coach, .coach.low {
    left: 2vw;
    top: 15vh;
    transform: none;
    width: min(380px, calc(50vw - 34vh - 3vw));
  }
}
/* Portrait glass (a phone): during the pour Dot's chalk drops under the strip, off the ladle. */
@media (max-aspect-ratio: 11/10) {
  .coach.low { top: auto; bottom: 40px; }
  .caption { top: 56%; }
}
#shake .row { display: block; }
#shake .row span:last-child { display: block; text-align: left; font-size: 13px; }
/* A thumb, not a keyboard: drop the key hints and keep the chip row on one line. */
@media (pointer: coarse) {
  .keys { display: none; }
  .go-btn span, .ghost-btn span { display: none; }
  .sheet { bottom: 10px; }
}
@media (max-width: 520px) {
  #hud-plan { display: none; }
  .coach { font-size: 14px; padding: 8px 12px; }
}
