/* Passeggiata nei terreni — MVP beta */
:root {
  --tw-green: #0c5505;
  --tw-gold: #e9e944;
  --tw-bg: #0a1f0a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: Lora, Georgia, serif;
  background: var(--tw-bg);
  color: #f5f5dc;
}

/* display:flex su .tw-gate/.tw-picker annulla l’attributo HTML hidden — forza hide */
.tw-gate[hidden],
.tw-picker[hidden],
.tw-app[hidden],
.tw-canvas-wrap[hidden],
.tw-hud-near[hidden],
.tw-tree-panel[hidden],
.tw-status[hidden] {
  display: none !important;
}

.tw-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  text-align: center;
}

.tw-gate-inner {
  max-width: 28rem;
}

.tw-gate h1 {
  color: var(--tw-gold);
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.tw-gate p {
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.tw-gate a.tw-btn {
  display: inline-block;
  background: var(--tw-green);
  color: var(--tw-gold);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.tw-app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.tw-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem 0.55rem 3.4rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.tw-topbar button {
  display: none;
}

.tw-hud-title {
  flex: 0 1 auto;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  color: var(--tw-gold);
}

.tw-picker {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.6rem 1rem 1rem;
  background: radial-gradient(ellipse at center, #143814 0%, var(--tw-bg) 70%);
  overflow-y: auto;
}

.tw-picker h2 {
  color: var(--tw-gold);
  margin: 0 0 0.35rem;
}

.tw-picker p {
  margin: 0 0 1.25rem;
  opacity: 0.9;
  text-align: center;
  max-width: 22rem;
  line-height: 1.45;
}

.tw-terrain-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(100%, 22rem);
}

.tw-terrain-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 2px solid rgba(233, 233, 68, 0.35);
  border-radius: 12px;
  background: rgba(12, 85, 5, 0.55);
  color: #f5f5dc;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}

.tw-terrain-btn:hover,
.tw-terrain-btn:focus-visible {
  border-color: var(--tw-gold);
  transform: translateY(-1px);
}

.tw-terrain-btn strong {
  color: var(--tw-gold);
  font-size: 1.05rem;
}

.tw-terrain-btn span {
  font-size: 0.82rem;
  opacity: 0.85;
}

.tw-canvas-wrap {
  position: absolute;
  inset: 0;
}

.tw-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.tw-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.tw-tree-sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.tw-tree-sign__stars {
  display: none;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #ffd54f;
  margin-bottom: 2px;
  animation: tw-star-spin 2.4s linear infinite;
}

.tw-tree-sign--owned .tw-tree-sign__stars {
  display: block;
}

.tw-tree-sign__board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  min-width: 3.2rem;
  max-width: 9rem;
  padding: 0.28rem 0.55rem 0.32rem;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, #fff8e1 0%, #ffe082 55%, #ffca28 100%);
  border: 2px solid #5d4037;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  text-align: center;
  line-height: 1.15;
}

.tw-tree-sign__board::after {
  content: '';
  display: block;
  width: 0.35rem;
  height: 0.55rem;
  margin-top: 0.12rem;
  background: #6d4c41;
  border-radius: 0 0 2px 2px;
}

.tw-tree-sign__id {
  font-size: 0.62rem;
  font-weight: 700;
  color: #4e342e;
  letter-spacing: 0.04em;
}

.tw-tree-sign__name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1b5e20;
  word-break: break-word;
}

.tw-tree-sign--owned .tw-tree-sign__board {
  animation: tw-sign-blink 1.1s ease-in-out infinite;
  border-color: #e65100;
  background: linear-gradient(180deg, #fff9c4 0%, #ffeb3b 50%, #ffc107 100%);
}

@keyframes tw-sign-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.04);
  }
}

@keyframes tw-star-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tw-hud-near {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background: rgba(12, 85, 5, 0.88);
  color: var(--tw-gold);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  max-width: min(92vw, 24rem);
  text-align: center;
  pointer-events: none;
}

.tw-tree-panel {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 22;
  width: min(92vw, 18rem);
  max-height: min(70vh, 28rem);
  pointer-events: none;
}

