/* =========================
   CORE / RESET
========================= */
:root{
  --app-height: 100vh;
  --stage-offset-y: 0px; /* regulacja wysokości sceny: np. -30px / +40px */

  --stage-scale: 1;
}

html, body{
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  height: var(--app-height);
  margin: 0;
  background:#fff;
  overflow:auto;
}

body{
  font:13px/1.35 Verdana, Geneva, sans-serif;
  color:#000;
  display:flex;
  flex-direction:column;
}

.muted{ color:#666; font-size:12px; }
hr.sep{ border:none; border-top:1px solid #ddd; margin:12px 0; }
.hidden{ display:none !important; }



/* ===== GAME AREA (flex: wypełnia viewport, stopka opada na dół) ===== */
#game-area{
  flex:1;
}

#demo-banner{
  flex-shrink:1;
  margin-right:auto;
  font-size:11px;
  line-height:1.3;
  color:#333;
  padding-left:4px;
  min-width:0;
}
#demo-banner a{
  color:#0057b7;
  text-decoration:none;
}
#demo-banner a:hover{
  text-decoration:underline;
}

/* ===== VIEWPORT (scroll container) ===== */
#stage-wrap{
  width:100%;
  height:auto;                 /* kończy się na zawartości */
  overflow:visible;
  -webkit-overflow-scrolling: touch;
  padding:0;
  display:block;
}

/* ===== STAGE AREA ===== */
#stage-area{
  position:relative;
  min-width:calc(400px * var(--stage-scale));
  padding-top:0;
  min-height:0;
  display:block;
}



/* ===== STAGE ===== */
/* CHAT INPUT — zakomentowane do testów na iOS
#below-stage{
  width:calc(400px * var(--stage-scale));
  margin:0 auto;
}
#below-stage input{
  width:100%;
  box-sizing:border-box;
  margin-top:4px;
  background:#f0f0f0;
  border:1px solid #d0d0d0;
  border-radius:4px;
  padding:10px 12px;
}
*/

#stage-scale{
  position:relative;
  width:calc(400px * var(--stage-scale));
  height:calc(600px * var(--stage-scale));

  margin:0 auto;               /* wyśrodkowanie poziome */
  border:1px solid #ccc;
  overflow:hidden;
  touch-action: pan-x pan-y;
  background:#000;
}

#stage{
  position:absolute;
  left:0;
  top:0;
  width:400px;
  height:600px;

  background:#000 url('/img/scena.png') no-repeat center center / 100% 100%;
  transform:scale(var(--stage-scale));
  transform-origin:0 0;
}

.zone-label{
  position:absolute;
  text-align:left;
  white-space:normal;
  font:bold 11px sans-serif;
  color:#1a6dc0;
  background:rgba(255,255,255,0.85);
  padding:2px;
  border-radius:4px;
  pointer-events:none;
  user-select:none;
  -webkit-transform:translate(2%, 0);
  transform:translate(2%, 0);
}




/* tutorial jako overlay w viewport (DZIAŁA na telefonie) */
/* tymczasowo wyłączony: usuń display:none żeby przywrócić */
#tutorial-hints{ display:none; }
#tutorial-hints{
  position: fixed;
  left: 8px;
  top: 52px;            /* żeby nie nachodził na Koszyk (0) */
  right: auto;
  transform: none;
  pointer-events: none;
  z-index: 1400;        /* wyżej niż koszyk (1300) */
}
#tutorial-hints .tutorial{ pointer-events:auto; }

/* opcjonalnie: na wąskich ekranach niech zajmuje prawie całą szerokość */
#tutorial-hints .tcard{ width:380px; max-width:calc(100vw - 16px); }



/* =========================
   ACTORS / SPRITES / BUBBLES
========================= */
.actor{
  position:absolute;
  left:0; top:0;
  width:38px; height:56px;
  will-change:transform;
  transform-origin:50% 100%;
  pointer-events:auto;
  user-select:none;
  touch-action:none;
}

