/* ===== KYSTECH — SKYWORLD GLOBAL TECH ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
    width: 100%; height: 100%; overflow: hidden;
    background-color: #0d0005;
    font-family: 'Playfair Display', Georgia, serif;
}

.stage-container { position: relative; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; }

#bg-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
/* Desktop: show the full portrait frame (letterboxed) instead of cropping the sides */
@media (min-width: 768px) { #bg-video { object-fit: contain; } }

/* --- Intro title (animated) --- */
#intro-title {
    position: absolute; top: 38px; left: 0; right: 0; z-index: 8;
    text-align: center; pointer-events: none; white-space: normal;
    font-size: clamp(24px, 6.5vw, 60px); font-weight: 900;
    letter-spacing: 0.14em; line-height: 1.3; text-transform: uppercase; color: #f7e7a9;
    max-width: 94vw; margin: 0 auto;
    text-shadow: 0 0 18px rgba(212,175,55,.55), 0 2px 8px rgba(0,0,0,.85);
}
#intro-title .word { display: inline-block; }
#intro-title .ch { display: inline-block; opacity: 0; transform: translateY(-26px) scale(.6); animation: introIn .7s cubic-bezier(.2,.7,.3,1.1) forwards; }
@keyframes introIn { to { opacity: 1; transform: translateY(0) scale(1); } }
#intro-title.done .ch { animation: none; opacity: 1; transform: none; }
#intro-title.shimmer::after {
    content: ''; position: absolute; inset: 0; border-radius: 6px;
    background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
    background-size: 220% 100%; animation: shimmer 2.2s ease;
    mix-blend-mode: overlay; pointer-events: none;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Enter button --- */
#enter-btn {
    position: relative; z-index: 10; padding: 18px 45px; font-size: 22px;
    letter-spacing: 2px; text-transform: uppercase; color: #2b000a;
    background: linear-gradient(135deg, #d4af37 0%, #fff3a8 50%, #aa7c11 100%);
    border: 2px solid #fff; border-radius: 50px; cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,.7), 0 0 20px rgba(212,175,55,.5);
    transition: all .4s ease; animation: pulse-glow 2s infinite;
    font-family: inherit;
}
#enter-btn:hover { transform: scale(1.08); box-shadow: 0 15px 40px rgba(212,175,55,.8); }
@keyframes pulse-glow { 0% { box-shadow: 0 0 0 0 rgba(212,175,55,.7); } 70% { box-shadow: 0 0 0 20px rgba(212,175,55,0); } 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); } }

/* --- Nav menu --- */
#menu-bar {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 10; display: flex; flex-direction: column; gap: 20px;
    justify-content: center; align-items: center; padding: 0 16px;
    width: min(360px, 88vw);
    transition: opacity 1.2s ease, transform 1.2s ease;
}
.nav-btn {
    width: 100%; padding: 15px 28px; font-size: 15px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; text-align: center;
    color: #f7e7a9; background: rgba(40,0,10,.65);
    border: 1px solid rgba(212,175,55,.6); border-radius: 14px;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    cursor: pointer; box-shadow: 0 8px 25px rgba(0,0,0,.5);
    transition: all .3s cubic-bezier(.25,.8,.25,1); font-family: inherit;
}
.nav-btn:hover { background: linear-gradient(135deg,#d4af37,#aa7c11); color: #1a0006; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(212,175,55,.4); }
@media (min-width: 768px) {
    #menu-bar { flex-direction: row; width: auto; gap: 28px; }
    .nav-btn { width: auto; padding: 16px 34px; font-size: 16px; }
}

/* --- Footer --- */
#site-footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 18;
    text-align: center; font-size: 11px; line-height: 1.6; pointer-events: none;
    color: rgba(247,231,169,.9);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(5,0,2,.92) 30%, rgba(5,0,2,.5) 70%, transparent 100%);
}
#site-footer .footer-line { margin: 1px 0; text-shadow: 0 1px 3px rgba(0,0,0,.9); }

/* --- Overlay / Panel --- */
#overlay {
    position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
    background: rgba(10,0,5,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    padding: 16px; transition: opacity .3s ease, visibility .3s ease;
}
#panel {
    width: 100%; max-width: 480px; height: min(640px, 86vh);
    position: relative;
    background-color: #0b141a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1.5'%3E%3Cpath d='M70 26c9 13 23 22 23 37 0 13-10 24-23 24S47 76 47 63c0-15 14-24 23-37z'/%3E%3Ccircle cx='26' cy='104' r='9'/%3E%3Ccircle cx='114' cy='46' r='7'/%3E%3Cpath d='M26 36l3 7 7 3-7 3-3 7-3-7-7-3 7-3z'/%3E%3Cpath d='M112 96l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3C/g%3E%3C/svg%3E");
    border: 1px solid rgba(212,175,55,.35); border-radius: 16px;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,.7);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
