body { overflow: hidden; }

#scene { position: fixed; inset: 0; overflow: hidden; background: var(--floor); }
.room-wrap { position: absolute; transform-origin: 0 0; width: 480px; height: 300px; }
.room-wrap canvas { width: 100%; height: 100%; display: block; }
.doormat {
  position: absolute;
  left: 196px; top: 274px; width: 88px;
  font-family: var(--pixel);
  font-size: 7px; line-height: 1.15;
  color: #f2e6c9; text-align: center; letter-spacing: 0.04em;
}
#tags { position: absolute; inset: 0; pointer-events: none; }
#tags .nametag { position: absolute; transform: translate(-50%, -100%); font-size: 7px; padding: 0 3px; border-width: 1px; }

.creator-hotspot {
  position: fixed; z-index: 5;
  background: transparent; border: 0; padding: 0;
  cursor: help;
}

.topbar {
  position: fixed; z-index: 20; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.topbar .btn { pointer-events: auto; font-size: 16px; padding: 6px 12px; }
.meet { display: flex; align-items: center; gap: 8px; }
.meet canvas { width: 22px; height: 32px; }

.board-frame {
  position: fixed; z-index: 10;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  display: flex;
  background: var(--wood);
  border: 4px solid var(--wood-dark);
  padding: 10px;
  box-shadow: 0 0 0 4px #9a6a40 inset, 0 12px 0 rgba(60,35,20,0.35);
}
.board {
  flex: 1;
  background: var(--paper);
  border: 3px solid var(--wood-dark);
  padding: 20px 22px 18px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  min-height: 300px;
}
.board-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; }
.board-head .faces { display: flex; align-items: flex-end; gap: 6px; }
.board-head canvas { width: 36px; height: 52px; }
.board-head canvas.formi { width: 32px; height: 30px; }
.board-head .speech { font-size: 15px; margin-bottom: 8px; order: -1; padding: 6px 12px; }
.board:focus { outline: none; }

.q-title { font-family: var(--serif); font-size: 26px; line-height: 1.15; text-align: center; margin: 4px 0 6px; overflow-wrap: anywhere; }
.q-title .req { color: var(--red); }
.q-desc { text-align: center; color: var(--ink-2); font-size: 14px; margin: 0 0 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.q-body { display: grid; gap: 10px; margin-bottom: 16px; }
.q-body .chip { font-size: 17px; }
.scale { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.scale .chip { width: auto; min-width: 44px; justify-content: center; padding: 8px 10px; }
.scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.grid-row { display: grid; gap: 6px; padding-bottom: 8px; border-bottom: 2px dashed #d8ccb4; }
.grid-row .label { font-size: 15px; }
.grid-row .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.grid-row .chip { width: auto; font-size: 15px; padding: 5px 9px; box-shadow: 0 3px 0 var(--ink); }

.nav { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.nav .btn-primary { flex: 1; }
.progress { display: flex; gap: 4px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.progress i { width: 10px; height: 10px; border: 2px solid var(--ink); background: var(--paper); }
.progress i.done { background: var(--ink); }
.progress i.now { background: var(--red); }
.counter { font-family: var(--pixel); font-size: 14px; color: var(--ink-2); text-align: center; margin-bottom: 4px; }
.err { color: var(--red-dark); font-family: var(--pixel); font-size: 15px; min-height: 18px; text-align: center; }
.pick-list { display: grid; gap: 8px; margin-bottom: 14px; }
.pick-list .chip { font-family: var(--sans); font-size: 15px; line-height: 1.3; }
.pick-list .chip small { display: block; color: inherit; opacity: 0.75; font-size: 12px; font-family: var(--pixel); }
.center { text-align: center; }
.big { font-family: var(--serif); font-size: 34px; margin: 6px 0; text-align: center; }
.done-meme { max-width: 100%; max-height: 220px; display: block; margin: 8px auto; border: 3px solid var(--ink); }
.loading { margin: auto; font-family: var(--pixel); font-size: 18px; }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(42,31,26,0.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.card {
  position: relative; width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink);
  padding: 22px; text-align: center;
}
.card canvas { width: 72px; height: 104px; }
.card h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 6px 0 2px; }
.card .role { font-family: var(--pixel); margin: 0 0 14px; color: var(--ink-2); }
.card .why { text-align: left; background: #fff; border: 3px solid var(--ink); padding: 10px 12px; margin-bottom: 12px; }
.card .why p { margin: 4px 0 0; line-height: 1.45; }
.card .meme { margin: 0 0 14px; }
.card .meme img { max-width: 100%; max-height: 220px; border: 3px solid var(--ink); display: block; margin: 6px auto; }
.close { position: absolute; top: 6px; right: 10px; font-size: 28px; background: none; border: 0; }
.made-with { position: fixed; right: 12px; bottom: 10px; z-index: 15; font-family: var(--pixel); font-size: 13px; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); padding: 3px 8px; text-decoration: none; }

@media (max-width: 720px) {
  .meet span { display: none; }
  .board-frame { top: calc(50% + 14px); max-height: calc(100dvh - 96px); padding: 6px; }
  .board { padding: 16px 14px 14px; }
  .q-title { font-size: 22px; }
  .made-with { display: none; }
  .creator-hotspot { display: none; }
}
.nav { flex-wrap: wrap; }
.nav > .btn { flex: 1 1 auto; text-align: center; }
.nav > .btn[aria-label="Back"] { flex: 0 0 auto; }

/* ---- maker (Shaurya) ---- */
.maker-tag { position: absolute; transform: translate(-50%, -100%); font-size: 7px; padding: 0 3px; border-width: 1px; background: #fff3d6; white-space: nowrap; }
.maker-bubble { position: absolute; transform: translate(-50%, -100%); font-family: var(--pixel); font-size: 7px; line-height: 1.2; background: #fff; border: 1px solid var(--ink); padding: 2px 4px; white-space: nowrap; display: none; box-shadow: 0 1px 0 var(--ink); }
.maker-hotspot { position: fixed; z-index: 6; cursor: pointer; }
.maker-hotspot:focus-visible { outline: 3px solid var(--focus); }
.maker-badge { position: fixed; left: 12px; bottom: 10px; z-index: 15; display: flex; align-items: center; gap: 6px; font-family: var(--pixel); font-size: 13px; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); padding: 2px 8px 2px 4px; text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.maker-badge canvas { width: 16px; height: 23px; image-rendering: pixelated; }
.maker-badge:hover { background: #fff3d6; }
@media (max-width: 720px) {
  .maker-hotspot { display: none; }
  .maker-badge { left: 50%; transform: translateX(-50%); bottom: 6px; font-size: 12px; }
}
