* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1a1f; font-family: 'Poppins', system-ui, sans-serif; color: #fff; }
canvas { display: block; touch-action: none; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#start {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #ff5fa2 0%, #8e2de2 55%, #2b0f4c 100%);
}
#start .card {
  width: 100%; max-width: 380px; text-align: center; padding: 32px 24px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 24px;
  backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.heart { font-size: 54px; animation: beat 1.2s infinite; }
@keyframes beat { 0%,100% { transform: scale(1);} 15% { transform: scale(1.18);} 30% { transform: scale(1);} 45% { transform: scale(1.12);} }
#start h1 { font-family: 'Dancing Script', cursive; font-size: 48px; margin: 4px 0; }
#start p { margin: 4px 0 14px; opacity: .9; }
.lbl { font-weight: 600; margin-top: 18px !important; }
.roles { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.role { flex: 1; padding: 12px; border-radius: 14px; border: 2px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 16px; }
.role.on { background: #fff; color: #c2185b; border-color: #fff; font-weight: 600; }
#enter { width: 100%; padding: 15px; border: 0; border-radius: 16px; font-size: 18px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, #ff4f9a, #ff7eb3); box-shadow: 0 8px 24px rgba(255,79,154,.5); }
#enter:disabled { opacity: .5; }
#loading { font-size: 13px; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud button { pointer-events: auto; }
#topbar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
#topbar button, #actions button {
  border: 0; border-radius: 999px; padding: 10px 16px; font-size: 15px; font-weight: 600;
  background: rgba(255,255,255,.92); color: #c2185b; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
#btnMusic.off { opacity: .5; }
#topbar button.on { background: #ff4f9a; color: #fff; }
#status { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px;
  background: rgba(194,24,91,.9); font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .4s; white-space: nowrap; }
#status.show { opacity: 1; }
#actions { position: absolute; right: 16px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
#actions button.on { background: #ff4f9a; color: #fff; }
#help { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 12px; opacity: .75;
  background: rgba(0,0,0,.4); padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
#joy { display: none; position: absolute; left: 24px; bottom: 28px; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); pointer-events: auto; touch-action: none; }
#knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.85); }
#lockHint { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); padding: 12px 20px; border-radius: 14px;
  background: rgba(0,0,0,.55); font-weight: 600; font-size: 15px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
@media (pointer: coarse) {
  #joy { display: block; }
  #help, #lockHint { display: none; }
}

#photoView, #invite { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(10,0,20,.75); backdrop-filter: blur(6px); }
.pcard { background: #fff; color: #333; border-radius: 20px; padding: 18px; text-align: center; max-width: 440px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.pcard img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #f5f5f5; }
.pcard h3 { font-family: 'Dancing Script', cursive; font-size: 30px; color: #c2185b; margin: 10px 0; }
.pcard button { border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 600; background: #ff4f9a; color: #fff; font-size: 15px; }
#pvQuote { font-family: 'Dancing Script', cursive; font-size: 24px; color: #6a1b4d; margin: -4px 0 14px; line-height: 1.3; }
.pcard input { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #ddd; font-size: 13px; margin: 8px 0; }
.pcard .row { display: flex; gap: 8px; justify-content: center; }
.pcard .small { font-size: 12px; color: #888; }
