
:root { --ink: #43342c; --accent: #EF6415; --paper: #fffaf0; --edge: #d9bd90; --meadow: #cfe7b2; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--meadow); }
body {
  position: relative; min-height: 100vh;
  font-family: "XYHei", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-weight: 900; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 330px; z-index: -1;
  background-image: var(--sky); background-size: cover; background-position: center 42%; }
body::after { content: ""; position: absolute; left: 0; right: 0; top: 190px; height: 140px; z-index: -1;
  background: linear-gradient(rgba(207, 231, 178, 0), #cfe7b2); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }


.top { display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 10px 10px 12px; }
.brand { display: flex; align-items: center; min-width: 0; }
.brand img { width: 52px; height: 54px; margin-right: 6px; filter: drop-shadow(0 4px 4px rgba(60, 40, 20, .3)); }
.brand h1 { display: inline-block; padding: 3px 10px 4px; font-size: 19px; font-weight: 900; white-space: nowrap; background: var(--paper);
  border-radius: 8px; box-shadow: 0 3px 0 var(--edge), 0 6px 10px rgba(60, 40, 20, .22); transform: rotate(-1.6deg); }
.brand .by { display: table; margin: 5px 0 0 8px; padding: 1px 8px; font-size: 11px; color: #fff; background: var(--accent);
  border-radius: 5px; box-shadow: 0 2px 0 #a93a08; transform: rotate(1.4deg); }
.nav { display: none; flex: 0 0 auto; margin-left: 8px; }
body.has-plaza .nav { display: flex; }
.nav button { min-height: 40px; padding: 0 13px; font-size: 15px; background: var(--paper); border-radius: 12px;
  box-shadow: 0 4px 0 var(--edge), 0 6px 10px rgba(60, 40, 20, .2); }
.nav button + button { margin-left: 7px; }
.nav button.on { color: #fff; background: var(--accent); box-shadow: 0 2px 0 #a93a08, 0 4px 8px rgba(60, 40, 20, .25); transform: translateY(2px); }

.layout { max-width: 1240px; margin: 0 auto; }
.stage { padding: 0 10px; }
#board { display: block; width: 100%; height: auto; border: 4px solid var(--paper); border-radius: 18px;
  box-shadow: 0 6px 0 var(--edge), 0 14px 24px rgba(60, 40, 20, .28);
  -webkit-user-select: none; user-select: none; touch-action: pan-y; cursor: pointer; }


.panel, .picker, .share { background-color: var(--paper); background-image: var(--grain); }
.panel { margin: 18px 10px 0; padding: 12px 14px 16px; border-radius: 20px;
  box-shadow: 0 6px 0 var(--edge), 0 14px 22px rgba(60, 40, 20, .2); }
body[data-mode="make"] .solve-only, body[data-mode="solve"] .make-only { display: none; }
body[data-mode="plaza"] .layout { display: none; }
.plaza { display: none; }
body[data-mode="plaza"] .plaza { display: block; }
body:not(.voting) .vote-only { display: none; }
body:not(.has-plaza) .plaza-only { display: none; }

.btn { min-height: 44px; padding: 0 14px; font-size: 14px; background: #fff; border-radius: 14px;
  box-shadow: 0 4px 0 var(--edge), 0 6px 10px rgba(60, 40, 20, .16), inset 0 0 0 2px rgba(217, 189, 144, .45); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 2px 4px rgba(60, 40, 20, .16); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.primary { color: #fff; background: var(--accent); box-shadow: 0 4px 0 #a93a08, 0 8px 12px rgba(120, 50, 10, .28), inset 0 0 0 2px #ffb27a; }
.btn.sun { background: #ffd23f; box-shadow: 0 4px 0 #c28f10, 0 8px 12px rgba(120, 90, 10, .24), inset 0 0 0 2px #ffe89a; }
.btn.big { display: block; width: 100%; min-height: 52px; font-size: 17px; letter-spacing: 1px; }
.link { min-height: 40px; padding: 0 6px; font-size: 15px; color: var(--accent); }
.link.quiet { min-height: 34px; font-size: 12px; color: var(--ink); opacity: .55; text-decoration: underline; }


.tag { display: inline-block; margin: 4px 0 9px; padding: 2px 14px 3px; font-size: 13px; background: #ffd95e;
  box-shadow: 0 2px 3px rgba(60, 40, 20, .2); transform: rotate(-2deg); }


.scenes { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px 8px; padding: 3px 14px 10px; }
.scene { flex: 0 0 82px; margin-right: 9px; padding: 4px 4px 5px; background: #fff; border-radius: 11px;
  box-shadow: 0 3px 0 var(--edge), 0 5px 8px rgba(60, 40, 20, .18); }
.scene .pic { display: block; position: relative; height: 52px; overflow: hidden; border-radius: 7px; background: var(--meadow); }
.scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.scene .plus { position: absolute; left: 0; right: 0; top: 0; bottom: 0; font-size: 34px; line-height: 50px; color: #fff;
  text-shadow: 0 2px 4px rgba(60, 40, 20, .6); }
.scene .name { display: block; margin-top: 4px; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.scene.on { background: var(--accent); color: #fff; box-shadow: 0 3px 0 #a93a08, 0 8px 12px rgba(60, 40, 20, .28); transform: translateY(-2px) rotate(-1.5deg); }

.titleRow { display: flex; align-items: center; margin-bottom: 14px; }
.titleRow p { flex: 1; min-width: 0; font-size: 15px; line-height: 1.5; }
.titleRow .btn { flex: 0 0 auto; margin-left: 8px; }

.tools { display: flex; margin-bottom: 8px; }
.tools .btn { flex: 1; }
.tools .btn + .btn { margin-left: 10px; }


body:not([data-step]) .custom-only, body[data-step=""] .custom-only { display: none; }
body:not([data-step="layout"]) .layout-only { display: none; }
body[data-step="layout"] .people-only { display: none; }
body[data-step="layout"] #board { touch-action: none; cursor: move; }
.segment { display: flex; margin-bottom: 12px; padding: 4px; background: rgba(120, 85, 40, .14); border-radius: 14px; }
.segment button { flex: 1; min-height: 38px; font-size: 15px; border-radius: 11px; opacity: .65; }
.segment button.on { background: #fff; opacity: 1; box-shadow: 0 3px 0 var(--edge); }
.tip { margin-bottom: 8px; font-size: 12px; line-height: 1.6; opacity: .65; }
.palette { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 8px; padding: 2px 2px 8px; }
.module { flex: 0 0 76px; margin-right: 8px; padding: 6px 4px 5px; text-align: center; background: #fff; border-radius: 12px;
  box-shadow: 0 3px 0 var(--edge), 0 5px 7px rgba(60, 40, 20, .14); }
.module canvas { display: block; width: 64px; height: 52px; margin: 0 auto 3px; }
.module span { display: block; font-size: 11px; line-height: 1.3; white-space: nowrap; }
.modbar { display: flex; align-items: center; min-height: 40px; margin-bottom: 10px; }
.modbar strong { flex: 1; min-width: 0; font-size: 13px; }
.modbar .btn { margin-left: 8px; }
.chips { display: flex; flex-wrap: wrap; }
.chip { min-height: 34px; margin: 0 8px 9px 0; padding: 0 13px; font-size: 13px; background: #fff; border-radius: 99px;
  box-shadow: 0 3px 0 var(--edge); }


.publish { position: -webkit-sticky; position: sticky; bottom: 0; z-index: 5; margin: 6px -14px -16px; padding: 6px 14px 16px;
  background: var(--paper); border-radius: 0 0 20px 20px; box-shadow: 0 -9px 10px -8px rgba(60, 40, 20, .28); }
.publish p { margin-bottom: 7px; font-size: 12px; text-align: center; opacity: .66; }
.publishRow { display: flex; }
.publishRow .btn { flex: 1; }
.publishRow .btn + .btn { flex: 0 0 38%; margin-left: 10px; }



.panel.solve-only { padding: 18px 20px 22px; }
#backPlaza { display: inline-block; min-height: 36px; margin-bottom: 18px; padding: 0 14px; font-size: 14px; background: #fff;
  border-radius: 99px; box-shadow: 0 3px 0 var(--edge), 0 5px 8px rgba(60, 40, 20, .14); }
body:not(.voting) #backPlaza { display: none; }
.question { font-size: 15px; line-height: 1.6; opacity: .72; }
#verdict { margin: 6px 0 2px; font-size: 30px; line-height: 1.3; color: var(--accent); }
#nearby, #friend { font-size: 15px; line-height: 1.7; }
.options { display: flex; flex-wrap: wrap; margin: 20px 0 6px; }
.opt { width: 50px; height: 52px; margin: 0 10px 10px 0; font-size: 23px; background: #ffd23f; border-radius: 11px;
  box-shadow: inset 0 0 0 4px var(--paper), 0 4px 0 var(--edge), 0 6px 9px rgba(60, 40, 20, .22); }
.opt.on { color: #fff; background: var(--accent); transform: translateY(-3px) rotate(-4deg); }
.solve-only .btn.big { margin-top: 11px; }
.results { margin-top: 4px; }
.row { display: flex; align-items: center; margin-bottom: 8px; }
.row b { flex: 0 0 52px; font-size: 14px; }
.row .bar { flex: 1; height: 22px; overflow: hidden; background: rgba(120, 85, 40, .13); border-radius: 7px; }
.row .bar i { display: block; height: 22px; background: #ffd23f; border-radius: 7px; box-shadow: inset 0 -4px 0 rgba(150, 100, 0, .22); }
.row.mine .bar i { background: var(--accent); }
.row span { flex: 0 0 84px; margin-left: 8px; font-size: 12px; text-align: right; }
.total { font-size: 12px; text-align: right; opacity: .62; }
.report { margin-top: 12px; text-align: center; }
.report .chips { justify-content: center; margin-top: 4px; }


.plaza { max-width: 1100px; margin: 0 auto; padding: 0 10px; }
.plazaHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.plazaHead h2 { padding: 4px 14px 5px; font-size: 18px; color: #fff; background: var(--accent); border-radius: 8px;
  box-shadow: 0 3px 0 #a93a08, 0 6px 10px rgba(60, 40, 20, .24); transform: rotate(-1.4deg); }
.sort { display: flex; margin-bottom: 12px; padding: 4px; background: rgba(255, 250, 240, .85); border-radius: 14px; box-shadow: 0 3px 0 var(--edge); }
.sort button { flex: 1; min-height: 40px; font-size: 15px; border-radius: 11px; opacity: .66; }
.sort button.on { color: #fff; background: var(--ink); opacity: 1; box-shadow: 0 3px 0 #1f1712; }
.demo { margin-bottom: 12px; padding: 7px 12px; font-size: 12px; line-height: 1.6; background: #fff3bf; border-radius: 10px;
  box-shadow: 0 3px 0 #dcc56a; }
.cards { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.cardWrap { width: 50%; padding: 0 6px 16px; }
.card { position: relative; display: block; width: 100%; padding: 6px 6px 8px; text-align: left; background: var(--paper); border-radius: 14px;
  box-shadow: 0 5px 0 var(--edge), 0 10px 16px rgba(60, 40, 20, .24); }
.cardWrap:nth-child(odd) .card { transform: rotate(-.8deg); }
.cardWrap:nth-child(even) .card { transform: rotate(.8deg); }
.card canvas { display: block; width: 100%; height: auto; border-radius: 9px; background: var(--meadow); }
.card .meta { display: flex; align-items: center; justify-content: space-between; min-height: 24px; margin-top: 7px; font-size: 12px; white-space: nowrap; }

.card .meta > em { position: absolute; right: -3px; top: -8px; padding: 3px 10px; font-style: normal; font-size: 11px; line-height: 16px; color: #fff; background: var(--accent);
  border: 2px solid var(--paper); border-radius: 99px; box-shadow: 0 2px 5px rgba(60, 40, 20, .3); }
.card .meta > em.own { color: var(--ink); background: #ffd23f; }
.card .meta > em.private { background: var(--ink); }
.btn.more { max-width: 320px; margin: 0 auto; }
.none { width: 100%; padding: 30px 12px; font-size: 14px; text-align: center; opacity: .7; }


.picker { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column; height: 56vh;
  padding: 10px 12px 0; border-radius: 20px 20px 0 0; box-shadow: 0 -4px 0 var(--edge), 0 -12px 30px rgba(50, 30, 8, .32);
  transform: translateY(110%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
body.picking[data-mode="make"] .picker { transform: translateY(0); visibility: visible; }
body.picking[data-mode="make"] { padding-bottom: 56vh; }
#scrim { display: none; }
.pickerHead { display: flex; align-items: center; justify-content: space-between; }
.pickerHead strong { font-size: 15px; }
.pickerOps { display: flex; margin: 6px 0 10px; }
.pickerOps .btn { flex: 1; }
.pickerOps .btn + .btn { margin-left: 10px; }
.tabs { display: flex; margin-bottom: 6px; }
.tab { flex: 1; min-height: 34px; margin-right: 6px; font-size: 13px; background: rgba(120, 85, 40, .1); border-radius: 10px; }
.tab:last-child { margin-right: 0; }
.tab.on { color: #fff; background: var(--ink); box-shadow: 0 3px 0 #1f1712; }
.heroGrid { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 24px; }
.hero { width: 20%; padding: 3px 2px 7px; text-align: center; }
.face { position: relative; display: block; width: 58px; height: 58px; margin: 0 auto 5px; background: #e8f1f4; border: 3px solid #fff; border-radius: 15px;
  box-shadow: 0 3px 0 var(--edge), 0 5px 7px rgba(60, 40, 20, .2); }
.face img { display: block; width: 52px; height: 52px; border-radius: 12px; }
.badge { display: none; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 0 6px; font-size: 10px; line-height: 15px;
  white-space: nowrap; color: #fff; background: var(--ink); border-radius: 99px; }
.hero.seated .face img { opacity: .42; }
.hero.seated .badge { display: block; }
.hero.here .face { border-color: var(--accent); }
.hero.here .face img { opacity: 1; }
.hero.here .badge { background: var(--accent); }
.hname { display: block; font-size: 12px; line-height: 1.3; }


#askScrim { display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 30; background: rgba(40, 28, 14, .62); }
.ask { display: none; position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 92%; max-width: 380px;
  padding: 16px 16px 8px; text-align: center; background-color: var(--paper); background-image: var(--grain); border-radius: 20px;
  box-shadow: 0 6px 0 var(--edge), 0 18px 40px rgba(20, 10, 0, .4); }
.ask h2 { margin-bottom: 12px; font-size: 19px; }
.btn.choice { margin-bottom: 14px; padding: 10px 12px; }
.btn.choice small { display: block; margin-top: 3px; font-size: 12px; letter-spacing: 0; opacity: .66; }
body.asking { overflow: hidden; }
body.asking #askScrim, body.asking .ask { display: block; }


.replies { margin-top: 16px; }
.wall { display: flex; flex-wrap: wrap; }
.wall .empty { width: 100%; margin-bottom: 10px; font-size: 13px; opacity: .62; }
.sticker { position: relative; width: 74px; margin: 0 8px 10px 0; padding: 4px 2px 5px; text-align: center; background: #fff; border-radius: 13px;
  box-shadow: 0 3px 0 var(--edge), 0 5px 8px rgba(60, 40, 20, .18); }
.sticker img { display: block; width: 58px; height: 58px; margin: 0 auto 1px; object-fit: contain; }
.sticker span { display: block; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.sticker b { position: absolute; right: -5px; top: -6px; min-width: 22px; padding: 0 5px; font-size: 12px; line-height: 20px; color: #fff; background: var(--ink); border: 2px solid var(--paper); border-radius: 99px; }
.sticker.on { background: #fff1d6; box-shadow: inset 0 0 0 3px var(--accent), 0 3px 0 #a93a08, 0 5px 8px rgba(60, 40, 20, .2); }
.sticker.on b { background: var(--accent); }
.wall .sticker:nth-child(odd) { transform: rotate(-2.2deg); }
.wall .sticker:nth-child(even) { transform: rotate(1.8deg); }
.stickers { display: none; flex-wrap: wrap; margin-top: 12px; padding: 10px 0 0 8px; background: rgba(120, 85, 40, .1); border-radius: 14px; }
.stickers.open { display: flex; }
.stickers .sticker { width: 68px; }
.stickers .sticker img { width: 54px; height: 54px; }
.ownRow { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
body:not(.voting) .ownRow { display: none; }
.ownRow span { margin-right: 6px; opacity: .66; }
.ownRow .link { min-height: 34px; font-size: 13px; }
.mineLink { display: block; min-height: 36px; margin: 0 0 12px auto; padding: 0 14px; font-size: 13px; background: var(--paper); border-radius: 99px;
  box-shadow: 0 3px 0 var(--edge), 0 5px 8px rgba(60, 40, 20, .18); }
.card .faces { display: flex; align-items: center; }
.card .faces img { width: 22px; height: 22px; margin-left: -7px; object-fit: contain; }
.card .faces i { margin-left: 3px; font-style: normal; font-size: 11px; }

.legal { max-width: 640px; margin: 0 auto; padding: 24px 20px 28px; font-size: 11px; line-height: 1.7; text-align: center; opacity: .6; }


#shareScrim { display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 30; background: rgba(40, 28, 14, .66); }
.share { display: none; position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 94%; max-width: 460px; height: 94%; flex-direction: column; padding: 8px 14px 10px; border-radius: 20px;
  box-shadow: 0 6px 0 var(--edge), 0 18px 40px rgba(20, 10, 0, .4); }
body.sharing { overflow: hidden; }
body.sharing #shareScrim { display: block; }
body.sharing .share { display: flex; }
.shareHead { display: flex; align-items: center; justify-content: space-between; }
.shareHead h2 { font-size: 18px; }
.shareBody { flex: 1; min-height: 0; position: relative; margin: 4px 0; }
.shareBody img { position: absolute; left: 0; top: 0; right: 0; bottom: 0; margin: auto; max-width: 100%; max-height: 100%; border-radius: 10px;
  -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
#shareHint { margin: 4px 0 9px; font-size: 13px; text-align: center; opacity: .72; }
.shareActions { display: flex; flex-wrap: wrap; margin-right: -10px; }
.shareActions .btn { flex: 1 0 40%; margin: 0 10px 8px 0; }

#toast { position: fixed; left: 50%; bottom: 40px; z-index: 40; max-width: 86%; padding: 10px 18px; font-size: 14px; color: #fff;
  background: rgba(67, 52, 44, .95); border-radius: 99px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 359px) {
  .brand img { display: none; }
  .hero { width: 25%; }
}
@media (min-width: 640px) { .cardWrap { width: 33.33%; } }


@media (min-width: 900px) {
  .top { padding: 12px 24px 14px; }
  .nav button { padding: 0 22px; }
  .layout { display: flex; align-items: flex-start; justify-content: center; padding: 0 24px; }
  .stage { flex: 0 0 auto; width: calc((100vh - 104px) * .74); max-width: 640px; min-width: 340px; padding: 0; }
  .side { flex: 1; max-width: 520px; max-height: calc(100vh - 82px); overflow-y: auto; margin-left: 10px; padding: 0 16px 16px; }
  .panel { margin: 0 0 18px; }
  .scenes { flex-wrap: wrap; overflow: visible; margin: 0 -9px 2px 0; padding: 3px 0 0; }
  .scene { flex-basis: 82px; margin-bottom: 11px; }
  .palette { flex-wrap: wrap; overflow: visible; }
  .module { margin-bottom: 9px; }
  .publish { position: static; margin: 10px 0 0; padding: 0; background: none; box-shadow: none; }
  .picker { position: static; height: 520px; transform: none; visibility: visible; transition: none; border-radius: 20px;
    box-shadow: 0 6px 0 var(--edge), 0 14px 22px rgba(60, 40, 20, .2); }
  body.picking[data-mode="make"] { padding-bottom: 0; }
  .pickerHead .link { display: none; }
  .hero { width: 16.66%; }
  .cardWrap { width: 25%; }
  .sort { width: 260px; }
  .mineLink { margin-top: -49px; margin-bottom: 21px; }
  
  body.sharing .share { display: grid; grid-template-columns: 1fr 240px; grid-template-rows: auto 1fr auto auto 1fr; grid-column-gap: 18px;
    width: 780px; max-width: 94%; height: 92%; max-height: 860px; padding: 12px 20px 18px; }
  .shareHead { grid-column: 1 / 3; grid-row: 1; }
  .shareBody { grid-column: 1; grid-row: 2 / 6; }
  #shareHint { grid-column: 2; grid-row: 3; }
  .shareActions { grid-column: 2; grid-row: 4; }
  .shareActions .btn { flex-basis: 100%; }
}