/* Focus/outline fixes (Firefox mobile zielona ramka) */
.actor, .actor *{ outline:none !important; }
.actor:focus, .actor *:focus{ outline:none !important; }

.sprite{
  width:38px; height:56px;
  background-image:url('/img/sprites.png');
  background-repeat:no-repeat;
  background-position:0 0;
  transform-origin:50% 100%;
  image-rendering: pixelated; /* spójnie na wszystkich */
}

.label{
  position:absolute;
  left:50%;
  top:60px;
  transform:translateX(-50%);
  font:13px Verdana, Geneva, sans-serif;
  color:#222;
  background:rgba(255,255,255,.85);
  padding:2px 6px;
  border-radius:6px;
  border:1px solid #ddd;
  white-space:nowrap;
  max-width:200px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.me .label{ border-color:#7ab8ff; }

.bubble{
  position:absolute;
  left:50%;
  bottom:67px;
  transform:translateX(-50%);
  min-width:28px;
  max-width:260px;
  font:13px/1.35 Verdana, Geneva, sans-serif;
  color:#000;
  background:#fff;
  border:1px solid #222;
  border-radius:12px;
  padding:6px 10px;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
  display:none;
  z-index:1000;
  pointer-events:auto;
}
.bubble::before{
  content:"";
  position:absolute;
  left:50%;
  bottom:-5px;
  transform:translateX(-50%);
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:5px solid #222;
  width:0; height:0;
}
.bubble::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-3px;
  transform:translateX(-50%);
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:4px solid #fff;
  width:0; height:0;
}
.bubble.show{ display:block; }
.bubble.editing{ display:block; }

.bubble-view{
  white-space:pre-wrap;
  word-wrap:break-word;
}
.bubble-editor{
  display:none;
  min-height:1.5em;
  outline:none;
  white-space:pre-wrap;
  word-wrap:break-word;
  -webkit-user-select:text;
  user-select:text;
}

/* mrugający „kursor”/hint gdy puste — tylko bez fokusu */
.bubble-editor.empty:not(:focus)::after{
  content:"|";
  display:inline-block;
  margin-left:1px;
  animation: caretBlink 1s steps(1) infinite;
  color:#000;
}
@keyframes caretBlink{ 50%{ opacity:0; } }

.bubble.editing .bubble-view{ display:none; }
.bubble.editing .bubble-editor{ display:block; }

.bubble-send{ display:none; }

/* =========================
   HINT (lewy dół)
========================= */
#hint{
  position:fixed;
  left:8px;
  bottom:8px;
  top:auto;
  font:13px Verdana, Geneva, sans-serif;
  color:#444;
  background:rgba(255,255,255,.9);
  padding:6px 8px;
  border-radius:6px;
  border:1px solid #eee;
  z-index:900;
}

/* =========================
   OFFER PANEL (produkty przy półce)
========================= */
#offer-panel{
  position:fixed;
  left:8px;
  right:8px;
  bottom:0;
  max-width:380px;
  box-sizing:border-box;
  height:500px;
  max-height:500px;
  overflow-y:auto;
  font:13px/1.35 Verdana, Geneva, sans-serif;
  color:#000;
  background:#fff;
  border:1px solid #222;
  border-radius:12px;
  padding:10px 10px 8px;
  box-shadow:0 -2px 10px rgba(0,0,0,.25);
  display:none;
  z-index:1400;
}
#offer-close{
  position:absolute;
  top:0;
  right:0;
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:22px;
  line-height:1;
  width:44px;
  height:44px;
  display:-webkit-box;
  display:-webkit-flex;
  display:flex;
  -webkit-box-align:center;
  -webkit-align-items:center;
  align-items:center;
  -webkit-box-pack:center;
  -webkit-justify-content:center;
  justify-content:center;
}
.offer-title{ font-weight:800; font-size:18px; letter-spacing:0.2px; }
#offer-filters-toggle{ margin:6px 0; padding:4px 10px; font-size:13px; cursor:pointer; background:#f0f0f0; border:1px solid #ccc; border-radius:4px; }
#offer-filters{ display:flex; flex-wrap:wrap; gap:16px; margin:0 0 10px; padding:10px; border:1px solid #ccc; border-radius:6px; background:#f7f7f7; }
.filter-group{ display:flex; flex-direction:column; gap:4px; }
.filter-values-list{ display:flex; flex-direction:column; gap:4px; }
.filter-values-scroll{ max-height:138px; overflow-y:auto; overflow-x:clip; padding-right:18px; }
.filter-group-title{ font-weight:700; font-size:13px; margin-bottom:2px; }
.filter-value{ display:flex; align-items:center; gap:5px; font-size:13px; cursor:pointer; white-space:nowrap; }
.offer-body{ margin-top:4px; }
#offer-panel ul{ padding-left:18px; margin:4px 0; }

