/* ====== محكمة الهزار العليا — تصميم سينمائي ====== */
:root {
  --bg: #050505;
  --bg2: #0d0b08;
  --gold: #d4af37;
  --gold-light: #f5d97a;
  --red: #e0313a;
  --green: #2ecc71;
  --text: #ece7dc;
  --muted: #9a917f;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(212, 175, 55, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: radial-gradient(ellipse at 50% -10%, #1a1408 0%, var(--bg) 55%), var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ====== ستارة الافتتاح ====== */
#curtain {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(circle at 50% 40%, #241a06 0%, #000 70%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.2s ease, visibility 1.2s;
}
#curtain.open { opacity: 0; visibility: hidden; }
.curtain-inner { text-align: center; animation: curtainIn 1.4s ease both; }
.curtain-seal {
  font-size: 4.5rem;
  filter: drop-shadow(0 0 25px rgba(212,175,55,.6));
  animation: sealPulse 2s ease-in-out infinite;
}
.curtain-title {
  font-family: 'Aref Ruqaa', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212,175,55,.4);
  margin-top: .5rem;
}
.curtain-sub { color: var(--text); font-size: 1.1rem; margin-top: .6rem; }
.case-no { color: var(--red); font-weight: 900; }
.curtain-hint { color: var(--muted); margin-top: 1.4rem; font-size: .9rem; animation: blink 1.6s infinite; }
@keyframes curtainIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sealPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes blink { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

/* ====== شريط عاجل ====== */
#breaking-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: stretch;
  background: #12080a;
  border-bottom: 1px solid rgba(224,49,58,.4);
  overflow: hidden;
}
.breaking-label {
  background: var(--red); color: #fff;
  font-weight: 900; padding: .45rem 1rem;
  white-space: nowrap; display: flex; align-items: center;
  animation: breakingGlow 1.5s infinite;
}
@keyframes breakingGlow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.breaking-track {
  display: flex; align-items: center; white-space: nowrap;
  animation: marquee 30s linear infinite;
}
.breaking-text { padding: .45rem 0; color: #f2d5d7; font-size: .95rem; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ====== الهيرو ====== */
#hero-section {
  text-align: center;
  padding: 4rem 1.2rem 3.5rem;
  position: relative;
}
.dust {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(212,175,55,.5), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.35), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(212,175,55,.3), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,.3), transparent),
    radial-gradient(1.5px 1.5px at 10% 80%, rgba(212,175,55,.4), transparent);
  animation: dustFloat 14s ease-in-out infinite alternate;
}
@keyframes dustFloat { from { transform: translateY(0); } to { transform: translateY(-25px); } }

.court-eyebrow { color: var(--muted); letter-spacing: .5px; font-size: .95rem; }
.court-title {
  font-family: 'Aref Ruqaa', serif;
  font-size: clamp(2.3rem, 7vw, 4.2rem);
  color: var(--gold);
  text-shadow: 0 0 60px rgba(212,175,55,.35);
  margin: .3rem 0;
}
.court-case { font-size: clamp(1rem, 3vw, 1.35rem); color: var(--text); }
.court-case em { color: var(--gold-light); font-style: normal; }

