/* REWIND CLUB 3D — интерфейс поверх сцены (стили карточки и поиска — из site.css) */
body.w3d { margin: 0; overflow: hidden; background: #100c14; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; }

.hud-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px; pointer-events: none; z-index: 5; }
.hud-top > * { pointer-events: auto; }
.hud-title { font-family: var(--script); font-size: 30px; color: #ffe6f5; text-shadow: 0 0 6px #ffa0d2, 0 0 16px var(--neon); pointer-events: none; }
.hud-right { display: flex; gap: 8px; }
.hud-btn { font-family: var(--cond); font-weight: 900; font-size: 14px; letter-spacing: .05em; color: #fff; background: rgba(20,16,26,.72);
  border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 9px 12px; cursor: pointer; text-decoration: none; backdrop-filter: blur(4px); }
.hud-btn:hover { background: rgba(60,50,72,.85); }

.crosshair { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255,255,255,.75); box-shadow: 0 0 4px #000; pointer-events: none; z-index: 3; }
.look { position: fixed; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4; max-width: 88vw;
  font-family: var(--cond); font-weight: 900; font-size: 17px; text-transform: uppercase; color: #fff; cursor: pointer;
  background: rgba(20,16,26,.82); border: 1px solid rgba(255,216,74,.5); border-radius: 12px; padding: 10px 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look em { font-family: var(--marker); font-style: normal; text-transform: none; color: #ffd84a; margin-left: 6px; }
.look small { display: block; font-size: 11px; letter-spacing: .1em; color: #b9aec8; }
.mike-say { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 4; max-width: min(420px, 86vw);
  background: #fff; color: #1a1820; border-radius: 16px; padding: 12px 16px; font-family: var(--cond); font-weight: 700; font-size: 17px; line-height: 1.25;
  box-shadow: 0 8px 26px rgba(0,0,0,.5); pointer-events: none; }
.mike-say b { display: block; font-size: 12px; letter-spacing: .12em; color: #c8283a; }

.joy { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; z-index: 4; pointer-events: none;
  background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.28); }
.joy { transition: opacity .25s ease; }
.joy.rest { opacity: .55; transition: opacity .25s ease, left .25s ease, top .25s ease; }
.joy.rest .knob { animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: translate(0, 0); } 25% { transform: translate(0, -22px); } 40% { transform: translate(0, -22px); } }
.joy-label { position: absolute; left: 0; right: 0; bottom: -24px; text-align: center; font-family: var(--cond); font-weight: 900;
  font-size: 13px; letter-spacing: .14em; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.joy:not(.rest) .joy-label { display: none; }
.hint-look { position: fixed; right: 18px; bottom: max(120px, calc(env(safe-area-inset-bottom) + 110px)); z-index: 4; pointer-events: none;
  width: 140px; text-align: center; color: #fff; font-family: var(--cond); font-weight: 700; font-size: 14px; line-height: 1.25;
  background: rgba(20,16,26,.55); border: 2px dashed rgba(255,255,255,.45); border-radius: 18px; padding: 12px 10px; transition: opacity .5s ease; }
.hint-look b { display: block; font-size: 16px; font-weight: 900; letter-spacing: .04em; }
.hint-look .hand { display: block; font-size: 30px; animation: swipe 2.2s ease-in-out infinite; }
@keyframes swipe { 0%, 100% { transform: translateX(18px); } 50% { transform: translateX(-18px); } }
.keys { position: fixed; left: 18px; bottom: 22px; z-index: 4; pointer-events: none; text-align: center; transition: opacity .6s ease; }
.keys .krow { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.keys kbd { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 9px; font-family: var(--cond); font-weight: 900;
  font-size: 20px; color: #2a2030; background: linear-gradient(#fffdf6, #e6dccb); border: 1px solid rgba(0,0,0,.25);
  box-shadow: 0 4px 0 #a8977e, 0 6px 14px rgba(0,0,0,.3); transition: transform .08s ease, box-shadow .08s ease, background .08s ease; }
.keys kbd.on { transform: translateY(3px); box-shadow: 0 1px 0 #a8977e; background: #ffd84a; }
.keys p { margin: 6px 0 0; font-family: var(--cond); font-size: 13px; font-weight: 700; color: #fff; background: rgba(20,16,26,.6);
  border-radius: 8px; padding: 5px 9px; }
.fadeout { opacity: 0 !important; }
.joy .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 2px 10px rgba(0,0,0,.4); }

.fade { position: fixed; inset: 0; z-index: 8; background: #0b0910; opacity: 0; pointer-events: none; transition: opacity .32s ease;
  display: grid; place-items: center; }
.fade.on { opacity: 1; }
.fade span { font-family: "Courier New", monospace; font-weight: 700; font-size: 34px; color: #e9f2ff; letter-spacing: .1em; text-shadow: 2px 0 #ff2f6a, -2px 0 #2fd4ff; }

.start { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px; background: radial-gradient(120% 80% at 50% 30%, rgba(42,35,51,.92), rgba(12,10,16,.97)); }
.start[hidden] { display: none; }
.start-sub { color: #cfc6da; font-size: 18px; max-width: 420px; line-height: 1.4; margin: 14px 0 24px; font-family: var(--cond); font-weight: 600; }
.start-sub b { color: #fff; }
.btn.big { font-size: 20px; padding: 16px 34px; }
.btn[disabled] { opacity: .6; cursor: default; }
.controls { color: #8f86a0; font-family: var(--cond); font-weight: 700; font-size: 14px; margin: 22px 0 0; max-width: 360px; line-height: 1.4; }
.controls.touch { display: none; }
@media (pointer: coarse) { .controls.touch { display: block; } .controls.mouse { display: none; } .crosshair { display: none; } }

.search { position: fixed; inset: 0; z-index: 7; background: rgba(8,6,12,.8); backdrop-filter: blur(3px); padding: 90px 16px 0; }
.search[hidden] { display: none; }
.search .x { position: absolute; right: 14px; top: 14px; background: none; border: 0; color: #fff; font-size: 34px; cursor: pointer; }
.modal { z-index: 10; }

/* узкое окно с мышью: подпись кассеты справа, чтобы не наезжать на клавиши WASD слева */
@media (max-width: 760px) {
  body.mouse .look { left: auto; right: 14px; transform: none; max-width: calc(100vw - 220px); }
}

/* телефон: подпись кассеты — справа внизу, джойстик — слева внизу, не пересекаются */
@media (pointer: coarse) {
  .look { left: auto; right: 12px; transform: none; max-width: calc(100vw - 170px); bottom: max(18px, env(safe-area-inset-bottom)); }
  .joy-label { bottom: auto; top: -22px; }
}

/* узкий телефон: панель в одну строку — без надписи-логотипа, кнопки не переносятся */
.hud-btn { white-space: nowrap; }
@media (max-width: 430px) {
  .hud-title { display: none; }
  .hud-btn { padding: 9px 11px; }
}

/* счётчик найденных отсылок */
.hud-left { display: flex; gap: 8px; align-items: center; }
.eggs { pointer-events: none; font-family: var(--cond); font-weight: 900; font-size: 14px; letter-spacing: .04em; color: #fff;
  background: rgba(20,16,26,.72); border: 1px solid rgba(255,216,74,.5); border-radius: 999px; padding: 7px 11px; white-space: nowrap; }
.eggs b { color: #ffd84a; }
.eggs.pop { animation: eggpop .5s ease; }
@keyframes eggpop { 50% { transform: scale(1.25); background: rgba(255,216,74,.35); } }
