@font-face {
  font-family: "milligram";
  src: url("Fonts/alfont_com_Milligram-Arabic-Extrabold-TRIAL.ttf") format("truetype");
}

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

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  min-height: 100vh;
  font-family: "Baloo Bhaijaan 2", "milligram", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  background: url("Images/Powr/Powr bg red.jpg") no-repeat center center;
  background-size: cover;
  padding: 24px;
}

body.red-theme {
  background: var(--red-bg, url("Images/Powr/Powr bg red.jpg")) no-repeat center center;
  background-size: cover;
}

body.blue-theme {
  background: var(--blue-bg, url("Images/Powr/Powr bg red.jpg")) no-repeat center center;
  background-size: cover;
}

body.neutral-theme {
  background: url("Images/bg both.jpg") no-repeat center center;
  background-size: cover;
}

.container {
  max-width: 1350px;
  margin: auto;
}

header {
  position: relative;
  text-align: center;
  margin-bottom: 16px;
}

.logo img {
  height: 145px !important;
  width: auto !important;
  display: block;
  margin: 0 auto;
}

.language-toggle {
  position: absolute;
  top: 8px;
  left: 0;
  width: auto;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.home-card {
  width: min(100%, 560px);
  margin: 35px auto;
  background: #fff7e9;
  border: 5px solid #f3d8a2;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 8px 0 rgba(0,0,0,0.25), inset 0 0 0 3px white;
  text-align: center;
  color: #0a2875;
}

.home-card h1 {
  margin-bottom: 18px;
  font-size: 34px;
}

.game-explain {
  background: #fff2a8;
  border: 4px solid #ffcb29;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  color: #0a2875;
  line-height: 1.6;
}

.field-label,
.section-title {
  display: block;
  margin: 10px 0;
  color: #0a2875;
}

.field-label {
  font-size: 24px;
  font-weight: 900;
}

.home-card input,
.home-card select {
  width: 100%;
  padding: 14px;
  border: 4px solid #ffcb29;
  border-radius: 14px;
  font-size: 18px;
  margin-bottom: 14px;
  text-align: center;
  font-family: inherit;
}

.profile-name-row {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 12px;
  align-items: stretch;
  width: 82%;
  max-width: 440px;
  min-width: min(100%, 300px);
  margin: 0 auto 14px;
}

.home-message {
  width: 82%;
  max-width: 440px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  background: #fff2a8;
  border-radius: 999px;
  color: #a80000;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.home-message.hidden {
  display: none;
}

.profile-picker-btn {
  order: 2;
  position: relative;
}

.name-input-wrap {
  order: 1;
}

.name-input-wrap {
  position: relative;
  min-width: 0;
}

.name-input-wrap input {
  height: 74px;
  margin-bottom: 0;
  padding-right: 48px;
  padding-left: 42px;
}

.name-input-wrap input::placeholder {
  color: rgba(10, 40, 117, 0.38);
}

.random-name-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #0a2875;
  font-size: 21px;
  line-height: 1;
  transition: background 0.15s ease;
}

.random-name-btn:hover {
  transform: translateY(-50%);
  background: rgba(255, 203, 41, 0.32);
  box-shadow: none;
}

.name-edit-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #0a2875;
  font-size: 22px;
  pointer-events: none;
}

.avatar-edit-icon {
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 26px;
  height: 26px;
  border: 3px solid white;
  border-radius: 50%;
  background: #ffcb29;
  color: #0a2875;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(0,0,0,0.22);
  pointer-events: none;
}

.home-mode-panel {
  margin: 14px 0;
  background: #fffdf5;
  border: 4px solid #ffcb29;
  border-radius: 18px;
  padding: 14px;
}

.home-mode-panel h2 {
  margin-bottom: 10px;
}

.home-action-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
  margin-top: 12px;
  padding-bottom: var(--home-dropdown-open-space, 0);
}

.home-dropdown {
  min-width: 0;
  margin-top: 0;
}

.create-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
}

.home-action-row .home-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  min-height: 0;
  border: 3px solid #f4b400;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 15px;
  background: #fff2a8;
  color: #0a2875;
  box-shadow: 0 4px 0 #b97700;
  line-height: 1;
  margin: 0;
}

