/* Reset & Base */
* { margin:0; padding:0; box-sizing:border-box; font-family:"Microsoft JhengHei", "Courier New", monospace; }
body { background:#0a0a0a; min-height:100vh; color:white; overflow-x:hidden; font-size: 14px; }
body::before {
    content:""; position:fixed; inset:0;
    background: radial-gradient(circle at top, #1a2a6c 0%, #112 35%, #000 100%);
    z-index:-1;
}

/* Animations */
@keyframes scanline { 0% { transform: translateY(-100%); } 100% { transform: translateY(100vh); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 10px #0ff, 0 0 20px #0ff; } 50% { box-shadow: 0 0 20px #0ff, 0 0 30px #0ff; } }
@keyframes glow-red { 0%, 100% { box-shadow: 0 0 15px #f00, 0 0 30px #f00; } 50% { box-shadow: 0 0 30px #f00, 0 0 45px #f00; } }

.scanline {
    position: fixed; top: 0; left: 0; width: 100%; height: 2px;
    background: rgba(0, 255, 255, 0.2);
    animation: scanline 6s linear infinite; z-index: 999; pointer-events: none;
}

/* Login Screen */
#login-screen {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px);
}
.login-box {
    background: rgba(10, 15, 25, 0.9); border: 1px solid rgba(0, 255, 255, 0.4);
    padding: 40px; border-radius: 16px; text-align: center; width: 90%; max-width: 420px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.15);
}
.login-icon {
    width: 60px; height: 60px; border-radius: 50%; background: rgba(0,255,255,0.1);
    margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,255,255,0.3); animation: pulse 2s infinite;
}
.login-icon svg { width: 30px; height: 30px; fill: none; stroke: #0ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-title { font-size: 26px; font-weight: 900; margin-bottom: 5px; color: white; letter-spacing: 2px; }
.login-subtitle { font-size: 12px; color: #0ff; margin-bottom: 30px; letter-spacing: 1px; font-family: "Courier New", monospace; opacity: 0.8; }
.login-input {
    width: 100%; padding: 16px; background: rgba(0,0,0,0.6); border: 1px solid rgba(0, 255, 255, 0.3);
    color: white; font-size: 24px; text-align: center; letter-spacing: 8px; border-radius: 8px;
    outline: none; margin-bottom: 20px; transition: 0.3s;
}
.login-input:focus { border-color: #0ff; box-shadow: 0 0 15px rgba(0,255,255,0.5); }
.login-input::placeholder { color: rgba(255,255,255,0.2); letter-spacing: 8px; }
.login-btn {
    width: 100%; padding: 16px; background: #0ff; color: #000; font-size: 18px; font-weight: 900;
    border: none; border-radius: 8px; cursor: pointer; transition: 0.3s; letter-spacing: 2px;
}
.login-btn:hover { background: #fff; box-shadow: 0 0 20px #0ff; }
.error-msg { color: #ff4444; font-size: 13px; margin-top: 15px; display: none; font-weight: bold; background: rgba(255,0,0,0.1); padding: 8px; border-radius: 4px;}

/* Main App */
#main-app { display: none; padding-bottom: 60px; }

/* Marquee */
.marquee-container {
    background: rgba(0,0,0,0.8); border-bottom: 1px solid rgba(0,255,255,0.3);
    overflow: hidden; padding: 10px 0; position: relative;
}
.marquee-content {
    display: inline-flex; white-space: nowrap; animation: marquee 40s linear infinite; color: #0ff;
    font-family: "Courier New", monospace; letter-spacing: 1px;
}

/* Header & Controls */
.container { width: 95%; max-width: 1600px; margin: auto; padding: 30px 20px; }
.header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; gap: 20px; }
.title-wrap h1 { font-size: 36px; font-weight: 900; color: white; display: flex; align-items: center; gap: 12px; letter-spacing: 1px;}
.title-wrap h1 span { font-size: 13px; background: #0ff; color: #000; padding: 4px 10px; border-radius: 4px; letter-spacing: 0;}
.title-wrap p { color: #aaa; font-size: 13px; letter-spacing: 3px; margin-top: 8px; font-family: "Courier New", monospace;}

.status-badges { display: flex; gap: 15px; font-size: 12px; }
.badge { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15); padding: 10px 15px; border-radius: 6px; color: #ccc; display: flex; align-items: center; gap: 8px;}
.badge span { font-weight: bold; color: #0ff; font-family: "Courier New", monospace;}
.badge .status-dot { width: 8px; height: 8px; background: #0f0; border-radius: 50%; box-shadow: 0 0 8px #0f0; }

/* Version Tabs */
.version-wrap { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 30px; }
.version-btn {
    padding: 14px 30px; border-radius: 30px; border: 1px solid rgba(0,255,255,0.2);
    background: rgba(10,15,25,0.8); color: #aaa; cursor: pointer; transition: 0.3s; font-weight: bold; font-size: 16px; letter-spacing: 1px;
}
.version-btn:hover, .version-btn.active {
    background: rgba(0,255,255,0.1); border-color: #0ff; box-shadow: 0 0 20px rgba(0,255,255,0.3); color: #0ff;
}

.countdown-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px;}
.countdown { font-size: 20px; color: #0ff; font-weight: bold; letter-spacing: 1px; font-family: "Courier New", monospace;}
.refresh-btn { 
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; 
    padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: 0.3s; display: flex; align-items: center; gap: 6px;
}
.refresh-btn:hover { background: rgba(255,255,255,0.2); }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
    background: rgba(15, 20, 25, 0.85); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 20px; display: flex; flex-direction: column;
    backdrop-filter: blur(5px); position: relative; overflow: hidden; transition: 0.3s;
}
.card.high-chance {
    border-color: rgba(0, 255, 255, 0.5); animation: glow 2s infinite; background: rgba(15, 30, 35, 0.85);
}
.card.super-high-chance {
    border-color: rgba(255, 50, 50, 0.6); animation: glow-red 1.5s infinite; background: rgba(35, 15, 15, 0.85);
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.room-id { background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 4px; font-size: 13px; color: #aaa; font-family: "Courier New", monospace; border: 1px solid rgba(255,255,255,0.1);}
.chance-wrap { text-align: right; }
.chance-label { font-size: 10px; color: #aaa; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; margin-bottom: 4px;}
.chance-value { font-size: 32px; font-weight: 900; color: #0ff; font-family: "Courier New", monospace; text-shadow: 0 0 10px rgba(0,255,255,0.5);}
.card.super-high-chance .chance-value { color: #ff4444; text-shadow: 0 0 10px rgba(255,0,0,0.5);}

.signal-list { flex-grow: 1; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.signal-item { padding: 10px; border-radius: 6px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.signal-s { background: rgba(0, 255, 255, 0.1); border: 1px solid rgba(0, 255, 255, 0.2); }
.signal-s span { background: #0ff; color: #000; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 11px; white-space: nowrap;}
.signal-s p { color: #0ff; font-weight: bold; line-height: 1.4;}

.signal-a { background: rgba(0, 255, 255, 0.05); border: 1px solid rgba(0, 255, 255, 0.1); }
.signal-a span { background: rgba(255,255,255,0.9); color: #000; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 11px; white-space: nowrap;}
.signal-a p { color: #ddd; line-height: 1.4;}

.signal-b { background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255,255,255,0.05);}
.signal-b span { background: #444; color: #fff; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 11px; white-space: nowrap;}
.signal-b p { color: #999; line-height: 1.4;}

.command-wrap { border-top: 1px dashed rgba(255,255,255,0.15); padding-top: 15px; display: flex; gap: 10px; align-items: flex-start; }
.command-wrap span { background: rgba(255,255,255,0.1); color: #fff; padding: 3px 6px; border-radius: 3px; font-weight: bold; font-size: 11px; letter-spacing: 1px;}
.command-wrap p { font-size: 13px; color: #0ff; font-weight: bold; line-height: 1.5; }
.card.super-high-chance .command-wrap p { color: #ffaa00; }

.loading-overlay {
    position: absolute; inset: 0; background: rgba(15, 20, 25, 0.95);
    display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 10;
    transition: opacity 0.5s; backdrop-filter: blur(5px);
}
.chip-icon {
    width: 36px; height: 36px; margin-bottom: 15px;
    animation: pulse 1.5s infinite;
}
.progress-bar-bg {
    width: 60%; height: 4px; background: rgba(0,255,255,0.1); margin-top: 15px; border-radius: 2px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%; background: #0ff; width: 0%; box-shadow: 0 0 8px #0ff; transition: width 0.2s linear;
}
.loading-text { font-size: 11px; color: #0ff; letter-spacing: 3px; font-family: "Courier New", monospace;}

.footer { margin-top: 50px; text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px;}
.footer h4 { color: #0ff; font-size: 14px; letter-spacing: 5px; margin-bottom: 10px;}
.footer p { color: #555; font-size: 11px; letter-spacing: 1px; font-family: "Courier New", monospace; max-width: 800px; margin: auto; line-height: 1.6;}

@media(max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; }
    .status-badges { flex-direction: column; gap: 10px; width: 100%;}
    .badge { width: 100%; justify-content: space-between;}
    .grid { grid-template-columns: 1fr; }
    .countdown-wrap { flex-direction: column; gap: 15px; align-items: flex-start;}
}