/* المتهم تحت الضوء */
.defendant { margin: 3rem auto 0; position: relative; width: fit-content; }
.spotlight-ring {
  position: relative;
  width: min(320px, 78vw); height: min(320px, 78vw);
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(var(--gold), #6b5518, var(--gold-light), #40320c, var(--gold));
  animation: ringSpin 10s linear infinite;
  box-shadow: 0 0 80px rgba(212,175,55,.35), 0 0 160px rgba(212,175,55,.15);
}
@keyframes ringSpin { to { filter: hue-rotate(20deg); } }
.defendant-img {
  width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; display: block;
  filter: contrast(1.05);
}
.spotlight-beam {
  position: absolute; left: 50%; bottom: 99%;
  width: 180%; height: 220px;
  transform: translateX(-50%);
  background: linear-gradient(to top, rgba(212,175,55,.14), transparent 75%);
  clip-path: polygon(38% 100%, 62% 100%, 85% 0, 15% 0);
  pointer-events: none;
  animation: beamFlicker 4s ease-in-out infinite;
}
@keyframes beamFlicker { 0%,100% { opacity: .8; } 50% { opacity: 1; } }

.stamp {
  position: absolute; top: 6%; left: -4%;
  transform: rotate(-18deg);
  border: 3px solid var(--red); color: var(--red);
  font-weight: 900; font-size: 1.4rem;
  padding: .2rem .9rem; border-radius: 8px;
  background: rgba(224,49,58,.08);
  text-shadow: 0 0 12px rgba(224,49,58,.5);
  box-shadow: 0 0 18px rgba(224,49,58,.35);
  animation: stampIn .6s cubic-bezier(.2,2,.4,1) 2.2s both;
}
@keyframes stampIn { from { transform: rotate(-18deg) scale(3); opacity: 0; } to { transform: rotate(-18deg) scale(1); opacity: 1; } }

.defendant-name { margin-top: 1.2rem; font-size: 1.2rem; }
.tiktok-link {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-inline-start: .6rem;
  color: #25f4ee; text-decoration: none;
  font-size: 1rem; font-weight: 700;
  transition: transform .2s;
}
.tiktok-link:hover { transform: scale(1.07); text-decoration: underline; }

/* بطاقة الاتهام */
.charge-card {
  max-width: 720px; margin: 2.5rem auto 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.6rem 1.8rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.charge-card h2 { color: var(--gold); font-size: 1.25rem; margin-bottom: .8rem; }
.charge-text { line-height: 2; color: var(--text); font-size: 1.05rem; }
.quote {
  color: var(--gold-light); font-weight: 900; font-size: 1.15em;
  text-shadow: 0 0 18px rgba(245,217,122,.4);
}

.cta-btn {
  display: inline-block; margin-top: 2.2rem;
  background: linear-gradient(135deg, var(--gold), #a8842a);
  color: #16110394; color: #1a1403;
  font-weight: 900; font-size: 1.15rem;
  padding: .9rem 2.4rem; border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(212,175,55,.35);
  transition: transform .25s, box-shadow .25s;
}
.cta-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 40px rgba(212,175,55,.5); }

/* ====== الأقسام العامة ====== */
main { max-width: 1000px; margin: 0 auto; padding: 0 1.2rem 3rem; }
section { margin-top: 4.5rem; }
.section-title {
  font-family: 'Aref Ruqaa', serif;
  color: var(--gold);
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  text-align: center;
}
.section-sub { text-align: center; color: var(--muted); margin-top: .4rem; }

/* ====== التصويت ====== */
.vote-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
  margin-top: 2rem;
}
.vote-card {
  font-family: 'Cairo', sans-serif;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 1.8rem 1.2rem;
  color: var(--text);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.vote-card:hover { transform: translateY(-6px); }
.vote-guilty:hover { border-color: var(--red); box-shadow: 0 12px 40px rgba(224,49,58,.25); }
.vote-innocent:hover { border-color: var(--green); box-shadow: 0 12px 40px rgba(46,204,113,.25); }
.vote-card:disabled { opacity: .75; cursor: not-allowed; transform: none; }
.vote-card.voted { border-width: 3px; }
.vote-guilty.voted { border-color: var(--red); }
.vote-innocent.voted { border-color: var(--green); }
.vote-emoji { font-size: 2.6rem; }
.vote-label { font-weight: 900; font-size: 1.2rem; }
.vote-desc { color: var(--muted); font-size: .9rem; }
.vote-count { font-size: 2.4rem; font-weight: 900; margin-top: .4rem; }
.vote-guilty .vote-count { color: var(--red); }
.vote-innocent .vote-count { color: var(--green); }
.vote-unit { color: var(--muted); font-size: .85rem; }

.verdict-meter { margin-top: 2rem; }
.meter-bar {
  height: 22px; border-radius: 20px; overflow: hidden;
  background: rgba(46,204,113,.25);
  border: 1px solid var(--border);
}
.meter-fill {
  height: 100%; width: 50%;
  background: linear-gradient(90deg, #8e1e24, var(--red));
  border-radius: 0 20px 20px 0;
  transition: width 1s cubic-bezier(.3,1.2,.4,1);
}
.meter-labels {
  display: flex; justify-content: space-between;
  margin-top: .6rem; color: var(--muted); font-size: .95rem;
  flex-wrap: wrap; gap: .4rem;
}
.meter-labels strong { color: var(--text); }
.verdict-line {
  text-align: center; margin-top: 1.4rem;
  font-size: 1.2rem; font-weight: 700; color: var(--gold-light);
  min-height: 1.8em;
}
.vote-note { text-align: center; color: var(--muted); font-size: .85rem; margin-top: .8rem; }

/* ====== الأدلة ====== */
.evidence-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem; margin-top: 2rem;
}
.evidence-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem;
  transition: transform .25s, box-shadow .25s;
}
.evidence-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(212,175,55,.15); }
.evidence-icon { font-size: 1.8rem; color: var(--gold); margin-bottom: .7rem; }
.evidence-card h3 { color: var(--gold-light); margin-bottom: .5rem; font-size: 1.05rem; }
.evidence-card p { color: var(--text); line-height: 1.8; font-size: .95rem; }