.tw-tree-panel:not([hidden]) {
  pointer-events: auto;
}

.tw-tree-panel-inner {
  background: rgba(255, 253, 245, 0.96);
  border: 2px solid #5d4037;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #0c5505;
  font-size: 0.82rem;
  line-height: 1.4;
}

.tw-tree-panel-tab,
.tw-tree-panel-close {
  display: none;
}

.tw-tree-panel-drawer {
  width: 100%;
}

.tw-tree-panel-tab-label {
  display: block;
  max-height: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tw-tree-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem 0.35rem;
  padding-right: 2rem;
  background: linear-gradient(180deg, #e8f5e9 0%, #f1f8e9 100%);
  border-bottom: 1px solid rgba(93, 64, 55, 0.2);
  position: relative;
}

.tw-tree-panel-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 999px;
  background: rgba(93, 64, 55, 0.12);
  color: #3e2723;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.tw-tree-panel-title {
  margin: 0;
  font-size: 0.95rem;
  color: #0c5505;
  font-weight: 700;
}

.tw-tree-panel-dist {
  font-size: 0.75rem;
  color: #0c5505;
  opacity: 0.82;
  white-space: nowrap;
}

.tw-tree-panel-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 11rem;
  object-fit: contain;
  background: #efebe9;
}

.tw-tree-panel-photo-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: #efebe9;
  cursor: zoom-in;
  position: relative;
}

.tw-tree-panel-photo-btn:focus-visible {
  outline: 2px solid var(--tw-gold);
  outline-offset: -2px;
}

.tw-tree-panel-photo-hint {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0c5505;
  background: rgba(232, 245, 233, 0.95);
  border-top: 1px solid rgba(93, 64, 55, 0.15);
}

.tw-tree-panel-gallery-count {
  margin: 0;
  padding: 0.25rem 0.7rem 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #0c5505;
}

.tw-photo-lightbox[hidden] {
  display: none !important;
}

.tw-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.tw-photo-lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.tw-photo-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 42rem);
  max-height: min(92vh, 44rem);
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 245, 0.98);
  border: 2px solid #5d4037;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.tw-photo-lb-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(12, 85, 5, 0.9);
  color: var(--tw-gold);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.tw-photo-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.2rem;
  height: 2.8rem;
  border: none;
  border-radius: 8px;
  background: rgba(12, 85, 5, 0.85);
  color: var(--tw-gold);
  font-size: 1.6rem;
  cursor: pointer;
}

.tw-photo-lb-prev { left: 0.35rem; }
.tw-photo-lb-next { right: 0.35rem; }

.tw-photo-lightbox-stage {
  flex: 1 1 auto;
  min-height: 12rem;
  max-height: min(58vh, 28rem);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #263238;
  touch-action: none;
  cursor: grab;
}

.tw-photo-lightbox-stage:active {
  cursor: grabbing;
}

.tw-photo-lb-img {
  max-width: 100%;
  max-height: min(58vh, 28rem);
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.tw-photo-lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #e8f5e9;
  border-top: 1px solid rgba(93, 64, 55, 0.15);
}

.tw-photo-lb-zoom-btn {
  min-width: 2rem;
  height: 2rem;
  border: 1px solid rgba(12, 85, 5, 0.45);
  border-radius: 8px;
  background: #fff;
  color: #1b5e20;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.tw-photo-lb-counter {
  min-width: 3.5rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #33691e;
}

.tw-photo-lb-caption {
  margin: 0;
  padding: 0.45rem 0.75rem 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #37474f;
  max-height: 4.5rem;
  overflow-y: auto;
}

.tw-photo-lb-thumbs {
  display: flex;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem 0.6rem;
  overflow-x: auto;
  background: #f1f8e9;
  border-top: 1px solid rgba(93, 64, 55, 0.12);
}

.tw-photo-lb-thumb {
  flex: 0 0 auto;
  width: 3.4rem;
  height: 2.6rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #efebe9;
}

.tw-photo-lb-thumb--active {
  border-color: var(--tw-gold);
  box-shadow: 0 0 0 1px #0c5505;
}

