/*
 * ป๊อปอัปเตือนก่อนเข้าเว็บ (หน้าแรก) — คู่กับ lib/entry_notice.php + assets/entry-notice.js
 * ฉากหลังเบลอเต็มจอ + การ์ดกลางจอ; ยอมรับ = เข้าเว็บ (จำไว้ตามจำนวนวันที่ตั้งใน lib/entry_notice.php), ปฏิเสธ = ออกไปเว็บอื่น
 * ต้องมี assets/site-theme.css (ตัวแปร --notice-scrim, --notice-icon, --card-bg, --border, --text-primary, --text-muted, --accent, --shadow) โหลดอยู่ก่อน
 *
 * ไม่กะพริบเนื้อหาข้างหลัง: ป๊อปอัปเป็น HTML ที่เห็นตั้งแต่แรก; assets/entry-notice.js (โหลดใน <head>) ใส่คลาส notice-accepted ที่ <html> ก่อน paint
 * ถ้าเคยยอมรับแล้ว → ซ่อน (ไม่มี JS = ซ่อนด้วย <noscript> ใน lib/entry_notice.php)
 */
.entry-notice {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: var(--notice-scrim);
    -webkit-backdrop-filter: blur(10px) saturate(1.15); backdrop-filter: blur(10px) saturate(1.15);
    animation: entry-fade .35s ease both;
}
html.notice-accepted .entry-notice { display: none; }
html:not(.notice-accepted) body { overflow: hidden; } /* เลื่อนหน้าข้างหลังไม่ได้ระหว่างรอตอบ */
.entry-notice.is-leaving { animation: entry-fade-out .25s ease forwards; }

.entry-card {
    position: relative; overflow: hidden; width: 100%; max-width: 420px; box-sizing: border-box;
    padding: 36px 30px 28px; text-align: center;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 24px;
    box-shadow: 0 28px 70px var(--shadow), 0 2px 8px var(--shadow-sm);
    font-family: var(--font-main);
    animation: entry-rise .5s cubic-bezier(.2, .9, .3, 1.08) .05s both;
}
/* แถบสีบางๆ ขอบบนการ์ด */
.entry-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--brand-logo-yellow), var(--bar-highlight));
}

.entry-icon {
    position: relative; display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 20px;
    border-radius: 50%; color: var(--notice-icon);
    background: color-mix(in srgb, var(--notice-icon) 16%, transparent);
}
/* วงกระเพื่อมรอบไอคอน */
.entry-icon::after {
    content: ''; position: absolute; inset: -8px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--notice-icon) 38%, transparent);
    animation: entry-pulse 2.6s ease-out infinite;
}

.entry-title { margin: 0 0 16px; font-size: 23px; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
/* 3 ข้อ: จุดสีเหลืองนำหน้า, ข้อสุดท้าย (สิ่งที่ต้องทำ) เด่นกว่า */
.entry-list { display: grid; gap: 12px; margin: 0 0 28px; padding: 0; list-style: none; text-align: left; }
.entry-list li { position: relative; padding-left: 24px; font-size: 15.5px; line-height: 1.6; color: var(--text-muted); }
.entry-list li::before {
    content: ''; position: absolute; left: 3px; top: .62em; width: 9px; height: 9px; border-radius: 50%;
    background: var(--notice-icon); box-shadow: 0 0 0 4px color-mix(in srgb, var(--notice-icon) 20%, transparent);
}
.entry-list .entry-list-key { color: var(--text-primary); font-weight: 600; }

.entry-actions { display: flex; gap: 12px; }
.entry-btn {
    flex: 1; padding: 13px 18px; border-radius: 999px; cursor: pointer;
    font-family: inherit; font-size: 16px; font-weight: 700;
    transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.entry-btn:active { transform: scale(.97); }
.entry-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.entry-btn-accept { border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.entry-btn-accept:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.entry-btn-decline { border: 1px solid var(--border-strong); background: transparent; color: var(--text-muted); }
.entry-btn-decline:hover { border-color: var(--text-muted); color: var(--text-primary); }

@media (max-width: 480px) {
    .entry-card { padding: 30px 22px 22px; border-radius: 22px; }
    .entry-title { font-size: 21px; }
    .entry-list li { font-size: 15px; }
    .entry-actions { flex-direction: column-reverse; } /* มือถือ: ยอมรับอยู่บน */
}

@keyframes entry-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes entry-fade-out { to { opacity: 0; } }
@keyframes entry-rise { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes entry-pulse { 0% { transform: scale(.85); opacity: .9; } 70%, 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .entry-notice, .entry-card, .entry-notice.is-leaving { animation: none; }
    .entry-icon::after { animation: none; opacity: 0; }
    .entry-btn { transition: none; }
}
