:root {
  --main-red: #ff2d2d;
  --main-yellow: #ff0000;
  --main-bg: #f4f5fa;
  --main-dark: #232946;
  --border-color: #b4b4b4;
  --btn-radius: 8px;
}

body {
  font-family: 'Tajawal', Arial, sans-serif;
  background: var(--main-bg);
  margin: 0;
  padding: 0;
  color: #232323;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}

.main-header {
    display: flex;
    justify-content: space-between;
  background: #fff;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 7px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 2px 12px;
}
.garena-logo {
  width: 32px;
  height: 32px;
}
.header-title {
  font-size: 1.1em;
  color: var(--main-dark);
  font-weight: bold;
  letter-spacing: 0.5px;
}
.header-bottom {
  display: flex;
  justify-content: flex-end;
    align-items: center;
  padding: 0px 12px 0px 12px;
}
.country-select {
  font-size: 0.98em;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  padding: 0px 8px;
  background: #fff;
  color: #232323;
  outline: none;
}

.main-banner {
  width: 100%;
  margin: 0 auto 9px auto;
  background: #18181b;
  text-align: center;
}
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 16px;
  background: #222;
  user-select: none;
  pointer-events: none;
}

.choose-game {
  background: #fff;
  margin: 0 0 7px 0;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 8px;
}
.games-title {
  padding: 11px 12px 3px 0;
  font-weight: bold;
  color: var(--main-dark);
  font-size: 1em;
}
.games-list {
  display: flex;
  gap: 17px;
  padding: 5px 12px 0 12px;
  overflow-x: auto;
}
.game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--btn-radius);
  transition: background 0.2s, border 0.2s, color 0.2s;
  border: 3px solid transparent;
  min-width: 75px;
  background: #fff;
  user-select: none;
}
.game-item.selected  {
  background: #fffbe6;
  border: 2px solid var(--main-yellow);
}
.game-item img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--main-bg);
  margin-bottom: 2px;
  box-shadow: 0 2px 8px #0001;
}
.game-item span {
  font-size: 0.91em;
  color: var(--main-dark);
  font-weight: 600;
}

/* بانر اللعبة المختارة */
.game-banner {
  padding: 6px 7px 0 7px;
  position: relative;
}
.game-banner-img-wrap {
  position: relative;
}
.game-banner-img {
  width: 100%;
  border-radius: 12px;
  height: 70px;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}
.secure-badge-img {
  position: absolute;
  bottom: 6px;
  right: 18px;
  height: 28px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0004;
  background: #fff;
  padding: 0;
  border: none;
  z-index: 2;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 370px) {
  .secure-badge-img {
    height: 20px;
    right: 8px;
  }
}

.login-section {
  background: #fff;
  margin: 12px 0 19px 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 9px #0001;
  padding: 15px 13px 19px 13px;
  display: block;
  max-width: 410px;
  margin-left: auto;
  margin-right: auto;
}
.login-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.13em;
  font-weight: bold;
  color: var(--main-dark);
  margin-bottom: 13px;
}
.step-num {
  background: var(--main-red);
  color: #fff;
  font-weight: bold;
  border-radius: 50%;
  width: 23px; height: 23px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1em;
  margin: 0px 20px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
#idbtn {
    display: flex;
    margin: 0px 20px;
    border-radius: 5px;
}
.player-id-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--main-dark);
  font-weight: 500;
  font-size: 1em;
    margin: 0px 20px;
}
.help-icon {
  width: 17px; height: 17px;
}
input[type="text"]#player-id {
  width: 100%;
  padding: 13px 20px;
  font-size: 1.06em;
  border-radius: 7px;
  border: 1px solid rgb(126, 126, 126);
  background: var(--main-bg);
  color: var(--main-dark);
  outline: none;
  transition: border 0.2s;
  direction: ltr;
  text-align: left;
}
input[type="text"]:focus {
  border-color: var(--main-yellow);
}
.main-btn {
  width: 60%;
  padding: 0px 0;
  font-size: 0.9em;
  background: var(--main-yellow);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 0 10px #ffd70044;
  margin-top: 0px;
  margin-right: 5px;
}
.main-btn.red {
  background: var(--main-red);
  color: #fff;
  box-shadow: 0 0 10px #ff2d2d22;
}
.main-btn:disabled {
  background: #fff2;
  color: #aaa;
  cursor: not-allowed;
  box-shadow: none;
}
.or-login {
  text-align: center;
  color: #888;
  font-size: 0.96em;
  margin-top: 7px;
}
.social-login {
  display: flex;
  gap: 11px;
  justify-content: center;
  margin: 4px 0 0 0;
}
.social-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--main-bg);
  border: 1.5px solid var(--border-color);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 60% 60%;
  cursor: pointer;
  transition: border 0.2s;
  outline: none;
}
.social-btn.vk { background-image: url('/assets/vk.png'); }
.social-btn.x { background-image: url('/assets/twitter.png'); }
.social-btn.google { background-image: url('assets/google.png'); }
.social-btn:hover { border: 1.5px solid var(--main-yellow); }