.create-action-btn:hover,
.home-action-row .home-dropdown summary:hover {
  border-color: #f4b400;
  background: linear-gradient(#ffe96b, #ffbd16);
  box-shadow: 0 5px 0 #b97700;
}

.home-dropdown summary {
  list-style: none;
  border: 4px solid #f4b400;
  padding: 13px 18px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  background: linear-gradient(#ffe96b, #ffbd16);
  color: #0a2875;
  box-shadow: 0 5px 0 #b97700;
  text-align: center;
  user-select: none;
}

.home-dropdown summary::-webkit-details-marker {
  display: none;
}

.home-dropdown-content {
  position: absolute;
  left: 0;
  right: 0;
  margin-top: 12px;
  background: #fffdf5;
  border: 4px solid #ffcb29;
  border-radius: 18px;
  padding: 14px;
  z-index: 5;
}

.home-dropdown[open] {
  position: static;
}

.home-dropdown[open] .home-dropdown-content {
  grid-column: 1 / -1;
}

.home-action-row .home-dropdown[open] .home-dropdown-content {
  grid-column: auto;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 12px 0 18px;
}

.profile-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
  margin-bottom: 0;
}

.profile-picker-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  background: white;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.48);
}

.popup-overlay.hidden {
  display: none;
}

.popup-box {
  position: relative;
  width: min(100%, 520px);
  max-height: 86vh;
  overflow-y: auto;
  background: #fff7e9;
  border: 5px solid #ffcb29;
  border-radius: 20px;
  padding: 18px;
  color: #0a2875;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,0.25), inset 0 0 0 3px white;
}

.popup-box h2 {
  margin-bottom: 10px;
}

.popup-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.popup-close.hidden {
  display: none;
}