.film-list{ padding-right:6px; }
.film-item{
  display:flex;
  gap:12px;
  margin-bottom:18px;
  padding-bottom:12px;
  border-bottom:1px solid #ccc;
}
.film-item img{
  width:90px; height:90px;
  object-fit:contain;
  object-position:center;
  background:#fff;
}
.film-item .info{ flex:1; display:flex; flex-direction:column; }
.film-item .title{ font-weight:bold; margin-bottom:6px; font-size:14px; }
.film-item .pid{ font-size:12px; color:#444; margin-bottom:2px; }
.film-item ul{ margin:0; padding-left:18px; font-size:13px; }
.film-item li{ margin-bottom:2px; }

.price-row{
  margin-top:6px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.price-block{ display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.price-gross{ font-weight:800; font-size:14px; }
.price-net{ font-size:12px; color:#666; }
.price-tag{opacity:.85;font-size:12px;margin-left:6px;}
.add-btn{
  padding:6px 10px;
  border:1px solid #222;
  background:#fff;
  border-radius:10px;
  cursor:pointer;
  font:13px Verdana, Geneva, sans-serif;
}
.add-btn:active{ transform:translateY(1px); }

/* =========================
   CART
========================= */
#top-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding:6px 8px;
  z-index:1301;
}
#lang-select,
#cart-btn{
  flex-shrink:0;
  height:34px;
  box-sizing:border-box;
  padding:0 10px;
  border:1px solid #222;
  background:#fff;
  border-radius:10px;
  font:13px Verdana, Geneva, sans-serif;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
  -webkit-appearance:none;
  appearance:none;
}

#cart-btn{
  position:static;
}

#cart-popup{
  position:fixed;
  right:8px;
  top:52px;
  z-index:1300;
  width:380px;
  max-width:calc(100vw - 16px);
  max-height:calc(100vh - 100px);
  background:#fff;
  border:1px solid #222;
  border-radius:12px;
  box-shadow:0 4px 14px rgba(0,0,0,.2);
  display:none;
  overflow-y:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
}

#cart-popup::-webkit-scrollbar{
  display:none;
}

.cart-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 10px 6px;
  border-bottom:1px solid #ddd;
}
.cart-title{ font-weight:800; font-size:16px; }
.cart-actions{ display:flex; gap:8px; align-items:center; }
.cart-actions button{
  padding:6px 10px;
  border:1px solid #222;
  background:#fff;
  border-radius:10px;
  cursor:pointer;
}
#cart-close{
  border:none;
  background:transparent;
  font-size:22px;
  line-height:1;
  padding:0;
  cursor:pointer;
  width:44px;
  height:44px;
  display:-webkit-box;
  display:-webkit-flex;
  display:flex;
  -webkit-box-align:center;
  -webkit-align-items:center;
  align-items:center;
  -webkit-box-pack:center;
  -webkit-justify-content:center;
  justify-content:center;
}

#cart-body{
  padding:10px;
  max-height:360px;
  overflow:auto;
}

.cart-line{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid #eee;
}
.cart-line:last-child{ border-bottom:none; }

.cart-line-info{
  flex:1;
}

.cart-product-name{
  font-weight:600;
  margin-bottom:5px;
  font-size:14px;
}

