.p-hud { display:none; }
@media (max-width:1023px), (max-width:1000px) and (max-height:500px) {
  .hud-prototype,.hud-prototype body { overflow:clip; }
  .hud-prototype .lab-topbar,.hud-prototype .lab-mission,.hud-prototype .lab-tools,
  .hud-prototype .lab-hint,.hud-prototype #say-open,.hud-prototype #dev { display:none!important; }
  .hud-prototype .lab-bottom { padding-bottom:78px; }
  .hud-prototype .lab-prompt { max-width:calc(100vw - 32px); font-size:.85rem; }
  .hud-prototype .lab-visor__label { bottom:110px; left:16px; font-size:.65rem; }
  .hud-prototype .lab-emote-fan { z-index:82; right:16px; bottom:110px; max-width:calc(100vw - 32px); }
  .hud-prototype .lab-emote-fan button { width:40px; height:44px; }
  .p-hud { display:block; position:fixed; inset:0; pointer-events:none; z-index:60; }
  .p-hud button,.p-hud a { pointer-events:auto; -webkit-tap-highlight-color:transparent; }
  .p-hud button { cursor:pointer; font-family:'Outfit',sans-serif; }
  .p-hud button:focus-visible,.p-hud a:focus-visible { outline:3px dashed var(--fire); outline-offset:4px; }
  .p-header { position:absolute; top:calc(var(--safe-top) + 16px); left:calc(var(--safe-left) + 16px); right:calc(var(--safe-right) + 16px); display:flex; align-items:center; justify-content:space-between; z-index:2; }
  .p-header>img { width:106px; height:44px; object-fit:contain; }
  .p-menu-button,.p-talk { display:flex; align-items:center; justify-content:center; gap:9px; min-height:52px; padding:0 16px; background:var(--paper); color:var(--ink); border:3px solid var(--ink); border-radius:var(--radius-button); box-shadow:3px 4px 0 var(--ink); font-size:16px; font-weight:650; }
  .p-hud svg { width:23px; height:23px; flex:none; }
  .p-objective { position:absolute; top:calc(var(--safe-top) + 84px); left:calc(var(--safe-left) + 16px); display:flex; align-items:center; gap:8px; max-width:calc(100% - 32px); min-height:44px; padding:8px 10px; border:0; border-radius:var(--radius-chip); color:var(--paper); background:rgb(14 11 12 / .88); font-size:14px; }
  .p-objective>svg:first-child { width:16px; height:16px; color:var(--fire); }
  .p-objective>svg:last-child { width:14px; height:14px; }
  .p-objective>span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .p-objective>b { margin-left:8px; font:400 12px 'DM Mono',monospace; color:var(--paper-worn); }
  .p-mission { position:absolute; top:calc(var(--safe-top) + 136px); left:16px; right:16px; padding:18px; border:3px solid var(--ink); border-radius:var(--radius-object); background:var(--paper); color:var(--ink); box-shadow:4px 5px 0 var(--ink); pointer-events:auto; }
  .p-mission p { margin:0 0 12px; font-family:'Archivo Black',sans-serif; }
  .p-mission ol { margin:0; padding-left:24px; display:grid; gap:10px; font-size:16px; line-height:1.4; }
  .p-mission li[data-done=true] { text-decoration:line-through; color:var(--graphite); }
  .p-talk { position:absolute; left:calc(var(--safe-left) + 16px); bottom:calc(var(--safe-bottom) + 23px); height:56px; min-width:116px; z-index:2; }
  .p-talk>b { color:var(--ink); background:var(--fire); border-radius:50%; min-width:20px; padding:2px; }
  .p-walk-hint { position:absolute; bottom:calc(var(--safe-bottom) + 103px); left:16px; right:16px; margin:0; color:var(--paper); font-size:13px; text-align:center; text-shadow:0 2px 4px #000; pointer-events:none; }
  .p-wheel { position:absolute; right:calc(var(--safe-right) + 16px); bottom:calc(var(--safe-bottom) + 15px); width:76px; height:82px; z-index:3; }
  .p-wheel-button { width:76px; display:grid; justify-items:center; gap:6px; padding:0; border:0; background:transparent; color:var(--paper); font-size:12px; font-weight:650; }
  .p-wheel-icon { display:grid; place-items:center; width:60px; height:60px; color:var(--ink); background:var(--fire); border:3px solid var(--ink); border-radius:50%; box-shadow:3px 4px 0 var(--ink); }
  .p-wheel-icon svg { width:32px; height:32px; }
  .p-wheel-button.is-active .p-wheel-icon { background:#ffe08a; border-color:var(--fire); }
  .p-wheel-button>span:last-child { padding:1px 5px; background:rgb(14 11 12 / .88); border-radius:4px; }
  .p-wheel-button[aria-expanded=true] .p-wheel-icon { background:var(--paper); }
  .p-wheel-button[aria-expanded=true] .p-wheel-icon svg { transform:rotate(30deg); }
  .p-wheel.is-open~.p-walk-hint { display:none; }
  .p-wheel-shade { position:absolute; inset:0; padding:0; border:0; background:rgb(14 11 12 / .35); cursor:default; z-index:1; }
  .p-skill { position:absolute; width:96px; min-height:80px; padding:0; border:0; background:transparent; color:var(--paper); display:grid; justify-items:center; gap:6px; font-size:13px; }
  .p-skill-icon { display:grid; place-items:center; width:56px; height:56px; color:var(--ink); background:var(--paper); border:3px solid var(--ink); border-radius:50%; box-shadow:3px 4px 0 var(--ink); }
  .p-skill-icon svg { width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:2; }
  .p-skill-icon .lab-tool__body { fill:none; }
  .p-skill>span:last-child { border-radius:4px; background:var(--ink); padding:3px 6px; line-height:1.2; }
  .p-skill[aria-pressed=true] .p-skill-icon { background:#ffe08a; }
  .p-skill--visor { right:-10px; bottom:182px; }
  .p-skill--gesture { right:83px; bottom:132px; }
  .p-skill--photo { right:184px; bottom:68px; }
  .p-skill-arc { position:absolute; width:230px!important; height:270px!important; right:0; bottom:0; color:var(--paper); opacity:.35; pointer-events:none; }
  .p-menu-sheet { position:fixed; inset:auto 0 0; margin:0 auto; width:100%; max-width:480px; max-height:calc(100dvh - var(--safe-top) - 28px); overflow-y:auto; overscroll-behavior:contain; padding:22px 20px calc(var(--safe-bottom) + 22px); border:3px solid var(--ink); border-bottom:0; border-radius:22px 26px 0 0; color:var(--ink); background:var(--paper); box-shadow:0 -8px 32px #0005; pointer-events:auto; }
  .p-menu-sheet::backdrop { background:rgb(14 11 12 / .68); }
  .p-menu-sheet>header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
  .p-menu-sheet h2 { margin:0; font:400 clamp(22px,6vw,28px)/1.1 'Archivo Black',sans-serif; text-transform:uppercase; letter-spacing:-.02em; }
  .p-menu-sheet>header button { display:grid; place-items:center; width:44px; height:44px; border:2px solid var(--ink); border-radius:var(--radius-chip); background:transparent; flex:none; }
  .p-menu-sheet nav { display:grid; }
  .p-menu-sheet nav>button { display:flex; align-items:center; gap:14px; width:100%; min-height:53px; padding:12px 2px; border:0; border-bottom:1px solid #0e0b0c33; border-radius:0; background:transparent; color:var(--ink); font-size:17px; text-align:left; }
  .p-menu-sheet nav>button>svg:last-child { margin-left:auto; width:16px; height:16px; }
  .p-menu-sheet nav>button small { display:block; margin-top:3px; color:var(--graphite); font-size:13px; }
  .p-menu-section { margin:24px 0 3px; color:var(--graphite); font-size:14px; font-weight:600; }
  .p-menu-sheet footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; margin-top:18px; }
  .p-menu-sheet footer button { display:flex; align-items:center; gap:7px; min-height:44px; padding:8px 0; border:0; background:transparent; color:var(--ink); font-size:13px; }
  .p-menu-sheet footer svg { display:block; width:20px; height:20px; }
  .p-menu-sheet footer a { display:inline-flex; align-items:center; min-height:44px; color:var(--graphite); font-size:13px; text-underline-offset:4px; }
  .p-people-sheet>p { line-height:1.5; }
  .p-return-menu { min-height:48px; width:100%; background:var(--fire); color:var(--ink); border:2px solid var(--ink); border-radius:var(--radius-button); }
  .hud-prototype .lab-chat { z-index:100; height:min(470px,70dvh); bottom:0; border-radius:20px 23px 0 0; }
  .is-chat-open .p-talk,.is-chat-open .p-wheel,.is-chat-open .p-walk-hint { visibility:hidden; }
  @media(max-height:500px) {
    .p-header { top:8px; }
    .p-header>img { width:85px; height:36px; }
    .p-menu-button { min-height:44px; }
    .p-objective { top:62px; }
    .p-wheel { bottom:8px; }
    .p-talk { bottom:15px; }
    .p-walk-hint { display:none; }
  }
}

@media(max-width:1023px),(max-width:1000px) and (max-height:500px){.hud-prototype .lab-prompt{position:fixed;top:auto;bottom:calc(var(--safe-bottom) + 116px);left:16px;right:16px;width:calc(100% - 32px);margin:0;transform:none;z-index:65;min-height:52px;white-space:normal}.hud-prototype .lab-prompt b{white-space:normal}.p-skill--gesture{right:112px;bottom:147px}.p-skill--photo{right:188px;bottom:55px}.lab-profile{box-sizing:border-box;max-width:calc(100vw - 24px);overflow-x:hidden}.lab-profile__row{flex-direction:column;align-items:stretch}.lab-profile__row input,.lab-profile__row button{width:100%;max-width:100%;box-sizing:border-box}.lab-profile__row button{min-height:48px}.lab-profile__alias,.lab-profile__facts{min-width:0;overflow-wrap:anywhere}}

@media(max-width:1023px),(max-width:1000px) and (max-height:500px){.p-skill--visor{right:6px;bottom:156px}.p-skill--gesture{right:80px;bottom:138px}.p-skill--photo{right:147px;bottom:72px}.p-skill-arc{width:220px!important;height:240px!important}}

/* La rueda despliega las habilidades desde su centro. Solo transform/opacity:
   sin bucle JS, efectos de filtro ni capas persistentes al terminar. */
@media (max-width:1023px), (max-width:1000px) and (max-height:500px) {
  .p-wheel-icon svg {
    transition: transform 280ms var(--spring);
  }
  .p-wheel-button[aria-expanded=true] .p-wheel-icon svg { transform:rotate(90deg); }
  .p-wheel-button:active .p-wheel-icon { transform:translateY(2px) scale(.94); }
  .p-skills {
    visibility:hidden;
    transition:visibility 0s linear 180ms;
  }
  .p-wheel.is-open .p-skills { visibility:visible; transition-delay:0s; }
  .p-skill {
    width:64px;
    grid-template-columns:minmax(0,1fr);
    opacity:0;
    transform:translate(var(--from-x),var(--from-y)) scale(.18);
    transform-origin:50% 28px;
    transition:transform 160ms ease-in, opacity 120ms linear;
  }
  .p-skill>span:last-child { white-space:nowrap; }
  .p-skill--visor { --from-x:0px; --from-y:160px; --step:0; }
  .p-skill--gesture { --from-x:74px; --from-y:142px; --step:1; }
  .p-skill--photo { --from-x:141px; --from-y:76px; --step:2; }
  .p-wheel.is-open .p-skill {
    opacity:1;
    transform:translate(0,0) scale(1);
    transition:transform 300ms var(--spring), opacity 140ms ease-out;
    transition-delay:calc(var(--step) * 28ms);
  }
  .p-skills[aria-hidden=true] .p-skill { pointer-events:none; }
  .p-skill-arc { opacity:0; transition:opacity 100ms linear; }
  .p-wheel.is-open .p-skill-arc { opacity:.35; transition:opacity 200ms ease-out 100ms; }
  .p-wheel-shade {
    opacity:0;
    visibility:hidden;
    pointer-events:none!important;
    transition:opacity 140ms linear, visibility 0s linear 140ms;
  }
  .has-wheel .p-wheel-shade {
    opacity:1;
    visibility:visible;
    pointer-events:auto!important;
    transition-delay:0s;
  }
}
@media (prefers-reduced-motion:reduce) {
  .p-hud .p-wheel .p-skills,
  .p-hud .p-wheel .p-skill,
  .p-hud .p-wheel .p-skill-arc,
  .p-hud .p-wheel-shade,
  .p-hud .p-wheel-button .p-wheel-icon svg { transition:none; }
  .p-hud .p-wheel .p-skill,
  .p-hud .p-wheel-button .p-wheel-icon svg { transform:none; }
}

.lab-mission-action{font:inherit;text-align:left;color:inherit;border:0;background:transparent;padding:6px 0;min-height:44px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.lab-mission-action:disabled{text-decoration:none;cursor:default}.lab-guide-target{outline:3px dashed #ffb43a!important;outline-offset:5px}.lab-coach{position:fixed;z-index:90;top:145px;left:16px;width:min(340px,calc(100vw - 32px));padding:18px;background:var(--paper);color:var(--ink);border:3px solid var(--ink);border-radius:14px 20px 16px 22px;box-shadow:4px 5px 0 var(--ink)}.lab-coach h2{font:400 20px/1.2 'Archivo Black',sans-serif;margin:0 0 10px}.lab-coach-copy{font:400 16px/1.45 'Outfit',sans-serif;margin:0 0 14px}.lab-coach-count{font:400 12px 'DM Mono',monospace;margin:0 0 10px}.lab-coach-count:empty{display:none}.lab-coach>div{display:flex;justify-content:space-between;gap:12px}.lab-coach button,.lab-help{min-height:44px;padding:8px 12px;font:600 14px 'Outfit',sans-serif;background:var(--paper);color:var(--ink);border:2px solid var(--ink);border-radius:8px;cursor:pointer}.lab-coach .lab-coach-next{background:var(--fire)}.lab-board__form select{width:100%;min-height:48px;padding:8px;font:inherit;background:var(--paper);color:var(--ink);border:2px solid var(--ink);border-radius:8px}.lab-coach :focus-visible,.lab-mission-action:focus-visible{outline:3px dashed var(--fire);outline-offset:3px}@media(min-width:1024px) and (min-height:501px){.lab-coach{top:auto;bottom:100px;left:calc(50% - 170px)}}

@media(max-width:1023px),(max-width:1000px) and (max-height:500px){.p-quick{position:absolute;top:calc(var(--safe-top) + 80px);left:16px;display:flex;gap:8px}.p-quick button{min-height:44px;padding:8px 13px;background:var(--paper);color:var(--ink);border:2px solid var(--ink);border-radius:var(--radius-chip);font-size:14px;font-weight:600}.p-objective{top:calc(var(--safe-top) + 132px)}.p-mission{top:calc(var(--safe-top) + 182px)}.lab-coach{top:calc(var(--safe-top) + 190px)}@media(max-height:500px){.p-quick{top:8px;left:120px}.p-objective{top:62px}.lab-coach{top:112px;max-height:calc(100dvh - 128px);overflow:auto}}}
