/* Suite Chaos. One visual world: a boutique hotel at night.
   Layout idea: a single phone-width column; the hotel on top, the front-desk message slip below. */
:root {
  color-scheme: dark;
  --night: #11162d;      /* page */
  --panel: #1b2245;      /* tiles */
  --line: #333c70;       /* borders on dark */
  --text: #eef0ff;       /* text on dark */
  --mute: #a2abd6;       /* secondary text on dark */
  --slip: #f8f1d4;       /* message-slip paper */
  --ink: #1b2040;        /* text on paper */
  --ink-soft: #5a5f80;
  --neon: #ff6384;       /* the sign, urgency */
  --brass: #f2c35b;      /* money, Victoria */
  --ok: #63d3a2;
  --bad: #ff7b6b;
  --display: 'Limelight', 'Copperplate', 'Rockwell', Georgia, serif;
  --body: 'Figtree', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  background-image: radial-gradient(1200px 500px at 50% -120px, #27306a 0%, transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
#app { max-width: 460px; margin: 0 auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
h1, h2, h3, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---- hotel picture ---- */
.hotel { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0b0f26; }
.hotel svg { display: block; width: 100%; height: auto; }

/* ---- title ---- */
.title { text-align: center; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.title h1 { font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1; color: var(--neon); text-shadow: 0 0 18px rgba(255, 99, 132, .55); letter-spacing: .5px; }
.title p { color: var(--mute); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.btn { display: block; width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; text-align: center; }
.btn small { display: block; font-weight: 400; color: var(--mute); font-size: 13px; }
.btn.primary { background: var(--brass); color: #20180a; border-color: var(--brass); }
.btn.primary small { color: #5b4514; }
.btn:active { transform: translateY(1px); }
.how { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.how h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: 8px; }
.how li { padding: 6px 0 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.how li:first-child { border-top: 0; }
.how b { color: var(--text); }
.how li { color: var(--mute); }
.how.goal { border-color: var(--brass); }
.how.goal p { font-size: 16.5px; color: var(--text); }

/* ---- top bar and meters ---- */
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bar .time { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--text); }
.bar .where { color: var(--mute); font-size: 13px; text-align: right; }
.meters { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 8px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.tile .lab { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.tile .val { font-size: 20px; font-weight: 700; line-height: 1.15; }
.tile .sub { font-size: 12px; color: var(--mute); white-space: nowrap; }
.track { height: 5px; border-radius: 3px; background: #0d1128; margin-top: 5px; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--ok); transition: width .3s; }
.track i.warn { background: var(--brass); }
.track i.bad { background: var(--bad); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.ratebox > div { min-width: 0; }
.ratebox .sub { white-space: normal; }
.pips { display: flex; gap: 5px; margin-top: 6px; }
.pips i { width: 13px; height: 13px; border-radius: 50%; background: var(--brass); }
.pips i.off { background: transparent; border: 2px solid var(--line); }
.ratebox { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ratebox .chg { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--brass); background: transparent; color: var(--brass); font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; }
.ratebox .chg[disabled] { border-color: var(--line); color: var(--mute); cursor: default; }

/* ---- managers ---- */
.staff { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mgr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 6px 6px; min-width: 0; }
.mgr b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr.gone b { text-decoration: line-through; color: var(--mute); }
.mgr .track { margin-top: 3px; height: 4px; }
.caption { font-size: 12px; color: var(--mute); }

/* ---- the message slip (incident card) ---- */
.slip { background: var(--slip); color: var(--ink); border-radius: 6px 6px 14px 14px; padding: 0 16px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 12px; }
.slip .head { display: flex; justify-content: space-between; gap: 10px; margin: 0 -16px; padding: 8px 16px; border-bottom: 2px solid var(--ink); border-top: 6px solid var(--neon); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.slip.owner .head { border-top-color: var(--brass); }
.slip .head span + span { color: var(--ink-soft); white-space: nowrap; }
.slip h2 { font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.1; text-wrap: balance; }
.slip p { font-size: 16.5px; }
.slip .you { font-size: 14px; color: var(--ink-soft); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; width: 100%; min-height: 52px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--ink); background: #fffdf2; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.opt .l { font-weight: 600; font-size: 16px; line-height: 1.25; }
.opt .m { font-size: 13px; color: var(--ink-soft); }
.opt .m b { color: #a2271f; font-weight: 600; }
.opt:active { background: #f0e7c2; }
.opt[disabled] { opacity: .45; cursor: not-allowed; }
.opt.del { border-style: dashed; background: transparent; }
.opt.go { background: var(--ink); color: var(--slip); align-items: center; justify-content: center; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #dff3e6; color: #17603f; border: 1px solid #9fd3b6; }
.chip.bad { background: #fde3dd; color: #96261c; border-color: #efaaa0; }
.chip.flat { background: #ebe6cf; color: var(--ink); border-color: #cfc8a8; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: #17603f; color: #fff; }
.badge.lost { background: #96261c; }
.pace { border-top: 1px dashed var(--ink-soft); padding-top: 10px; font-size: 14.5px; }
.pace b { font-weight: 700; }
.facts li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px dashed #c9c19d; font-size: 15px; }
.facts li:first-child { border-top: 0; }
.facts li span:first-child { color: var(--ink-soft); flex: none; }
.facts li span:last-child { font-weight: 600; text-align: right; }

/* ---- rate controls ---- */
.ctrl { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ctrl .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ctrl .top label, .ctrl .top span.lab { font-weight: 600; }
.ctrl .big { font-size: 26px; font-weight: 700; color: var(--brass); }
.ctrl .note { font-size: 13.5px; color: var(--mute); }
input[type=range] { width: 100%; height: 36px; accent-color: var(--brass); margin: 0; }
.step { display: flex; align-items: center; gap: 10px; }
.step button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #131935; font-size: 24px; line-height: 1; font-weight: 600; }
.step button[disabled] { opacity: .35; cursor: default; }

/* ---- dawn ---- */
.paper { background: var(--slip); color: var(--ink); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.paper .mast { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border-bottom: 3px double var(--ink); padding-bottom: 6px; font-weight: 700; }
.paper h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 25px; line-height: 1.12; text-wrap: balance; }
.stampRow { display: flex; justify-content: center; padding: 10px 0 6px; }
.stamp { max-width: 100%; padding: 6px 16px 9px; border-radius: 8px; border: 5px solid #a2271f; outline: 2px solid #a2271f; outline-offset: 3px; color: #a2271f; text-align: center; font-family: var(--display); font-size: min(46px, calc((min(100vw, 460px) - 104px) / (var(--n, 10) * .78))); line-height: 1; text-transform: uppercase; white-space: nowrap; transform: rotate(-5deg); animation: stamp .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.stamp small { display: block; font-family: var(--body); font-weight: 700; font-size: 11px; letter-spacing: .16em; line-height: 1.7; }
.stamp.good { border-color: #17603f; outline-color: #17603f; color: #17603f; }
@keyframes stamp { from { transform: rotate(-5deg) scale(1.6); opacity: 0; } }
.gradeRow { text-align: center; }
.gradeRow .big { font-size: 22px; font-weight: 700; line-height: 1.2; }
.gradeRow .sm { font-size: 14px; color: var(--ink-soft); }
.adj li { font-size: 14.5px; display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.adj li b.up { color: #17603f; } .adj li b.down { color: #96261c; }
table.pl { width: 100%; border-collapse: collapse; font-size: 15px; }
table.pl td { padding: 4px 0; }
table.pl td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
table.pl tr.tot td { border-top: 2px solid var(--ink); font-weight: 700; padding-top: 6px; }
table.pl tr.sub td { color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stats div { background: #efe7c4; border-radius: 8px; padding: 6px 2px; }
.stats b { display: block; font-size: 17px; }
.stats span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.quote { font-size: 15.5px; border-left: 3px solid var(--brass); padding-left: 10px; }
.quote.vic { border-left-color: var(--neon); font-style: italic; }
.sect { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); border-top: 1px solid #c9c19d; padding-top: 10px; }
.log li { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; font-size: 14px; padding: 5px 0; border-top: 1px dashed #c9c19d; }
.log li:first-child { border-top: 0; }
.log .t { color: var(--ink-soft); }
.log .c { color: var(--ink-soft); display: block; font-size: 13px; }
.log .d { font-variant-numeric: tabular-nums; font-weight: 600; }
.log .d.neg { color: #96261c; } .log .d.pos { color: #17603f; }
textarea.share { width: 100%; min-height: 96px; border-radius: 10px; border: 1px solid var(--line); background: #0d1128; color: var(--text); font: inherit; font-size: 14px; padding: 10px; }

@media (max-width: 360px) {
  #app { padding-left: 12px; padding-right: 12px; }
  .title h1 { font-size: 40px; }
  .tile .val { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .stamp { animation: none; } }

/* ---- how to play ---- */
.bar .where { margin-left: auto; }
.helpbtn { flex: none; align-self: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--brass); font-weight: 700; font-size: 18px; }
.overlay { position: fixed; inset: 0; z-index: 10; background: rgba(8, 10, 24, .82); overflow-y: auto; padding: 16px; }
.sheet { max-width: 460px; margin: 0 auto; background: var(--slip); color: var(--ink); border-radius: 12px; border-top: 6px solid var(--brass); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.sheetTop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet h2 { font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.15; text-wrap: balance; }
.sheet p { font-size: 15.5px; }
.sheet .x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 24px; line-height: 1; }