.cart-prices{
  display:flex;
  flex-direction:column;
  gap:3px;
  font-size:13px;
  color:#666;
}

.cart-unit-price{
  color:#666;
}

.cart-total-price{
  color:#666;
}

.cart-line-controls{
  display:flex;
  align-items:center;
  gap:5px;
  white-space:nowrap;
}

.cart-line-controls .add-btn{
  padding:4px 8px;
  font-size:12px;
  border:1px solid #ccc;
  background:#f5f5f5;
  border-radius:3px;
  cursor:pointer;
}

.cart-line-controls .add-btn:hover{
  background:#e0e0e0;
}

.cart-qty{
  min-width:25px;
  text-align:center;
  font-weight:600;
}

.cart-sum{
  padding:10px;
  border-top:1px solid #ddd;
  display:flex;
  justify-content:space-between;
  gap:8px;
}
.sum-col{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
}
.sum-gross{ font-weight:900; font-size:14px; }
.sum-net{ font-size:12px; color:#666; }

.qty-box{ display:flex; align-items:center; gap:6px; }
.qty-btn{
  width:28px;
  height:28px;
  border:1px solid #222;
  background:#fff;
  border-radius:8px;
  cursor:pointer;
}
.qty-val{ min-width:26px; text-align:center; }

/* =========================
   CHECKOUT VIEW
========================= */
.checkout-wrap{ padding:16px 8px 40px; }
@media (min-width:860px){ .checkout-wrap{ max-width:980px; margin:0 auto; padding:60px 12px 40px; } }
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.topbar h1{ font-size:18px; margin:0; font-weight:900; }
.topbar a{
  display:inline-block;
  padding:7px 10px;
  border:1px solid #222;
  border-radius:10px;
  text-decoration:none;
  color:#000;
  background:#fff;
}

/* checkout 2-kolumnowy layout */
.co-layout{
  display:-webkit-box;
  display:-webkit-flex;
  display:flex;
  -webkit-flex-direction:column;
  flex-direction:column;
  gap:12px;
}
/* mobile: kolejność sekcji */
.co-summary  { -webkit-order:1; order:1; }
.co-right    { -webkit-order:2; order:2; }
.co-customer { -webkit-order:3; order:3; }

/* desktop: grid 2 kolumny */
@media (min-width:860px){
  .co-layout{
    display:grid;
    grid-template-columns:1fr 1fr;
    grid-template-areas:
      "summary  right"
      "customer right";
    -webkit-align-items:start;
    align-items:start;
    gap:16px;
  }
  .co-summary  { grid-area:summary; }
  .co-right    { grid-area:right; }
  .co-customer { grid-area:customer; }
}

.co-section{ margin-bottom:16px; }
.co-section-title{ font-size:13px; font-weight:600; margin-bottom:10px; }
.co-radio-label{ display:-webkit-box; display:-webkit-flex; display:flex; -webkit-box-align:center; -webkit-align-items:center; align-items:center; gap:10px; margin-bottom:8px; cursor:pointer; font-size:14px; }
.co-terms{ order:4; margin-top:16px; font-size:13px; }
.co-terms a{ color:#000; }
@media (min-width:860px){ .co-terms{ grid-column:1 / -1; order:unset; } }
.co-buttons{ display:-webkit-box; display:-webkit-flex; display:flex; gap:8px; margin-top:10px; order:5; }
@media (min-width:860px){ .co-buttons{ grid-column:1 / -1; order:unset; } }
.co-total{ display:-webkit-box; display:-webkit-flex; display:flex; -webkit-box-pack:justify; -webkit-justify-content:space-between; justify-content:space-between; padding-top:12px; border-top:2px solid #ddd; margin-top:8px; font-weight:bold; font-size:15px; }

#order-summary h2{ margin:0 0 12px 0; font-size:14px; font-weight:900; }
#order-summary-total{ font-weight:bold; color:#222; }

.card{
  background:#fff;
  padding:0 0 16px 0;
}
.card h2{ margin:0 0 8px 0; font-size:14px; font-weight:900; }
/* desktop: obramowanie i cień */
@media (min-width:860px){
  .card{
    border:1px solid #222;
    border-radius:12px;
    padding:12px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
  }
}

.row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width: 560px){ .row{ grid-template-columns:1fr; } }

.f{ display:flex; flex-direction:column; gap:4px; margin-bottom:10px; }

label{ font-size:12px; color:#222; }

input, select{
  font:13px Verdana, Geneva, sans-serif;
  padding:8px 10px;
  border:1px solid #222;
  border-radius:10px;
  outline:none;
}

.small{ font-size:12px; color:#666; }
.chk{ display:flex; align-items:center; gap:8px; margin:10px 0; }
.btn{
  padding:8px 12px;
  border:1px solid #222;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  font-weight:900;
}
.err{ color:#b00020; font-size:12px; margin-bottom:8px; }

.sumline{ padding:8px 0; border-bottom:1px solid #eee; }
.sumline:last-child{ border-bottom:none; }
.pname{ font-weight:800; }
.priceBig{ font-weight:900; font-size:14px; }
.priceSmall{ font-size:12px; color:#666; }

.tot{ margin-top:10px; padding-top:10px; border-top:1px solid #ddd; }
.totBig{ font-weight:900; font-size:16px; }
.totSmall{ font-size:12px; color:#666; }

/* =========================
   JOIN OVERLAY (name + gender)
========================= */
#join-overlay{
  position:fixed;
  top:0; right:0; bottom:0; left:0;
  z-index:2000;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
#join-overlay.show{ display:flex; }

.join-card{
  width:380px;
  max-width:calc(100vw - 24px);
  border:1px solid #222;
  border-radius:14px;
  background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  padding:14px;
}

.join-title{
  font-weight:900;
  font-size:16px;
  margin:0 0 8px 0;
}

.join-row{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }

.join-row input{
  font:13px Verdana, Geneva, sans-serif;
  padding:8px 10px;
  border:1px solid #222;
  border-radius:10px;
  outline:none;
}

.gender-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:6px;
}

.gender-card{
  border:1px solid #222;
  border-radius:12px;
  padding:10px;
  cursor:pointer;
  user-select:none;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.gender-card.selected{
  outline:2px solid #7ab8ff;
  outline-offset:2px;
}

.gender-sil{
  width:38px;
  height:56px;
  background-image:url('/img/sprites.png');
  background-repeat:no-repeat;
  image-rendering: pixelated;
  border:1px solid #ddd;
  border-radius:10px;
  background-color:#f6f6f6;
}
.gender-m .gender-sil{ background-position: 0px 0px; }
.gender-f .gender-sil{ background-position: 0px -57px; }

.join-actions{
  display:flex;
  gap:8px;
  margin-top:12px;
}
.join-actions button{
  padding:8px 12px;
  border:1px solid #222;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  font-weight:900;
  font:13px Verdana, Geneva, sans-serif;
}
.join-actions .primary{ background:#000; color:#fff; }

.join-error{
  margin-top:8px;
  color:#b00020;
  font-size:12px;
  display:none;
}
.join-error.show{ display:block; }

/* =========================
   TUTORIAL CARDS (dymek)
========================= */
.tcard{
  width:400px;
  max-width:calc(100vw - 16px);
  display:flex;
  align-items:flex-end;
  gap:10px;
}

.tgirl{
  width:38px;
  height:44px;
  flex:0 0 auto;
  background-image:url('/img/sprites.png');
  background-repeat:no-repeat;
  image-rendering: pixelated;
  border:1px solid #ddd;
  border-radius:10px;
  background-color:#f6f6f6;
  background-position: 0px -57px; /* dziewczyna idle */
}

.tbox{
  position:relative;
  flex:1;
  border:1px solid #222;
  border-radius:12px;
  background:#fff;
  padding:10px 34px 10px 12px;
  box-shadow:0 2px 10px rgba(0,0,0,.12);
}

.tbox::after{
  content:"";
  position:absolute;
  left:-8px;
  bottom:16px;
  border-right:8px solid #222;
  border-top:8px solid transparent;
  border-bottom:8px solid transparent;
  width:0; height:0;
}
.tbox::before{
  content:"";
  position:absolute;
  left:-7px;
  bottom:16px;
  border-right:7px solid #fff;
  border-top:7px solid transparent;
  border-bottom:7px solid transparent;
  width:0; height:0;
}

.ttext{
  font:13px/1.35 Verdana, Geneva, sans-serif;
  color:#000;
}

.tclose{
  position:absolute;
  top:0;
  right:0;
  width:44px;
  height:44px;
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:22px;
  line-height:1;
  display:-webkit-box;
  display:-webkit-flex;
  display:flex;
  -webkit-box-align:center;
  -webkit-align-items:center;
  align-items:center;
  -webkit-box-pack:center;
  -webkit-justify-content:center;
  justify-content:center;
}
.tclose:active{ transform:translateY(1px); }



/* ===== WRITE TIP UI (bottom-right, pointer click -> bubble) ===== */
#write-tip-ui.wtui{
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 1600; /* above tutorial-hints (1400) and cart (1300) */
  pointer-events: none;
}
#write-tip-ui.hidden{ display:none !important; }

#write-tip-ui .wtui-hero{
  width: 38px;
  height: 44px;
  background-image:url('/img/sprites.png');
  background-repeat:no-repeat;
  image-rendering: pixelated;
  border:1px solid #ddd;
  border-radius:10px;
  background-color:#f6f6f6;
  /* same frame as .tgirl in tutorial */
  background-position: 0px -57px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}

#write-tip-ui .wtui-pointer{
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  transform: translate(-50%,-50%) scale(1);
}

#write-tip-ui .wtui-bubble{
  position: fixed;
  max-width: 260px;
  padding: 8px 10px;
  border:1px solid #222;
  border-radius: 12px;
  background:#fff;
  font:13px/1.35 Verdana, Geneva, sans-serif;
  color:#000;
  opacity: 0;
  transform: translate(-50%,-100%) scale(.95);
  transform-origin: 20px 100%;
  box-shadow:0 16px 40px rgba(0,0,0,.25);
}
#write-tip-ui .wtui-bubble::after{
  content:"";
  position:absolute;
  left:90%;
  bottom:-8px;
  transform:translateX(-50%);
  border-left:8px solid transparent;
  border-right:8px solid transparent;
  border-top:8px solid #222;
  width:0; height:0;
}
#write-tip-ui .wtui-bubble::before{
  content:"";
  position:absolute;
  left:90%;
  bottom:-7px;
  transform:translateX(-50%);
  border-left:7px solid transparent;
  border-right:7px solid transparent;
  border-top:7px solid #fff;
  width:0; height:0;
}

@keyframes wtuiPointerClick {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(1); }
  12%  { opacity: 1; }
  62%  { opacity: 1; }
  70%  { transform: translate(-50%,-50%) scale(.85); }
  78%  { transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; }
}
@keyframes wtuiBubblePop {
  0%   { opacity: 0; transform: translate(-50%,-110%) scale(.92); }
  100% { opacity: 1; transform: translate(-50%,-120%) scale(1); }
}
#write-tip-ui.wt-on .wtui-pointer{ animation: wtuiPointerClick 2.2s ease-in-out forwards; }
#write-tip-ui.wt-show .wtui-bubble{ animation: wtuiBubblePop .18s ease-out forwards; }


/* ===== WRITE TIP UI (stage bottom-right, temporary) ===== */
#stage #write-tip-ui{
  position:absolute;
  right:12px; bottom:12px;
  z-index:99999;
  pointer-events:none;
}
#stage #write-tip-ui .wtui-hero{
  width:38px; height:44px;
  background:url('/img/sprites.png') no-repeat 0px -57px;
  image-rendering:pixelated;
  border:1px solid #222;
  border-radius:10px;
  background-color:#eee;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
#stage #write-tip-ui .wtui-pointer{
  position:absolute;
  width:22px; height:22px;
  border-radius:50%;
  border:2px solid #fff;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  opacity:0;
  left:0; top:0;
  transform:translate(-50%,-50%);
}
#stage #write-tip-ui .wtui-bubble{
  position:absolute;
  padding:8px 10px;
  border:1px solid #222;
  border-radius:12px;
  background:#fff;
  font:13px Verdana, Geneva, sans-serif;
  opacity:0;
  left:0; top:0;
  transform:translate(-50%,-100%);
  box-shadow:0 16px 40px rgba(0,0,0,.25);
  white-space:nowrap;
}
#stage #write-tip-ui .wtui-bubble::after{
  content:"";
  position:absolute;
  left:90%;
  bottom:-8px;
  transform:translateX(-50%);
  border-left:8px solid transparent;
  border-right:8px solid transparent;
  border-top:8px solid #222;
  width:0; height:0;
}
#stage #write-tip-ui .wtui-bubble::before{
  content:"";
  position:absolute;
  left:90%;
  bottom:-7px;
  transform:translateX(-50%);
  border-left:7px solid transparent;
  border-right:7px solid transparent;
  border-top:7px solid #fff;
  width:0; height:0;
}