/* ====== الشهادات ====== */
.comment-form {
  max-width: 640px; margin: 2rem auto 0;
  display: flex; flex-direction: column; gap: .8rem;
}
.comment-form input, .comment-form textarea {
  font-family: 'Cairo', sans-serif;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: .8rem 1rem;
  font-size: 1rem;
  resize: vertical;
  transition: border-color .2s;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--gold);
}
.comment-form ::placeholder { color: var(--muted); }
.submit-btn {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, var(--gold), #a8842a);
  color: #1a1403; font-weight: 900; font-size: 1.05rem;
  border: none; border-radius: 50px;
  padding: .8rem 1.5rem; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(212,175,55,.35); }
.submit-btn:disabled { opacity: .6; cursor: wait; }

.comments-list {
  max-width: 700px; margin: 2.2rem auto 0;
  display: flex; flex-direction: column; gap: 1rem;
}
.loading-msg, .empty-msg { text-align: center; color: var(--muted); padding: 1rem; }
.comment-item {
  background: var(--card); border: 1px solid var(--border);
  border-right: 4px solid var(--gold);
  border-radius: 14px; padding: 1rem 1.2rem;
  animation: commentIn .5s ease both;
}
@keyframes commentIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
.comment-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem;
}
.comment-name { color: var(--gold-light); font-weight: 900; }
.comment-name i { margin-inline-end: .35rem; color: var(--gold); }
.comment-date { color: var(--muted); font-size: .78rem; }
.comment-text { line-height: 1.9; color: var(--text); word-break: break-word; }

/* ====== الفوتر ====== */
#site-footer {
  text-align: center; padding: 2.5rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted); margin-top: 3rem;
}
.disclaimer { margin-top: .5rem; font-size: .85rem; }

/* ====== الكونفيتي والتوست ====== */
#confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 900;
}
#gavel-toast {
  position: fixed; bottom: 25px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #1c1608; border: 1px solid var(--gold);
  color: var(--gold-light); font-weight: 700;
  padding: .8rem 1.6rem; border-radius: 50px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  transition: transform .4s cubic-bezier(.2,1.4,.4,1);
  z-index: 950; text-align: center; max-width: 90vw;
}
#gavel-toast.show { transform: translateX(-50%) translateY(0); }

/* ====== موبايل ====== */
@media (max-width: 640px) {
  .vote-grid { grid-template-columns: 1fr; }
  .stamp { left: 0; font-size: 1.1rem; }
  .breaking-text { font-size: .85rem; }
}
