/* Floater shared styles: palette, font, ceramic buttons, and the timer component (floater.js). */
@font-face { font-family: "Baloo 2"; src: url("baloo2.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

/* App palette (docs/design-system/README.md) */
:root {
  --mint: #B8D8C6; --mint-deep: #6BA385; --grout: #F7EEDC; --cream: #F9F1E1; --cream-dark: #D6C7AB;
  --card: #FFFBF4; --floor: #FDF1E0; --water: #A7D9F6; --wood: #CC8F54; --wood-dark: #9E6636;
  --terracotta: #D96945; --terracotta-dark: #A84A2B; --terracotta-ink: #BC5532; --brown: #6B4021; --brown-deep: #4E2E17;
  --ink: #3B2414; --paper: #FCF7EB; --gold: #8A5D05; /* text gold (contrast); the golden art itself is #CC8C0D */ --gold-bright: #F2B530;
  --muted: #7A5B44;
  color-scheme: light;
}

/* Ceramic tile buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
  padding: 0 26px; border-radius: 16px; background: var(--terracotta); color: #fff;
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 20px; text-decoration: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 5px 0 var(--terracotta-dark);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 1px 0 var(--terracotta-dark); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 17px; border-radius: 14px; background: var(--terracotta-ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 4px 0 var(--terracotta-dark); }

/* Timer component */
.pick { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pb { width: 100%; background: none; border: 2px solid transparent; border-radius: 14px; padding: 6px 2px; cursor: pointer; font: inherit; color: var(--ink); line-height: 1.15; }
.pb img { width: 58px; height: 58px; margin: 0 auto 2px; }
.pb b { display: block; font-size: 13px; }
.pb small { display: block; font-size: 11px; color: var(--muted); }
.pb.on { border-color: var(--wood); background: #FBEBD3; }
.pb.on small { color: var(--gold); font-weight: 700; }
.pb.locked { cursor: default; }
.pb.locked img { filter: grayscale(1) brightness(1.6) contrast(.4); opacity: .45; }
.pb.locked b, .pb.locked small { color: #A89580; font-weight: 500; }
.pb:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 1px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #F0E4D0; }
.log li:first-child { border-top: 0; }
.log img { width: 36px; height: 36px; }
.log span { flex: 1; line-height: 1.2; }
.log small { display: block; color: var(--muted); font-size: 14px; }
.log small.gold { color: var(--gold); font-weight: 700; }
.log time { font-size: 14px; color: var(--muted); }
.log .empty { color: var(--muted); font-size: 15px; border: 0; }

.demo {
  position: relative; width: min(390px, 100%); margin: 0 auto; border-radius: 40px; overflow: hidden;
  background: var(--floor); box-shadow: 0 0 0 8px #0b0b0b, 0 0 0 14px #b9b0a2, 0 30px 60px rgba(20,10,4,.3);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.d-wall { height: 118px; display: grid; place-items: center; position: relative;
  background-color: var(--mint);
  background-image: linear-gradient(90deg, var(--grout) 3px, transparent 3px), linear-gradient(0deg, var(--grout) 3px, transparent 3px);
  background-size: 40px 40px; }
.d-wall::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 10px; border-radius: 5px; background: linear-gradient(var(--wood) 0 65%, var(--wood-dark) 65%); }
.d-roll { position: relative; margin-top: -6px; padding-top: 14px; width: 150px; }
.d-roll::before { content: ""; position: absolute; top: 0; left: -16px; right: -16px; height: 16px; border-radius: 8px;
  background: radial-gradient(circle at 8px 8px, var(--wood-dark) 7px, transparent 8px), radial-gradient(circle at calc(100% - 8px) 8px, var(--wood-dark) 7px, transparent 8px), linear-gradient(var(--paper), #EFE6D2);
  box-shadow: inset 0 0 0 2px var(--ink); }
.d-roll .d-time { display: block; background: var(--paper); border: 2px solid var(--ink); border-top: 0; border-bottom: 0;
  padding: 2px 10px 0; text-align: center; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 34px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.d-roll .d-bar { display: block; background: var(--paper); border: 2px solid var(--ink); border-top: 0; border-bottom: 0; padding: 0 14px 16px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; }
.d-roll .d-bar::before { content: ""; display: block; height: 7px; border-radius: 4px; background: #E9DFC9; box-shadow: inset 0 0 0 1.5px var(--ink); }
.d-roll .d-bar i { display: block; height: 7px; margin-top: -7px; width: 0; max-width: 100%; border-radius: 4px; background: var(--mint-deep); box-shadow: inset 0 0 0 1.5px var(--ink); }
#dCanvas { display: block; width: 100%; aspect-ratio: 1 / 1.13; margin-top: -2px; touch-action: manipulation; }
.d-panel { padding: 4px 18px 26px; min-height: 172px; }
.d-panel > div { display: none; }
.demo[data-state="idle"] .d-idle, .demo[data-state="running"] .d-run,
.demo[data-state="done"] .d-result, .demo[data-state="splat"] .d-result { display: block; }
.demo[data-state="flushing"] .d-flush { display: grid; place-items: center; min-height: 150px; }
.d-flush p { margin: 0; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 44px; color: var(--brown); animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.d-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 16px; }
.chip { min-height: 46px; border-radius: 14px; border: 2px solid var(--cream-dark); background: var(--cream); font: 600 16px/1 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--terracotta-ink); border-color: var(--terracotta-dark); color: #fff; }
.d-wide { width: 100%; font-size: 19px; }
.d-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); min-height: 30px; }
.d-stage { background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; color: var(--brown); white-space: nowrap; }
.d-tiles { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 8px 0 16px; }
.d-tiles i { height: 12px; border-radius: 4px; background: #E9DFC9; transition: background .3s; }
.d-tiles i.on { background: var(--mint-deep); }
.d-giveup { display: block; margin: 12px auto 0; background: none; border: 0; color: #D33A2C; font: 600 16px/1 -apple-system, BlinkMacSystemFont, sans-serif; min-height: 40px; padding: 0 16px; cursor: pointer; }
.d-result h3 { font-size: 26px; text-align: center; margin: 0; }
.d-result p { text-align: center; color: var(--muted); margin: 4px 0 12px; font-size: 16px; }
.d-unlock { display: flex; align-items: center; gap: 10px; background: #FBEBD3; border: 2px solid var(--gold); border-radius: 16px; padding: 8px 12px; margin-bottom: 14px; animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.d-unlock[hidden] { display: none; }
.d-unlock img { width: 52px; height: 52px; }
.d-unlock span { font-weight: 700; color: var(--gold); line-height: 1.2; font-size: 14px; }
.d-unlock b { display: block; color: var(--ink); font-family: "Baloo 2", sans-serif; font-size: 20px; }
.d-unlock small { display: block; color: var(--muted); font-weight: 500; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.d-get { display: block; text-align: center; margin-top: 12px; font-size: 15px; font-weight: 600; }
.d-dim { position: absolute; inset: 0; background: rgba(28,18,10,.62); display: none; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 22px 34px; }
.demo.down .d-dim { display: flex; }
.demo.down .d-panel { visibility: hidden; }
.demo.down .d-roll { position: relative; z-index: 2; }
.d-plea { color: #fff; font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 24px; line-height: 1.15; text-align: center; margin: 0 0 18px; min-height: 2.3em; display: flex; align-items: flex-end; }
.d-plea[data-tone="angry"] { color: #FFB59A; }
.d-hold { position: relative; overflow: hidden; width: 100%; min-height: 56px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; font: 600 17px/1 -apple-system, BlinkMacSystemFont, sans-serif; touch-action: none; }
.d-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.3); }
.d-hold-label { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.d-hold svg, .demo .btn svg { width: 20px; height: 20px; }
