:root {
  --bg-dark: #0f172a;
  --bg-panel: #1e293b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --gray: #64748b;
  --text: #f8fafc;
  --border: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background-color: var(--bg-dark); color: var(--text); overflow-x: hidden; }
.hidden { display: none !important; }
.mt-15 { margin-top: 15px; }
.w-100 { width: 100%; }
.highlight { color: var(--primary); font-weight: bold; }

/* SCREENS */
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: absolute; inset: 0; background: var(--bg-dark); }

/* AUTH */
.auth-card { background: var(--bg-panel); padding: 40px; border-radius: 20px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid var(--border); }
.brand-logo { text-align: center; font-size: 24px; font-weight: bold; color: var(--primary); margin-bottom: 20px; }
.auth-card h2 { text-align: center; margin-bottom: 25px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 14px; color: #cbd5e1; }
.input-group input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-dark); color: white; outline: none; }
.input-group input:focus { border-color: var(--primary); }
.form-options { margin-bottom: 20px; font-size: 14px; }
.btn-primary, .btn-success, .btn-danger { width: 100%; padding: 14px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; color: white; transition: 0.2s; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-danger:disabled, .btn-success:disabled { opacity: 0.5; cursor: not-allowed; }
.switch-text { text-align: center; margin-top: 20px; font-size: 14px; color: #94a3b8; }
.switch-text span { color: var(--primary); cursor: pointer; font-weight: bold; }

/* HUB */
.hub-container { text-align: center; }
.hub-container h1 { font-size: 36px; margin-bottom: 40px; }
.hub-buttons { display: flex; gap: 20px; margin-bottom: 40px; justify-content: center; }
.btn-play, .btn-settings { padding: 20px 40px; border: none; border-radius: 15px; font-size: 20px; font-weight: bold; cursor: pointer; color: white; transition: transform 0.2s; display: flex; align-items: center; gap: 10px; }
.btn-play:hover, .btn-settings:hover { transform: translateY(-5px); }
.btn-play { background: var(--success); }
.btn-settings { background: var(--gray); }
.btn-logout { background: transparent; color: var(--danger); border: 1px solid var(--danger); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; }

/* PANELS */
.panel-container { background: var(--bg-panel); width: 90%; max-width: 500px; border-radius: 20px; border: 1px solid var(--border); padding: 25px; }
.large-panel { max-width: 800px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.btn-close { background: transparent; border: none; color: white; font-size: 24px; cursor: pointer; }
.setting-item { margin-bottom: 20px; }
.setting-item label { display: block; margin-bottom: 10px; font-weight: 600; }
.setting-item select, .search-box input { width: 100%; padding: 12px; border-radius: 8px; background: var(--bg-dark); border: 1px solid var(--border); color: white; }
.search-box { display: flex; gap: 10px; }
.search-box button { width: auto; padding: 0 20px; }

/* TABS */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 12px; background: var(--bg-dark); border: 1px solid var(--border); color: white; border-radius: 8px; cursor: pointer; font-weight: bold; }
.tab-btn.active { background: var(--primary); border-color: var(--primary); }
.data-list { list-style: none; }
.data-list li { background: var(--bg-dark); padding: 15px; margin-bottom: 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; }
.gem-checkboxes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; max-height: 200px; overflow-y: auto; padding-right: 5px; }
.gem-cb { display: flex; align-items: center; gap: 8px; background: var(--bg-dark); padding: 10px; border-radius: 8px; font-size: 12px; }

/* TRADE ARENA */
.trade-arena { width: 100%; max-width: 1000px; padding: 20px; }
.trade-header { text-align: center; margin-bottom: 30px; }
.trade-status { font-size: 18px; color: #f59e0b; margin-top: 10px; font-weight: bold; }
.trade-sides { display: flex; gap: 20px; }
.trade-side { flex: 1; background: var(--bg-panel); border-radius: 20px; border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; }
.trade-side h3 { text-align: center; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.offer-box { flex: 1; min-height: 200px; background: var(--bg-dark); border-radius: 12px; margin-bottom: 15px; padding: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-content: flex-start; }
.inventory-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 15px; border-top: 1px dashed var(--border); padding-top: 15px; }
.gem-item { background: #334155; padding: 8px 12px; border-radius: 8px; cursor: pointer; user-select: none; border: 1px solid #475569; display: flex; align-items: center; gap: 5px; font-size: 14px; }
.gem-item:hover { background: #475569; }

/* Trade Action Buttons */
.trade-action-btns { display: flex; gap: 10px; }
.btn-ready { flex: 2; padding: 15px; border: none; border-radius: 10px; font-size: 18px; font-weight: bold; color: white; cursor: pointer; transition: 0.3s; background: var(--success); }
.btn-ready:disabled { background: var(--gray); cursor: not-allowed; opacity: 0.7; }
.btn-cancel-trade { flex: 1; padding: 15px; border: none; border-radius: 10px; font-size: 18px; font-weight: bold; color: white; cursor: pointer; background: var(--danger); transition: 0.3s; }
.btn-cancel-trade:hover { background: var(--danger-hover); }

.partner-btn { width: 100%; background: var(--gray); cursor: default; }
.partner-btn.ready-state { background: var(--success); }

/* MODALS & NOTIFICATIONS */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--bg-panel); padding: 30px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; border: 1px solid var(--border); }
.modal-buttons { display: flex; gap: 15px; margin-top: 25px; }
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast { background: var(--bg-panel); border-left: 4px solid var(--primary); padding: 15px 20px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 10px; min-width: 250px; animation: slideIn 0.3s forwards; }
.toast-btns { display: flex; gap: 10px; }
.toast-btns button { padding: 8px; border: none; border-radius: 5px; cursor: pointer; color: white; font-weight: bold; flex: 1; }
.btn-accept { background: var(--success); }
.btn-reject { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ADMIN */
.admin-box { max-width: 500px; border-color: #a855f7; box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); text-align: left; }
.admin-section label { display: block; margin-bottom: 5px; color: #d8b4fe; }
.admin-section input, .admin-section select { width: 100%; padding: 10px; margin-bottom: 10px; background: var(--bg-dark); border: 1px solid #7e22ce; color: white; border-radius: 6px; }
#announcement-banner { position: fixed; top: 0; left: 0; right: 0; background: #ef4444; color: white; text-align: center; padding: 10px; font-weight: bold; z-index: 10000; }