/* ========================================
   GROUP MODE
   ======================================== */
.group-mode {
  position: relative;
  padding: var(--section-padding);
  background: transparent;
  overflow: hidden;
}

.group-mode::before,
.group-mode::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.45;
}

.group-mode::before {
  width: 300px;
  height: 300px;
  top: 20px;
  left: -120px;
  background: radial-gradient(circle, rgb(74 125 255 / 16%) 0%, rgb(74 125 255 / 0%) 72%);
}

.group-mode::after {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: -80px;
  background: radial-gradient(circle, rgb(74 125 255 / 18%) 0%, rgb(74 125 255 / 0%) 72%);
}

.group-mode .container {
  position: relative;
  z-index: 1;
}

.group-mode-layout {
  display: grid;
  gap: 26px;
  align-items: start;
}

.group-mode-copy {
  min-width: 0;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.group-mode-copy h2 {
  font-size: 2.35rem;
  line-height: 1.1;
  margin-bottom: 14px;
  max-width: none;
}

.group-mode-intro {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
  max-width: 62ch;
  margin: 0 auto 4px;
}

.group-mode-mock {
  min-width: 0;
  padding: 18px;
  border-radius: 33px;
  background: linear-gradient(145deg, rgb(255 255 255 / 96%), rgb(240 244 255 / 92%));
  box-shadow: 0 30px 70px rgb(22 93 252 / 12%);
  border: 1px solid rgb(255 255 255 / 80%);
  backdrop-filter: blur(10px);
}

.group-mode-mock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 20px;
  align-items: stretch;
}

.group-room-panel,
.group-chat-panel {
  min-width: 0;
  background: rgb(255 255 255 / 98%);
  border-radius: 33px;
  border: 1px solid #edf1f7;
  box-shadow: 0 18px 44px rgb(17 24 39 / 6%);
  padding: 22px;
}

.group-app-panel,
.group-app-chat {
  display: flex;
  flex-direction: column;
}

.group-app-panel {
  min-height: 596px;
}

.group-room-header,
.group-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef1f8;
  margin-bottom: 18px;
}

.group-room-header h3,
.group-chat-header h3 {
  font-size: 1.55rem;
  color: #20183c;
}

.group-room-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 33px;
  border: 1.5px solid var(--primary-blue);
  color: var(--primary-blue);
  background: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.group-room-stage {
  position: relative;
  min-height: 318px;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 18px;
  background: #07142e;
}

.group-room-background {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(6 13 30 / 10%) 0%, rgb(6 13 30 / 68%) 100%),
    url('../Media/winner-banner.webp') center / cover no-repeat;
  transform: scale(1.02);
  z-index: -2;
}

.group-room-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center 18%, rgb(255 255 255 / 20%), rgb(9 18 42 / 0%) 36%);
  z-index: -1;
}

.group-room-participants {
  position: absolute;
  inset: 0;
}

.group-room-participant {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--white);
  text-align: center;
  width: 150px;
}

.group-room-participant-left {
  left: 8%;
  bottom: 34px;
}

.group-room-participant-center {
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
}

.group-room-participant-right {
  right: 8%;
  bottom: 34px;
}

.group-room-score-ring {
  --score: 80;

  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 7px;
  background: conic-gradient(#a856f6 calc(var(--score) * 1%), rgb(248 232 250 / 42%) 0);
  box-shadow: 0 10px 24px rgb(0 0 0 / 30%);
}

.group-room-participant-center .group-room-score-ring {
  width: 126px;
  height: 126px;
}

.group-room-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 5px;
  background: rgb(255 255 255 / 96%);
  overflow: hidden;
}

.group-room-avatar img,
.group-room-user img,
.group-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.group-room-award {
  width: 80px;
  height: auto;
  margin: -28px 0 2px;
  filter: drop-shadow(0 12px 20px rgb(0 0 0 / 38%));
  z-index: 2;
}

.group-room-award-side {
  width: 72px;
  margin-top: -24px;
}

