/* JoyJoy — shared staged install UI for Shieldy / Gamey.
   Automatic mode follows the TuneTune state flow; manual quick-link remains available. */

#panel-bot-control .general-control-card.bot-site-install-control-v1 {
  --bot-install-accent:#2da44e;
  --bot-install-accent-strong:#21863a;
  --bot-install-rgb:45,164,78;
  position:relative;
  overflow:hidden;
  padding:14px;
  margin-bottom:18px;
  border:1px solid color-mix(in srgb,var(--bot-install-accent) 18%,var(--account-border,#d0d7de));
  border-radius:16px;
  background:radial-gradient(circle at 100% 0%,color-mix(in srgb,var(--bot-install-accent) 8%,transparent) 0,transparent 34%),var(--account-surface,#fff);
  box-shadow:0 7px 22px rgba(26,96,156,.055);
}
#panel-bot-control .general-control-card.bot-site-install-control-v1[data-install-bot="gamey"] {
  --bot-install-accent:#e83e82;
  --bot-install-accent-strong:#cf2f70;
  --bot-install-rgb:232,62,130;
}
#panel-bot-control .bot-site-install-control-v1 .general-control-grid {
  display:grid;
  grid-template-columns:minmax(300px,.92fr) minmax(400px,1.08fr);
  gap:12px;
  align-items:stretch;
}
#panel-bot-control .bot-site-install-control-v1 .control-context-field,
#panel-bot-control .bot-site-install-control-v1 .bot-install-box {
  min-width:0;
  border:1px solid var(--account-border,#d0d7de);
  border-radius:13px;
  background:color-mix(in srgb,var(--account-surface,#fff) 94%,var(--bot-install-accent) 6%);
}
#panel-bot-control .bot-site-install-control-v1 .control-context-field {
  display:grid;
  align-content:start;
  gap:7px;
  padding:14px;
}
#panel-bot-control .bot-site-install-control-v1 .control-context-label {
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  color:var(--account-text,#1f2328);
  font-size:14px;
  font-weight:900;
  line-height:1.2;
}
#panel-bot-control .bot-site-install-control-v1 .control-context-label::before {
  content:"";
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-radius:999px;
  background:var(--bot-install-accent);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--bot-install-accent) 13%,transparent);
}
#panel-bot-control .bot-site-install-control-v1 #managed-server-hint {
  margin-top:1px;
  color:var(--account-muted,#667085);
  font-size:12px;
  font-weight:650;
  line-height:1.4;
}
#panel-bot-control .bot-site-install-control-v1 .managed-server-trigger-be58d3f52 {
  min-height:52px;
  padding:10px 48px 10px 14px;
  border-color:color-mix(in srgb,var(--bot-install-accent) 38%,var(--account-border,#d0d7de));
  border-radius:11px;
  background:var(--account-surface,#fff);
  box-shadow:0 2px 8px rgba(27,78,121,.04);
  font-size:14px;
  font-weight:900;
}
#panel-bot-control .bot-site-install-control-v1 .managed-server-trigger-be58d3f52:hover:not(:disabled),
#panel-bot-control .bot-site-install-control-v1 .managed-server-trigger-be58d3f52:focus-visible,
#panel-bot-control .bot-site-install-control-v1 .managed-server-select-be58d3f52.is-open .managed-server-trigger-be58d3f52 {
  border-color:var(--bot-install-accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--bot-install-accent) 13%,transparent);
}
#panel-bot-control .bot-site-install-control-v1 .managed-server-menu-be58d3f52 {
  position:static!important;
  inset:auto!important;
  display:none;
  width:100%;
  max-width:100%!important;
  max-height:236px;
  margin:8px 0 0;
  box-sizing:border-box;
  opacity:1;
  visibility:visible;
  transform:none;
  pointer-events:auto;
  box-shadow:0 10px 28px rgba(13,25,43,.13)!important;
}
#panel-bot-control .bot-site-install-control-v1 .managed-server-select-be58d3f52.is-open .managed-server-menu-be58d3f52 { display:block; }

