html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #15110d;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
canvas { display: block; }

/* Native inputs overlaid on the Pixi canvas (text entry works on mobile). */
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui input {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  font: 600 18px "Alegreya Sans", Georgia, serif;
  color: #f2e6c9;
  background: #2a1f16;
  border: 2px solid #8d939c;
  border-radius: 6px;
  padding: 0 14px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
#ui input:focus { border-color: #d9a93a; }
#ui input::placeholder { color: #8f7d60; }

/* Dialogs (password prompt, invite/share sheet) */
.dlg-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 7, 5, 0.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { width: min(440px, 100%); max-height: 100%; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; padding: 18px; border-radius: 10px; background: #2a1f16; border: 3px solid #8d939c; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); color: #f2e6c9; font: 16px "Alegreya Sans", Georgia, serif; }
.dlg h2 { margin: 0 0 10px; font: 900 22px Cinzel, Georgia, serif; color: #d9a93a; text-align: center; }
.dlg p { margin: 8px 0; color: #e8d9b6; line-height: 1.4; }
.dlg .dlg-note { font-size: 14px; color: #b3a07e; }
.dlg-input { width: 100%; box-sizing: border-box; margin: 8px 0; padding: 10px 12px; border-radius: 6px; border: 2px solid #8d939c; background: #1f1710; color: #f2e6c9; font: 600 16px "Alegreya Sans", Georgia, serif; user-select: text; -webkit-user-select: text; }
.dlg-input:focus { outline: none; border-color: #d9a93a; }
.dlg-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dlg-row > * { flex: 1 1 0; min-width: 0; }
.dlg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 12px; border-radius: 6px; border: 1px solid #8d939c; background: #5a3d24; color: #f2e6c9; font: 700 15px "Alegreya Sans", Georgia, serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.dlg-btn:hover { filter: brightness(1.15); }
.dlg-btn.primary { background: #d9a93a; color: #1b1b1b; }
.dlg-btn.whatsapp { background: #25d366; color: #0b2e17; border-color: #1a9e4c; }
.dlg-btn.viber { background: #7360f2; color: #fff; border-color: #5443c9; }
.dlg-btn.telegram { background: #29a9eb; color: #fff; border-color: #1c86bd; }
.dlg-btn.native { background: #3f7d3a; }
.dlg-preview { display: block; width: 100%; border-radius: 6px; border: 1px solid #6b5a45; margin-bottom: 4px; }

/* Top-right DOM buttons: sound toggle, phone fullscreen (js/ui/corner.js) */
.corner-bar { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 40; display: flex; flex-direction: row-reverse; gap: 8px; }
.corner-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; border: 2px solid #8d939c; background: rgba(42, 31, 22, 0.9); color: #d9a93a; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); cursor: pointer; }
.corner-btn:active { transform: translateY(2px); }
.corner-btn[hidden] { display: none; }

/* "Turn your phone" animation */
.rotate-hint { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; box-sizing: border-box; background: rgba(13, 10, 7, 0.94); color: #f2e6c9; font: 600 16px "Alegreya Sans", Georgia, serif; text-align: center; }
.rotate-phone { width: 64px; height: 112px; margin-bottom: 24px; border: 4px solid #d9a93a; border-radius: 12px; box-sizing: border-box; padding: 8px 4px; animation: rotate-phone 2.4s ease-in-out infinite; }
.rotate-screen { width: 100%; height: 100%; border-radius: 3px; background: #3a2b1e; display: flex; align-items: center; justify-content: center; color: #d9a93a; font-size: 22px; }
.rotate-text { font: 900 22px Cinzel, Georgia, serif; color: #d9a93a; }
.rotate-tip { font-size: 14px; color: #b3a07e; }
@keyframes rotate-phone {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
