@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background: #090e17; color: #ffffff; min-height: 100vh; background-image: radial-gradient(circle at top right, #102a43, #090e17); }

.main-header { background: rgba(16, 185, 129, 0.1); padding: 25px; text-align: center; border-bottom: 2px solid #10b981; backdrop-filter: blur(10px); }
.main-header h1 { font-size: 2.5em; color: #10b981; letter-spacing: 2px; text-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
.main-header p { color: #94a3b8; }

.login-container { max-width: 520px; margin: 60px auto 40px auto; background: rgba(15, 23, 42, 0.92); padding: 40px 35px; border-radius: 24px; text-align: center; border: 1px solid rgba(16, 185, 129, 0.18); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.login-container h2 { margin-bottom: 12px; color: #f8fafc; }
.auth-description { color: #94a3b8; font-size: 0.95em; margin-bottom: 20px; line-height: 1.6; }
.login-container label { display: block; text-align: left; margin-bottom: 10px; color: #cbd5e1; font-size: 0.95em; }
select, input[type="text"], input[type="password"] { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid #334155; background: rgba(15, 23, 42, 0.92); color: #e2e8f0; margin-bottom: 16px; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #10b981 50%), linear-gradient(135deg, #10b981 50%, transparent 50%); background-position: calc(100% - 20px) center, calc(100% - 15px) center; background-size: 8px 8px; background-repeat: no-repeat; }
select:focus, input[type="text"]:focus, input[type="password"]:focus { border-color: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08); }
.auth-note { font-size: 0.9em; color: #94a3b8; margin-top: -10px; margin-bottom: 18px; text-align: left; }
button { background: linear-gradient(135deg, #22c55e, #10b981); color: white; border: none; padding: 15px; font-size: 1.05em; border-radius: 14px; cursor: pointer; width: 100%; font-weight: 700; letter-spacing: 0.6px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(16, 185, 129, 0.25); }
button:disabled { background: #475569; cursor: not-allowed; box-shadow: none; }
.error { color: #f87171; margin-top: 15px; display: none; font-weight: 600; }

.store-container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.user-info-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; background: rgba(30,41,59,0.5); padding: 15px; border-radius: 15px; margin-bottom: 25px; border: 1px solid #334155; }
.user-info-item { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 90px; background: #1e293b; padding: 8px; border-radius: 10px; border: 1px solid #475569; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.user-info-item .label { font-size: 0.75em; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px; }
.user-info-item .value { font-size: 1.15em; font-weight: 800; color: #10b981; }
.wallet-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; background: rgba(30,41,59,0.5); padding: 15px; border-radius: 15px; margin-bottom: 25px; border: 1px solid #334155; }
.wallet-item { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 90px; background: #1e293b; padding: 8px; border-radius: 10px; border: 1px solid #475569; }
.wallet-item .label { font-size: 0.75em; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px; }
.wallet-item .value { font-size: 1.2em; font-weight: bold; }
#valDiamond { color: #38bdf8; } #valGold { color: #fbbf24; } #valTopup { color: #10b981; font-size: 0.9em; }

.store-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #1e293b; padding-bottom: 15px; margin-bottom: 20px; }
.store-header h3 { color: #f8fafc; font-size: 1.5em; }
#welcomeStatus { color: #cbd5e1; }
.welcome-bar { display: flex; justify-content: space-between; align-items: center; background: #1e293b; padding: 18px 22px; border-radius: 15px; border: 1px solid #334155; margin-bottom: 15px; }
.welcome-bar h3 { color: #f8fafc; font-size: 1.3em; margin: 0; }
.welcome-bar span { color: #94a3b8; }
.logout-btn { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; border: none; padding: 10px 20px; font-size: 0.9em; border-radius: 10px; cursor: pointer; font-weight: 600; letter-spacing: 0.5px; transition: transform 0.2s ease, box-shadow 0.2s ease; width: auto; }
.logout-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3); }
#giftsSent { background: #1e293b; padding: 8px 15px; border-radius: 8px; color: #10b981; border: 1px solid #334155; }

.category-bar { display: flex; overflow-x: auto; overflow-y: hidden; gap: 10px; padding-bottom: 15px; margin-bottom: 20px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.category-bar::-webkit-scrollbar { height: 8px; }
.category-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 10px; }
.category-bar::-webkit-scrollbar-track { background: transparent; }
.cat-btn { background: #1e293b; border: 1px solid #334155; color: #94a3b8; padding: 8px 20px; border-radius: 20px; cursor: pointer; white-space: nowrap; width: auto;}
.cat-btn.active, .cat-btn:hover { background: #10b981; color: white; border-color: #10b981; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: linear-gradient(180deg, #1e293b, #0f172a); border-radius: 16px; padding: 20px; text-align: center; border: 1px solid #334155; position: relative; }
.card:hover { transform: translateY(-5px); border-color: #10b981; }
.sort-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.5); font-size: 0.7em; padding: 4px 8px; border-radius: 6px; color: #64748b; }
.card-img-container { height: 130px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.card-img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); }
.price { font-size: 1.2em; font-weight: 800; margin: 15px 0; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 10px; }
.expire { font-size: 0.75em; color: #94a3b8; margin-bottom: 15px; font-family: monospace; }
.btn-send { background: #3b82f6; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); }

/* Modal */
.modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); align-items:center; justify-content:center; z-index:9999; backdrop-filter: blur(5px); }
.modal-content { background:#1e293b; padding:30px; border-radius:20px; width:90%; max-width:400px; text-align:center; border: 1px solid #10b981; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal-btns { display:grid; grid-template-columns: 1fr 1fr; gap:15px; margin-top: 20px; }
.btn-cancel { background:#475569; box-shadow: none; }
.btn-cancel:hover { background:#334155; }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .welcome-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; }
  .welcome-bar h3 { font-size: 1.1em; }
  .welcome-bar span { font-size: 0.9em; }
  .user-info-bar { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .user-info-item { width: 100%; min-height: 90px; padding: 10px; }
  .wallet-bar { grid-template-columns: 1fr 1fr; }
  .wallet-item.full { grid-column: span 2; }
  .store-header { flex-direction: column; gap: 15px; }
}