/* ============================================================
   FULLY — La Cameretta (stile "videogioco premium")
   Tutte le classi sono prefissate con .room- per non collidere.
   Portrait/mobile, max-width ~500px come le altre schermate.
   ============================================================ */

.room-screen {
  min-height: 100%;
  background:
    radial-gradient(140% 60% at 50% -10%, rgba(47, 143, 255, 0.10), transparent 60%),
    var(--grad-bg, linear-gradient(180deg, #030611 0%, #071127 40%, #101b45 100%));
  padding: 14px 14px 40px;
}

.room {
  max-width: 500px;
  margin: 0 auto;
}

/* ---------- Header ---------- */
.room-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.room-back {
  flex: 0 0 auto;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.16));
  background: var(--card-2, rgba(255, 255, 255, 0.06));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.room-back:active { transform: scale(0.95); }
.room-title {
  flex: 1 1 auto;
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .2px;
}
.room-coins {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--ink, #08111f);
  background: var(--grad-gold, linear-gradient(135deg, #f7d548, #ffbf00));
  box-shadow: 0 4px 14px rgba(247, 213, 72, 0.28);
}
.room-coins b { font-size: 16px; }
.room-head-right { display: flex; align-items: center; gap: 10px; }
.room-theme { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); font-size: 20px; cursor: pointer; line-height: 1; }
.room-theme:active { transform: scale(.94); }

/* ---------- Messaggio guida ---------- */
.room-hint {
  min-height: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  text-align: center;
  color: var(--ink, #08111f);
  background: var(--gold, #f7d548);
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  transition: max-height .2s ease, opacity .2s ease, margin .2s ease, padding .2s ease;
  padding: 0 12px;
  margin: 0;
}
.room-hint.is-active {
  max-height: 80px;
  opacity: 1;
  padding: 10px 12px;
  margin: 0 0 12px;
}

/* ============================================================
   LA STANZA (scena accogliente)
   ============================================================ */
/* Stanza illustrata (sfondo immagine + oggetti posizionati in %). */
.room-scene {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 20px;
  aspect-ratio: 1024 / 1536;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.room-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.room-slots { position: absolute; inset: 0; }

/* ---------- Slot posizionati sull'illustrazione ---------- */
.room-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  transition: background .15s ease, box-shadow .15s ease;
}
.room-slot.is-free {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(255, 225, 120, 0.9), 0 0 18px rgba(255, 210, 90, 0.55);
  cursor: pointer;
  animation: room-pulse 1.1s ease-in-out infinite;
}
.room-slot-drop { font-size: 22px; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }

/* ---------- Oggetto piazzato ---------- */
.room-obj {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
  transition: transform .12s ease;
}
.room-obj:active { transform: scale(0.9); }
.room-obj-emoji {
  display: block;
  font-size: clamp(28px, 7vw, 44px);
  animation: room-bob 3.2s ease-in-out infinite;
}

/* ============================================================
   NEGOZIO
   ============================================================ */
.room-shop-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}
.room-cat { margin-bottom: 20px; }
.room-cat-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold, #f7d548);
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

/* Card oggetto — stile "glass" */
.room-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  border-radius: 16px;
  background: var(--card-2, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.16));
  backdrop-filter: blur(6px);
  text-align: center;
}
.room-card.is-owned {
  border-color: rgba(247, 213, 72, 0.45);
  background: rgba(247, 213, 72, 0.08);
}
.room-card-emoji {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
}
.room-card-name {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-card-foot { width: 100%; }

/* Bottoni card */
.room-buy,
.room-place {
  width: 100%;
  border: none;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.room-buy:active,
.room-place:active { transform: scale(0.95); }

.room-buy {
  color: var(--ink, #08111f);
  background: var(--grad-gold, linear-gradient(135deg, #f7d548, #ffbf00));
}
.room-buy.is-locked {
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.room-place {
  color: #fff;
  background: linear-gradient(135deg, #2f8fff, #1f6fe0);
}
.room-place.is-active {
  background: linear-gradient(135deg, #ffbf00, #f7d548);
  color: var(--ink, #08111f);
}
.room-place.is-placed {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.16));
}

/* ============================================================
   ANIMAZIONI (reduce-motion safe)
   ============================================================ */
@keyframes room-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes room-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(47, 143, 255, 0.65); }
  50%      { box-shadow: inset 0 0 0 3px rgba(47, 143, 255, 0.95); }
}

/* Rispetta la preferenza di movimento ridotto */
.reduce-motion .room-obj-emoji,
.reduce-motion .room-slot.is-free {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .room-obj-emoji,
  .room-slot.is-free {
    animation: none !important;
  }
}

/* ============================================================
   BRAWL SKIN — Cameretta (bordi ciccioni + bevel)
   ============================================================ */
.room-back { border: 3px solid #160a2e; box-shadow: 0 4px 0 #160a2e; font-family: 'Lilita One', system-ui; font-weight: 400; }
.room-back:active { transform: translateY(3px); box-shadow: 0 1px 0 #160a2e; }
.room-coins { border: 2px solid #160a2e; box-shadow: 0 3px 0 #160a2e; font-weight: 800; }
.room-cat-title { font-family: 'Lilita One', system-ui; font-weight: 400; }
.room-shop-title { font-family: 'Lilita One', system-ui; font-weight: 400; }
.room-card { border: 3px solid #160a2e; border-radius: 16px; box-shadow: 0 4px 0 #160a2e, 0 7px 14px rgba(0,0,0,.4); }
.room-card.is-owned { border-color: #2ea22b; box-shadow: 0 4px 0 #196b17, 0 7px 14px rgba(0,0,0,.4); }
.room-buy { border: 3px solid #b9740a; border-radius: 12px; background: linear-gradient(180deg, #ffe27a, #f0a713); color: #3a2600; box-shadow: 0 4px 0 #b9740a; font-family: 'Lilita One', system-ui; font-weight: 400; }
.room-buy:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9740a; }
.room-buy.is-locked { filter: grayscale(.4) brightness(.85); }
