/* gym.css — the "Besetztes Gym" meeting-platform visual layer.
   2.5D atmospheric room (not a real mesh) + lobby + HUD. Decay meets feier. */
.gy-lobby, .gy-room-view { min-height: 100vh; }

/* ============================ LOBBY ============================ */
.gy-lobby {
  padding: var(--section-pad-y) var(--section-pad-x);
  max-width: 1000px; margin: 0 auto;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255,122,0,0.07), transparent 60%),
    radial-gradient(90% 50% at 80% 110%, rgba(255,0,170,0.06), transparent 60%);
}
.gy-lobby-head { margin-bottom: var(--space-8); }
.gy-lobby-title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1.02; margin: var(--space-3) 0 var(--space-4); }
.gy-lobby-sub { color: var(--text-dim); font-size: var(--fs-md); max-width: 56ch; line-height: 1.5; margin: 0; text-wrap: pretty; }

.gy-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); }
.gy-door {
  text-align: left; cursor: pointer; color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: var(--card-pad);
  display: flex; flex-direction: column; gap: var(--space-2);
  position: relative; overflow: hidden;
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
/* a faint "door seam" of neon down the left edge — light from the room behind */
.gy-door::before { content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 3px; background: var(--border-soft); transition: background var(--dur-base); }
.gy-door:hover { transform: translateY(-3px); border-color: var(--border-soft); }
.gy-door.live::before { background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.gy-door.live:hover { box-shadow: var(--glow-cyan); border-color: transparent; }
.gy-door-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 11px; }
.gy-door-lock { font-size: 14px; }
.gy-door-live { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.gy-door-empty { color: var(--text-muted); }
.gy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); display: inline-block; }
.gy-dot.live { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.gy-door-name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.gy-door-sub { font-size: var(--fs-sm); color: var(--text-dim); }
.gy-door-cta { margin-top: var(--space-3); font-family: var(--font-mono); font-size: 12px; color: var(--accent); }

/* Modal */
.gy-modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(5,5,5,0.78); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.gy-modal { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-xl); padding: var(--space-7); width: 100%; max-width: 380px; box-shadow: var(--glow-soft); }
.gy-modal-title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl); margin: var(--space-2) 0 var(--space-2); }
.gy-modal-sub { color: var(--text-dim); font-size: var(--fs-sm); margin: 0 0 var(--space-5); }
.gy-modal-input { width: 100%; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 13px 14px; color: var(--text); font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.1em; margin-bottom: var(--space-5); }
.gy-modal-input:focus { outline: var(--focus-ring); outline-offset: 2px; box-shadow: var(--focus-shadow); }
.gy-modal-row { display: flex; gap: var(--space-3); justify-content: flex-end; }

