@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@700&display=swap');

*{
  font-family:'Quicksand',Helvetica,Arial,sans-serif;
  font-weight:700;
  margin:0;padding:0;box-sizing:border-box;
}

html{scroll-behavior:smooth}

body{
  font-family:'Quicksand',Arial,sans-serif;
  background:#000;
  color:#fff;
  overflow-x:hidden;
  overflow-y:auto;
  min-height:100vh;
  scrollbar-width:thin;
  scrollbar-color:#1a1a1a transparent;
  position:relative;
}

body::before{
  content:'';position:fixed;top:0;left:0;width:100%;height:100%;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,0.02) 1px,transparent 1px);
  background-size:50px 50px;
  z-index:-999;pointer-events:none;
}

::selection{background-color:#333;color:#fff}

::-webkit-scrollbar{width:8px;height:0}
::-webkit-scrollbar-track{background:transparent;border-radius:10px}
::-webkit-scrollbar-thumb{background-color:#1a1a1a;border-radius:10px;border:2px solid #000}
::-webkit-scrollbar-thumb:hover{background-color:#333}

:root{
  --bg:#000;
  --bg2:#0a0a0a;
  --bg3:#050505;
  --card:#0a0a0a;
  --line:rgba(255,255,255,0.06);
  --border:#1a1a1a;
  --highlight:#333;
  --accent:#fff;
  --glow-color:#fff;
  --glow-amount:10px;
  --text:#e0e0e0;
  --text-muted:#666;
  --dim:#555;
  --nav-h:80px;
  --radius:8px;
}

#loading-screen{
  position:fixed;inset:0;background:rgba(0,0,0,0.95);
  backdrop-filter:blur(20px);display:flex;flex-direction:column;
  justify-content:center;align-items:center;
  z-index:9999;opacity:1;transition:opacity 1s ease-out;
}
#loading-screen.hidden{opacity:0;pointer-events:none}
.loader-container{display:flex;flex-direction:column;align-items:center;gap:20px}
.load-spinner{
  width:50px;height:50px;border:3px solid #1a1a1a;
  border-top-color:#fff;border-radius:50%;animation:spin 0.8s linear infinite;
}
.load-text{font-size:0.85rem;color:#666;text-align:center;max-width:300px}
#loading-bar-container{
  position:fixed;bottom:0;left:0;width:100%;height:6px;
  background:#0a0a0a;z-index:10000;
}
#loading-bar{height:100%;width:0;background:linear-gradient(90deg,#333,#fff);border-radius:0 3px 3px 0;transition:width 0.8s ease}

.top-nav{
  position:fixed;top:10px;left:50%;transform:translateX(-50%);
  width:calc(100% - 40px);max-width:1400px;
  height:60px;z-index:200;
  display:flex;align-items:center;justify-content:space-between;
  background:rgba(0,0,0,0.85);backdrop-filter:blur(20px);
  border:1px solid #1a1a1a;
  border-radius:16px;
  padding:0 20px;
  box-shadow:0 4px 20px rgba(0,0,0,0.4);
}
.nav-logo{
  display:flex;align-items:center;text-decoration:none;flex-shrink:0;
  font-weight:700;font-size:1.1rem;color:#e0e0e0;
  letter-spacing:-0.01em;transition:opacity 0.2s;
}
.nav-logo:hover{opacity:0.7}

.nav-icons{
  display:flex;align-items:center;gap:6px;flex-shrink:0;
}
.nav-icon{
  display:flex;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:10px;
  color:rgba(255,255,255,0.35);text-decoration:none;
  background:transparent;border:none;cursor:pointer;
  transition:color 0.2s,background 0.2s,transform 0.2s;
}
.nav-icon:hover{color:#fff;background:rgba(255,255,255,0.08);transform:translateY(-1px)}
.nav-icon svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

#nav-tooltip{
  position:fixed;pointer-events:none;z-index:9999;
  background:#0a0a0a;border:1px solid #1a1a1a;
  color:#e0e0e0;font-family:'Quicksand',sans-serif;
  font-size:0.68rem;letter-spacing:0.04em;
  padding:0.3rem 0.7rem;border-radius:5px;white-space:nowrap;
  opacity:0;transition:opacity 0.15s ease;
  box-shadow:0 4px 18px rgba(0,0,0,0.5);transform:translate(14px,-50%);top:0;left:0;
}

.home-ac{
  display:none;position:absolute;top:calc(100% + 8px);left:0;right:0;
  background:rgba(0,0,0,0.97);backdrop-filter:blur(16px);
  border:1px solid #1a1a1a;border-radius:10px;
  padding:0.4rem;z-index:300;box-shadow:0 12px 40px rgba(0,0,0,0.7);overflow:hidden;
}
.home-ac-item{
  display:flex;align-items:center;gap:0.7rem;
  padding:0.65rem 0.85rem;border-radius:8px;color:#555;
  font-size:0.88rem;font-weight:700;cursor:pointer;
  transition:background 0.15s,color 0.15s;
}
.home-ac-item:hover,.home-ac-item.home-ac-active{background:rgba(255,255,255,0.05);color:#e0e0e0}
.home-ac-item svg{width:14px;height:14px;flex-shrink:0;stroke:#555;fill:none;stroke-width:2;stroke-linecap:round;opacity:0.5}
.home-ac-item b{color:#fff;font-weight:700}

.home-wrap{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-height:100vh;gap:20px;padding:2rem;text-align:center;
}

.home-title{font-size:4rem;color:#e0e0e0;margin-bottom:0;font-weight:700}

.home-search-form{width:min(450px,90vw);position:relative}
.home-search-row{
  display:flex;align-items:center;
  background:#0a0a0a;border:2px solid transparent;
  border-radius:25px;overflow:hidden;
  box-shadow:0 4px 10px rgba(0,0,0,0.3);
  transition:all 0.4s ease;
}
.home-search-row:focus-within{
  background:#0a0a0a;
  box-shadow:0 6px 15px rgba(0,0,0,0.5),0 0 var(--glow-amount) rgba(255,255,255,0.05);
  border-color:rgba(255,255,255,0.15);transform:scale(1.02);
}
.home-search-icon{
  flex-shrink:0;padding:0 0.6rem 0 1rem;
  color:#555;display:flex;align-items:center;transition:color 0.2s;
}
.home-search-row:focus-within .home-search-icon{color:#fff}
.home-search-icon svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round}
.home-search-input{
  flex:1;background:transparent;border:none;outline:none;
  color:#e0e0e0;font-family:'Quicksand',sans-serif;
  font-size:1rem;font-weight:700;
  padding:12px 20px 12px 0;caret-color:#fff;
  text-align:center;
}
.home-search-input::placeholder{color:#555;font-style:italic;transition:color 0.3s ease}
.home-search-row:focus-within .home-search-input::placeholder{color:#666}

.home-cta-btn{
  display:inline-flex;align-items:center;gap:8px;
  background:#0a0a0a;color:#e0e0e0;
  border:2px solid #1a1a1a;border-radius:8px;
  padding:15px 25px;font-family:'Quicksand',sans-serif;
  font-size:1.2rem;font-weight:700;cursor:pointer;text-decoration:none;
  transition:background-color 0.3s ease,transform 0.3s ease,border-color 0.3s ease,color 0.3s ease;
}
.home-cta-btn:hover{background:#1a1a1a;border-color:#333;color:#fff;transform:scale(1.05)}

.quickapps{width:min(540px,92vw);display:flex;flex-direction:column;gap:0.75rem}
.quickapps-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.qa-item{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:8px;background:#0a0a0a;border:2px solid #1a1a1a;
  border-radius:8px;padding:14px 8px 12px;text-decoration:none;
  color:#666;font-size:0.75rem;letter-spacing:0.03em;
  transition:all 0.3s ease;cursor:pointer;overflow:hidden;
}
.qa-item:hover{color:#fff;transform:scale(1.05);border-color:#333}
.qa-icon{
  width:36px;height:36px;display:flex;align-items:center;justify-content:center;
  border-radius:8px;background:rgba(255,255,255,0.03);
  transition:transform 0.3s ease;
}
.qa-item:hover .qa-icon{transform:scale(1.1)}
.qa-icon img{width:100%;height:100%;object-fit:contain;border-radius:6px}

.content-frame{
  flex:1;border:none;margin-top:var(--nav-h);
  width:100%;height:calc(100vh - var(--nav-h));background:var(--bg);
}

.page-body{display:flex;flex-direction:column;height:100vh;overflow:hidden}
.frame-area{flex:1;position:relative;background:#fff;overflow:hidden;margin-top:var(--nav-h)}
#sj-frame{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;border:none!important}

.loading{
  position:absolute;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:0.9rem;
  background:var(--bg);z-index:10;transition:opacity 0.3s;
}
.loading.hidden{opacity:0;pointer-events:none}
.spinner{
  width:28px;height:28px;border:2px solid #1a1a1a;
  border-top-color:#fff;border-radius:50%;animation:spin 0.7s linear infinite;
}
.loading p{font-size:0.75rem;color:#555;letter-spacing:0.04em}

#err-bar{
  display:none;position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);
  background:#1a0a0a;border:1px solid #5a1515;border-radius:5px;
  padding:0.5rem 1rem;font-size:0.75rem;color:#ff5e5e;
  z-index:200;white-space:nowrap;
}

.embed-nav-trigger{position:fixed;top:0;left:0;right:0;height:4px;z-index:200;cursor:pointer}
.embed-nav-trigger:hover .embed-navbar,.embed-navbar:hover{transform:translateY(0);opacity:1;pointer-events:all}
.embed-navbar{
  position:fixed;top:0;left:0;right:0;height:52px;
  background:rgba(0,0,0,0.97);backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  display:flex;align-items:center;padding:0 1.2rem;gap:1rem;
  transform:translateY(-100%);opacity:0;pointer-events:none;
  transition:transform 0.22s ease,opacity 0.22s ease;z-index:201;
}
.embed-navbar-logo{display:flex;align-items:center;text-decoration:none;flex-shrink:0}
.embed-navbar-logo img{height:22px;width:auto}
.embed-nav-div{width:1px;height:18px;background:var(--line);flex-shrink:0}
.embed-url-display{
  flex:1;font-size:0.7rem;color:var(--dim);
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
.embed-nav-actions{display:flex;gap:0.3rem;flex-shrink:0}
.embed-nav-btn{
  font-size:0.68rem;letter-spacing:0.04em;
  color:var(--dim);background:transparent;border:1px solid var(--border);
  border-radius:4px;padding:0.28rem 0.7rem;cursor:pointer;text-decoration:none;
  display:flex;align-items:center;gap:0.35rem;transition:color 0.2s,border-color 0.2s;
}
.embed-nav-btn:hover{color:#fff;border-color:#333}
.embed-nav-btn svg{width:11px;height:11px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round}

#embed-loading{
  position:fixed;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:1.2rem;
  background:var(--bg);z-index:50;transition:opacity 0.4s ease;
}
#embed-loading.hidden{opacity:0;pointer-events:none}
.embed-spinner-wrap{position:relative;width:52px;height:52px;display:flex;align-items:center;justify-content:center}
.spinner-ring{
  position:absolute;width:44px;height:44px;
  border:2px solid #1a1a1a;border-top-color:#fff;
  border-radius:50%;animation:spin 0.8s linear infinite;
}
.embed-load-icon{
  width:32px;height:32px;border:1px solid #1a1a1a;
  border-radius:50%;display:flex;align-items:center;justify-content:center;
}
.embed-load-icon svg{width:14px;height:14px;stroke:#fff;fill:none;stroke-width:2;stroke-linecap:round}
.embed-load-logo{height:28px;width:auto}
.embed-load-msg{font-size:0.75rem;color:#555;letter-spacing:0.04em}

#embed-error{
  position:fixed;inset:0;display:none;flex-direction:column;
  align-items:center;justify-content:center;gap:0.9rem;
  background:var(--bg);z-index:60;color:var(--dim);text-align:center;padding:2rem;
}
#embed-error.visible{display:flex}
.embed-err-code{font-size:0.7rem;color:#ff5e5e;margin-top:0.2rem}
.embed-retry-btn{
  margin-top:0.4rem;padding:0.45rem 1.2rem;
  background:#0a0a0a;color:#e0e0e0;border:2px solid #1a1a1a;border-radius:5px;
  font-size:0.75rem;cursor:pointer;transition:all 0.3s ease;
}
.embed-retry-btn:hover{transform:scale(1.05);border-color:#333;color:#fff}
#embed-error a{color:#fff;text-decoration:none;font-size:0.75rem}

.search-bar{
  flex-shrink:0;padding:1.2rem 2rem;background:var(--bg);
  border-bottom:1px solid var(--line);display:flex;justify-content:center;
}
.search-inner{
  display:flex;align-items:center;background:#0a0a0a;
  border:1px solid #1a1a1a;border-radius:25px;height:46px;
  width:min(450px,100%);overflow:hidden;transition:all 0.3s ease;
}
.search-inner:focus-within{
  box-shadow:0 6px 15px rgba(0,0,0,0.5),0 0 var(--glow-amount) rgba(255,255,255,0.05);
  border-color:rgba(255,255,255,0.15);
}
.search-inner svg{
  flex-shrink:0;width:16px;height:16px;stroke:#555;fill:none;
  stroke-width:2;stroke-linecap:round;margin:0 0.7rem 0 1.1rem;
}
#game-search{
  flex:1;background:transparent;border:none;outline:none;
  color:#e0e0e0;font-family:'Quicksand',sans-serif;
  font-size:1rem;font-weight:700;caret-color:#fff;padding-right:1rem;
  text-align:center;
}
#game-search::placeholder{color:#555;font-style:italic}

.games-scroll{flex:1;overflow-y:auto;padding:1.5rem 2rem 3rem}

.games-grid{
  display:flex;flex-wrap:wrap;justify-content:center;
  padding:0;margin:0 auto;gap:0;
}

.game-card{
  background:transparent;border:none;text-align:center;
  transition:all 0.3s ease;position:relative;
  display:inline-block;margin:10px;vertical-align:top;
  text-decoration:none;
}

.game-cover{
  width:180px;height:180px;border-radius:15px;
  transition:ease 0.2s;display:block;
  object-fit:cover;border:2px solid transparent;
}
.game-card:hover .game-cover{
  scale:1.1;border:5px solid #ffffff;
}

.game-cover-placeholder{
  width:180px;height:180px;border-radius:15px;
  background:linear-gradient(145deg,#0a0a0a,#050505);
  display:flex;align-items:center;justify-content:center;
  border:2px solid transparent;transition:ease 0.2s;
}
.game-card:hover .game-cover-placeholder{
  scale:1.1;border:5px solid #333;
}
.game-cover-placeholder svg{width:36px;height:36px;stroke:#555;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;opacity:0.4}

.game-info{
  padding:8px 4px 0;display:flex;flex-direction:column;gap:2px;
}
.game-name{
  font-size:0.85rem;font-weight:700;color:#e0e0e0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:180px;transition:color 0.2s;
}
.game-card:hover .game-name{color:#fff}
.game-author{font-size:0.7rem;color:#555;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}

.state-msg{display:flex;flex-direction:column;align-items:center;padding:5rem 2rem;gap:1rem;color:#555;font-size:0.8rem}
.state-msg.err{color:#ff5e5e}
.state-msg button{
  padding:10px 20px;background:#0a0a0a;color:#e0e0e0;
  border:2px solid #1a1a1a;border-radius:5px;
  font-size:0.85rem;font-weight:700;cursor:pointer;
  transition:all 0.3s ease;
}
.state-msg button:hover{transform:scale(1.05);border-color:#333;color:#fff}

@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}

.anim-1{animation:fadeUp 0.45s ease both}
.anim-2{animation:fadeUp 0.45s 0.07s ease both}
.anim-3{animation:fadeUp 0.45s 0.14s ease both}
.anim-4{animation:fadeUp 0.45s 0.21s ease both}
.anim-5{animation:fadeUp 0.45s 0.28s ease both}
.anim-6{animation:fadeUp 0.45s 0.35s ease both}

.hidden{display:none!important}

@media (max-width:768px){
  .home-title{font-size:2.5rem}
  .quickapps-grid{grid-template-columns:repeat(2,1fr)}
}