@keyframes wtuiClick {
  0%{opacity:0}
  15%{opacity:1}
  60%{opacity:1}
  70%{transform:translate(-50%,-50%) scale(.85)}
  100%{opacity:0}
}

/* ===== WRITE TIP — stały napis prawy dolny róg sceny ===== */
#write-tip-hint{
  position:absolute;
  bottom:14px;
  right:14px;
  z-index:200;
  font:12px/1.3 Verdana, Geneva, sans-serif;
  color:#000;
  text-shadow:0 1px 2px rgba(255,255,255,.8);
  pointer-events:none;
  -webkit-user-select:none;
  user-select:none;
}

/* ===== TYPING DOTS ===== */
.actor-typing{
  position:absolute;
  top:-20px; left:50%;
  transform:translateX(-50%);
  font:bold 14px Verdana, Geneva, sans-serif;
  color:#333;
  letter-spacing:2px;
  pointer-events:none;
  display:none;
  white-space:nowrap;
}
.actor-typing.show{ display:block; }
.actor-typing span{ opacity:0; }
.actor-typing span:nth-child(1){ animation:tdot1 1.2s step-end infinite; }
.actor-typing span:nth-child(2){ animation:tdot2 1.2s step-end infinite; }
.actor-typing span:nth-child(3){ animation:tdot3 1.2s step-end infinite; }
@keyframes tdot1{
  0%  { opacity:1; }
  75% { opacity:0; }
}
@keyframes tdot2{
  0%  { opacity:0; }
  25% { opacity:1; }
  75% { opacity:0; }
}
@keyframes tdot3{
  0%  { opacity:0; }
  50% { opacity:1; }
  75% { opacity:0; }
}

/* ===== AFK ZZZ ===== */
.actor-zzz{
  position:absolute;
  top:-28px; right:-6px;
  width:34px; height:26px;
  pointer-events:none;
  display:none;
  animation:zzz-sway 2s steps(8) infinite;
}
.actor-zzz.show{ display:block; }
.actor-zzz span{
  position:absolute;
  font:bold Verdana, Geneva, sans-serif;
  color:#333;
  line-height:1;
}
.actor-zzz span:nth-child(1){ font-size:10px; left:0;   bottom:0; }
.actor-zzz span:nth-child(2){ font-size:10px; left:9px;  bottom:2px; }
.actor-zzz span:nth-child(3){ font-size:10px; left:18px; bottom:4px; }
@keyframes zzz-sway{
  0%   { transform:translateX(0); }
  50%  { transform:translateX(4px); }
  100% { transform:translateX(0); }
}

/* ===== FOOTER ===== */
#footer_game_company {
  background: #f5f5f5;
  padding: 20px;
  margin-top: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

#footer_game_company div {
  margin: 4px 0;
}