#chat-hearts { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#chat-hearts .heart { position: absolute; bottom: -40px; opacity: 0; animation: heartFloat linear infinite; }
@keyframes heartFloat {
    0% { transform: translateY(0) scale(.5) rotate(-10deg); opacity: 0; }
    12% { opacity: .5; }
    85% { opacity: .32; }
    100% { transform: translateY(-580px) scale(1.15) rotate(12deg); opacity: 0; }
}
#panel-header {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: rgba(32,44,51,.97);
    border-bottom: 1px solid rgba(255,255,255,.08); flex: 0 0 auto;
}
#panel-title { font-size: 14px; letter-spacing: 1px; color: #f7e7a9; text-transform: uppercase; font-weight: 700; }
#panel-close { background: none; border: none; color: #f7e7a9; font-size: 18px; cursor: pointer; padding: 2px 8px; line-height: 1; }
#panel-close:hover { color: #fff; }
#panel-body { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }

@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; word-break: break-word; animation: msgIn .3s ease both; box-shadow: 0 1px 1px rgba(0,0,0,.25); }
.msg.bot { align-self: flex-start; background: #202c33; color: #e9edef; border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: #005c4b; color: #e9edef; border-bottom-right-radius: 4px; }
.msg.sys { align-self: center; background: rgba(255,255,255,.08); color: #c8d6dc; font-size: 12px; border-radius: 999px; padding: 6px 14px; }

.chat-options { display: flex; flex-direction: column; gap: 10px; align-self: stretch; }
.chat-options .opt {
    text-align: left; padding: 12px 16px; font-size: 13.5px; color: #e9edef;
    background: #202c33; border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px; cursor: pointer; transition: all .2s; font-family: inherit;
    animation: msgIn .3s ease both;
}
.chat-options .opt:hover { background: #2a3b45; border-color: rgba(212,175,55,.5); transform: translateX(4px); }

.chat-input { display: flex; gap: 8px; align-self: stretch; }
.chat-input input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: #202c33; color: #fff; font-size: 14px; outline: none; min-width: 0; }
.chat-input input::placeholder { color: #8696a0; }
.chat-input button { padding: 10px 16px; border-radius: 10px; border: none; background: linear-gradient(135deg,#d4af37,#aa7c11); color: #1a0006; font-weight: 700; cursor: pointer; }

code.details { display: block; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 10px; font-size: 12px; line-height: 1.6; color: #cfe8cf; white-space: pre-wrap; word-break: break-word; }
.copy-btn { margin-top: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(212,175,55,.5); background: transparent; color: #f7e7a9; cursor: pointer; font-size: 13px; font-family: inherit; }
.copy-btn.copied { background: #2e7d32; border-color: #2e7d32; color: #fff; }

.faq-item { background: #202c33; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 13px 15px; animation: msgIn .3s ease both; }
.faq-item h4 { color: #f7e7a9; font-size: 14px; margin-bottom: 6px; }
.faq-item p { color: #d9e2e8; font-size: 13px; line-height: 1.6; }

/* --- utility --- */
.hidden { opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; }
.menu-hidden { opacity: 0 !important; pointer-events: none !important; transform: translate(-50%, calc(-50% + 30px)) !important; }

/* --- pull-to-refresh --- */
#ptr-indicator { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 16px; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
#ptr-indicator .ptr-spinner { width: 26px; height: 26px; border: 3px solid rgba(212,175,55,.25); border-top-color: #d4af37; border-radius: 50%; }
#ptr-indicator .ptr-label { font-size: 12px; letter-spacing: 1px; color: #f7e7a9; text-transform: uppercase; text-shadow: 0 1px 4px rgba(0,0,0,.8); font-family: system-ui, sans-serif; }
#ptr-indicator.pulling .ptr-spinner { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* small screens */
@media (max-width: 480px) {
    #enter-btn { padding: 15px 34px; font-size: 18px; }
    #intro-title { top: 26px; font-size: clamp(22px, 7vw, 34px); }
    #menu-bar { gap: 18px; }
}
