* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background: url('bk.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── FULL CENTER (for step 1 & 2) ── */
.full-center {
    min-height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.connect-terminal {
    background: rgba(0,0,0,0.85); border: 1px solid #333; border-radius: 16px;
    padding: 40px 50px; text-align: center; width: 90%; max-width: 350px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); display: flex; flex-direction: column; align-items: center;
}
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.1); border-top: 4px solid #fff; border-radius: 50%; animation: spin 0.9s linear infinite; margin-bottom: 20px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.r-log { font-family: monospace; font-size: 0.9rem; color: #00ffaa; }

/* ── BACKGROUND GRID PAGE ── */
.page-bg {
    min-height: 100vh;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-header { text-align: center; margin-bottom: 20px; }
.page-logo { max-width: 180px; filter: drop-shadow(0 0 20px #ff1493); margin-bottom: 10px; }
.page-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #fff;
    text-shadow: 3px 3px 0 #ff1493, -1px -1px 0 #ff1493;
    letter-spacing: 2px;
}

.tabs-row { display: flex; gap: 12px; margin-bottom: 25px; }
.tab-pill {
    background: rgba(255,255,255,0.15); border: 2px solid #ff69b4;
    color: #fff; padding: 10px 28px; border-radius: 30px;
    font-family: 'Fredoka One', cursive; font-size: 1.1rem;
    cursor: pointer; transition: 0.2s; text-shadow: 1px 1px 0 #ff1493;
    backdrop-filter: blur(5px);
}
.tab-pill.active { background: #ff1493; border-color: #fff; box-shadow: 0 0 20px #ff1493; }

.bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 700px;
}
.grid-card {
    background: rgba(30,0,30,0.7);
    border: 2px solid #ff69b4;
    border-radius: 16px; padding: 10px;
    text-align: center; cursor: pointer; transition: 0.2s;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(255,20,147,0.3), inset 0 0 15px rgba(255,105,180,0.1);
}
.grid-card:hover {
    transform: scale(1.06) translateY(-5px);
    border-color: #ff1493;
    box-shadow: 0 10px 25px rgba(255,20,147,0.6);
}
.grid-card img {
    width: 100%; aspect-ratio: 1; object-fit: contain;
    border-radius: 10px; margin-bottom: 8px;
    background: rgba(0,0,0,0.4); border: 1px solid #ff69b4;
}
.grid-card .card-name {
    font-family: 'Fredoka One', cursive; color: #fff;
    font-size: 0.85rem; text-shadow: 1px 1px 0 #ff1493;
}

/* ── OVERLAY ── */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 999;
}

/* ── DTI POPUP ── */
.dti-popup {
    background: linear-gradient(160deg, #ffccd7 0%, #ff8daa 100%);
    border: 5px solid #ff1493; border-radius: 30px;
    padding: 15px 25px 55px;
    text-align: center; position: relative;
    width: 90%; max-width: 340px;
    box-shadow: 0 0 50px rgba(255,20,147,0.9), inset 0 0 30px rgba(255,255,255,0.6);
    animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { opacity:0; transform:scale(0.7); } to { opacity:1; transform:scale(1); } }

.popup-header-label {
    font-family: 'Fredoka One', cursive; font-size: 0.8rem;
    color: #fff; letter-spacing: 2px; margin-bottom: 5px;
    text-shadow: 1px 1px 0 #ff1493;
}
.popup-header-title {
    display: inline-block;
    background: #ff69b4; border: 3px solid #fff; border-radius: 30px;
    padding: 6px 25px; font-family: 'Fredoka One', cursive;
    font-size: 1.4rem; color: #fff; letter-spacing: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); margin-bottom: 18px;
    text-shadow: 1px 2px 0 #ff1493;
}

.popup-body { display: flex; flex-direction: column; align-items: center; }

.item-frame {
    width: 150px; height: 150px;
    background: #1a0026; border: 4px solid #ff1493; border-radius: 12px;
    display: flex; justify-content: center; align-items: center;
    position: relative; margin-bottom: 12px;
    box-shadow: inset 0 0 30px rgba(255,20,147,0.5);
}
.item-frame img { width: 90%; height: 90%; object-fit: contain; filter: drop-shadow(0 0 8px #ff69b4); }
.star-icon {
    position: absolute; top: 6px; right: 8px;
    font-size: 1.6rem; color: #ccc; line-height: 1;
}

.popup-item-name {
    font-family: 'Fredoka One', cursive; font-size: 1.2rem;
    color: #ff1493; margin-bottom: 14px; text-shadow: 1px 1px 0 #fff;
}

.popup-input {
    width: 100%; border: 3px solid #ffb6c1; border-radius: 20px;
    padding: 12px 20px; font-family: 'Fredoka One', cursive; font-size: 1.1rem;
    color: #ff69b4; text-align: center; outline: none; margin-bottom: 12px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.popup-input::placeholder { color: #ffb6c1; }
.popup-input:focus { border-color: #ff1493; }

.popup-btn {
    width: 80%; background: linear-gradient(180deg, #ff99cc 0%, #ff69b4 100%);
    border: 3px solid #fff; border-radius: 30px; padding: 12px;
    font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: #fff;
    cursor: pointer; box-shadow: 0 6px 15px rgba(255,20,147,0.4);
    text-shadow: 1px 2px 0 #ff1493; transition: 0.1s;
}
.popup-btn:active { transform: translateY(3px); box-shadow: 0 3px 8px rgba(255,20,147,0.4); }

.popup-status { font-family: 'Nunito', sans-serif; font-weight: 800; color: #ff1493; margin-top: 8px; height: 20px; font-size: 0.9rem; }

.popup-close {
    position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
    width: 56px; height: 56px; background: #ff1493; border: 4px solid #ffb6c1;
    border-radius: 50%; color: #fff; font-family: 'Fredoka One', cursive;
    font-size: 1rem; cursor: pointer; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ── VERIFICATION ── */
.verify-box {
    background: linear-gradient(160deg, #ffccd7 0%, #ff8daa 100%);
    border: 5px solid #ff1493; border-radius: 30px;
    padding: 25px 20px; text-align: center;
    width: 90%; max-width: 380px;
    box-shadow: 0 0 50px rgba(255,20,147,0.8);
    animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh; overflow-y: auto;
}
.verify-title {
    font-family: 'Fredoka One', cursive; font-size: 2rem;
    color: #ff1493; text-shadow: 2px 2px 0 #fff; margin-bottom: 10px;
}
.verify-desc {
    font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.95rem;
    color: #333; margin-bottom: 18px; line-height: 1.5;
}
.verify-highlight { color: #ffdd00; text-shadow: 1px 1px 0 #ff1493; }

.task-container {
    background: rgba(255,255,255,0.85); border-radius: 20px;
    padding: 15px; margin-bottom: 15px; border: 2px solid #ff69b4;
}
.task-label { font-family: 'Fredoka One', cursive; color: #ff1493; font-size: 1rem; margin-bottom: 10px; }

.offers-list { display: flex; flex-direction: column; gap: 8px; }
.offer-card {
    background: #fff; border: 2px solid #ffb6c1; border-radius: 14px;
    padding: 12px 15px; text-decoration: none; color: #333; display: block;
    transition: 0.2s; text-align: left;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.offer-card:hover { border-color: #ff1493; transform: scale(1.02); }
.o-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 0.9rem; color: #ff1493; margin-bottom: 3px; }
.o-sub { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.75rem; color: #888; }

.timer-row {
    font-family: 'Fredoka One', cursive; font-size: 1rem; color: #fff;
    text-shadow: 1px 1px 0 #ff1493;
}
.timer-row span { color: #ffdd00; }

/* ── TOASTS ── */
.toast-area { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast-msg { background: rgba(255,255,255,0.95); border: 2px solid #ff1493; padding: 10px 20px; border-radius: 20px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.85rem; color: #333; box-shadow: 0 5px 15px rgba(255,20,147,0.3); animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.toast-msg b { color: #ff1493; }
.toast-msg.hide { animation: toastOut 0.4s ease forwards; }
@keyframes toastIn { from { opacity:0; transform: translateY(20px) scale(0.9); } to { opacity:1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity:0; transform: translateY(-10px) scale(0.9); } }