.tw-photo-lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-tree-panel-meta {
  margin: 0;
  padding: 0.5rem 0.7rem 0.25rem;
  color: #0c5505;
  font-size: 0.78rem;
}

.tw-tree-panel-note {
  margin: 0;
  padding: 0 0.7rem 0.5rem;
  color: #0c5505;
  opacity: 0.9;
  font-size: 0.78rem;
  max-height: 5.5rem;
  overflow-y: auto;
}

.tw-tree-panel-link {
  display: block;
  margin: 0 0.7rem 0.65rem;
  padding: 0.4rem 0.55rem;
  text-align: center;
  background: var(--tw-green);
  color: var(--tw-gold);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}

.tw-tree-panel-link:hover {
  filter: brightness(1.08);
}

@media (max-width: 768px), (pointer: coarse) {
  .tw-tree-panel {
    right: 0;
    left: auto;
    bottom: auto;
    top: 42%;
    width: auto;
    max-height: none;
    transform: translateY(-50%);
  }

  .tw-tree-panel-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    max-width: 2.75rem;
    padding: 0.7rem 0.4rem;
    margin: 0;
    border: 2px solid rgba(233, 233, 68, 0.55);
    border-right: none;
    border-radius: 12px 0 0 12px;
    background: rgba(12, 85, 5, 0.94);
    color: var(--tw-gold);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    cursor: pointer;
    box-shadow: -3px 2px 14px rgba(0, 0, 0, 0.38);
    pointer-events: auto;
    touch-action: manipulation;
  }

  .tw-tree-panel-tab:focus-visible {
    outline: 2px solid var(--tw-gold);
    outline-offset: 2px;
  }

  .tw-tree-panel-drawer {
    position: absolute;
    right: 100%;
    top: 50%;
    width: min(calc(100vw - 9.5rem), 18rem);
    max-height: min(52vh, 24rem);
    transform: translateY(-50%) translateX(108%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.22s ease, visibility 0.28s;
  }

  .tw-tree-panel--open .tw-tree-panel-drawer {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .tw-tree-panel-close {
    display: block;
  }
}

.tw-hud-near {
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: calc(100% - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tw-hint {
  position: absolute;
  bottom: 3.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  font-size: 0.78rem;
  opacity: 0.75;
  text-align: center;
  pointer-events: none;
}

.tw-status {
  color: #ffb4b4;
  margin-top: 1rem;
}

.tw-room-soon {
  margin: 1rem 0 0;
  max-width: 22rem;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.45;
}

.tw-minimap-wrap {
  position: absolute;
  top: 3.2rem;
  right: 0.65rem;
  z-index: 18;
  pointer-events: none;
  border: 2px solid rgba(233, 233, 68, 0.45);
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  background: rgba(8, 30, 8, 0.55);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.tw-clock-panel {
  position: relative;
  pointer-events: auto;
  border-top: 1px solid rgba(233, 233, 68, 0.25);
  padding: 0.2rem 0.15rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tw-clock {
  display: block;
  width: 112px;
  height: 112px;
  touch-action: none;
  cursor: grab;
}

.tw-clock:active {
  cursor: grabbing;
}

.tw-clock-reset {
  margin-top: 0.15rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1;
  border: 1px solid rgba(233, 233, 68, 0.45);
  border-radius: 999px;
  background: rgba(12, 85, 5, 0.85);
  color: var(--tw-gold);
  cursor: pointer;
}

.tw-clock-reset:hover {
  filter: brightness(1.08);
}

.tw-clock-panel--readonly .tw-clock {
  pointer-events: none;
  opacity: 0.78;
  cursor: default;
}

.tw-clock-panel--readonly .tw-clock-reset {
  display: none;
}

.tw-intro-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 16;
  margin: 0;
  padding: 0.65rem 1.1rem;
  background: rgba(8, 30, 8, 0.82);
  color: var(--tw-gold);
  border: 2px solid rgba(233, 233, 68, 0.5);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.tw-minimap {
  display: block;
  width: 112px;
  height: 112px;
}

.tw-touch-controls {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.tw-joystick,
.tw-lookpad {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  pointer-events: auto;
  touch-action: none;
}

.tw-joystick {
  left: max(0.75rem, env(safe-area-inset-left));
  width: 112px;
  height: 112px;
}

.tw-joystick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(12, 85, 5, 0.55);
  border: 2px solid rgba(233, 233, 68, 0.4);
}

.tw-joystick-stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(233, 233, 68, 0.85);
  border: 2px solid rgba(12, 85, 5, 0.9);
  transform: translate(0, 0);
  will-change: transform;
}

.tw-lookpad {
  right: max(0.75rem, env(safe-area-inset-right));
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(12, 85, 5, 0.35);
  border: 2px dashed rgba(233, 233, 68, 0.35);
}

.tw-touch-controls[hidden],
.tw-minimap-wrap[hidden],
.tw-intro-hint[hidden] {
  display: none !important;
}

.tw-picker.gaming-fr-lobby {
  flex: 1;
  overflow-y: auto;
  padding: 64px 16px 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Stanza multiplayer — tema verde/oro del gioco (non bianco Piove frutta) */
.tw-app .tw-picker #tw-room.gaming-fr-room {
  width: min(100%, 22rem);
  margin: 0 0 1.25rem;
  padding: 1rem 1.05rem;
  background: rgba(8, 30, 8, 0.78);
  border: 2px solid rgba(233, 233, 68, 0.42);
  border-radius: 12px;
  color: #f5f5dc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.tw-app .tw-picker .gaming-fr-room-code {
  color: var(--tw-gold);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.tw-app .tw-picker .gaming-fr-room-code strong {
  letter-spacing: 0.06em;
}

.tw-app .tw-picker .gaming-fr-host-hint,
.tw-app .tw-picker .gaming-fr-join-label,
.tw-app .tw-picker .gaming-fr-status {
  color: rgba(245, 245, 220, 0.92);
}

/* Popup scelta colore omino — sfondo bianco (gaming.css): testo verde scuro forzato */
.tw-app .gaming-fr-basket-colors-label {
  color: #0c5505 !important;
}

.tw-app .gaming-fr-basket-colors-hint {
  color: #1b5e20 !important;
}

.tw-app .gaming-fr-basket-colors-hint--err {
  color: #b71c1c !important;
}

.tw-app .gaming-fr-basket-colors-timer {
  color: #0c5505 !important;
}

.tw-app .gaming-fr-basket-colors-timer--low {
  color: #b71c1c !important;
}

.tw-app .gaming-fr-join-overlay {
  position: fixed;
  inset: 0;
  z-index: 10150;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 24px;
  background: rgba(0, 0, 0, 0.58);
  pointer-events: auto;
}

.tw-app .gaming-fr-join-overlay[hidden] {
  display: none !important;
}

.tw-app .gaming-fr-join-overlay-inner {
  width: min(420px, 100%);
  max-height: min(70vh, 520px);
  overflow: auto;
}

.tw-app .gaming-fr-waiting-join {
  margin-top: 0;
  padding: 18px 16px;
  background: rgba(255, 253, 245, 0.98);
  border: 2px solid rgba(12, 85, 5, 0.45);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.tw-app .gaming-fr-waiting-join p {
  margin: 0;
  color: #0c5505 !important;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
}

.tw-app .gaming-fr-overlay-inner p,
.tw-app #twMatchNoticeMsg {
  margin: 0 0 16px;
  color: #0c5505 !important;
  font-weight: 600;
  line-height: 1.45;
}

.tw-app .gaming-roster-sheet {
  color: #0c5505;
}

.tw-app .gaming-roster-sheet .gaming-roster-sheet-title,
.tw-app .gaming-roster-sheet .gaming-roster-name,
.tw-app .gaming-roster-sheet .gaming-roster-gates-title,
.tw-app .gaming-roster-sheet .gaming-roster-gates-name,
.tw-app .gaming-roster-sheet .gaming-roster-room-meta {
  color: #0c5505 !important;
}

.tw-app .gaming-roster-sheet .gaming-roster-channel,
.tw-app .gaming-roster-sheet .gaming-roster-gates-status {
  color: #1b5e20 !important;
}

.tw-app .gaming-roster-sheet-close {
  color: #0c5505 !important;
}

.tw-app .gaming-fr-basket-colors--overlay {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 48;
  width: min(92vw, 22rem);
  margin: 0;
  padding: 1rem 0.85rem;
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  background: rgba(255, 253, 245, 0.98);
  border: 2px solid rgba(12, 85, 5, 0.35);
}

.tw-app .gaming-fr-basket-colors--overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(8, 24, 8, 0.42);
  z-index: -1;
  pointer-events: none;
}

.tw-app .tw-picker .gaming-fr-join-row input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(233, 233, 68, 0.45);
  color: #f5f5dc;
  border-radius: 8px;
}

.tw-app .tw-picker .gaming-btn-ghost {
  border: 1px solid rgba(233, 233, 68, 0.45);
  color: var(--tw-gold);
  background: rgba(12, 85, 5, 0.55);
  border-radius: 8px;
}

.tw-app .tw-picker .gaming-btn-ghost:hover {
  filter: brightness(1.08);
}

.tw-app .tw-picker .gaming-fr-basket-colors {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(233, 233, 68, 0.25);
}

.tw-app .tw-picker .gaming-fr-basket-color-btn {
  border-color: rgba(233, 233, 68, 0.45);
}

/* Menu ☰ — drawer coerente col tema */
.tw-app .gaming-fr-drawer-panel {
  background: linear-gradient(180deg, #143814 0%, var(--tw-bg) 100%);
  color: #f5f5dc;
  border-left: 2px solid rgba(233, 233, 68, 0.45);
}

.tw-app .gaming-fr-drawer-title {
  color: var(--tw-gold);
}

.tw-app .gaming-fr-drawer-link,
.tw-app .gaming-fr-drawer-account-name,
.tw-app .gaming-fr-drawer-account-points {
  color: #f5f5dc;
}

.tw-app .gaming-fr-drawer .gaming-btn-ghost {
  border-color: rgba(233, 233, 68, 0.45);
  color: var(--tw-gold);
  background: rgba(12, 85, 5, 0.45);
}

.tw-app .gaming-fr-room-code {
  color: var(--tw-gold);
}

.tw-picker.gaming-fr-lobby h2 {
  color: #fff;
  margin-top: 1rem;
}

.tw-picker.gaming-fr-lobby > p {
  color: rgba(255, 255, 255, 0.9);
}

.tw-room-join-other {
  margin-top: 1rem;
}

#tw-room-copy-code {
  margin: 0.35rem 0 0.75rem;
}

.tw-app .gaming-fr-menu-fab {
  z-index: 1200;
}

.tw-room-soon,
.tw-room-status[hidden],
.tw-room-lobby[hidden] {
  display: none !important;
}

.tw-room {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(233, 233, 68, 0.35);
  border-radius: 8px;
  background: rgba(12, 85, 5, 0.35);
}

.tw-room h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--tw-gold);
}

.tw-room-idle,
.tw-room-lobby {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tw-room-join {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tw-room-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.tw-room-input {
  flex: 1 1 120px;
  min-width: 100px;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(233, 233, 68, 0.45);
  background: rgba(0, 0, 0, 0.25);
  color: #f5f5dc;
  font: inherit;
  text-transform: uppercase;
}

.tw-btn--secondary {
  background: rgba(233, 233, 68, 0.15);
  border: 1px solid var(--tw-gold);
}

.tw-btn--ghost {
  background: transparent;
  border: 1px solid rgba(233, 233, 68, 0.35);
}

.tw-room-hint {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.tw-room-status {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
}

.tw-room-status--err {
  color: #ff8a80;
}

.tw-room-status--ok {
  color: #a5d6a7;
}

.tw-terrain-btn--selected {
  outline: 2px solid var(--tw-gold);
  outline-offset: 2px;
}

.tw-terrain-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .tw-hint::after {
    content: 'Joystick: muovi · Pad destro: guarda';
    display: block;
  }

  .tw-minimap {
    width: 96px;
    height: 96px;
  }
}

@media (min-width: 769px) {
  .tw-hint::after {
    content: 'Clicca per catturare il mouse · WASD · Shift corsa';
    display: block;
  }
}