.processing-screen, .fail-screen, .verify-screen, .diamonds-section {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px #0001;
  margin: 18px 10px;
  min-height: 210px;
  padding: 30px 10px 26px 10px;
  max-width: 410px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 500px) {
  .processing-screen, .fail-screen, .verify-screen, .diamonds-section {
    margin: 10px 2px;
    padding: 20px 2px 16px 2px;
    min-height: 170px;
  }
  .main-header, .choose-game, .login-section {
    padding-right: 4px; padding-left: 4px;
  }
  .main-header { padding: 10px 2px 7px 2px; }
  .login-section { padding: 11px 3px 14px 3px; }
  .game-banner { padding: 4px 2px 0 2px; }
  .diamonds-options { gap: 6px; }
}

.loader {
  border: 5px solid #eee;
  border-top: 5px solid var(--main-red);
  border-radius: 50%;
  width: 42px; height: 42px;
  margin-bottom: 18px;
  animation: spin 1.2s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg);} }

.processing-text {
  font-size: 1.1em;
  color: var(--main-dark);
  margin-bottom: 5px;
  font-weight: bold;
}


.step-title {
  display: flex; align-items: center; gap: 7px; margin-bottom: 15px;
  font-size: 1.1em; font-weight: bold; color: var(--main-dark);
}
.step-title .step-num {
  background: var(--main-red);
  color: #fff;
  border-radius: 50%; width: 23px; height: 23px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1em; margin-right: 4px;
}

.diamonds-options {
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 7px 0 13px 0;
  width: 100%;
}
.diamond-btn {
  background: var(--main-bg);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 1.08em;
  font-weight: bold;
  color: var(--main-dark);
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: border .2s, background .2s, color .2s;
  min-width: 85px;
  justify-content: center;
  margin-bottom: 2px;
}
.diamond-btn.selected, .diamond-btn:hover {
  border: 2px solid var(--main-red);
  background: #fff2f2;
  color: var(--main-red);
}
.diamond-btn img {
  width: 18px; height: 18px;
  margin-right: 2px;
  margin-left: 2px;
}

.fail-message {
  color: var(--main-red);
  font-weight: bold;
  font-size: 1.21em;
  margin-bottom: 22px;
}

.robot-message {
  color: var(--main-dark);
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 10px;
}
.verify-instructions {
  list-style: disc inside;
  color: var(--main-dark);
  font-size: 0.99em;
  margin-bottom: 13px;
  text-align: right;
  padding-right: 15px;
}
.verify-instructions li {margin-bottom: 3px;}

::-webkit-input-placeholder { color: #aaa; }
::-moz-placeholder { color: #aaa; }
:-ms-input-placeholder { color: #aaa; }
::placeholder { color: #aaa; }

@media (max-width: 600px) {
  .main-header, .choose-game, .login-section, .processing-screen, .fail-screen, .verify-screen, .diamonds-section {
    max-width: 100vw;
  }
  .banner-img, .game-banner-img { border-radius: 8px !important; }
}

/* دعم الشاشات الصغيرة جداً */
@media (max-width: 350px) {
  .games-list { gap: 4px; }
  .game-item img { width: 38px; height: 38px; }
  .diamond-btn { min-width: 62px; font-size: 0.93em; padding: 8px 8px;}
}

#collect-btn, #retry-btn, #verify-btn {
    padding: 10px 2px;
}