*{box-sizing:border-box} :root{--bg:#101214;--panel:#20252b;--panel2:#2d343c;--line:#4b5661;--text:#f7f8fa;--muted:#adb6c0;--gold:#dab65f;--green:#4d8566;--red:#985555;--blue:#58718d} body{margin:0;min-height:100vh;font-family:Tahoma,Arial,sans-serif;color:var(--text);background:radial-gradient(circle at 50% -20%,#59636e 0,#272d33 31%,var(--bg) 70%)}button,input{font:inherit}button{cursor:pointer}.hidden{display:none!important}.topbar{min-height:70px;padding:11px 3%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:rgba(16,18,20,.92)}.top-btn{padding:10px 15px;border:1px solid var(--line);border-radius:11px;color:var(--text);background:var(--panel2);text-decoration:none}.danger{background:#493237}.brand{display:flex;flex-direction:column;align-items:center}.brand strong{font-size:22px}.brand span{margin-top:3px;color:var(--muted);font-size:12px}.page{width:min(1000px,94%);margin:auto;padding:35px 0}.hero{text-align:center;padding:25px}.badge{display:inline-block;padding:6px 13px;border:1px solid #78643d;border-radius:999px;color:#f0d597;background:#332b1d;letter-spacing:2px}.hero h1{margin:15px 0 8px;font-size:clamp(32px,5vw,50px)}.hero p{color:var(--muted)}.name-card{width:min(520px,100%);margin:0 auto 14px;padding:17px;border:1px solid var(--line);border-radius:17px;background:var(--panel)}.name-card label{display:block;margin-bottom:8px;color:var(--muted)}.name-card input{width:100%;padding:13px;border:1px solid #596570;border-radius:11px;outline:none;color:#fff;background:#171b1f;text-align:center;font-weight:900}.main-btn{width:min(520px,100%);min-height:54px;display:block;margin:auto;border:1px solid #92753a;border-radius:13px;color:#fff;background:linear-gradient(135deg,#896b31,#55431f);font-weight:900;font-size:18px}.search-card{width:min(560px,100%);margin:60px auto;padding:35px 22px;border:1px solid var(--line);border-radius:22px;background:var(--panel);text-align:center}.radar{width:150px;height:150px;margin:auto;position:relative;overflow:hidden;border:2px solid #6c7a87;border-radius:50%;background:repeating-radial-gradient(circle,#29313a 0 2px,#1a1f24 3px 30px)}.radar:before{content:"";position:absolute;inset:50% 50% 0 0;background:linear-gradient(45deg,transparent,rgba(218,182,95,.65));transform-origin:0 0;animation:sweep 1.6s linear infinite}@keyframes sweep{to{transform:rotate(360deg)}}.radar-dot{position:absolute;top:48px;right:35px;width:10px;height:10px;border-radius:50%;background:var(--gold);box-shadow:0 0 15px var(--gold)}.search-card p,.search-card small{color:var(--muted)}.search-timer{margin:14px;font-size:20px;color:var(--gold)}.match-type{width:max-content;margin:0 auto 12px;padding:7px 14px;border:1px solid #6e6146;border-radius:999px;color:var(--gold);background:#29251d}.players{display:grid;grid-template-columns:1fr 115px 1fr;gap:10px}.player-card,.round{min-height:110px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--panel);text-align:center}.player-card{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center}.avatar{font-size:35px}.player-card small{color:var(--muted)}.player-card strong{display:block;margin-top:4px}.player-card b{color:var(--gold);font-size:30px}.me{border-top:3px solid #d6dce1}.opponent{border-top:3px solid #8299b1}.round{display:grid;place-content:center}.round span{color:var(--muted);font-size:12px}.round strong{font-size:19px}.progress{height:8px;margin:13px 0;overflow:hidden;border-radius:999px;background:#252b31}.progress div{width:10%;height:100%;background:linear-gradient(90deg,#80632e,#dbb760)}.question-card{padding:22px;border:1px solid var(--line);border-radius:20px;background:var(--panel);text-align:center}.question-meta{display:flex;justify-content:center;gap:8px}.question-meta span{padding:7px 12px;border:1px solid #596570;border-radius:999px;background:#2c333a;font-size:12px}.question-timer{width:78px;height:78px;margin:15px auto;display:grid;place-items:center;border:5px solid #8f99a3;border-radius:50%;background:#15191d;font-size:28px;font-weight:900}.question-timer.danger{border-color:#c56363}.question-card h2{min-height:95px;display:grid;place-items:center;line-height:1.7;font-size:clamp(21px,3vw,31px)}.answers-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.answer-btn{min-height:56px;padding:12px;border:1px solid #56616b;border-radius:11px;color:#fff;background:#30373f;font-weight:900}.answer-btn.correct{background:#49785d}.answer-btn.wrong{background:#784949}.answer-btn:disabled{cursor:not-allowed;opacity:.75}.status-message{min-height:30px;margin-top:13px;font-weight:900;color:#d9c38d}.next-btn{width:100%;min-height:48px;margin-top:9px;border:1px solid #67727d;border-radius:11px;color:#fff;background:#39424b;font-weight:900}.modal{position:fixed;inset:0;z-index:100;padding:15px;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.84)}.modal.active{display:flex}.final-card{width:min(500px,100%);padding:30px 22px;border:1px solid #78653e;border-radius:23px;background:radial-gradient(circle at top,#675632,#252a2f 58%);text-align:center}.final-icon{font-size:72px}.final-card h2{font-size:32px}.final-card strong{color:var(--gold);font-size:25px}.final-card p{color:var(--muted)}.final-card button{width:100%;min-height:47px;border:1px solid #79663f;border-radius:11px;color:#fff;background:#514326;font-weight:900}@media(max-width:700px){.players{grid-template-columns:1fr 1fr}.round{grid-column:1/-1;grid-row:2;min-height:75px}.answers-grid{grid-template-columns:1fr}}

.match-type {
  border-color: #6f7882;
  color: #e8ebee;
  background: linear-gradient(145deg, #3d444c, #292f35);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}

.search-card {
  background:
    radial-gradient(circle at top, #39434d, #20252b 66%);
}

.question-card {
  background:
    radial-gradient(circle at 50% -30%, #46515c, #20252b 65%);
}

.answer-btn {
  min-height: 62px;
  font-size: 16px;
  transition: transform .15s ease, border-color .15s ease;
}

.answer-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold);
}


/* Online premium neutral presentation */
.profile-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #78838e;
  border-radius: 50%;
  color: #f2d99e;
  background:
    linear-gradient(145deg, #4a535c, #292f35);
  font-size: 20px;
  font-weight: 900;
}

.match-type {
  padding-inline: 18px;
  letter-spacing: .1px;
}

.player-card {
  background:
    radial-gradient(circle at top, #39424b, #20252b 68%);
}

.search-card h2 {
  font-size: clamp(24px, 4vw, 34px);
}

.search-card small {
  display: block;
  margin-top: 10px;
}

.status-message {
  color: #e7cc90;
}

/* Profile identity and premium match presence */
.identity-card {
  position: relative;
  isolation: isolate;
  width: min(520px, 100%);
  min-height: 102px;
  margin: 0 auto 14px;
  padding: 17px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #6e7883;
  border-radius: 20px;
  background:
    radial-gradient(circle at 15% 0, rgba(218,182,95,.2), transparent 42%),
    linear-gradient(145deg, #333b44, #1c2126);
  box-shadow: 0 18px 46px rgba(0,0,0,.25);
}

.identity-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -70% -30%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.08) 49%, transparent 58%);
  transform: translateX(45%);
  animation: identity-shine 4.5s ease-in-out infinite;
}

.identity-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #d8bc76;
  border-radius: 18px;
  color: #fff0c3;
  background: linear-gradient(145deg, #7a6233, #29251d);
  box-shadow: 0 0 24px rgba(218,182,95,.18);
  font-size: 24px;
  font-weight: 900;
}

.identity-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.identity-copy small { color: var(--muted); }
.identity-copy strong {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-title {
  width: max-content;
  max-width: 100%;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid rgba(218,182,95,.4);
  border-radius: 999px;
  color: #edd79e;
  background: rgba(91,73,35,.45);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-edit {
  min-height: 44px;
  padding: 9px 11px;
  display: grid;
  place-items: center;
  border: 1px solid #68737e;
  border-radius: 10px;
  color: #e9edf0;
  background: rgba(20,24,28,.6);
  text-decoration: none;
  font-size: 12px;
  transition: border-color .2s ease, transform .2s ease;
}

.identity-edit:hover { border-color: var(--gold); transform: translateY(-2px); }
.main-btn:disabled { cursor: wait; opacity: .72; }

.player-card {
  grid-template-columns: auto minmax(0,1fr) auto;
  text-align: start;
}

.opponent-avatar-wrap {
  position: relative;
  align-self: start;
}

.player-menu-button {
  position: absolute;
  z-index: 12;
  top: -9px;
  inset-inline-start: -9px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #7c8792;
  border-radius: 50%;
  color: #f4f6f8;
  background: #252c33;
  box-shadow: 0 5px 14px rgba(0,0,0,.45);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.player-menu-button:hover,
.player-menu-button[aria-expanded="true"] {
  border-color: #e1be67;
  color: #ffe5a3;
}

.player-menu {
  position: absolute;
  z-index: 30;
  top: 25px;
  inset-inline-start: -5px;
  width: max-content;
  min-width: 145px;
  padding: 5px;
  border: 1px solid #66717c;
  border-radius: 11px;
  background: #151b20;
  box-shadow: 0 15px 34px rgba(0,0,0,.55);
}

.player-menu button {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: #ffcaca;
  background: transparent;
  text-align: start;
  white-space: nowrap;
}

.player-menu button:hover { background: rgba(152,85,85,.28); }

.report-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #69747f;
  border-radius: 21px;
  color: var(--text);
  background: linear-gradient(155deg,#293139,#171c21);
  box-shadow: 0 35px 90px rgba(0,0,0,.7);
}

.report-dialog::backdrop {
  background: rgba(4,7,9,.82);
  backdrop-filter: blur(5px);
}

.report-dialog form {
  max-height: calc(100dvh - 26px);
  padding: 22px;
  display: grid;
  gap: 15px;
  overflow-y: auto;
}

.report-dialog header,
.report-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-dialog header {
  padding-bottom: 14px;
  border-bottom: 1px solid #4d5862;
}

.report-dialog header small { color: #e2c878; }
.report-dialog h2 { margin: 5px 0 0; font-size: 23px; }
.report-dialog label { display: grid; gap: 8px; color: #d5dbe0; font-size: 13px; }
.report-dialog select,
.report-dialog textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #596570;
  border-radius: 12px;
  outline: none;
  color: #fff;
  background: #10151a;
  resize: vertical;
}
.report-dialog select:focus,
.report-dialog textarea:focus {
  border-color: #dbb85f;
  box-shadow: 0 0 0 3px rgba(219,184,95,.12);
}
.report-close {
  width: 38px;
  height: 38px;
  border: 1px solid #606b75;
  border-radius: 11px;
  color: #fff;
  background: #20272e;
  font-size: 23px;
}
.report-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.report-message { min-height: 22px; margin: 0; color: #e4cb84; font-size: 12px; }
.report-message.error { color: #ff9f9f; }
.report-message.success { color: #85e0ae; }
.report-dialog footer { justify-content: flex-start; }
.report-submit,
.report-cancel {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 11px;
  font-weight: 900;
}
.report-submit {
  border: 1px solid #e0bf68;
  color: #17130b;
  background: linear-gradient(135deg,#e4c873,#b98d35);
}
.report-submit:disabled { cursor: wait; opacity: .6; }
.report-cancel { border: 1px solid #5d6872; color: #fff; background: #252c33; }

.player-identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.player-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-title {
  position: relative;
  isolation: isolate;
  width: max-content;
  max-width: 100%;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}

.match-title::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  background: linear-gradient(105deg, transparent 28%, rgba(255,255,255,.3) 48%, transparent 68%);
  transform: translateX(120%);
  animation: title-glint 3.2s ease-in-out infinite;
}

.tier-neutral { color: #c2c9d0; border-color: #56616b; background: #2c3339; }
.tier-bronze { color: #f0c69f; border-color: #866343; background: #493522; }
.tier-silver { color: #edf4fb; border-color: #8697a8; background: #40505e; }
.tier-gold { color: #fff0ae; border-color: #c8a64d; background: #66531f; }
.tier-royal { color: #eadcff; border-color: #a879db; background: #4a2b69; box-shadow: 0 0 18px rgba(168,121,219,.22); }
.tier-mythic {
  color: #fff8ce;
  border-color: #e2bd58;
  background: linear-gradient(90deg, #6d2f63, #7b5a1d, #285d5a);
  box-shadow: 0 0 22px rgba(226,189,88,.28);
}

.presence {
  width: max-content;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #aeb8c2;
  font-size: 10px;
}

.presence i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #63d49a;
  box-shadow: 0 0 0 0 rgba(99,212,154,.5);
  animation: presence-pulse 1.7s ease-out infinite;
}

.presence em { font-style: normal; }

.match-enter .me { animation: player-enter-right .7s cubic-bezier(.2,.9,.2,1) both; }
.match-enter .opponent { animation: player-enter-left .7s cubic-bezier(.2,.9,.2,1) both; }
.match-enter .round { animation: round-enter .65s .16s ease-out both; }
.match-enter .question-card { animation: question-enter .65s .28s ease-out both; }

@keyframes identity-shine {
  0%, 62%, 100% { transform: translateX(55%); }
  78% { transform: translateX(-55%); }
}

@keyframes title-glint {
  0%, 65%, 100% { transform: translateX(120%); }
  82% { transform: translateX(-120%); }
}

@keyframes presence-pulse {
  70% { box-shadow: 0 0 0 7px rgba(99,212,154,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,212,154,0); }
}

@keyframes player-enter-right {
  from { opacity: 0; transform: translateX(35px) scale(.96); }
}

@keyframes player-enter-left {
  from { opacity: 0; transform: translateX(-35px) scale(.96); }
}

@keyframes round-enter {
  from { opacity: 0; transform: translateY(-15px) scale(.9); }
}

@keyframes question-enter {
  from { opacity: 0; transform: translateY(24px); }
}

@media(max-width:700px){
  body{padding-bottom:env(safe-area-inset-bottom)}
  .topbar{min-height:calc(62px + env(safe-area-inset-top));padding-top:max(9px,env(safe-area-inset-top));position:sticky;top:0;z-index:70;backdrop-filter:blur(14px)}
  .page{width:100%;padding:12px}
  .hero{padding:18px 10px}.hero h1{font-size:clamp(31px,10vw,42px)}.hero p{max-width:34ch;margin-inline:auto;font-size:12px;line-height:1.6}
  .players{gap:7px}.player-card{min-height:100px;padding:10px;grid-template-columns:auto 1fr}.player-card>b{grid-column:1/-1;font-size:25px}
  .player-menu{position:fixed;top:auto;right:12px;left:12px;bottom:max(12px,env(safe-area-inset-bottom));width:auto;padding:8px}
  .player-menu button{min-height:48px;text-align:center}
  .report-dialog form{padding:18px}
  .question-card{padding:16px 12px;border-radius:19px}.question-card h2{min-height:82px;font-size:clamp(19px,5.4vw,25px);line-height:1.55}
  .answers-grid{grid-template-columns:1fr}.answer-btn{min-height:50px;font-size:13px}
}

.premium-celebration .final-card{border-color:#f2c55e;box-shadow:0 0 55px #e8b44755;animation:onlineCelebration 1.8s ease-in-out infinite}
@keyframes onlineCelebration{50%{filter:brightness(1.1);transform:scale(1.015)}}

@media (max-width:700px) {
  .identity-card { grid-template-columns: auto 1fr; }
  .identity-edit { grid-column: 1/-1; text-align: center; }
  .player-card { min-height: 128px; padding: 11px; gap: 8px; }
  .player-card b { font-size: 24px; }
  .profile-avatar { width: 40px; height: 40px; }
}

.question-image{width:min(500px,100%);margin:8px auto;overflow:hidden;border:1px solid rgba(255,255,255,.1);border-radius:15px;background:#0f1418}
.question-image img{width:100%;height:135px;display:block;object-fit:cover}
.question-image figcaption{padding:4px 8px;color:#89949d;font-size:9px;text-align:start}
@media(max-width:700px){.question-image img{height:86px}.question-image figcaption{display:none}.question-timer{width:64px;height:64px;margin-block:6px}.question-card{padding:12px 10px}.question-card h2{min-height:62px;margin-block:8px}.answer-btn{min-height:48px}}

@media (prefers-reduced-motion:reduce) {
  .identity-card::after,
  .match-title::after,
  .presence i,
  .match-enter .me,
  .match-enter .opponent,
  .match-enter .round,
  .match-enter .question-card {
    animation: none;
  }
}
/* محادثة صوتية اختيارية للمواجهات؛ الإذن لا يطلب إلا بعد الضغط. */
.online-voice-toggle{position:fixed;z-index:80;top:78px;left:max(9px,env(safe-area-inset-left));width:48px;height:48px;padding:3px;display:grid;place-items:center;border:2px solid #806f49;border-radius:50%;color:#f2d486;background:#202922ee;box-shadow:0 7px 22px #0008;font-weight:900}.online-voice-toggle span{font-size:15px}.online-voice-toggle b{font-size:7px}.online-voice-toggle.enabled{border-color:#70d19a;color:#092018;background:#8bdcad}.online-voice-toggle.connecting{opacity:.65}.online-opponent-mute{width:25px;height:25px;padding:0;position:absolute;z-index:8;left:-7px;top:-7px;display:grid;place-items:center;border:1px solid #65716b;border-radius:50%;color:#c2cbc6;background:#1a211dee;box-shadow:0 4px 10px #0008;font-size:10px}.online-opponent-mute.active{border-color:#70d19a;background:#29523b}.online-opponent-mute.muted{border-color:#a16166;background:#4b2428}.online-voice-audio{width:0;height:0;overflow:hidden;position:fixed;pointer-events:none}@media(max-width:520px){.online-voice-toggle{top:72px;width:43px;height:43px}}
.top-btn,#leaveMatch{min-height:44px}
/* Private friend rooms */
.knowledge-room-tools{display:grid;grid-template-columns:1fr minmax(130px,180px) 1fr;gap:10px;margin-top:12px}.knowledge-room-tools button,.knowledge-room-tools label{min-height:48px;border:1px solid #53606e;border-radius:14px;background:#222a33;color:#fff}.knowledge-room-tools button{padding:10px 14px;font:inherit;font-weight:800;cursor:pointer}.knowledge-room-tools label{display:flex;align-items:center;padding:4px 10px;gap:6px}.knowledge-room-tools label span{font-size:11px;color:#abb7c5}.knowledge-room-tools input{min-width:0;width:100%;border:0;outline:0;background:transparent;color:#f5cf72;font:800 17px/1 system-ui;text-align:center;direction:ltr}.knowledge-room-dialog{width:min(520px,calc(100% - 24px));border:1px solid #8d6c28;border-radius:22px;background:#151c23;color:#fff;padding:0}.knowledge-room-dialog::backdrop{background:#05080dcc;backdrop-filter:blur(5px)}.knowledge-room-dialog>section{position:relative;padding:24px}.knowledge-room-dialog>section>button{position:absolute;left:14px;top:14px;width:44px;height:44px;border:1px solid #56616d;border-radius:12px;background:#252e37;color:#fff;font-size:24px}.knowledge-room-dialog h2 b{color:#f1ca68;direction:ltr;display:inline-block}.knowledge-room-dialog p{color:#adb8c4}.knowledge-room-dialog #knowledgeRoomFriends{display:grid;gap:8px;max-height:45vh;overflow:auto}.knowledge-room-friend{display:grid;grid-template-columns:42px 1fr auto;grid-template-areas:"avatar name action" "avatar title action";align-items:center;column-gap:10px;min-height:58px;padding:8px 10px;border:1px solid #48525e;border-radius:14px;background:#222a33;color:#fff;text-align:right}.knowledge-room-friend>span{grid-area:avatar;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#765d24;color:#ffe296}.knowledge-room-friend>b{grid-area:name}.knowledge-room-friend>small{grid-area:title;color:#aeb9c5}.knowledge-room-friend>strong{grid-area:action;color:#f1ca68}.knowledge-room-friend:disabled{opacity:.65}
@media(max-width:560px){.knowledge-room-tools{grid-template-columns:1fr 1fr}.knowledge-room-tools label{grid-column:1/-1;grid-row:1}.knowledge-room-dialog>section{padding:20px 14px}.knowledge-room-dialog h2{font-size:20px}}
