/* ================= RESET ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Aksen global: dipakai untuk bayangan .card. Diubah oleh app.js mengikuti
   platform yang terdeteksi, kembali ke merah bila kosong/tidak dikenal. */
:root { --accent: #ef4444; }

/* ================= BACKGROUND 1: STARSCRIPT ================= */
.bg-starscript {
    min-height: 100vh;
    background-color: #1c0a0c;
    background-image: repeating-linear-gradient(
        45deg,
        #2a0a0c,
        #2a0a0c 15px,
        #4a0a0c 15px,
        #4a0a0c 30px
    );
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ================= BACKGROUND 2: AMPREN ================= */
.bg-ampren {
    min-height: 100vh;
    background-color: #f4f4f0;
    background-image:
        linear-gradient(#e5e7eb 2px, transparent 2px),
        linear-gradient(90deg, #e5e7eb 2px, transparent 2px);
    background-size: 30px 30px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ================= KOTAK CARD ================= */
.card {
    background: #ffffff;
    border: 4px solid #000000;
    border-radius: 20px;
    box-shadow: 8px 8px 0px var(--accent);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    transition: box-shadow 0.2s ease;
}

.card h1 {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #000;
    line-height: 1.1;
}
.card h2 {
    font-size: 18px;
    font-weight: 900;
    color: #ef4444;
    text-transform: uppercase;
    line-height: 1.2;
    margin-top: 4px;
}
.card p {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-top: 14px;
}

/* Badge Kuning */
.badge-yellow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #facc15;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #000;
    margin-top: 16px;
    box-shadow: 2px 2px 0px #000;
}
.badge-yellow svg { width: 16px; height: 16px; }

/* Badge platform: gaya neo-brutalist sama seperti .badge-yellow, hanya warna
   isi yang mengikuti platform (di-set inline oleh app.js). */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #000;
    background: #e5e7eb;
    margin-top: 12px;
    box-shadow: 2px 2px 0px #000;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
/* TikTok: bayangan badge ganda cyan + pink */
.platform-badge.is-tiktok {
    box-shadow: -3px -3px 0 #25F4EE, 3px 3px 0 #FE2C55, 2px 2px 0 #000;
}
.platform-badge .platform-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #000;
    background: #fff;
}

/* Nama platform di card hasil */
.result-platform {
    display: inline-flex;
    align-items: center;
    border: 3px solid #000;
    border-radius: 50px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 800;
    color: #000;
    background: #e5e7eb;
    margin-top: 14px;
    box-shadow: 2px 2px 0px #000;
    transition: background 0.2s ease, color 0.2s ease;
}

.dashed-line {
    border-top: 3px dashed #000;
    margin: 20px 0;
    width: 100%;
}

.bottom-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Badge Live */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dcfce7;
    border: 3px solid #000;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    box-shadow: 2px 2px 0px #000;
}
.live-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 1.5px solid #000;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Tombol WhatsApp */
.wa-btn {
    background: #22c55e;
    border: 3px solid #000;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000;
    transition: transform 0.1s, box-shadow 0.1s;
    padding: 0;
}
.wa-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.wa-btn svg { width: 24px; height: 24px; fill: #fff; }

/* ================= KUMPULAN TOMBOL ================= */
.buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 480px;
}

.btn {
    background: #ef4444;
    color: #fff;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 3px 3px 0px #000;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}
.btn:active { transform: translate(3px, 3px); box-shadow: none; }

/* Varian Warna */
.btn-white  { background: #fff; color: #000; }
.btn-black  { background: #111; color: #fff; }
.btn-yellow { background: #facc15; color: #000; }
.btn-green  { background: #22c55e; color: #fff; }
.btn-blue   { background: #3b82f6; color: #fff; }
.btn-purple { background: #a855f7; color: #fff; }
.btn-pink   { background: #ec4899; color: #fff; }
.btn-orange { background: #f97316; color: #fff; }

/* Varian Ukuran */
.btn-sm { padding: 6px 12px; font-size: 12px; box-shadow: 2px 2px 0px #000; border-radius: 8px; }
.btn-sm:active { transform: translate(2px, 2px); }

.btn-lg { padding: 14px 28px; font-size: 16px; box-shadow: 4px 4px 0px #000; border-radius: 14px; }
.btn-lg:active { transform: translate(4px, 4px); }

.btn-block { width: 100%; padding: 16px; font-size: 16px; box-shadow: 5px 5px 0px #000; border-radius: 14px; }
.btn-block:active { transform: translate(5px, 5px); }

.btn-pill  { border-radius: 50px; }
.btn-round { border-radius: 50%; width: 52px; height: 52px; padding: 0; font-size: 20px; }

/* ================= TAMBAHAN APLIKASI ================= */
/* Kelas di bawah hanya untuk kebutuhan fungsional (input, player, dsb).
   Tidak mengubah tampilan kelas dasar TestUI. */
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: 3px 3px 0px #000; }

.url-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.url-input {
    flex: 1 1 200px;
    min-width: 0;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 2px 2px 0px #000 inset;
    background: #fff;
}
.url-input:focus { outline: none; }

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 16px;
    margin-bottom: 6px;
    color: #000;
}
.format-select {
    width: 100%;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    background: #fff;
    box-shadow: 2px 2px 0px #000;
    cursor: pointer;
}

.thumb {
    width: 100%;
    border: 3px solid #000;
    border-radius: 14px;
    margin-top: 16px;
    display: block;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.player {
    width: 100%;
    border: 3px solid #000;
    border-radius: 14px;
    margin-top: 16px;
    display: block;
    background: #000;
}

.meta-title { font-size: 16px; font-weight: 900; color: #000; margin-top: 12px; line-height: 1.3; }
.meta-sub { font-size: 13px; color: #4b5563; margin-top: 4px; }

.error-box {
    background: #fee2e2;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #991b1b;
    margin-top: 16px;
    box-shadow: 2px 2px 0px #000;
}
.hidden { display: none !important; }

@media (max-width: 480px) {
    .bg-starscript, .bg-ampren { padding: 24px 14px; }
    .card { padding: 18px; box-shadow: 6px 6px 0px var(--accent); }
    .card h1 { font-size: 22px; }
}