.confirm-box {
  width: min(100%, 360px);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.game-message-box {
  width: min(100%, 380px);
  text-align: center;
}

.game-message-box h2 {
  margin: 10px 0 16px;
  text-align: center;
}

.game-message-home-btn {
  width: min(100%, 260px);
  min-height: 48px;
  margin: 0 auto;
  display: block;
  border-radius: 999px;
}

.game-message-home-btn.hidden {
  display: none;
}

.avatar-card {
  border: 4px solid transparent;
  border-radius: 140px;
  overflow: hidden;
  cursor: pointer;
  background: white;
}

.avatar-card.selected {
  border-color: #0a2875;
  box-shadow: 0 0 0 4px #ffe052;
}

.avatar-card img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.mode-card {
  background: #fffdf5;
  border: 4px solid #ffc72c;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
  color: #a80000;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(0,0,0,0.18);
}

.mode-card:hover {
  transform: translateY(-3px);
}

.mode-card.selected {
  border-color: #0a2875;
  box-shadow: 0 0 0 5px #ffe052;
}

.mode-card img {
  width: 100%;
  height: 105px;
  object-fit: cover;
  background: #ddd;
  display: block;
}

.mode-card h3 {
  padding: 8px 4px;
  font-size: 15px;
  background: white;
}

.lobby-avatar {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid #ffcb29;
  margin: 5px auto 15px;
  display: block;
  background: white;
}

.main-layout {
  position: relative;
  min-height: 640px;
  margin-bottom: 42px;
}

.side-panel {
  background: #fff7e9;
  border: 5px solid #f3d8a2;
  border-radius: 22px;
  padding: 5px;
  box-shadow: 0 8px 0 rgba(0,0,0,0.25), inset 0 0 0 3px white;
  position: absolute;
  top: 0;
  left: 0;
  width: 210px;
  direction: rtl;
  z-index: 2;
}

.main-layout.blue-layout .side-panel {
  left: auto;
  right: 0;
}

.board-panel {
  position: relative;
  width: min(100%, 900px);
  margin: 0 auto 5px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(#ef1d1d, #a60000);
  border: 6px solid #ffcb29;
  box-shadow: 0 8px 0 rgba(0,0,0,0.25);
  direction: rtl;
}

.board-score {
  position: absolute;
  top: 8px;
  z-index: 2;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-shadow:
    0 4px 0 rgba(0,0,0,0.42),
    0 0 4px white,
    0 0 12px rgba(255,255,255,0.85),
    0 0 18px currentColor;
}

.board-score-red {
  left: 16px;
  color: #b90000;
}

.board-score-blue {
  right: 16px;
  color: #004aad;
}

.board-panel.blue-board {
  background: linear-gradient(#1fa8ff, #004aad);
}

.board-panel.neutral-board {
  background: linear-gradient(#858b95, #4b515a);
  border-color: #d8dde5;
}

.board-panel.neutral-board .game-board {
  background: #e9edf2;
  border-color: #f9fafb;
}

.board-panel h2,
.side-panel h2 {
  color: white;
  text-align: center;
  margin-bottom: 16px;
  font-size: 28px;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
}

.board-panel h2 {
  padding: 0 128px;
}

.side-panel h2 {
  color: #0a2875;
  font-size: 20px;
  text-shadow: none;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  background: #fff7e9;
  border-radius: 18px;
  padding: 16px;
  border: 4px solid white;
}

.card {
  position: relative;
  background: #fffdf5;
  border: 4px solid #ffc72c;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
  color: #a80000;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(0,0,0,0.18);
  transform-origin: bottom;
}

.card:hover {
  transform: translateY(-4px);
}

.card.selected {
  border-color: #0a2875;
  box-shadow: 0 0 0 5px #ffe052, 0 4px 0 rgba(0,0,0,0.18);
}

.card.likely-choice {
  border-color: #ffe052;
  box-shadow: 0 0 0 5px rgba(255,224,82,0.85), 0 4px 0 rgba(0,0,0,0.18);
}

.likely-mark-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid white;
  background: rgba(255,203,41,0.9);
  box-shadow: 0 2px 0 rgba(0,0,0,0.22);
  line-height: 1;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.card:hover .likely-mark-btn,
.likely-mark-btn:focus-visible,
.card.likely-choice .likely-mark-btn {
  opacity: 1;
  transform: scale(1);
}

.card.likely-choice .likely-mark-btn {
  border-color: #ffe052;
  background: #ffcb29;
}

.card.eliminated {
  opacity: 0.35;
  filter: grayscale(100%);
  transform: rotateX(70deg) scale(0.96);
}

.card img,
.chosen-card img {
  width: 100%;
  height: 105px;
  object-fit: cover;
  background: #ddd;
  display: block;
}

.card h3,
.chosen-card h3 {
  padding: 8px 4px;
  font-size: 15px;
  background: white;
}

.chosen-placeholder {
  border: 4px dashed #b7b7b7;
  border-radius: 18px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  color: #aaa;
  background: #f1f1f1;
  margin-bottom: 14px;
}

.chosen-card {
  border: 5px solid #ffc72c;
  border-radius: 18px;
  overflow: hidden;
  text-align: center;
  background: white;
  margin-bottom: 14px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.2);
}

.chosen-card img {
  height: 220px;
}

.hidden-character-card img {
  background: #e9edf2;
  object-fit: contain;
  padding: 18px;
  filter: grayscale(20%);
}

.chosen-card h3 {
  color: white;
  font-size: 30px;
  background: #d71920;
}

.chosen-card.blue-name h3 {
  background: #005ecb;
}

details {
  margin-top: 12px;
}

summary {
  list-style: none;
  border: 4px solid #f4b400;
  padding: 13px 18px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  background: linear-gradient(#ffe96b, #ffbd16);
  color: #0a2875;
  box-shadow: 0 5px 0 #b97700;
  text-align: center;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

.dropdown-menu {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

button {
  width: 100%;
  border: 3px solid #f4b400;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  background: #fff2a8;
  color: #0a2875;
  box-shadow: 0 4px 0 #b97700;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
  font-family: inherit;
}

button:hover,
summary:hover {
  transform: translateY(-2px);
}

.color-btn {
  width: auto;
  border: 3px solid white;
  padding: 10px 22px;
  border-radius: 999px;
  color: white;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.25);
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease, background 0.28s ease;
}

.color-btn.red {
  background: linear-gradient(#ff3b3b, #b50000);
}

.color-btn.blue {
  background: linear-gradient(#24a3ff, #004aad);
}

.color-btn.selected {
  border-color: #ffe052;
}

.message {
  margin-top: 20px;
  padding: 16px;
  background: #fff7e9;
  border: 4px solid #f3d8a2;
  border-radius: 16px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #0a2875;
}

.exit-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  min-height: 0;
  padding: 0;
  z-index: 3000;
  font-size: 26px;
  line-height: 1;
  border-radius: 50%;
}

.exit-toggle:hover,
.players-toggle:hover,
.new-set-toggle:hover {
  border-color: #f4b400;
  background: linear-gradient(#ffe96b, #ffbd16);
  box-shadow: 0 5px 0 #b97700;
}

@media (max-width: 1000px) {
  .main-layout,
  .main-layout.blue-layout {
    min-height: auto;
    margin-bottom: 32px;
  }

  .side-panel,
  .main-layout.blue-layout .side-panel {
    position: static;
    width: 100%;
    margin-bottom: 20px;
  }

  .board-panel {
    width: 100%;
    margin-bottom: 45px;
  }

  .game-board {
    grid-template-columns: repeat(4, 1fr);
  }

  .logo img {
    height: 105px !important;
  }
}

@media (max-width: 550px) {
  .game-board,
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-action-row {
    grid-template-columns: 3fr 1fr;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== Round / winner controls ===== */
.score-panel { width: min(100%, 360px); margin: 16px auto 0; background: #fff7e9; border: 4px solid #f3d8a2; border-radius: 16px; padding: 12px; color: #0a2875; text-align: center; }
.score-panel h3 { margin-bottom: 10px; }
.score-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; margin: 8px 0; }
.score-dots { display: flex; gap: 6px; justify-content: center; }
.winner-panel.hidden { display: none; }
.winner-panel { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.winner-box { width: min(100%, 360px); background: #fff7e9; border: 5px solid #ffcb29; border-radius: 22px; padding: 18px; text-align: center; color: #0a2875; box-shadow: 0 8px 0 rgba(0,0,0,0.25); }
.winner-box h2 { margin-bottom: 14px; }
.winner-box button { margin-top: 10px; }


.player-mini-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row-reverse;
}
.player-mini-card img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 3px solid #ffc72c;
}

.player-mini-card span {
  font-size: 18px;
  display: block;
  width: 100%;
  text-align: center;
}

.remaining-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 3px solid #ffc72c;
  border-radius: 14px;
  background: #fffdf5;
  color: #0a2875;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.remaining-eye {
  width: 30px;
  height: 28px;
  min-height: 0;
  flex: 0 0 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.remaining-eye.active {
  background: rgba(255,203,41,0.35);
}

.remaining-eye img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.remaining-status strong {
  min-width: 24px;
  text-align: center;
  color: #a80000;
}

.remaining-status.shared strong,
.remaining-status.mine strong {
  color: #0a2875;
}

.game-log-panel {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 5px solid #f3d8a2;
  border-radius: 18px;
  background: #fff7e9;
  color: #0a2875;
  text-align: right;
  box-shadow: 0 6px 0 rgba(0,0,0,0.22), inset 0 0 0 3px white;
}

.game-log-panel.hidden {
  display: none;
}

.game-log-panel h3 {
  font-size: 15px;
  margin-bottom: 8px;
  text-align: center;
}

.game-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  scrollbar-width: none;
}

.game-log-list::before {
  content: "";
  margin-top: auto;
}

.game-log-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.game-log-entry {
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1.25;
}

.game-log-entry:nth-child(odd) {
  background: #f7e6c4;
  border: 0;
}

.game-log-entry:nth-child(even) {
  background: transparent;
  border: 0;
  padding-right: 10px;
}

.game-log-entry.winner-red {
  color: #d71920;
}

.game-log-entry.winner-blue {
  color: #005ecb;
}

.game-log-empty {
  color: #8d6b24;
  font-size: 12px;
  text-align: center;
}

.round-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-round-controls {
  position: absolute;
  top: 20px;
  right: 128px;
  z-index: 3000;
}

.new-set-toggle {
  width: 46px;
  height: 46px;
  min-width: 46px;
  max-width: 46px;
  flex: 0 0 46px;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.main-round-toggle {
  height: 46px;
  flex: 0 0 auto;
  min-height: 0;
  min-width: 118px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  color: white;
}

.main-round-toggle.start-state {
  border-color: #12863d;
  background: linear-gradient(#31cf66, #119342);
  box-shadow: 0 5px 0 #075c27;
}

.main-round-toggle.end-state {
  border-color: #a90000;
  background: linear-gradient(#ff4b4b, #c50000);
  box-shadow: 0 5px 0 #760000;
}

.main-round-toggle:hover {
  filter: brightness(1.05);
}
/* ===== Online lobby / team layout updates ===== */
.players-toggle {
  position: absolute;
  top: 20px;
  right: 74px;
  width: 46px;
  height: 46px;
  min-height: 0;
  padding: 0;
  z-index: 3000;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
}

.players-menu {
  position: absolute;
  top: 85px;
  right: 20px;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff7e9;
  border: 5px solid #f3d8a2;
  border-radius: 20px;
  padding: 18px;
  z-index: 2999;
  display: none;
  color: #0a2875;
}

.players-menu.open { display: block; }
.players-menu h2 { text-align: center; margin-bottom: 12px; }

.menu-action-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border-radius: 999px;
  font-size: 14px;
}

.player-info-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  background: #fffdf5;
  border: 4px solid #ffc72c;
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 10px;
  text-align: right;
}

.player-info-row img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 3px solid #ffc72c;
}

.player-info-row span,
.player-info-row small {
  display: block;
}

.player-info-row small.ready { color: #0a8a1f; }
.player-info-row small.not-ready { color: #a80000; }
.red-row { border-color: #d71920; }
.blue-row { border-color: #005ecb; }

.dual-layout {
  display: grid;
  grid-template-columns: 210px minmax(600px, 900px) 210px;
  gap: 18px;
  align-items: start;
  justify-content: center;
  position: relative;
}

.team-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 210px;
}

.choose-team-hint {
  display: none;
  color: white;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
  animation: chooseHintBounce 0.9s ease-in-out infinite;
}

.choose-team-hint span {
  display: block;
  width: 0;
  height: 0;
  margin: 2px auto 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid #ffe052;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
}

.team-column:not(:has(.team-side-choice.has-player)) .choose-team-hint {
  display: block;
}

body:not(.neutral-theme) .choose-team-hint {
  display: none;
}

@keyframes chooseHintBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.team-column.synced-board-height {
  height: var(--board-panel-height, auto);
  min-height: 0;
}

.dual-layout .side-panel {
  position: static;
  width: 210px;
}

.red-side-panel .chosen-card h3 { background: #d71920; }
.blue-side-panel .chosen-card h3 { background: #005ecb; }

.blue-mini-card {
  flex-direction: row;
}


.center-area { min-width: 0; }

.color-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.color-btn.has-player:disabled {
  opacity: 0.9;
  filter: none;
}

@media (max-width: 1000px) {
  .dual-layout {
    grid-template-columns: 1fr;
  }
  .team-column {
    width: 100%;
  }
  .dual-layout .side-panel {
    width: 100%;
  }
}

/* FORCE TEAM SIDES */
.dual-layout { direction: ltr !important; }
.red-side-panel, .blue-side-panel, .center-area { direction: rtl !important; }
.room-code-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3000;
  background: #fff7e9;
  border: 4px solid #ffcb29;
  border-radius: 16px;
  padding: 10px 16px;
  color: #0a2875;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}

.team-side-choice {
  min-height: 64px;
  width: 100%;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.team-side-choice.has-player {
  justify-content: flex-start;
  padding: 8px 16px;
  border-radius: 18px;
}

.team-choice-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.9);
  background: white;
  animation: teamChoiceContentIn 0.22s ease both;
}

.team-choice-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: right;
}

.team-choice-name,
.team-choice-label,
.team-choice-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: teamChoiceContentIn 0.22s ease both;
}

.team-choice-status {
  font-size: 11px;
  color: rgba(255,255,255,0.78);
}

.team-side-choice.is-ready .team-choice-status {
  color: #4cff7a;
}

@keyframes teamChoiceContentIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.remaining-counter {
  width: fit-content;
  margin: 0 auto;
  margin-top: 20px; /* 👈 هنا تتحكم بالارتفاع */
  background: #fff7e9;
  border: 4px solid #ffcb29;
  border-radius: 16px;
  padding: 8px 16px; /* 👈 صححتها لك */
  color: #0a2875;
  font-weight: 900;
}

@media (max-width: 1000px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
  }

  .logo img {
    height: 78px !important;
  }

  .exit-toggle,
  .players-toggle,
  .new-set-toggle {
    top: 10px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    flex-basis: 42px;
    font-size: 20px;
  }

  .exit-toggle {
    right: 10px;
  }

  .players-toggle {
    right: 60px;
  }

  .top-round-controls {
    top: 10px;
    right: 110px;
    gap: 6px;
  }

  .main-round-toggle {
    height: 42px;
    min-width: 82px;
    padding: 0 12px;
    font-size: 14px;
  }

  .room-code-badge {
    top: 10px;
    left: 10px;
    max-width: calc(100vw - 116px);
    padding: 7px 10px;
    border-width: 3px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dual-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "red blue"
      "center center";
    gap: 8px;
    align-items: stretch;
  }

  .red-team-column {
    grid-area: red;
  }

  .blue-team-column {
    grid-area: blue;
  }

  .center-area {
    grid-area: center;
  }

  .team-column,
  .dual-layout .side-panel {
    width: 100%;
    min-width: 0;
  }

  .team-column {
    gap: 6px;
  }

  .team-side-choice {
    min-height: 50px;
    padding: 7px 8px;
    font-size: 12px;
    border-width: 2px;
  }

  .team-side-choice.has-player {
    padding: 6px 8px;
    gap: 6px;
  }

  .team-choice-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-width: 2px;
  }

  .team-choice-status {
    font-size: 9px;
  }

  .side-panel {
    border-width: 3px;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.22), inset 0 0 0 2px white;
    margin-bottom: 0;
  }

  .side-panel h2 {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .chosen-placeholder {
    height: 88px;
    border-width: 3px;
    border-radius: 12px;
    font-size: 34px;
    margin-bottom: 6px;
  }

  .chosen-card {
    border-width: 3px;
    border-radius: 12px;
    margin-bottom: 6px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
  }

  .chosen-card img {
    height: 88px;
  }

  .chosen-card h3 {
    font-size: 13px;
    padding: 5px 3px;
  }

  .remaining-status {
    min-height: 34px;
    gap: 4px;
    padding: 5px 6px;
    border-width: 2px;
    border-radius: 10px;
    font-size: 10px;
  }

  .remaining-eye {
    width: 24px;
    height: 22px;
    flex-basis: 24px;
  }

  .board-panel {
    width: 100%;
    padding: 8px;
    border-width: 4px;
    border-radius: 16px;
    margin-top: 4px;
    margin-bottom: 14px;
  }

  .board-panel h2 {
    font-size: 18px;
    margin-bottom: 8px;
    padding: 0 76px;
  }

  .board-score {
    top: 5px;
    width: 34px;
    height: 34px;
    font-size: 30px;
  }

  .board-score-red {
    left: 7px;
  }

  .board-score-blue {
    right: 7px;
  }

  .game-board {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border-width: 3px;
    border-radius: 12px;
  }

  .card {
    border-width: 2px;
    border-radius: 8px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.16);
  }

  .card:hover {
    transform: none;
  }

  .card.selected,
  .card.likely-choice {
    box-shadow: 0 0 0 3px rgba(255,224,82,0.85), 0 2px 0 rgba(0,0,0,0.16);
  }

  .card img {
    height: 46px;
  }

  .card h3 {
    min-height: 25px;
    padding: 4px 2px;
    font-size: 8px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .likely-mark-btn {
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-width: 2px;
  }

  .top-round-controls {
    top: 56px;
    right: 10px;
  }

  .main-round-toggle {
    min-width: 94px;
  }
}
