* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f4e7cf; }
body { font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif; color: #2f2a24; -webkit-user-select: none; user-select: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
body.bare #ui { display: none; }

.head { position: absolute; left: 28px; top: 22px; pointer-events: none !important; color: #fffaf0; text-shadow: 0 2px 10px rgba(30, 20, 5, .65), 0 1px 2px rgba(30, 20, 5, .8); }
.head h1 { margin: 0; font: 700 34px/1.05 "Iowan Old Style", "Palatino", "Songti SC", "Noto Serif SC", serif; letter-spacing: .01em; }
.head p { margin: 6px 0 0; font-size: 13px; opacity: .92; }
.head .day { margin-top: 12px; display: inline-block; font: 600 13px/1 inherit; padding: 6px 10px; border-radius: 99px; background: rgba(47, 42, 36, .86); color: #fbf3e2; }

.cards { position: absolute; right: 22px; top: 20px; display: flex; flex-direction: column; gap: 8px; width: 168px; }
.card { background: rgba(255, 251, 242, .9); border: 1px solid rgba(60, 45, 30, .14); border-radius: 12px; padding: 10px 12px 9px; box-shadow: 0 6px 18px rgba(80, 55, 20, .12); backdrop-filter: blur(6px); }
.card .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.card .name { display: inline; font: 700 15px/1 "Iowan Old Style", "Palatino", "Songti SC", serif; }
.card .era { margin: 5px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.card .row { display: flex; justify-content: space-between; font-size: 12.5px; line-height: 1.55; }
.card .row span { opacity: .65; }
.card.wild { padding: 7px 12px; }

.bar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; padding: 8px; background: rgba(255, 251, 242, .92); border: 1px solid rgba(60, 45, 30, .14); border-radius: 18px; box-shadow: 0 10px 30px rgba(80, 55, 20, .18); backdrop-filter: blur(6px); max-width: calc(100vw - 20px); overflow-x: auto; }
.bar .sep { width: 1px; height: 30px; background: rgba(60, 45, 30, .16); margin: 0 3px; flex: none; }
.tool { flex: none; width: 58px; height: 54px; border: 0; border-radius: 12px; background: transparent; color: #4a4036; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 600 10.5px/1 inherit; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.tool svg { width: 22px; height: 22px; }
.tool:hover { background: rgba(60, 45, 30, .08); }
.tool.on { background: #2f2a24; color: #fbe9b8; }
.tool.hit { transform: scale(.9); background: #c8432a; color: #fff; }

.speed { position: absolute; left: 24px; bottom: 24px; display: flex; gap: 4px; padding: 5px; background: rgba(255, 251, 242, .92); border: 1px solid rgba(60, 45, 30, .14); border-radius: 12px; }
.spd { border: 0; background: transparent; min-width: 36px; height: 30px; border-radius: 8px; font: 700 12px/1 inherit; color: #4a4036; cursor: pointer; }
.spd.on { background: #2f2a24; color: #fbe9b8; }

.toasts { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none !important; }
.toast { padding: 10px 18px; border-radius: 99px; background: rgba(47, 42, 36, .9); color: #fbf3e2; font: 600 15px/1.2 "Iowan Old Style", "Palatino", "Songti SC", serif; border: 2px solid transparent; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .6s, transform .6s; white-space: nowrap; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.hint { position: absolute; right: 24px; bottom: 26px; font-size: 11.5px; color: #fffaf0; text-shadow: 0 1px 4px rgba(30, 20, 5, .8); opacity: .9; pointer-events: none !important; }

@media (max-width: 760px) {
  .head { left: 16px; top: 14px; }
  .head h1 { font-size: 24px; }
  .head p, .hint { display: none; }
  .cards { right: 10px; top: 12px; width: 132px; gap: 6px; }
  .card { padding: 8px 10px 7px; }
  .bar { bottom: 62px; border-radius: 14px; }
  .tool { width: 48px; height: 48px; font-size: 9.5px; }
  .speed { left: 50%; transform: translateX(-50%); bottom: 14px; }
  .toasts { top: 150px; }
  .toast { font-size: 13px; }
}

.card .row b { font-variant-numeric: tabular-nums; }
.bar { gap: 3px; }
.tool { width: 52px; }
.spd.gear { display: flex; align-items: center; justify-content: center; margin-left: 4px; }
.spd.gear svg { width: 18px; height: 18px; }
.panel { position: absolute; left: 24px; bottom: 74px; width: 290px; padding: 14px 16px 12px; background: rgba(255, 251, 242, .96); border: 1px solid rgba(60, 45, 30, .16); border-radius: 14px; box-shadow: 0 14px 40px rgba(60, 40, 10, .28); font-size: 13px; }
.panel[hidden] { display: none; }
.panel h2 { margin: 0 0 10px; font: 700 17px/1 "Iowan Old Style", "Palatino", "Songti SC", serif; }
.panel .grp { margin-bottom: 11px; }
.panel .grp > label { display: block; font-size: 11px; letter-spacing: .06em; opacity: .6; margin-bottom: 5px; }
.panel .seg { display: flex; gap: 4px; }
.panel .seg button { flex: 1; border: 1px solid rgba(60, 45, 30, .18); background: transparent; border-radius: 8px; padding: 7px 4px; font: 600 12px/1.1 inherit; color: #4a4036; cursor: pointer; }
.panel .seg button.on { background: #2f2a24; color: #fbe9b8; border-color: #2f2a24; }
.panel .line { display: flex; align-items: center; gap: 10px; }
.panel .line input[type=range] { flex: 1; accent-color: #c8432a; }
.panel .chk { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.panel input[type=checkbox] { width: 16px; height: 16px; accent-color: #c8432a; }
@media (max-width: 760px) { .panel { left: 50%; transform: translateX(-50%); bottom: 118px; } }

.tool { width: 54px; white-space: nowrap; font-size: 10px; }

/* photo mode (thumbnails): the scene without its interface */
body.photo #ui { display: none; }
