.kgh-secret-open{overflow:hidden!important}
.kgh-secret-trigger-target{--kgh-secret-hold-ms:1800ms;position:relative!important;isolation:isolate;touch-action:manipulation}
.kgh-secret-trigger-target::after{content:"";position:absolute;inset:-7px;border-radius:999px;pointer-events:none;opacity:0;transform:scale(.88);border:2px solid transparent;background:conic-gradient(#d7ae59 0deg,rgba(215,174,89,.08) 0deg) border-box;mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0);mask-composite:exclude;-webkit-mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;z-index:10}
.kgh-secret-trigger-target.kgh-secret-holding::after{opacity:1;animation:kgh-secret-ring var(--kgh-secret-hold-ms) linear forwards}
.kgh-secret-trigger-target.kgh-secret-unlocked{filter:drop-shadow(0 0 12px rgba(215,174,89,.9))}
@keyframes kgh-secret-ring{0%{transform:scale(.88);background:conic-gradient(#d7ae59 0deg,rgba(215,174,89,.08) 0deg)}100%{transform:scale(1);background:conic-gradient(#d7ae59 360deg,rgba(215,174,89,.08) 360deg)}}
.kgh-secret-overlay{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;padding:16px;background:rgba(2,4,9,.84);backdrop-filter:blur(14px);opacity:0;transition:opacity .22s ease}
.kgh-secret-overlay.is-visible{opacity:1}
.kgh-secret-shell{display:flex;flex-direction:column;width:min(1500px,calc(100vw - 24px));height:min(900px,calc(100dvh - 24px));overflow:hidden;border:1px solid rgba(215,174,89,.28);border-radius:24px;background:#07080c;box-shadow:0 38px 120px rgba(0,0,0,.72),0 0 50px rgba(83,229,255,.08)}
.kgh-secret-header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:54px;padding:8px 10px 8px 18px;color:#f5eddc;background:linear-gradient(90deg,#11110f,#0a0d16);border-bottom:1px solid rgba(255,255,255,.1)}
.kgh-secret-header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:800 15px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em}
.kgh-secret-close{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid rgba(255,255,255,.15);border-radius:12px;color:#f5eddc;background:rgba(255,255,255,.07);font:300 27px/1 system-ui;cursor:pointer}
.kgh-secret-close:hover{background:rgba(255,122,88,.2);border-color:rgba(255,122,88,.45)}
.kgh-secret-stage{position:relative;flex:1;min-height:0;background:#07080c}
.kgh-secret-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:#07080c;opacity:0;transition:opacity .28s ease}
.kgh-secret-frame.is-ready{opacity:1}
.kgh-secret-loader{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#d9cfbd;background:radial-gradient(circle,rgba(83,229,255,.08),transparent 35%),#07080c;transition:opacity .25s ease}
.kgh-secret-loader.is-hidden{opacity:0;pointer-events:none}
.kgh-secret-k{display:grid;place-items:center;width:72px;height:72px;border:1px solid rgba(215,174,89,.5);border-radius:50%;color:#d7ae59;font:700 42px/1 Georgia,serif;box-shadow:0 0 28px rgba(215,174,89,.18);animation:kgh-secret-pulse 1.2s ease-in-out infinite}
.kgh-secret-loader small{font:600 13px/1.4 system-ui;color:#9da4b2;letter-spacing:.04em}
@keyframes kgh-secret-pulse{50%{transform:scale(1.06);box-shadow:0 0 42px rgba(83,229,255,.22)}}
@media(max-width:700px){.kgh-secret-overlay{padding:0}.kgh-secret-shell{width:100vw;height:100dvh;border:0;border-radius:0}.kgh-secret-header{min-height:calc(46px + env(safe-area-inset-top));padding:calc(5px + env(safe-area-inset-top)) 8px 5px 12px}.kgh-secret-header strong{font-size:13px}.kgh-secret-close{width:36px;height:36px}.kgh-secret-stage{min-height:0}}
@media(prefers-reduced-motion:reduce){.kgh-secret-overlay,.kgh-secret-frame,.kgh-secret-loader{transition:none}.kgh-secret-k{animation:none}}

/* V0.4: mobile launcher no longer consumes a separate title bar. */
@media(max-width:700px), (pointer:coarse){
  .kgh-secret-shell{position:relative}
  .kgh-secret-header{position:absolute;z-index:6;top:0;left:0;min-height:0;padding:calc(7px + env(safe-area-inset-top)) 0 0 7px;background:transparent;border:0;pointer-events:none}
  .kgh-secret-header strong{display:none}
  .kgh-secret-close{width:38px;height:38px;border-radius:12px;background:rgba(7,10,17,.82);backdrop-filter:blur(12px);pointer-events:auto}
  .kgh-secret-stage{width:100%;height:100%}
}


/* V0.8: non-destructive popup isolation and reliable mobile hold gesture. */
.kgh-secret-trigger-target,
.kgh-secret-trigger-target * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
@media (pointer: coarse) {
  .kgh-secret-trigger-target { touch-action: none !important; }
}
html.kgh-secret-root-open,
html.kgh-secret-root-open body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.kgh-secret-overlay { pointer-events: auto !important; isolation: isolate !important; }
.kgh-popup-suppressed-by-game {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.kgh-launcher-pseudo-fullscreen-root,body.kgh-launcher-pseudo-fullscreen-root{width:100%!important;height:100%!important;min-height:100dvh!important;margin:0!important;overflow:hidden!important;overscroll-behavior:none!important}
.kgh-secret-overlay.kgh-launcher-pseudo-fullscreen{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;min-height:100dvh!important;z-index:2147483646!important}


/* V0.13.0.45: responsive multi-game selector. */
.kgh-secret-header{position:relative}
.kgh-secret-header>strong{flex:1;min-width:0}
.kgh-secret-back{display:none;place-items:center;flex:0 0 auto;width:38px;height:38px;padding:0;border:1px solid rgba(255,255,255,.15);border-radius:12px;color:#f5eddc;background:rgba(255,255,255,.07);font:500 29px/1 system-ui;cursor:pointer}
.kgh-secret-back.is-visible{display:grid}
.kgh-secret-back:hover{background:rgba(83,229,255,.15);border-color:rgba(83,229,255,.42)}
.kgh-secret-selector{height:100%;overflow:auto;padding:clamp(24px,4vw,56px);color:#f5eddc;background:radial-gradient(circle at 50% 0,rgba(83,229,255,.10),transparent 36%),radial-gradient(circle at 12% 82%,rgba(215,174,89,.08),transparent 28%),#07080c;box-sizing:border-box}
.kgh-secret-selector-intro{max-width:1100px;margin:0 auto clamp(22px,3vw,36px)}
.kgh-secret-selector-intro h2{margin:0 0 7px;font:800 clamp(24px,3vw,38px)/1.12 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:-.025em}
.kgh-secret-selector-intro p{margin:0;color:#9da4b2;font:500 15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.kgh-secret-game-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:clamp(16px,2.2vw,26px);max-width:1100px;margin:0 auto}
.kgh-secret-game-card{display:flex;flex-direction:column;min-width:0;padding:0;overflow:hidden;border:1px solid rgba(255,255,255,.13);border-radius:22px;color:#f5eddc;text-align:left;background:#0d111a;cursor:pointer;transition:transform .18s ease,border-color .18s ease,background .18s ease;box-shadow:0 18px 45px rgba(0,0,0,.28)}
.kgh-secret-game-card:hover,.kgh-secret-game-card:focus-visible{transform:translateY(-4px);border-color:rgba(83,229,255,.55);background:#111823;outline:2px solid rgba(83,229,255,.45);outline-offset:3px}
.kgh-secret-game-art{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:4/3;overflow:hidden;background:radial-gradient(circle at 50% 42%,rgba(83,229,255,.20),transparent 34%),linear-gradient(145deg,#131a27,#080a10)}
.kgh-secret-game-art::before{content:attr(data-initials);display:grid;place-items:center;width:96px;height:96px;border:1px solid rgba(215,174,89,.48);border-radius:50%;color:#d7ae59;font:800 38px/1 Georgia,serif;background:rgba(5,7,11,.52);box-shadow:0 0 40px rgba(83,229,255,.10)}
.kgh-secret-game-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#090c13}
.kgh-secret-game-copy{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px 17px}
.kgh-secret-game-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:800 16px/1.3 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.kgh-secret-game-copy small{flex:0 0 auto;color:#53e5ff;font:800 12px/1 system-ui;text-transform:uppercase;letter-spacing:.08em}
@media(min-width:1200px){.kgh-secret-game-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px),(pointer:coarse){
  .kgh-secret-header{left:0;right:0;width:auto;display:flex;justify-content:space-between;gap:8px;padding:calc(7px + env(safe-area-inset-top)) 7px 0;box-sizing:border-box}
  .kgh-secret-header>strong{display:none}
  .kgh-secret-back,.kgh-secret-close{pointer-events:auto;background:rgba(7,10,17,.82);backdrop-filter:blur(12px)}
  .kgh-secret-close{margin-left:auto}
  .kgh-secret-selector{padding:calc(72px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom))}
  .kgh-secret-selector-intro{margin-bottom:18px}
  .kgh-secret-selector-intro h2{font-size:27px}
  .kgh-secret-game-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .kgh-secret-game-card{border-radius:16px}
  .kgh-secret-game-art{aspect-ratio:1/1}
  .kgh-secret-game-art::before{width:68px;height:68px;font-size:28px}
  .kgh-secret-game-copy{display:block;padding:12px}
  .kgh-secret-game-copy strong{display:block;font-size:14px}
  .kgh-secret-game-copy small{display:block;margin-top:7px;font-size:10px}
}
@media(max-width:390px){.kgh-secret-game-grid{grid-template-columns:1fr}.kgh-secret-game-art{aspect-ratio:16/9}}
@media(prefers-reduced-motion:reduce){.kgh-secret-game-card{transition:none}}

/* V0.13.0.46: larger desktop hub and edge-to-edge embedded game viewport. */
@media (min-width:701px) and (pointer:fine) {
  .kgh-secret-overlay { padding:6px; }
  .kgh-secret-shell {
    width:min(1840px,calc(100vw - 12px));
    height:min(1040px,calc(100dvh - 12px));
    border-radius:18px;
  }
  .kgh-secret-header {
    min-height:50px;
    padding:6px 8px 6px 16px;
  }
  .kgh-secret-stage { width:100%; height:100%; }
  .kgh-secret-frame { display:block; inset:0; width:100%; height:100%; }
}


/* V0.13.0.47: game-controlled aspect ratio. The shell wraps the actual playfield,
   so the iframe is never stretched or cropped just to fill a wide monitor. */
@media (min-width:701px) and (pointer:fine) {
  .kgh-secret-shell.is-playing {
    max-width:calc(100vw - 12px);
    max-height:calc(100dvh - 12px);
    transition:width .16s ease,height .16s ease;
  }
  .kgh-secret-shell.is-playing .kgh-secret-stage {
    flex:1 1 auto;
    width:100%;
    min-height:0;
    overflow:hidden;
  }
  .kgh-secret-shell.is-playing .kgh-secret-frame {
    width:100%;
    height:100%;
    object-fit:contain;
  }
}