/* ============================ AVATAR ============================ */
.gy-av { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gy-av-cap { width: 38px; height: 56px; border-radius: var(--radius-full); position: relative; display: flex; justify-content: center; align-items: flex-start; }
.gy-av-md .gy-av-cap { width: 38px; height: 56px; }
.gy-av-sm .gy-av-cap { width: 26px; height: 38px; }
.gy-av-ring { position: absolute; top: -10px; width: 22px; height: 22px; }
.gy-av-sm .gy-av-ring { top: -7px; width: 15px; height: 15px; }
.gy-av-stick { position: absolute; right: -12px; top: 6px; font-size: 15px; }
.gy-av-label { font-family: var(--font-mono); font-size: 11px; color: var(--text); white-space: nowrap; display: flex; align-items: center; gap: 4px; text-shadow: 0 1px 4px #000; }
.gy-av-mic { font-size: 9px; }
.gy-av.speaking .gy-av-label { color: #fff; }

/* ============================ SCENE ============================ */
/* An ENCLOSING room: material back wall (top) meets a vanishing-point floor
   (bottom) at the horizon (~50%). Decay (concrete/Sprossenwand/cracks/pipes/
   posters) meets feier (mirror ball + speckles + wash beams + haze). */
.gy-stage { position: relative; }
.gy-scene { position: relative; height: clamp(440px, 68vh, 680px); overflow: hidden; background: #060606; perspective: 560px; perspective-origin: 50% 44%; }
.gy-room { position: absolute; inset: 0; transform-style: preserve-3d; }

/* ---- BACK WALL (above horizon) — concrete + decay ---- */
.gy-wall {
  position: absolute; top: 0; left: 0; right: 0; height: 50%; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 118%, rgba(255,0,170,0.13), transparent 56%),
    radial-gradient(70% 60% at 10% 16%, rgba(255,122,0,0.06), transparent 60%),
    radial-gradient(60% 60% at 90% 26%, rgba(0,255,255,0.06), transparent 60%),
    radial-gradient(42% 55% at 28% 78%, rgba(0,0,0,0.55), transparent 72%),
    radial-gradient(34% 44% at 72% 60%, rgba(0,0,0,0.5), transparent 72%),
    linear-gradient(#1d1b16, #161410 58%, #100f0c);
}
/* fractal-noise concrete grain */
.gy-wall-grain {
  position: absolute; inset: 0; opacity: 0.5; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
/* cracks — thin pale fractures */
.gy-crack { position: absolute; background: linear-gradient(90deg, transparent, rgba(210,210,200,0.18), transparent); }
.gy-crack-1 { left: 46%; top: 4%; width: 2px; height: 40%; transform: rotate(8deg); filter: blur(0.3px); }
.gy-crack-2 { left: 80%; top: 30%; width: 1.5px; height: 52%; transform: rotate(-12deg); }
/* Sprossenwand — vertical posts (spans) + horizontal rungs (bg) */
.gy-sprossen {
  position: absolute; right: 5%; top: 12%; width: 158px; height: 78%;
  display: flex; justify-content: space-between; opacity: 0.62;
  background: repeating-linear-gradient(to bottom, rgba(150,102,55,0.42) 0 3px, transparent 3px 26px);
}
.gy-sprossen span { width: 7px; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, rgba(70,45,22,0.7), rgba(165,112,62,0.6) 45%, rgba(60,38,18,0.7)); }
/* exposed pipe + drooping cable */
.gy-pipe { position: absolute; left: 3.5%; top: -2%; width: 13px; height: 104%; border-radius: 5px;
  background: linear-gradient(90deg, #0c0c0c, #3a3a3a 36%, #6d6d6d 50%, #2c2c2c 70%, #0c0c0c); opacity: 0.8; box-shadow: 2px 0 8px rgba(0,0,0,0.6); }
.gy-cable { position: absolute; left: 8%; top: 22%; width: 40%; height: 46px; border: none; border-bottom: 2px solid rgba(15,15,15,0.95); border-radius: 0 0 70% 90%; opacity: 0.7; }
/* posters + stickers (generic — no real flyers) */
.gy-poster { position: absolute; background: #0b0b0b; border: 1px solid rgba(255,255,255,0.14); display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 12px rgba(0,0,0,0.5); }
.gy-poster span { font-family: var(--font-display); font-weight: 700; line-height: 0.88; text-align: center; color: var(--text); }
.gy-poster-1 { left: 19%; top: 16%; width: 52px; height: 70px; transform: rotate(-5deg); }
.gy-poster-1 span { font-size: 15px; color: var(--accent); text-shadow: 0 0 8px rgba(0,255,255,0.5); }
.gy-poster-2 { left: 29%; top: 22%; width: 44px; height: 56px; transform: rotate(5deg); }
.gy-poster-2 span { font-size: 24px; }
.gy-sticker { position: absolute; font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: var(--radius-full); white-space: nowrap; }
.gy-sticker-1 { left: 60%; top: 26%; background: var(--accent2); color: #000; font-weight: 600; transform: rotate(-7deg); }
.gy-sticker-2 { left: 50%; top: 38%; background: #0d0d0d; color: var(--accent); border: 1px solid var(--accent); transform: rotate(5deg); }
.gy-tag { position: absolute; font-family: var(--font-display); font-weight: 700; opacity: 0.6; }
.gy-tag-1 { left: 6%; top: 40%; color: var(--accent); font-size: 14px; transform: rotate(-3deg); text-shadow: 0 0 10px rgba(0,255,255,0.5); }
.gy-tag-2 { left: 67%; top: 9%; color: var(--accent2); font-size: 20px; transform: rotate(4deg); text-shadow: 0 0 12px rgba(255,0,170,0.5); letter-spacing: 0.04em; }
.gy-neonstrip { position: absolute; left: 8%; right: 36%; top: 7%; height: 4px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 14px var(--accent), 0 0 40px rgba(0,255,255,0.55); opacity: 0.9; }

/* ---- FLOOR (below horizon) — vanishing-point grid ---- */
.gy-floor {
  position: absolute; left: -25%; right: -25%; bottom: 0; height: 56%;
  transform: rotateX(80deg); transform-origin: bottom center;
  background:
    repeating-linear-gradient(to right, rgba(0,255,255,0.18) 0 1.5px, transparent 1.5px 66px),
    repeating-linear-gradient(to bottom, rgba(0,255,255,0.13) 0 1.5px, transparent 1.5px 66px),
    radial-gradient(46% 60% at 50% 100%, rgba(255,0,170,0.14), transparent 70%),
    #080808;
  -webkit-mask-image: linear-gradient(to top, #000 34%, transparent 92%);
  mask-image: linear-gradient(to top, #000 34%, transparent 92%);
}
/* glowing horizon seam where wall meets floor */
.gy-horizon { position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-1px); z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(0,255,255,0.5), rgba(255,0,170,0.4), transparent);
  box-shadow: 0 0 26px rgba(0,255,255,0.4); }

/* ---- LIGHT: wash beams + haze ---- */
.gy-wash { position: absolute; pointer-events: none; filter: blur(7px); z-index: 1; }
.gy-wash-cyan { left: 4%; top: -2%; width: 40%; height: 86%; background: linear-gradient(to bottom, rgba(0,255,255,0.16), transparent 78%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.gy-wash-magenta { right: 4%; top: -2%; width: 40%; height: 86%; background: linear-gradient(to bottom, rgba(255,0,170,0.15), transparent 78%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.gy-haze { position: absolute; left: 0; right: 0; top: 36%; height: 34%; pointer-events: none; z-index: 2; filter: blur(14px); background: linear-gradient(to bottom, transparent, rgba(150,150,160,0.07) 45%, transparent); }

/* ---- mirror ball + speckles ---- */
.gy-speckles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.gy-speckles span { position: absolute; border-radius: 50%; opacity: 0.7; }
@media (prefers-reduced-motion: no-preference) { .gy-speckles span { animation: speck 3.6s var(--ease) infinite alternate; } }
@keyframes speck { from { opacity: 0.18; transform: scale(0.6); } to { opacity: 0.9; transform: scale(1.1); } }

.gy-ball { position: absolute; top: 4%; left: 50%; width: 60px; height: 60px; transform: translateX(-50%); border-radius: 50%; overflow: hidden; z-index: 3;
  background: radial-gradient(circle at 36% 30%, #ffffff, #a6e3e4 24%, #2f7173 68%, #0a2a2b);
  box-shadow: 0 0 28px rgba(0,255,255,0.4), 0 7px 16px rgba(0,0,0,0.6); }
.gy-ball::before { content: ''; position: absolute; top: -60px; left: 50%; width: 1px; height: 60px; background: rgba(150,150,150,0.5); }
.gy-ball-facets { position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: overlay;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.3) 0 1px, transparent 1px 9px), repeating-linear-gradient(90deg, rgba(0,0,0,0.3) 0 1px, transparent 1px 9px); }
.gy-ball-shine { position: absolute; top: 16%; left: 22%; width: 18px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.85); filter: blur(2px); }
@media (prefers-reduced-motion: no-preference) { .gy-ball { animation: bob 5.5s var(--ease) infinite alternate; } }
@keyframes bob { from { transform: translateX(-50%) translateY(0) rotate(-5deg); } to { transform: translateX(-50%) translateY(6px) rotate(5deg); } }

/* fairy lights string */
.gy-fairy { position: absolute; top: 3%; left: 0; right: 0; height: 22px; z-index: 3; }
.gy-fairy span { position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent3); box-shadow: 0 0 8px var(--accent3); }
.gy-fairy span:nth-child(3n) { background: var(--accent); box-shadow: 0 0 8px var(--accent); top: 9px; }
.gy-fairy span:nth-child(3n+1) { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); top: 5px; }
@media (prefers-reduced-motion: no-preference) { .gy-fairy span { animation: twinkle 2.6s var(--ease) infinite alternate; } .gy-fairy span:nth-child(2n) { animation-delay: 1.1s; } }
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }

/* freaky instrument prompt, standing on the floor */
.gy-instrument { position: absolute; left: 13%; bottom: 16%; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; z-index: 4; }
.gy-instr-glyph { font-size: 36px; filter: drop-shadow(0 0 12px rgba(255,0,170,0.5)); }
.gy-instr-hint { font-family: var(--font-mono); font-size: 10px; color: var(--accent); background: rgba(10,10,10,0.7); padding: 2px 7px; border-radius: var(--radius-full); }

/* people on the floor */
.gy-people { position: absolute; inset: 0; z-index: 4; }
.gy-person { position: absolute; transform-origin: bottom center; }
.gy-shadow { position: absolute; bottom: -7px; left: 50%; width: 44px; height: 11px; transform: translateX(-50%); background: radial-gradient(rgba(0,0,0,0.6), transparent 70%); border-radius: 50%; pointer-events: none; }

.gy-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 5; box-shadow: inset 0 0 150px 50px rgba(0,0,0,0.85); }
.gy-movehint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 6; font-size: 11px; color: var(--text-dim); background: rgba(10,10,10,0.6); padding: 4px 12px; border-radius: var(--radius-full); border: 1px solid var(--border); }

/* ============================ HUD ============================ */
.gy-bar { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); padding: 0 var(--space-5); background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.gy-bar-room { display: flex; align-items: baseline; gap: 9px; }
.gy-bar-name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.gy-bar-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.gy-leave { background: var(--bg-elev); border: 1px solid var(--border-soft); color: var(--text); border-radius: var(--radius-sm); padding: 9px 14px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.gy-leave:hover { border-color: var(--accent); color: var(--accent); }

.gy-presence { position: absolute; top: var(--space-4); right: var(--space-4); width: 200px; background: rgba(16,16,16,0.82); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); z-index: 5; }
.gy-presence-list { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.gy-pr { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; }
.gy-pr-cap { width: 10px; height: 14px; border-radius: var(--radius-full); flex: none; }
.gy-pr-name { color: var(--text); flex: 1; }
.gy-pr-state { color: var(--text-dim); font-size: 10px; }
.gy-pr.speaking .gy-pr-name { color: var(--accent); }
.gy-pr.speaking .gy-pr-state { color: var(--accent); }

.gy-flash { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl); color: #fff; text-shadow: var(--neon-ink-magenta); z-index: 8; animation: pop var(--dur-slow) var(--ease); pointer-events: none; }
@keyframes pop { from { opacity: 0; transform: translate(-50%,-40%) scale(0.9); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

/* controls strip */
.gy-controls { padding: var(--space-4) var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.gy-voice { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.gy-mic { background: var(--accent); color: #000; border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 11px 18px; font-family: var(--font-mono); font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: var(--glow-cyan); }
.gy-mic.muted { background: var(--bg-elev); color: var(--text-dim); border-color: var(--border-soft); box-shadow: none; }
.gy-voice-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.gy-chip { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); border: 1px solid var(--border-soft); border-radius: var(--radius-full); padding: 5px 11px; }
.gy-chip.hot { color: var(--accent2); border-color: var(--accent2); }

.gy-dock-head { margin-bottom: var(--space-3); }
.gy-dock-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.gy-ritual { position: relative; text-align: left; cursor: pointer; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; gap: 3px; color: var(--text); transition: all var(--dur-fast) var(--ease); }
.gy-ritual:hover { border-color: var(--border-soft); transform: translateY(-2px); }
.gy-ritual.on { border-color: var(--accent); box-shadow: var(--glow-cyan); }
.gy-ritual-glyph { font-size: 24px; }
.gy-ritual-label { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-base); }
.gy-ritual-note { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.gy-energy { display: block; height: 5px; background: var(--bg-soft); border-radius: var(--radius-full); overflow: hidden; margin-top: 6px; }
.gy-energy-fill { display: block; height: 100%; background: var(--accent3); box-shadow: 0 0 8px var(--accent3); transition: width var(--dur-slow) var(--ease); }

.btn.primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #fff; color: #000; }

/* ---- movement: pan smoothing (umsehen) ---- */
.gy-scene { cursor: grab; }
@media (prefers-reduced-motion: no-preference) { .gy-room { transition: transform 0.12s linear; } }

/* ---- Push-to-Talk ---- */
.gy-ptt { background: var(--bg-elev); border: 1px solid var(--border-soft); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 16px; font-family: var(--font-mono); font-weight: 600;
  font-size: 13px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.gy-ptt.on { background: var(--accent2); color: #000; border-color: var(--accent2); box-shadow: var(--glow-magenta); }

/* ---- text chat (overlay, bottom-left of the stage) ---- */
.gy-chat { position: absolute; left: var(--space-4); bottom: var(--space-4); width: 264px; max-height: 48%;
  display: flex; flex-direction: column; background: rgba(16,16,16,0.86); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-3); z-index: 6; }
.gy-chat-head { margin-bottom: var(--space-2); }
.gy-chat-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; }
.gy-msg { display: flex; flex-direction: column; gap: 1px; }
.gy-msg.me { align-items: flex-end; text-align: right; }
.gy-msg-who { font-family: var(--font-mono); font-size: 10px; }
.gy-msg-text { color: var(--text); font-size: 12px; line-height: 1.32; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 8px; max-width: 100%; word-break: break-word; }
.gy-msg.me .gy-msg-text { background: rgba(0,255,255,0.08); border-color: rgba(0,255,255,0.3); }
.gy-chat-input { display: flex; gap: 6px; margin-top: var(--space-2); }
.gy-chat-input input { flex: 1 1 auto; min-width: 0; background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); font-family: var(--font-sans); font-size: 13px; }
.gy-chat-input input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-shadow); }
.gy-chat-input button { background: var(--accent); color: #000; border: none; border-radius: var(--radius-sm);
  padding: 0 13px; font-weight: 700; cursor: pointer; }

@media (max-width: 760px) {
  .gy-presence { position: static; width: auto; margin: var(--space-4) var(--space-5) 0; }
  .gy-chat { position: static; width: auto; max-height: 190px; margin: var(--space-4) var(--space-5) 0; }
}