.group-room-name {
  max-width: 140px;
  margin-top: 7px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgb(0 0 0 / 36%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-room-score {
  display: block;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 2px 10px rgb(0 0 0 / 35%);
}

.group-room-table-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 26px;
}

.group-room-table-wrap h4 {
  margin: 0;
  color: #20183c;
  font-size: 1.05rem;
  font-weight: 700;
}

.group-room-table {
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}

.group-room-table-head,
.group-room-table-row {
  display: grid;
  grid-template-columns: 90px minmax(220px, 1fr) 92px;
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 0 16px;
}

.group-room-table-head {
  color: #979797;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  background: transparent;
  border-bottom: 1px solid #ededed;
}

.group-room-table-head span:nth-child(2) {
  justify-self: center;
}

.group-room-table-head span:last-child {
  justify-self: end;
}

.group-room-table-row {
  color: #20183c;
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: 1px solid #ededed;
}

.group-room-table-row:last-child {
  border-bottom: 1px solid #ededed;
}

.group-room-table-row > span:last-child {
  justify-self: end;
  font-weight: 500;
}

.group-room-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.group-room-rank-gold {
  background: #ffbb0d;
}

.group-room-rank-silver {
  background: #b6bccd;
}

.group-room-rank-bronze {
  background: #dca16a;
}

.group-room-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-room-table .group-room-user {
  justify-self: center;
  gap: 12px;
}

.group-room-user img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.group-room-avatar-fallback {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #165dfc 0%, #6d8fff 100%);
  font-size: 0.8rem;
  font-weight: 700;
}

.group-room-user-name {
  color: #111827;
  font-weight: 500;
}

.group-room-admin-star {
  color: #f5b400;
  font-size: 0.78rem;
  line-height: 1;
}

.group-chat-panel {
  min-height: 100%;
}

.group-chat-feed {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  min-height: 536px;
  padding-right: 2px;
}

.group-chat-date {
  text-align: center;
  color: #979797;
  font-size: 0.84rem;
  font-weight: 500;
}

.group-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.group-chat-row-primary {
  justify-content: flex-end;
}

.group-chat-row-secondary {
  justify-content: flex-start;
}

.group-chat-entry {
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 52px);
}

.group-chat-entry-primary {
  align-items: flex-end;
}

.group-chat-entry-secondary {
  align-items: flex-start;
}

.group-chat-sender {
  margin: 0 0 3px;
  color: #6a6a6a;
  font-size: 0.78rem;
  font-weight: 500;
}

.group-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.group-chat-message {
  position: relative;
  padding: 15px;
  border-radius: 20px;
  font-size: 0.91rem;
  line-height: 1.45;
}

.group-chat-message p {
  margin: 0;
  color: inherit;
}

.group-chat-message-primary {
  align-self: flex-end;
  background: var(--primary-blue);
  color: #fff;
}

.group-chat-message-primary::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  background: var(--primary-blue);
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.group-chat-message-secondary {
  align-self: flex-start;
  background: #ededed;
  color: #20183c;
}

.group-chat-message-secondary::after {
  content: '';
  position: absolute;
  left: -5px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  background: #ededed;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.group-chat-time {
  margin-top: 7px;
  color: #979797;
  font-size: 0.78rem;
  font-weight: 500;
}

.group-chat-leaderboard-card {
  width: min(420px, 100%);
  align-self: center;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 24px;
  padding: 16px 18px 14px;
  box-shadow: 0 10px 24px rgb(17 24 39 / 6%);
}

.group-chat-leaderboard-card h4 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 500;
  color: #20183c;
}

.group-chat-leaderboard-range {
  margin: 0 0 14px;
  text-align: center;
  font-size: 0.82rem;
  color: #6a6a6a;
}

.group-chat-leaderboard-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-chat-leaderboard-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #eee;
}

.group-chat-leaderboard-row strong {
  color: #20183c;
  font-size: 0.94rem;
  font-weight: 700;
}

.group-chat-leaderboard-time {
  display: block;
  text-align: center;
  margin-top: 12px;
}

.group-chat-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px -2px 0;
  padding-top: 12px;
  border-top: 1px solid #e5eaf5;
}

.group-chat-attach,
.group-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 700;
}

.group-chat-attach {
  border: 1px solid #d9e4f5;
  background: #f6f9ff;
  color: #165dfc;
  font-size: 1.35rem;
  line-height: 1;
}

.group-chat-input {
  min-width: 0;
  height: 44px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid #d9e4f5;
  border-radius: 33px;
  color: #8a94a6;
  background: #fff;
  font-size: 0.88rem;
}

.group-chat-send {
  background: var(--primary-blue);
  color: #fff;
  font-size: 1.1rem;
}
