/* A rotary field selector with an enamel face and a knurled brass index knob. */
.gear-trigger{
  --gear-color:#ffbe76;
  position:absolute;right:var(--hud-right);bottom:var(--hud-bottom);
  display:flex;align-items:center;gap:9px;width:134px;height:58px;
  padding:6px 9px 7px 6px;isolation:isolate;
  border:1px solid #ad9c78;border-radius:9px 5px 10px 5px;color:#fff0ce;
  background:linear-gradient(152deg,#4b5147,#2a3430 39%,#202a27 75%,#394239);
  box-shadow:inset 0 1px 0 #dad8b780,inset 0 -3px 0 #131b19,0 0 0 2px #151c19,0 4px 8px #0008;
  touch-action:none;user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;
}
.gear-trigger::before{
  content:"";position:absolute;inset:3px;border:1px solid #aba88d32;border-radius:6px 3px 7px 3px;pointer-events:none;
}
.gear-trigger::after{
  content:"";position:absolute;bottom:5px;right:7px;width:22px;height:3px;
  background:repeating-linear-gradient(-55deg,#caae76 0 2px,#303a33 2px 4px);opacity:.8;
}
.gear-trigger-icon{
  flex:0 0 41px;height:40px;display:grid;place-items:center;position:relative;
  color:var(--gear-color);border:1px solid #101916;border-radius:5px 3px 5px 3px;
  background:repeating-linear-gradient(0deg,transparent 0 3px,#80a79310 3px 4px),radial-gradient(ellipse at 50% 70%,#35493c,#101d19 84%);
  box-shadow:inset 0 2px 3px #07120f,0 1px 0 #bac3a066;
}
.gear-trigger-icon::after{
  content:"";position:absolute;left:4px;top:4px;width:3px;height:3px;border-radius:50%;
  background:var(--gear-color);box-shadow:0 0 3px var(--gear-color);
}
.gear-trigger-icon svg{display:block;width:35px;height:33px;filter:drop-shadow(0 1px 1px #07100d)}
.gear-trigger-type{display:grid;align-content:center;justify-items:start;gap:3px;min-width:0;text-align:left}
.gear-trigger-label{
  font:800 25px/.94 var(--font-display,Impact,sans-serif);text-transform:uppercase;letter-spacing:.02em;
  text-shadow:0 2px 1px #0b1412;
}
.gear-trigger-equipped{color:var(--gear-color);font:700 11px/1 var(--font-mono,monospace);text-shadow:0 1px #111714}
.gear-trigger kbd{
  position:absolute;right:6px;top:5px;min-height:0;padding:1px 3px;
  border:1px solid #908d77;border-radius:2px;background:#222c27;color:#eee1be;font:700 10px/1.05 var(--font-mono,monospace);
}
@media(hover:hover){.gear-trigger:hover{border-color:#f2d8a4;background:linear-gradient(152deg,#626658,#36423b 39%,#25352f 75%,#475447)}}
.gear-trigger:active{transform:translateY(1px)}
.gear-trigger:focus-visible{outline:3px solid #ffdb89;outline-offset:4px}
#stage.taxi-cutscene .gear-trigger,#hud[inert] .gear-trigger{visibility:hidden}
.gear-sr{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap}

#gear-wheel{
  --gear-color:#ffbe76;--gear-size:min(315px,73dvh,77vw);
  width:min(380px,calc(100vw - 24px));max-width:calc(100vw - 16px);
  max-height:calc(100dvh - 16px);overflow:auto;overscroll-behavior:contain;
  margin:auto;padding:0;color:#f8edd5;color-scheme:dark;
  background:linear-gradient(145deg,#38423a,#25312e 48%,#202a28 77%);
  border:1px solid #a39677;border-radius:14px 14px 10px 10px;
  box-shadow:inset 0 1px #fbf4cd60,inset 0 0 0 4px #b7b29513,0 12px 40px #0308068c;
  font:500 1rem/1.35 var(--font-body,system-ui,sans-serif);
}
#gear-wheel[open]{display:grid;justify-items:center;grid-template-columns:1fr}
#gear-wheel::backdrop{background:#071111a1}
.gear-head{
  width:100%;display:flex;justify-content:space-between;align-items:center;padding:7px 11px 7px 18px;gap:8px;
  background:linear-gradient(to bottom,#435049,#323e37);border-bottom:1px solid #121e1d;box-shadow:0 1px #bbc3a32c;
}
.gear-head h2{margin:0;color:#f7eacd;text-transform:uppercase;letter-spacing:.01em;font:800 1.65rem/1 var(--font-display,Impact,sans-serif)}
.gear-close{
  border:1px solid #777f6b;border-radius:5px;min-width:44px;min-height:44px;
  padding:2px;background:#24302c;color:#f1e6c9;text-align:center;font:400 1.6rem/1 sans-serif;touch-action:manipulation;
}
.gear-dial{
  position:relative;width:var(--gear-size);aspect-ratio:1;max-width:100%;margin:8px auto;isolation:isolate;
  border-radius:50%;background:linear-gradient(145deg,#babea2,#444c40 25%,#101817 62%,#828670);
  box-shadow:0 2px 6px #090e0ce0;touch-action:none;user-select:none;-webkit-user-select:none;
}
.gear-face{display:block;width:100%;height:100%;pointer-events:none}
.gear-sector{fill:#35433e;stroke:#58645a;stroke-width:.65}
.gear-dial[data-selection="standard"] .gear-sector[data-id="standard"],
.gear-dial[data-selection="unstable"] .gear-sector[data-id="unstable"],
.gear-dial[data-selection="slime"] .gear-sector[data-id="slime"],
.gear-dial[data-selection="trap"] .gear-sector[data-id="trap"]{fill:#49544a;stroke:var(--gear-color);stroke-width:1.35}
.gear-choice{
  position:absolute;left:var(--icon-x);top:var(--icon-y);transform:translate(-50%,-50%);
  display:grid;place-items:center;width:max-content;min-width:44px;min-height:44px;border:0;padding:0;
  background:transparent;color:#f3e9d3;text-align:center;
  font:650 16px/1.05 var(--font-body,sans-serif);touch-action:manipulation;
}
.gear-choice-art{
  position:relative;display:grid;justify-items:center;gap:1px;color:var(--gear-color);filter:drop-shadow(0 1px 1px #07100d);pointer-events:none;
}
.gear-choice-art svg{display:block;width:clamp(36px,11vw,50px);height:auto}
.gear-choice.is-new .gear-choice-art::after{
  content:"New";position:absolute;left:50%;bottom:100%;transform:translateX(-50%);
  padding:1px 5px;border-radius:2px;background:var(--gear-color);color:#101d19;
  font:800 10px/1.2 var(--font-mono,monospace);letter-spacing:.08em;text-transform:uppercase;
}
.gear-caption{display:flex;align-items:center;gap:4px;color:#fbefd6;white-space:nowrap}
.gear-slot{min-width:15px;height:16px;border:1px solid #afaa8a83;border-radius:2px;color:#ded6b7;font:650 11px/14px var(--font-mono,monospace)}
.gear-choice[aria-disabled="true"] .gear-choice-art{color:#c2c3ac}
.gear-choice[aria-disabled="true"] .gear-caption{color:#e0ddc9}
.gear-choice[aria-disabled="true"] .gear-slot{
  font-size:0;border:0;min-width:12px;height:14px;
  background:center / 12px 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14' fill='none' stroke='%23dacfaa' stroke-width='1.25'%3E%3Cpath d='M3 6V4a3 3 0 0 1 6 0v2'/%3E%3Crect x='1.6' y='6' width='8.8' height='6.5' rx='1.4'/%3E%3C/svg%3E");
}
.gear-choice:focus-visible{outline:0}
.gear-choice:focus-visible .gear-caption{text-decoration:underline;text-decoration-color:var(--gear-color);text-underline-offset:3px}
.gear-hub{
  pointer-events:none;position:absolute;left:36.5%;top:36.5%;width:27%;height:27%;border-radius:50%;transform:rotate(var(--pointer-turn,0deg));
  background:repeating-conic-gradient(#51584b 0deg 3deg,#272e28 3deg 6deg,#858674 6deg 7deg);
  border:1px solid #101915;box-shadow:0 2px 4px #030906e6,0 0 0 2px #9d997a70;
  transition:transform .14s ease-out;
}
.gear-hub i{position:absolute;inset:10%;border-radius:50%;border:1px solid #999b81;background:linear-gradient(138deg,#495246,#252f29 68%);box-shadow:inset 0 1px #bdbba16b}
.gear-hub i::before{content:'';position:absolute;left:46.5%;top:0;width:7%;height:36%;border-radius:0 0 2px 2px;background:var(--gear-color);box-shadow:0 0 3px #121a14}
.gear-hub i::after{content:'';position:absolute;left:39%;top:39%;width:22%;height:22%;border-radius:50%;border:1px solid #bcbca1;background:linear-gradient(140deg,#737970 46%,#222d27 47% 53%,#7c8076 56%)}
.gear-detail{
  width:100%;min-width:0;min-height:100px;padding:11px 17px 14px;background:linear-gradient(115deg,#172521,#19251f);
  border-top:1px solid #7f846c;box-shadow:inset 3px 0 var(--gear-color);text-align:left;
}
.gear-detail small{color:var(--gear-color);font:750 .76rem/1 var(--font-mono,monospace);text-transform:uppercase;letter-spacing:.07em}
.gear-detail h3{margin:4px 0 2px;color:#fff2d9;font:800 1.47rem/1 var(--font-display,Impact,sans-serif);text-transform:uppercase}
.gear-detail p{margin:5px 0 0;color:#dedfc9;font:500 .94rem/1.3 var(--font-body,sans-serif)}
@media(max-width:720px),(pointer:coarse){
  .gear-trigger{width:114px;height:54px;gap:7px}
  .gear-trigger-icon{flex-basis:36px;height:36px}
  .gear-trigger-icon svg{width:31px;height:30px}
  .gear-trigger-label{font-size:23px}
  .gear-trigger kbd{display:none}
}
@container (max-width:374px){
  .gear-trigger{display:grid;justify-content:center;justify-items:center;gap:3px;width:68px;height:73px;padding:3px 4px 6px;right:max(9px,var(--hud-right))}
  .gear-trigger-icon{width:42px;height:26px}.gear-trigger-icon svg{width:28px;height:25px}
  .gear-trigger-type{justify-items:center;gap:2px}.gear-trigger-label{font-size:19px}.gear-trigger-equipped{font-size:11px}
  .gear-trigger::after,.gear-trigger kbd{display:none}
}
@media(max-width:720px) and (orientation:portrait){
  #gear-wheel{margin:auto auto max(17px,env(safe-area-inset-bottom),7dvh)}
}
@media(max-height:460px) and (orientation:landscape){
  #gear-wheel{--gear-size:min(69dvh,238px);width:min(550px,calc(100vw - 24px))}
  #gear-wheel[open]{grid-template-columns:1.1fr .9fr;align-items:stretch}
  .gear-head{grid-column:1/-1;padding:3px 9px 3px 14px}.gear-head h2{font-size:1.4rem}
  .gear-dial{margin:6px auto}
  .gear-detail{padding:14px;display:flex;flex-direction:column;justify-content:center;border-top:0;border-left:1px solid #71806a;box-shadow:none}
  .gear-choice{font-size:14px}.gear-choice-art svg{width:min(10dvh,40px)}
  .gear-trigger{height:48px}
}
@media(max-width:379px),(max-height:460px) and (orientation:landscape){
  /* Place the key or lock next to the drawing to leave the full chord for its name. */
  .gear-caption{position:relative}
  .gear-caption .gear-slot{position:absolute;left:calc(50% + 20px);bottom:calc(100% + 4px)}
  .gear-choice:is([data-id="unstable"],[data-id="slime"]) .gear-slot{left:auto;right:calc(50% + 12px)}
}
@media(max-height:300px) and (orientation:landscape){.gear-choice{font-size:13px}}
@media(prefers-reduced-motion:reduce){.gear-hub{transition:none}}
