@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;800;900&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --primary: #ff9f43;
    --primary-dark: #ee5253;
    --green: #1dd1a1;
    --green-dark: #10ac84;
    --blue: #48dbfb;
    --blue-dark: #0abde3;
    --purple: #f368e0;
    --purple-dark: #9b59b6;
    --text-main: #2d3436;
    --text-muted: #7f8fa6;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Nunito', sans-serif; -webkit-tap-highlight-color: transparent;}
body { background-image: var(--bg-gradient); background-attachment: fixed; display: flex; justify-content: center; min-height: 100vh; color: var(--text-main); }
.background-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: url('https://www.transparenttextures.com/patterns/cubes.png'); opacity: 0.2; z-index: 0; pointer-events: none;}

.app-container { width: 100%; max-width: 480px; height: 100vh; position: relative; display: flex; flex-direction: column; overflow: hidden; z-index: 1; background: rgba(255,255,255,0.3); backdrop-filter: blur(10px); box-shadow: 0 0 40px rgba(0,0,0,0.1); }

/* --- GLASSMORPHISM CARDS --- */
.glass-panel { background: var(--card-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: 24px; box-shadow: var(--shadow-soft); border: 2px solid var(--glass-border); transition: transform 0.3s ease; }
.card { padding: 25px 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px;}

/* --- HEADER & PROFILE --- */
.main-header { padding: 20px; border-radius: 0 0 35px 35px; margin-bottom: 20px; border-top: none; z-index: 10; position: relative;}
.user-profile { display: flex; align-items: center; gap: 15px; margin-bottom: 18px;}
.avatar { width: 55px; height: 55px; background: #fff; border-radius: 18px; display: flex; justify-content: center; align-items: center; border: 3px solid var(--primary); overflow: hidden; box-shadow: 0 5px 15px rgba(255, 159, 67, 0.4); }
.user-info-text { flex: 1; overflow: hidden; }
.username { font-weight: 900; font-size: 18px; display: flex; align-items: center; gap: 8px; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.badge-admin { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; font-size: 10px; padding: 4px 10px; border-radius: 10px; font-weight: 900; box-shadow: 0 3px 8px rgba(10, 189, 227, 0.3); text-transform: uppercase; flex-shrink: 0;}
.status { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 800;}
.dot { width: 10px; height: 10px; background: var(--green); border-radius: 50%; display: inline-block; box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite;}

@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(0.95); opacity: 0.8; } }

/* --- ASSETS PANEL (TỐI ƯU CHỐNG TRÀN SỐ DƯ) --- */
.assets-panel { display: flex; justify-content: space-between; background: rgba(255,255,255,0.7); padding: 12px 8px; border-radius: 20px; gap: 6px; border: 1px solid rgba(255,255,255,0.9);}
.asset-item { flex: 1; background: #fff; padding: 12px 6px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); text-align: center; transition: 0.3s; min-width: 0;} /* min-width: 0 rất quan trọng để flex cho phép thu nhỏ */
.asset-label { font-size: 10px; color: var(--text-muted); font-weight: 900; margin-bottom: 5px; letter-spacing: 0.5px; text-transform: uppercase;}
.asset-value { font-size: 14px; font-weight: 900; word-break: break-all; line-height: 1.2;}
.text-green { color: var(--green-dark); } .text-orange { color: var(--primary-dark); } .text-purple { color: var(--purple-dark); } .text-blue { color: var(--blue-dark); } .text-gray { color: #576574; }

/* --- VIEWS & LAYOUT --- */
.content-area { flex: 1; overflow-y: auto; padding: 0 20px 110px 20px; }
.content-area::-webkit-scrollbar { display: none; }
.view { display: none; animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.view.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* --- THÔNG BÁO MARQUEE CSS (CỰC MƯỢT) --- */
.system-notice-bar {
    background: linear-gradient(90deg, #ff9ff3, #feca57);
    color: #fff;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 900;
    display: flex;
    align-items: center;
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(254, 202, 87, 0.4);
    border: 2px solid rgba(255,255,255,0.5);
}
.notice-icon { margin-right: 15px; font-size: 18px; animation: bell-ring 2s infinite; }
.notice-text-container { flex: 1; overflow: hidden; position: relative; white-space: nowrap; }
.notice-scroll { display: inline-block; padding-left: 100%; animation: marquee 10s linear infinite; text-shadow: 1px 1px 2px rgba(0,0,0,0.1);}
@keyframes marquee { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 10%, 30%, 50%, 70%, 90% { transform: rotate(-15deg); } 20%, 40%, 60%, 80% { transform: rotate(15deg); } }

/* --- NÚT BẤM --- */
.action-buttons { display: flex; gap: 15px; justify-content: center; align-items: center; margin-top: 15px;}
.btn { border: none; outline: none; border-radius: 16px; font-weight: 900; font-size: 14px; cursor: pointer; transition: all 0.2s; padding: 16px 15px; text-transform: uppercase; letter-spacing: 0.5px; position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent !important; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none;}
.btn i { font-size: 18px; }
.btn-primary { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); color: white; box-shadow: 0 6px 0 #c23616, 0 12px 20px rgba(238, 82, 83, 0.3);}
.btn-green { background: linear-gradient(180deg, var(--green), var(--green-dark)); color: white; box-shadow: 0 6px 0 #01a3a4, 0 12px 20px rgba(16, 172, 132, 0.3);}
.btn-purple { background: linear-gradient(180deg, var(--purple), var(--purple-dark)); color: white; box-shadow: 0 6px 0 #8e44ad, 0 12px 20px rgba(155, 89, 182, 0.3);}
.btn-blue { background: linear-gradient(180deg, var(--blue), var(--blue-dark)); color: white; box-shadow: 0 6px 0 #0984e3, 0 12px 20px rgba(10, 189, 227, 0.3);}
.btn-outline { background: #fff; color: var(--text-muted); border: 2px solid #c8d6e5; box-shadow: 0 4px 0 #c8d6e5;}

/* --- GIAO DIỆN CHUỒNG GÀ --- */
.card-title { font-size: 18px; font-weight: 900; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: var(--primary-dark);}
.badge-status { background: var(--green); color: #fff; font-size: 11px; padding: 6px 14px; border-radius: 20px; font-weight: 900; box-shadow: 0 4px 10px rgba(29, 209, 161, 0.3);}
.section-title { font-size: 18px; font-weight: 900; margin: 25px 0 15px 0; text-align: center; text-transform: uppercase;}

.chicken-stage { position: relative; width: 100%; height: 160px; display: flex; justify-content: center; align-items: flex-end; margin-bottom: 25px; background: rgba(255,255,255,0.4); border-radius: 20px; padding-bottom: 20px; border: 2px dashed rgba(255,255,255,0.6);}
.cute-chicken { position: relative; z-index: 2; width: 100px; height: 110px; animation: bounce 1.5s infinite alternate ease-in-out; }
.chicken-body { width: 100%; height: 100%; background: #fff; border-radius: 50px 50px 35px 35px; border: 5px solid #2d3436; position: relative; box-shadow: inset -10px -10px 0 rgba(0,0,0,0.05); }
.comb { position: absolute; width: 45px; height: 25px; background: #ff4757; border-radius: 20px 20px 0 0; top: -20px; left: 25px; border: 5px solid #2d3436; border-bottom: none;}
.comb::before, .comb::after { content: ''; position: absolute; background: #ff4757; border: 5px solid #2d3436; border-bottom: none; border-radius: 20px 20px 0 0;}
.comb::before { width: 25px; height: 15px; top: 8px; left: -12px; }
.comb::after { width: 25px; height: 15px; top: 8px; right: -12px; }
.chicken-face { position: absolute; width: 100%; height: 100%; }
.eye { position: absolute; width: 10px; height: 10px; background: #2d3436; border-radius: 50%; top: 28px; }
.eye.left { left: 24px; } .eye.right { right: 24px; }
.beak { position: absolute; width: 22px; height: 12px; background: #ffa502; border-radius: 8px; border: 5px solid #2d3436; top: 40px; left: 34px; z-index:2;}
.wattle { position: absolute; width: 12px; height: 16px; background: #ff4757; border-radius: 0 0 8px 8px; border: 5px solid #2d3436; border-top: none; top: 50px; left: 39px; z-index:1;}
.chicken-wing { position: absolute; width: 30px; height: 40px; background: #f1f2f6; border: 5px solid #2d3436; border-radius: 15px; top: 40px; }
.chicken-wing.left { left: -12px; transform: rotate(15deg); }
.chicken-wing.right { right: -12px; transform: rotate(-15deg); }
.nest { position: absolute; width: 140px; height: 30px; background: #f1c40f; border-radius: 50%; border: 5px solid #2d3436; bottom: 8px; z-index: 1; box-shadow: inset 0 -10px 0 #d4ac0d;}

@keyframes bounce { 0% { transform: translateY(0); } 100% { transform: translateY(12px); } }
.food-thought { position: absolute; font-size: 35px; top: -45px; right: -15px; opacity: 0; display: none; z-index: 10; filter: drop-shadow(0 4px 5px rgba(0,0,0,0.2));}
.hungry .food-thought { display: block; animation: floatAnim 2s infinite ease-in-out; }
.hungry .cute-chicken { animation: none; transform: translateY(10px); filter: grayscale(30%); } 
@keyframes floatAnim { 0% { transform: translateY(0) scale(0.9); opacity: 0.8; } 50% { transform: translateY(-15px) scale(1.1); opacity: 1; } 100% { transform: translateY(0) scale(0.9); opacity: 0.8; } }

.capacity-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); font-weight: 900; margin-bottom: 15px; background: #fff; padding: 18px; border-radius: 18px; box-shadow: 0 4px 10px rgba(0,0,0,0.02);}

/* --- SHOP ITEMS --- */
.shop-item { display: flex; align-items: center; background: #fff; padding: 18px; border-radius: 20px; margin-bottom: 15px; box-shadow: 0 6px 15px rgba(0,0,0,0.04); transition: 0.3s; border: 1px solid transparent;}
.shop-item:hover { transform: scale(1.02); border-color: var(--primary); }
.shop-icon { font-size: 32px; width: 65px; height: 65px; display: flex; justify-content: center; align-items: center; border-radius: 20px; flex-shrink: 0; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.shop-info { flex: 1; padding-left: 18px; }
.shop-info h4 { margin-bottom: 5px; color: var(--text-main); font-weight: 900; font-size: 17px;}
.shop-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; font-weight: 800; }

/* --- INPUTS & FORMS --- */
.input-group { display: flex; flex-direction: column; gap: 10px; margin-top: 15px;}
.input-group label { font-size: 12px; font-weight: 900; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;}
.input-with-icon { position: relative; display: flex; align-items: center;}
.input-with-icon input, .input-with-icon select { width: 100%; background: rgba(255,255,255,0.8); border: 2px solid #dcdde1; padding: 16px 50px 16px 20px; border-radius: 16px; color: var(--text-main); font-weight: 800; font-size: 15px; outline: none; transition: 0.3s; box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);}
.input-with-icon input:focus, .input-with-icon select:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(72, 219, 251, 0.2);}
.input-with-icon .icon { position: absolute; right: 18px; font-size: 18px; color: var(--text-muted);}

.exchange-rate-box { background: rgba(255, 159, 67, 0.1); border: 2px dashed var(--primary); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;}
.rate-item { font-size: 18px; font-weight: 900;}
.receive-box { background: rgba(29, 209, 161, 0.1); border-radius: 20px; padding: 20px; text-align: center; font-size: 15px; font-weight: 800; color: var(--text-main); border: 2px solid rgba(29, 209, 161, 0.3);}

/* --- HISTORY --- */
.history-list { display: flex; flex-direction: column; gap: 12px; max-height: 280px; overflow-y: auto; padding-right: 5px;}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-thumb { background: #bdc3c7; border-radius: 10px; }
.history-item { background: #fff; border: 1px solid #f1f2f6; border-radius: 16px; padding: 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.03);}
.hist-amt { font-weight: 900; font-size: 16px; color: var(--primary-dark);}
.hist-bank { font-size: 13px; color: var(--text-muted); font-weight: 800; margin: 4px 0;}
.hist-date { font-size: 11px; color: #a4b0be;}
.hist-status { font-size: 11px; font-weight: 900; padding: 6px 10px; border-radius: 10px; text-transform: uppercase;}

/* --- LEADERBOARD --- */
.lb-item { display: flex; align-items: center; background: #fff; padding: 12px 18px; border-radius: 18px; border: 1px solid transparent; gap: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 12px; transition: 0.3s;}
.lb-item:hover { transform: translateX(5px); border-color: var(--primary); }
.lb-rank { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px;}
.rank-1 { background: linear-gradient(135deg, #f1c40f, #f39c12); color: #fff; box-shadow: 0 4px 12px rgba(241, 196, 15, 0.4);}
.rank-2 { background: linear-gradient(135deg, #bdc3c7, #95a5a6); color: #fff; box-shadow: 0 4px 12px rgba(189, 195, 199, 0.4);}
.rank-3 { background: linear-gradient(135deg, #e67e22, #d35400); color: #fff; box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);}
.rank-other { background: #f8f9fa; color: var(--text-muted); border: 2px solid #dcdde1;}

/* --- BOTTOM NAV (KHẮC PHỤC LỖI TRÀN CHỮ) --- */
.bottom-nav { position: absolute; bottom: 0; left: 0; width: 100%; display: flex; justify-content: space-between; padding: 12px 5px 25px 5px; border-radius: 35px 35px 0 0; z-index: 100; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-top: 1px solid rgba(255,255,255,0.5); box-shadow: 0 -10px 30px rgba(0,0,0,0.08);}
.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #a4b0be; gap: 6px; font-weight: 900; flex: 1; transition: 0.3s; padding: 8px 2px; border-radius: 16px; overflow: hidden; min-width: 0;}
.nav-item span { width: 100%; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.nav-item i { font-size: 20px; transition: 0.3s;}
.nav-item.active { color: var(--primary-dark); background: rgba(238, 82, 83, 0.1); transform: translateY(-5px);}
.nav-item.active i { transform: scale(1.2); }
.hidden { display: none !important; }

/* ========================================================
   GIAO DIỆN ADMIN NÂNG CẤP (SÁNG SỦA, SẠCH SẼ, HIỆN ĐẠI)
   ======================================================== */
.admin-wrapper { background: rgba(255, 255, 255, 0.95); padding: 25px 20px; border-radius: 28px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); border: 1px solid rgba(255,255,255,0.8); color: var(--text-main); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px dashed #ecf0f1; }
.admin-title { text-align: center; font-size: 20px; font-weight: 900; color: var(--primary-dark); margin-bottom: 25px; letter-spacing: 1px; text-transform: uppercase; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 30px; }
.admin-stat-box { background: #fff; padding: 20px 5px; border-radius: 20px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #f1f2f6; transition: 0.3s;}
.admin-stat-box:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.stat-label { font-size: 10px; font-weight: 900; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;}
.stat-val { font-size: 16px; font-weight: 900; }
.stat-revenue .stat-val { color: var(--green-dark); }
.stat-players .stat-val { color: var(--primary-dark); }
.stat-pending .stat-val { color: var(--purple-dark); }

.admin-card { background: #fff; border-radius: 24px; padding: 25px 20px; margin-bottom: 25px; box-shadow: 0 6px 20px rgba(0,0,0,0.04); border: 1px solid #f1f2f6;}
.admin-card-title { font-size: 15px; font-weight: 900; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; text-transform: uppercase; color: var(--text-main);}

.admin-input, .admin-select, .admin-textarea { width: 100%; background: #f8f9fa; color: var(--text-main); border: 2px solid #ecf0f1; padding: 15px; border-radius: 16px; font-size: 14px; font-weight: 700; margin-bottom: 15px; outline: none; transition: all 0.3s; }
.admin-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.admin-input:focus, .admin-select:focus, .admin-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(72, 219, 251, 0.15); background: #fff;}
.admin-input::placeholder, .admin-textarea::placeholder { color: #bdc3c7; font-weight: 600; }

.admin-result-box { background: #f8f9fa; border: 2px dashed #bdc3c7; border-radius: 18px; padding: 20px; margin-top: 20px; font-size: 14px; color: var(--text-main);}
.admin-result-box p { margin-bottom: 12px; border-bottom: 1px solid #ecf0f1; padding-bottom: 12px; display: flex; justify-content: space-between; align-items: center;}
.admin-result-box p:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.admin-result-box strong { font-weight: 900; font-size: 15px;}

.admin-withdraw-item { background: #fff; border-radius: 18px; padding: 20px; border-left: 5px solid var(--primary-dark); margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #f1f2f6;}
.title-red { color: var(--primary-dark); } .title-pink { color: var(--purple); } .title-yellow { color: #f39c12; } .title-cyan { color: var(--blue-dark); } .title-green { color: var(--green-dark); }
.flex-row { display: flex; gap: 15px; margin-bottom: 15px; }
.flex-row > * { flex: 1; margin-bottom: 0; }