/* ===== الهوية: غيّري الألوان من هنا فقط ===== */
:root {
  --bg: #0e0b1f;
  --bg2: #171233;
  --card: #1c1640;
  --line: #2f2766;
  --text: #f4f1ff;
  --muted: #a79fd0;
  --accent: #8b5cf6;
  --accent2: #f43f5e;
  --ok: #22c55e;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #2a1f6b 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}
#app { max-width: 480px; margin: 0 auto; padding: 0 16px 40px; min-height: 100vh; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 8px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: .3px; }
.top-r { display: flex; gap: 8px; align-items: center; }
.code-pill { direction: ltr; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 700; letter-spacing: 3px; }
.icon { background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px; font-size: 15px; cursor: pointer; font-family: inherit; }

main { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.muted { color: var(--muted); font-size: 15px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.center { align-items: center; }

.btn {
  font-family: inherit; font-size: 18px; font-weight: 700; border: 0; border-radius: 14px;
  padding: 14px 18px; cursor: pointer; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  width: 100%; transition: transform .06s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #6d3df0); border-color: transparent; }
.btn.danger { background: linear-gradient(135deg, var(--accent2), #d81b46); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.hero { text-align: center; padding: 28px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.hero .logo { font-size: 64px; filter: drop-shadow(0 6px 24px rgba(139, 92, 246, .55)); }
.hero h1 { font-size: 40px; font-weight: 800; }

.big { font-size: 56px; line-height: 1.1; }
.big-code { direction: ltr; font-size: 52px; font-weight: 800; letter-spacing: 10px; padding-left: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 500; font-size: 16px; }
.chip .em { font-size: 20px; }
.chip.off { opacity: .4; }
.chip.done { border-color: var(--ok); }
.chip.me { border-color: var(--accent); }

.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font-family: inherit; font-size: 14px; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.opt { font-family: inherit; font-size: 18px; font-weight: 700; color: var(--text); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 18px 10px; cursor: pointer; min-height: 72px; }
.opt:active { border-color: var(--accent); }
.avatar-btn { font-family: inherit; color: var(--text); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; }
.avatar-btn .em { font-size: 32px; }
.avatar-btn[disabled] { opacity: .25; cursor: not-allowed; }

.question { font-size: 24px; font-weight: 800; text-align: center; }
.progress { color: var(--muted); font-size: 15px; text-align: center; }

.role { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 8px 0; }
.role .secret { font-size: 34px; font-weight: 800; color: #c4b5fd; }
.role.imp h2 { color: var(--accent2); }
.role-bar { font-family: inherit; font-size: 15px; font-weight: 700; color: var(--text); background: var(--bg2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px; cursor: pointer; width: 100%; }

.ans { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ans:last-child { border-bottom: 0; }
.ans .word { font-weight: 800; font-size: 18px; text-align: left; }
.recap h4 { margin: 10px 0 2px; color: var(--muted); font-size: 14px; font-weight: 500; }
.recap .ans { padding: 5px 0; }
.recap .word { font-size: 15px; }

.result-title { font-size: 30px; font-weight: 800; text-align: center; }
.result-title.win { color: var(--ok); }
.result-title.lose { color: var(--accent2); }
.score { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.score b { font-size: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #111; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 10; }
.error { color: #fda4af; text-align: center; font-weight: 700; }

input.code-input {
  font-family: inherit; direction: ltr; text-align: center; font-size: 40px; font-weight: 800; letter-spacing: 12px;
  width: 100%; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); text-transform: uppercase;
}
input.code-input:focus { outline: none; border-color: var(--accent); }

/* ===== إضافات: الفئات، التحقيق، المؤقت ===== */
.catpill { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: 15px; }
.catgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.catbtn { position: relative; font-family: inherit; color: var(--text); background: var(--bg2); border: 2px solid var(--line); border-radius: 14px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; }
.catbtn .em { font-size: 26px; }
.catbtn.on { border-color: var(--accent); background: #251c55; }
.catbtn.locked { opacity: .55; }
.catbtn i { position: absolute; top: 4px; left: 6px; font-style: normal; font-size: 12px; }
.catbtn[disabled] { cursor: default; }
.text-input { font-family: inherit; font-size: 18px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); }
.text-input:focus { outline: none; border-color: var(--accent); }
.opt.sel { border-color: var(--accent); background: #251c55; }

.timer { position: relative; height: 30px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.timer .bar { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, var(--accent), #6d3df0); transition: width .25s linear; opacity: .55; }
.timer .bar.low { background: linear-gradient(90deg, var(--accent2), #d81b46); }
.timer b { position: relative; font-size: 17px; }

.qa { gap: 10px; }
.qa-head { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.qa-head .arrow { color: var(--muted); font-size: 14px; }
.bubble { border-radius: 16px; padding: 12px 14px; font-size: 19px; font-weight: 700; line-height: 1.5; word-break: break-word; }
.bubble.q { background: #2a2060; border: 1px solid var(--line); }
.bubble.a { background: #17304a; border: 1px solid #2c5a86; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bubble.a.none, .bubble.a.skip { background: var(--bg2); border-color: var(--line); color: var(--muted); }
.bubble .who { font-size: 14px; }

.rep{background:none;border:0;font-size:16px;opacity:.6;cursor:pointer;padding:0 6px}.rep:active{opacity:1}

.ico3d{position:relative;display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;flex:none;
  background:radial-gradient(circle at 32% 28%,#fff 0,#ffe9b8 18%,#f3b85a 55%,#b86e1c 100%);
  box-shadow:inset -5px -7px 10px rgba(90,40,0,.35),inset 4px 4px 8px rgba(255,255,255,.7),0 6px 10px rgba(0,0,0,.35),0 2px 0 rgba(255,255,255,.2);overflow:hidden}
.ico3d b{font-size:30px;font-weight:400;line-height:1;filter:drop-shadow(0 3px 2px rgba(0,0,0,.35))}
.ico3d img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%}
.chip .ico3d{width:30px;height:30px;box-shadow:inset -2px -3px 5px rgba(90,40,0,.35),inset 2px 2px 4px rgba(255,255,255,.7),0 3px 5px rgba(0,0,0,.35)}
.chip .ico3d b{font-size:16px}
.opt .ico3d{width:44px;height:44px}.opt .ico3d b{font-size:24px}
.avatar-btn.sel{border-color:var(--accent);transform:translateY(-2px)}
.btn[disabled]{opacity:.4}

.acct{display:flex;gap:10px;align-items:center;justify-content:center;margin:6px 0}
.coinbadge{background:var(--bg2);border:1px solid var(--line);border-radius:999px;padding:6px 14px;font-weight:700}
.btn.small{padding:8px 12px;font-size:14px;width:auto}
.tabs{display:flex;gap:6px;overflow-x:auto;padding:4px 0}.tabs button{font-family:inherit;white-space:nowrap;background:var(--bg2);color:var(--text);border:1px solid var(--line);border-radius:999px;padding:8px 14px;cursor:pointer}.tabs button.on{border-color:var(--accent);font-weight:700}
.item{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}.item b{flex:1}.item.col{flex-direction:column;border:0;gap:6px;text-align:center}
.price{font-weight:700}.owned{color:var(--ok);font-weight:700}.link{background:none;border:0;color:var(--accent);font-family:inherit;cursor:pointer;text-decoration:underline}
.swatch{font-size:20px}.avatar-btn{position:relative}.avatar-btn .lk{position:absolute;top:4px;left:6px;font-style:normal}.avatar-btn.lockedav{opacity:.55}
.fr-gold{box-shadow:0 0 0 3px #f5c542,0 0 14px #f5c542,0 6px 10px rgba(0,0,0,.35)!important}
.fr-neon{box-shadow:0 0 0 3px #38f5d0,0 0 18px #38f5d0,0 0 30px #1fb8ff!important}
.fr-fire{box-shadow:0 0 0 3px #ff7a18,0 0 18px #ff3d00,0 -6px 16px #ffb300!important}
.fr-ice{box-shadow:0 0 0 3px #bfeaff,0 0 18px #6fd0ff,0 0 28px #fff!important}
.fr-royal{box-shadow:0 0 0 3px #7a3cff,0 0 0 6px #f5c542,0 0 16px #7a3cff!important}
.fr-rainbow{box-shadow:0 0 0 3px #ff4d4d,0 0 0 6px #ffd24d,0 0 0 9px #4dd2ff,0 0 14px #b84dff!important}

.gain{color:var(--ok);font-weight:700}