#panel-bot-control .bot-site-install-control-v1 .bot-install-box {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"copy actions" "methods methods" "existing existing" "manualentry manualentry" "status status" "manual manual" "message message";
  gap:10px 14px;
  align-items:center;
  padding:14px;
}
#panel-bot-control .bot-site-install-control-v1 .quick-link-copy {
  grid-area:copy;
  display:flex!important;
  align-items:center;
  gap:11px;
  min-width:0;
}
#panel-bot-control .bot-site-install-control-v1 .quick-link-icon {
  width:38px;height:38px;flex:0 0 38px;display:grid;place-items:center;
  border:1px solid color-mix(in srgb,var(--bot-install-accent) 28%,transparent);
  border-radius:11px;
  background:color-mix(in srgb,var(--bot-install-accent) 10%,var(--account-surface,#fff));
  color:var(--bot-install-accent-strong);
}
#panel-bot-control .bot-site-install-control-v1 .quick-link-icon svg {
  width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;
}
#panel-bot-control .bot-site-install-control-v1 .quick-link-copy-text { display:grid;gap:3px;min-width:0; }
#panel-bot-control .bot-site-install-control-v1 .quick-link-copy strong { color:var(--account-text,#1f2328);font-size:14px;font-weight:900;line-height:1.2; }
#panel-bot-control .bot-site-install-control-v1 .quick-link-copy small { max-width:580px;color:var(--account-muted,#667085);font-size:12px;font-weight:650;line-height:1.42; }
.bot-install-mode-actions { grid-area:actions;display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap; }
.bot-install-mode-actions button { min-height:40px;padding:9px 14px;white-space:nowrap; }
.bot-install-mode-actions .primary { background:linear-gradient(180deg,color-mix(in srgb,var(--bot-install-accent) 86%,#fff),var(--bot-install-accent-strong));border-color:var(--bot-install-accent-strong); }

.bot-install-choice-actions-v1 { display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap; }
.bot-install-choice-actions-v1 .inline-button { min-width:132px; }

#panel-bot-control .bot-site-install-control-v1 .existing-bot-relink-note {
  display:flex;align-items:flex-start;gap:10px;margin-top:1px;padding:10px 11px;
  border:1px solid color-mix(in srgb,var(--bot-install-accent) 22%,var(--account-border,#d0d7de));
  border-radius:10px;background:color-mix(in srgb,var(--bot-install-accent) 5.5%,var(--account-surface,#fff));
}

#panel-bot-control .bot-site-install-control-v1 .bot-install-note-methods { grid-area:methods; }
#panel-bot-control .bot-site-install-control-v1 .bot-install-note-existing { grid-area:existing; }
.bot-install-manual-entry-row { grid-area:manualentry;display:flex;justify-content:flex-end;align-items:center; }
.bot-install-manual-entry-row .secondary { min-height:38px;padding:8px 13px; }

#panel-bot-control .bot-site-install-control-v1 .existing-bot-relink-icon {
  width:28px;height:28px;flex:0 0 28px;display:grid;place-items:center;border-radius:8px;
  background:color-mix(in srgb,var(--bot-install-accent) 12%,var(--account-surface,#fff));color:var(--bot-install-accent-strong);
}
#panel-bot-control .bot-site-install-control-v1 .existing-bot-relink-icon svg { width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round; }
#panel-bot-control .bot-site-install-control-v1 .existing-bot-relink-copy { display:grid;gap:2px;min-width:0; }
#panel-bot-control .bot-site-install-control-v1 .existing-bot-relink-copy strong { color:var(--account-text,#1f2328);font-size:12.5px;font-weight:900;line-height:1.25; }
#panel-bot-control .bot-site-install-control-v1 .existing-bot-relink-copy small { color:var(--account-muted,#667085);font-size:11.5px;font-weight:650;line-height:1.42; }

.bot-install-status {
  grid-area:status;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 13px;
  border:1px solid color-mix(in srgb,var(--bot-install-accent) 26%,transparent);border-radius:14px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--bot-install-accent) 9%,transparent),color-mix(in srgb,var(--bot-install-accent) 4%,transparent));
}
.bot-install-status[hidden] { display:none!important; }
.bot-install-status strong,.bot-install-status small { display:block; }
.bot-install-status strong { font-size:13px; }
.bot-install-status small { margin-top:3px;line-height:1.45;opacity:.76; }
.bot-install-button-spinner,.bot-install-status-spinner { width:15px;height:15px;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:bot-install-spin-v1 .7s linear infinite; }
.bot-install-status-spinner { color:var(--bot-install-accent); }
.bot-install-status[data-state="expired"] .bot-install-status-spinner,
.bot-install-status[data-state="identity-required"] .bot-install-status-spinner { animation:none;border-color:#e7a329;border-right-color:#e7a329; }
.bot-install-countdown { display:inline-flex;align-items:center;margin-top:7px;padding:4px 8px;border-radius:999px;background:color-mix(in srgb,var(--bot-install-accent) 10%,transparent);border:1px solid color-mix(in srgb,var(--bot-install-accent) 18%,transparent);color:var(--bot-install-accent-strong);font-size:11px;font-weight:800;font-variant-numeric:tabular-nums; }
.bot-install-status-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px; }
@keyframes bot-install-spin-v1 { to { transform:rotate(360deg); } }

.bot-install-manual-panel {
  grid-area:manual;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"copy actions" "result result" "hint hint";gap:9px 12px;padding:12px;
  border:1px dashed color-mix(in srgb,var(--bot-install-accent) 38%,var(--account-border,#d0d7de));border-radius:12px;background:color-mix(in srgb,var(--bot-install-accent) 4%,var(--account-surface,#fff));
}
.bot-install-manual-panel[hidden] { display:none!important; }
.bot-install-manual-copy { grid-area:copy;display:grid;gap:3px; }
.bot-install-manual-copy strong { font-size:13px;font-weight:900; }
.bot-install-manual-copy small { color:var(--account-muted,#667085);font-size:11.5px;line-height:1.42; }
.bot-install-manual-actions { grid-area:actions;display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap; }
.bot-install-manual-actions button { min-height:38px; }
.bot-install-manual-panel .quick-link-result { grid-area:result;margin:0;padding:9px 10px;border:1px solid color-mix(in srgb,var(--bot-install-accent) 30%,var(--account-border,#d0d7de));border-radius:10px;background:color-mix(in srgb,var(--bot-install-accent) 6%,var(--account-surface,#fff));box-shadow:none; }
.bot-install-manual-panel .quick-link-result code { color:var(--bot-install-accent-strong);font-size:16px;letter-spacing:.055em; }
.bot-install-manual-hint { grid-area:hint;margin:0;color:var(--account-muted,#667085);font-size:11.5px;line-height:1.45; }
.bot-install-manual-hint code { color:var(--bot-install-accent-strong);font-weight:900; }
#panel-bot-control .bot-site-install-control-v1 .api-form-message { grid-area:message;margin:0; }

.bot-install-success,.bot-install-failure { position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:24px;overflow:hidden;animation:bot-install-fade-v1 .24s ease both; }
.bot-install-success { --overlay-accent:#2da44e;--overlay-accent2:#6ed58a;background:radial-gradient(circle at 50% 28%,color-mix(in srgb,var(--overlay-accent) 26%,transparent),transparent 36%),linear-gradient(145deg,rgba(247,255,249,.985),rgba(230,249,235,.985)); }
.bot-install-success[data-bot="gamey"] { --overlay-accent:#e83e82;--overlay-accent2:#ff8ab9;background:radial-gradient(circle at 50% 28%,rgba(232,62,130,.22),transparent 36%),linear-gradient(145deg,rgba(255,248,252,.985),rgba(253,231,241,.985)); }
html[data-theme="dark"] .bot-install-success,html.dark .bot-install-success { background:radial-gradient(circle at 50% 28%,color-mix(in srgb,var(--overlay-accent) 24%,transparent),transparent 38%),linear-gradient(145deg,rgba(9,25,16,.99),rgba(12,37,23,.99)); }
html[data-theme="dark"] .bot-install-success[data-bot="gamey"],html.dark .bot-install-success[data-bot="gamey"] { background:radial-gradient(circle at 50% 28%,rgba(232,62,130,.20),transparent 38%),linear-gradient(145deg,rgba(31,10,21,.99),rgba(44,13,30,.99)); }
.bot-install-success-card,.bot-install-failure-card { position:relative;z-index:2;width:min(620px,100%);padding:38px 38px 34px;border-radius:28px;text-align:center;background:rgba(255,255,255,.88);backdrop-filter:blur(18px); }
.bot-install-success-card { border:1px solid color-mix(in srgb,var(--overlay-accent) 28%,transparent);box-shadow:0 28px 80px color-mix(in srgb,var(--overlay-accent) 18%,transparent),inset 0 1px 0 rgba(255,255,255,.75); }
html[data-theme="dark"] .bot-install-success-card,html.dark .bot-install-success-card,html[data-theme="dark"] .bot-install-failure-card,html.dark .bot-install-failure-card { background:rgba(18,31,27,.91);box-shadow:0 30px 90px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,255,255,.05); }
.bot-install-success-logo-wrap { width:124px;height:124px;margin:0 auto 17px;padding:8px;border-radius:34px;background:linear-gradient(145deg,color-mix(in srgb,var(--overlay-accent) 24%,transparent),color-mix(in srgb,var(--overlay-accent) 8%,transparent));box-shadow:0 14px 44px color-mix(in srgb,var(--overlay-accent) 25%,transparent);transform:rotate(-2deg); }
.bot-install-success-logo { width:100%;height:100%;object-fit:cover;border-radius:27px;display:block; }
.bot-install-success-kicker { color:var(--overlay-accent);font-size:13px;font-weight:800;letter-spacing:.12em;text-transform:uppercase; }
.bot-install-success h1 { margin:10px 0 2px;font-size:clamp(34px,6vw,54px);line-height:1;letter-spacing:-.035em; }
.bot-install-success h2 { margin:10px 0 0;font-size:clamp(20px,3vw,28px);color:var(--overlay-accent); }
.bot-install-success-server,.bot-install-success-copy { margin:13px auto 0;max-width:470px;line-height:1.55;opacity:.76; }
.bot-install-success-copy { margin-top:6px;font-size:14px; }
.bot-install-success-actions,.bot-install-failure-actions { display:flex;justify-content:center;gap:10px;margin-top:26px;flex-wrap:wrap; }
.bot-install-success-actions button,.bot-install-failure-actions button { min-height:44px;padding-inline:18px; }
.bot-install-confetti { position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:1; }
.bot-install-confetti i { position:absolute;left:var(--x);top:-8%;width:8px;height:15px;border-radius:3px;background:var(--overlay-accent);opacity:.88;transform:rotate(var(--r));animation:bot-install-confetti-fall-v1 var(--duration) cubic-bezier(.2,.7,.35,1) var(--delay) infinite; }
.bot-install-confetti i:nth-child(3n) { width:6px;height:6px;border-radius:999px; }
.bot-install-confetti i:nth-child(4n) { background:#fff; }
.bot-install-confetti i:nth-child(5n) { background:var(--overlay-accent2); }
@keyframes bot-install-confetti-fall-v1 { 0%{transform:translate3d(0,-10vh,0) rotate(var(--r));opacity:0}8%{opacity:.92}100%{transform:translate3d(30px,116vh,0) rotate(calc(var(--r) + 520deg));opacity:.18} }
@keyframes bot-install-fade-v1 { from{opacity:0}to{opacity:1} }

.bot-install-failure { background:radial-gradient(circle at 50% 28%,rgba(255,103,124,.20),transparent 37%),linear-gradient(145deg,rgba(255,250,251,.985),rgba(248,236,240,.985)); }
html[data-theme="dark"] .bot-install-failure,html.dark .bot-install-failure { background:radial-gradient(circle at 50% 28%,rgba(255,76,105,.17),transparent 38%),linear-gradient(145deg,rgba(30,12,20,.99),rgba(36,15,25,.99)); }
.bot-install-failure-card { border:1px solid rgba(231,84,108,.28);box-shadow:0 28px 80px rgba(138,41,61,.16),inset 0 1px 0 rgba(255,255,255,.78); }
.bot-install-failure-face { width:118px;height:118px;margin:0 auto 17px;display:grid;place-items:center;border-radius:999px;color:#df4661;background:linear-gradient(145deg,rgba(255,104,128,.15),rgba(222,64,92,.07));box-shadow:0 14px 42px rgba(222,64,92,.16); }
.bot-install-failure-face svg { width:86px;height:86px;overflow:visible; }
.bot-install-failure-face circle:first-child,.bot-install-failure-face path { fill:none;stroke:currentColor;stroke-width:5;stroke-linecap:round;stroke-linejoin:round; }
.bot-install-failure-face .eye { fill:currentColor;stroke:none; }
.bot-install-failure-kicker { color:#d8405b;font-size:13px;font-weight:800;letter-spacing:.12em;text-transform:uppercase; }
.bot-install-failure h1 { margin:10px 0 2px;font-size:clamp(30px,5vw,46px);line-height:1.06;letter-spacing:-.03em; }
.bot-install-failure h2 { margin:10px 0 0;font-size:clamp(20px,3vw,27px);color:#d8405b; }
.bot-install-failure-copy,.bot-install-failure-server { margin:13px auto 0;max-width:480px;line-height:1.55;opacity:.78; }
.bot-install-failure-server { margin-top:8px;font-size:14px; }
.bot-install-failure-retry { background:linear-gradient(135deg,#e24b66,#cf3655)!important;border-color:rgba(194,41,70,.52)!important;box-shadow:0 10px 24px rgba(202,48,78,.18); }

html[data-theme="dark"] #panel-bot-control .general-control-card.bot-site-install-control-v1 { background:radial-gradient(circle at 100% 0%,color-mix(in srgb,var(--bot-install-accent) 10%,transparent) 0,transparent 35%),var(--account-surface,#0d1627);box-shadow:0 10px 28px rgba(0,0,0,.16); }
html[data-theme="dark"] #panel-bot-control .bot-site-install-control-v1 .control-context-field,html[data-theme="dark"] #panel-bot-control .bot-site-install-control-v1 .bot-install-box { background:color-mix(in srgb,var(--account-surface-soft,#121d30) 92%,var(--bot-install-accent) 8%); }
html[data-theme="dark"] #panel-bot-control .bot-site-install-control-v1 .managed-server-trigger-be58d3f52 { background:#101a2c; }

@media(max-width:1050px){#panel-bot-control .bot-site-install-control-v1 .general-control-grid{grid-template-columns:1fr}}
@media(max-width:680px){
  #panel-bot-control .general-control-card.bot-site-install-control-v1{padding:10px;border-radius:14px}
  #panel-bot-control .bot-site-install-control-v1 .control-context-field,#panel-bot-control .bot-site-install-control-v1 .bot-install-box{padding:12px}
  #panel-bot-control .bot-site-install-control-v1 .bot-install-box{grid-template-columns:1fr;grid-template-areas:"copy" "actions" "methods" "existing" "manualentry" "status" "manual" "message"}
  .bot-install-mode-actions{display:grid;grid-template-columns:1fr;width:100%}.bot-install-mode-actions button{width:100%}
  .bot-install-status{grid-template-columns:auto 1fr}.bot-install-status-actions{grid-column:1/-1;width:100%;display:grid;grid-template-columns:1fr 1fr}.bot-install-status-actions button{width:100%}
  .bot-install-manual-panel{grid-template-columns:1fr;grid-template-areas:"copy" "actions" "result" "hint"}.bot-install-manual-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.bot-install-manual-actions button{width:100%}.bot-install-manual-entry-row{justify-content:stretch}.bot-install-manual-entry-row .secondary{width:100%}
  .bot-install-choice-actions-v1{width:100%;display:grid;grid-template-columns:1fr}.bot-install-choice-actions-v1 .inline-button{width:100%}
  .bot-install-success,.bot-install-failure{padding:14px}.bot-install-success-card,.bot-install-failure-card{padding:30px 18px 24px;border-radius:22px}.bot-install-success-logo-wrap{width:104px;height:104px;border-radius:29px}.bot-install-success-logo{border-radius:23px}.bot-install-success-actions,.bot-install-failure-actions{flex-direction:column}.bot-install-success-actions button,.bot-install-failure-actions button{width:100%}.bot-install-failure-face{width:100px;height:100px}.bot-install-failure-face svg{width:74px;height:74px}
}
@media(prefers-reduced-motion:reduce){.bot-install-button-spinner,.bot-install-status-spinner,.bot-install-confetti i{animation:none!important}.bot-install-confetti i{display:none}}
