/* font import removed � use theme fonts */
:root {
  --box: 60px;
}
.snake_game_wrap * {
  box-sizing: border-box;
}
.snake_game_wrap {
  font-family: inherit;
  color: inherit;
}
.snake_game_wrap .snake-inner-root {
  width: 100%;
  margin: 0;
}
button:hover {
  cursor: pointer;
}

.container {
  margin: auto;
  width: min(1440px, 100%);
  display: flex;
  justify-content: center;
}
/* In-game: board column left, players + status column right (dashboard-style) */
.snake_game_wrap .container.sg_game_layout {
  margin: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 20px;
}
.snake_game_wrap .sg_game_layout .boardArea {
  flex: 0 0 auto;
  width: auto;
  max-width: calc(100% - 240px);
  padding: 12px 16px 12px 4px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.boardArea {
  padding: 24px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.bigBoard {
  width: calc(var(--box) * 10);
  max-width: 100%;
  aspect-ratio: 1;
  position: relative;
}
.gamePlayers {
  flex: 1;
  padding: 24px;
}
.snake_game_wrap .sg_game_layout .gamePlayers {
  flex: 0 0 auto;
  width: 100%;
  padding: 0;
}
.snake_game_wrap .sg_game_sidebar {
  flex: 1 1 240px;
  min-width: 200px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: stretch;
}
.playersBox {
  background-color: #ffffff6b;
  height: 100%;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
}
.snake_game_wrap .sg_game_layout .playersBox {
  height: auto;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: 12px;
}
.snake_game_wrap .sg_game_sidebar .gamePlayers {
  min-width: 0;
}
.playerCard {
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.96);
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.08);
}
.level1 {
  display: flex;
  justify-content: space-between;
}
.level1 img {
  width: 120px;
  aspect-ratio: 1;
  border-radius: 100%;
}
.diceBox {
  width: 120px;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.diceBox:hover {
  cursor: pointer;
}
.diceImg {
  font-size: 96px;
  opacity: 0;
  transform: rotate(360deg) scale(0);
  animation: zoomInRotate 1.5s 1 forwards;
}
@keyframes zoomInRotate {
  0% {
    opacity: 0;
    transform: rotate(360deg) scale(0);
  }
  100% {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}
#dice1 {
  color: #ff3737;
}
#dice2 {
  color: #2455db;
}
#dice3 {
  color: #2c974b;
}
#dice4 {
  color: #ffa116;
}
.level2 {
  width: 100%;
  margin: 16px 0 0 0;
}
.level2 div {
  background-color: #ffffff88;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 20px;
  letter-spacing: 1px;
  font-weight: normal;
}
.board {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 600px;
  max-width: 100%;
  aspect-ratio: 1;
  box-shadow: -9px -9px 20px 5px rgba(0, 0, 0, 0.1),
    9px 9px 20px 5px rgba(0, 0, 0, 0.1);
}

.potsBoard {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: calc(var(--box) * 10);
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
}

.box {
  max-width: 100%;
  aspect-ratio: 1;
  width: min(100%, 60px);
  flex-wrap: wrap;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
  /* border: 1px solid; */
}
.pot {
  width: calc(var(--box) / 3);
  aspect-ratio: 1;
  border-radius: 100%;
  transform: scale(1);
  margin: 0;
  position: relative;
  animation: zoomIn 0.5s infinite;
}
.pot::after {
  content: "";
  width: 12px;
  aspect-ratio: 1;
  border-radius: 100%;
  z-index: 2;
  position: absolute;
  top: -6px;
  left: 4px;
}
.redPot {
  background: radial-gradient(
    circle at 50% 120%,
    #f68181,
    #ef7676 10%,
    #940505 80%,
    #450606 100%
  );
}
.redPot::after {
  background: radial-gradient(
    circle at 50% 120%,
    #f68181,
    #ef7676 10%,
    #940505 80%,
    #450606 100%
  );
}
.bluePot {
  background: radial-gradient(
    circle at 50% 120%,
    #8183f6,
    #8176ef 10%,
    #051a94 80%,
    #050606 100%
  );
}
.bluePot::after {
  background: radial-gradient(
    circle at 50% 120%,
    #8183f6,
    #8176ef 10%,
    #051a94 80%,
    #050606 100%
  );
}
.greenPot {
  background: radial-gradient(
    circle at 50% 120%,
    #8ff681,
    #b7ef76 10%,
    #059424 80%,
    #050605 100%
  );
}
.greenPot::after {
  background: radial-gradient(
    circle at 50% 120%,
    #8ff681,
    #b7ef76 10%,
    #059424 80%,
    #050605 100%
  );
}
.yellowPot {
  background: radial-gradient(
    circle at 50% 120%,
    #f4f681,
    #efe776 10%,
    #948a05 80%,
    #060605 100%
  );
}
.yellowPot::after {
  background: radial-gradient(
    circle at 50% 120%,
    #f4f681,
    #efe776 10%,
    #948a05 80%,
    #060605 100%
  );
}

/* Board pawns: vertical pin (scoped; redPot/bluePot from JS unchanged) */
.potsBoard .pot {
  animation: none;
  width: calc(var(--box) * 0.26);
  aspect-ratio: 3 / 4.1;
  max-width: 100%;
  border-radius: 50% 50% 46% 46% / 38% 38% 62% 62%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}
.potsBoard .pot::after {
  content: none;
  display: none;
}
.potsBoard .pot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -22%);
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.22);
}
.potsBoard .pot.redPot {
  background: radial-gradient(
    ellipse 85% 72% at 50% 62%,
    #e8a8a8 0%,
    #c02828 42%,
    #6a0a0a 88%,
    #3d0505 100%
  );
}
.potsBoard .pot.redPot::before {
  background: radial-gradient(
    circle at 38% 32%,
    #ffc8c8 0%,
    #e06060 45%,
    #8a1818 100%
  );
}
.potsBoard .pot.bluePot {
  background: radial-gradient(
    ellipse 85% 72% at 50% 62%,
    #a8b0e8 0%,
    #2838c0 42%,
    #0a126a 88%,
    #05083d 100%
  );
}
.potsBoard .pot.bluePot::before {
  background: radial-gradient(
    circle at 38% 32%,
    #c8d0ff 0%,
    #6068e0 45%,
    #181a8a 100%
  );
}

.exitPot {
  width: calc(var(--box) / 3);
  aspect-ratio: 1;
  border-radius: 100%;
  transform: scale(0.5);
  animation: zoomOut 1s 1 forwards;
}
.redExit {
  background-color: #ff6b6b;
}
.blueExit {
  background-color: #8176ef;
}
.greenExit {
  background-color: #b7ef76;
}
.yellowExit {
  background-color: #efe776;
}
@keyframes zoomIn {
  0% {
    transform: scale(0.5);
  }
  50% {
    transform: scale(1);
  }
  100% {
    transform: scale(0.5);
  }
}
@keyframes zoomOut {
  0% {
    transform: scale(0.7);
  }
  100% {
    transform: scale(0);
  }
}

@keyframes shadeIn {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1);
  }
  100% {
    filter: hue-rotate(1);
    transform: scale(0.8);
  }
}
.screen {
  width: 100%;
  min-height: 100dvh;
  padding: 16px;
  background-image: url("../images/screen1.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

@media only screen and (max-width: 1360px) {
  .container {
    flex-direction: column;
    gap: 12px;
  }
}
@media only screen and (max-width: 700px) {
  .boardArea {
    padding: 0px;
  }
  .gamePlayers {
    padding: 0px;
    width: min(600px, 100%);
  }
  .board {
    width: 100%;
  }
  .playersBox {
    border-radius: 0;
    gap: 6px;
    padding: 6px;
    overflow: hidden;
  }
  #small_modal .snake_game_modal .playersBox {
    overflow: visible;
  }
  .playerCard {
    border-radius: 0px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }
  .level1 img {
    width: 64px;
  }
  .diceBox {
    width: 40px;
  }
  .diceBox:hover {
    cursor: pointer;
  }
  .diceImg {
    font-size: 40px;
  }
  .level2 {
    width: 100%;
    margin: 6px 0 0 0;
  }
  .level2 div {
    background-color: unset;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
  }
}

/* -------------------------------------- */

/* Screen 1 */

.s1-card {
  backdrop-filter: blur(2px);
  background-color: #ffffff6b;
  width: min(680px, 100%);
  padding: 32px;
  margin: 32px auto;
  text-align: center;
  border-radius: 16px;
}
.s1-card h1 {
  font-size: 48px;
  color: #333;
}
.s1-card .subHeading {
  font-size: 24px;
  font-weight: 300;
  margin: 16px 0;
}
.choose {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 16px;
  margin: 16px 0;
}
.selectBox {
  aspect-ratio: 1;
  background-color: #ffffff88;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 95% 10% 86% 14% / 10% 90% 10% 90%;
  transition: all 0.5s;
}
.selected {
  background: linear-gradient(45deg, #2455db 10%, #6d94ff);
  color: #fff;
}
.selectBox:hover {
  cursor: pointer;
  box-shadow: #8d8d8d 0px 20px 30px -10px;
  transition: all 0.5s;
}
.selectBox span:first-child {
  font-size: 64px;
  display: block;
  line-height: 96px;
}
.selectBox span:last-child {
  font-size: 24px;
  line-height: 12px;
  font-weight: 300;
}
.startBtn {
  border-radius: 95% 10% 86% 14% / 10% 90% 10% 90%;
  width: 280px;
  height: 72px;
  border: none;
  font-size: 32px;
  background-color: #2455db;
  color: #fff;
  margin: 32px 0;
}
.info {
  font-size: 20px;
  font-weight: 300;
}
@media only screen and (max-width: 768px) {
  /* Tablet */
  .s1-card {
    padding: 16px;
    margin: 16px auto;
  }
  .s1-card h1 {
    font-size: 32px;
  }
  .s1-card .subHeading {
    font-size: 18px;
  }
}
@media only screen and (max-width: 600px) {
  /* Tablet Vertical*/
  .s1-card {
    margin: 0 auto;
  }
  .selectBox span:first-child {
    font-size: 48px;
    line-height: 48px;
  }
  .choose {
    column-gap: 4px;
  }
  .selectBox span:last-child {
    font-size: 16px;
    line-height: 12px;
  }
  .startBtn {
    width: 140px;
    height: 56px;
    font-size: 24px;
    margin: 16px 0;
  }
  .info {
    font-size: 14px;
  }
  .potsBoard .pot {
    width: calc(var(--box) * 0.24);
  }
  .potsBoard .pot::before {
    width: 58%;
    transform: translate(-50%, -20%);
  }
}

/* ---------------------------------- */

/* Screen 2 */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background-color: #ffffff88;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 16px;
  padding: 16px;
  transition: all 0.5s;
}
.profile {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.selectImage img {
  width: 120px;
  border-radius: 100%;
}
.arrow {
  aspect-ratio: 1;
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 6px;
  user-select: none;
  background-color: #ffffff8e;
}
.arrow:hover {
  cursor: pointer;
}
.arrow span {
  font-size: 32px;
}
.inputName {
  width: 100%;
  padding: 16px;
}
.inputName input {
  width: 100%;
  background-color: #ffffff88;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: bold;
}
.inputName input:focus {
  outline: none;
  box-shadow: none;
}
/* Player Red */
#profile1 {
  border: 5px solid #ff3737;
}
/* Player Blue */
#profile2 {
  border: 5px solid #4267b2;
}
/* Player Green */
#profile3 {
  border: 5px solid #2c974b;
}
/* Player Yellow */
#profile4 {
  border: 5px solid #ffa116;
}
.next {
  background-color: #2c974b;
}
@media only screen and (max-width: 768px) {
  /* Tablet */
  .cards {
    grid-template-columns: repeat(1, 1fr);
    gap: 8px;
  }
}

/* --------------------------------- */
/* Screen 3 */

#screen3 {
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal {
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: #000000a8;
  padding: 16px;
}
.modalBody {
  width: min(680px, 100%);
  background-color: #ffffff88;
  backdrop-filter: blur(5px);
  margin: 0px auto;
  border-radius: 24px;
  padding: 16px;
  text-align: center;
}
.modalBody img {
  width: 240px;
  aspect-ratio: 1;
  border-radius: 100%;
}
.modalBody h1 {
  margin: 32px 0 0 0;
  font-size: 24px;
}
.snake_game_modal .sg_hide {
  display: none !important;
}
.snake_game_modal.sg_match_completed .snake_game_wrap {
  display: none !important;
}
.snake_game_modal.sg_match_completed #sg_minimize_btn,
.snake_game_modal.sg_match_completed #sg_leaveBtn {
  display: none !important;
}
#sg_win_modal:not(.sg_hide) {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 8px 20px;
  text-align: center;
}
#sg_win_modal:not(.sg_hide) .sg_win_end_inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
#sg_win_modal:not(.sg_hide) #sg_wimg {
  width: 120px;
  max-width: 40vw;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}
#sg_win_modal:not(.sg_hide) #sg_wtitle {
  margin: 14px 0 16px;
  font-size: 22px;
  font-weight: 700;
}
.sg_win_end_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.snake_game_modal .hidden {
  display: none !important;
}

/* Single shell: only when we render our header row (hide duplicate CodyChat X; align padding) */
#small_modal_in.modal_pad:has(.sg_modal_header) > .modal_close {
  display: none !important;
}
#small_modal_in.modal_pad:has(.sg_modal_header) {
  padding-top: 8px;
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 12px;
}
/* In-game: kill theme white + modal_pad gap so screen1 reaches rounded corners edge-to-edge */
#small_modal_in.modal_pad:has(#sg_board) {
  padding: 0 !important;
  overflow: hidden;
  background-color: transparent !important;
  background-image: url("../images/screen1.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#small_modal_in:has(#sg_board) #small_modal_content {
  background: transparent !important;
}

/* Game modal: avoid clipping second player; stack on narrow viewports */
#small_modal .snake_game_modal .snake-inner-root {
  max-height: min(90vh, 860px);
  overflow-x: visible;
  overflow-y: auto;
}
#small_modal .snake_game_modal {
  --box: 46px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
@media (min-width: 960px) {
  #small_modal .snake_game_modal {
    --box: 50px;
  }
}
/* In-game: inner shell transparent — image lives on #small_modal_in (rounded clip, no white rim) */
#small_modal .snake_game_modal:has(#sg_board) {
  background-color: transparent;
  background-image: none;
}
#small_modal .snake_game_modal:has(#sg_board) .sg_modal_header {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
}
#small_modal .snake_game_modal .snake-inner-root .container.sg_game_layout {
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}
#small_modal .snake_game_modal .sg_game_layout .boardArea {
  max-width: calc(100% - 200px);
  padding: 8px 8px 8px 2px;
}
#small_modal .snake_game_modal .sg_game_sidebar {
  gap: 8px;
  min-width: 168px;
  max-width: 320px;
}
#small_modal .snake_game_modal .snake_game_wrap .sg_game_layout .playersBox {
  gap: 8px;
  padding: 10px 12px;
}
#small_modal .snake_game_modal .sg_game_sidebar .playerCard {
  padding: 12px 14px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 3px 12px rgba(0, 0, 0, 0.075);
}
#small_modal .snake_game_modal .sg_game_sidebar .level1 img {
  width: 72px;
}
#small_modal .snake_game_modal .sg_game_sidebar .diceBox {
  width: 72px;
}
#small_modal .snake_game_modal .sg_game_sidebar .diceImg {
  font-size: 44px;
}
/* Block clicks during roll / animation / opponent turn (JS also guards) */
#small_modal .snake_game_modal .diceBox.sg_dice_interaction_lock {
  pointer-events: none;
}
/* In-game dice: stable icon (no entrance spin on class swap) + turn colors */
#small_modal .snake_game_modal .diceBox .diceImg {
  animation: none;
  opacity: 1;
  transform: none;
}
#small_modal .snake_game_modal #sg_dice1.sg_dice_turn_active .diceImg {
  color: #c62828;
  opacity: 1;
}
#small_modal .snake_game_modal #sg_dice2.sg_dice_turn_active .diceImg {
  color: #1565c0;
  opacity: 1;
}
#small_modal .snake_game_modal .sg_dice_turn_muted .diceImg {
  color: #9e9e9e;
  opacity: 0.52;
}
@keyframes sg_dice_wiggle {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg);
  }
}
#small_modal .snake_game_modal .diceBox.sg_dice_tumbling {
  animation: sg_dice_wiggle 0.24s ease-in-out infinite;
}
#small_modal .snake_game_modal .sg_game_sidebar .level2 {
  margin-top: 10px;
}
#small_modal .snake_game_modal .sg_game_sidebar .level2 div {
  padding: 10px 12px;
  font-size: 16px;
}
@media (max-width: 720px) {
  #small_modal .snake_game_modal .snake-inner-root .container.sg_game_layout {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
  }
  #small_modal .snake_game_modal .sg_game_layout .boardArea {
    max-width: 100%;
    padding: 12px;
  }
  #small_modal .snake_game_modal .sg_game_sidebar {
    max-width: 100%;
    width: 100%;
  }
  #small_modal .snake_game_modal .gamePlayers {
    width: 100%;
    padding: 0;
  }
  .sg_modal_header {
    flex-wrap: nowrap;
    align-items: center;
  }
  .sg_header_trailing {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    margin-top: 0;
    justify-content: flex-end;
  }

  /* Mobile: compact player row � two players side by side, smaller avatar + dice */
  #small_modal .snake_game_modal .snake_game_wrap .sg_game_layout .playersBox {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }
  #small_modal .snake_game_modal .sg_game_sidebar .playerCard {
    padding: 10px 8px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  #small_modal .snake_game_modal .sg_game_sidebar .level1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  #small_modal .snake_game_modal .sg_game_sidebar .level1 img {
    width: 52px;
  }
  #small_modal .snake_game_modal .sg_game_sidebar .diceBox {
    width: 48px;
    flex-shrink: 0;
  }
  #small_modal .snake_game_modal .sg_game_sidebar .diceImg {
    font-size: 32px;
  }
  #small_modal .snake_game_modal .sg_game_sidebar .level2 {
    margin-top: 8px;
  }
  #small_modal .snake_game_modal .sg_game_sidebar .level2 div {
    padding: 8px 6px;
    font-size: 14px;
    letter-spacing: 0.5px;
  }
}

/* Ludo-style modal header + sound overlay (Snake_Game in CodyChat small_modal) */
.snake_game_modal.pad15 .sg_modal_header {
  margin: 0 0 12px 0;
}
#small_modal .snake_game_modal .sg_modal_header {
  align-items: center;
}
#small_modal .snake_game_modal:not(.pad15) .sg_modal_header {
  margin: 0 0 6px 0;
  padding: 4px 0 6px 0;
  min-height: 36px;
}
.sg_modal_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 10px 0;
  min-height: 40px;
  border-bottom: none;
  flex-shrink: 0;
  gap: 10px;
}
.sg_modal_title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
}
.sg_modal_title .fa {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  flex-shrink: 0;
}
.sg_header_trailing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 12px;
  flex: 1;
  min-width: 0;
  margin-left: auto;
}
.sg_header_timer {
  margin: 0;
  padding: 0 4px 0 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease, font-weight 0.15s ease;
  line-height: 1.2;
  align-self: center;
}
.sg_modal_header #sg_timer.sg_timer_my_turn {
  font-weight: 700;
}
.sg_modal_header #sg_timer.sg_timer_warn {
  color: #c62828;
  font-weight: 700;
}
.sg_header_actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}
.sg_icon_btn {
  cursor: pointer;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  transition: opacity 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  box-sizing: border-box;
}
.sg_icon_btn .fa {
  line-height: 1;
  display: block;
}
.sg_icon_btn:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.06);
}
.sg_sound_btn {
  color: #03add8;
}
.sg_close_btn {
  color: inherit;
  font-size: 20px;
}

/* Lobby: opponent <select> should match <input.full_input> (theme often styles inputs only) */
.snake_game_modal select#sg_opponent.full_input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 40px 10px 12px;
  margin: 0;
  font-size: inherit;
  line-height: 1.35;
  color: inherit;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background-color: rgba(245, 246, 248, 1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.snake_game_modal select#sg_opponent.full_input:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: none;
}
.snake_game_modal select#sg_opponent.full_input:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Lobby — create / play with bot */
.sg_step1_actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.sg_resuming_text {
  text-align: center;
}

/* Pending invite rows (incoming invites list) */
.sg_pending_invite_row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.sg_pending_invite_row:last-child {
  margin-bottom: 0;
}
.sg_pending_invite_text {
  flex: 1 1 160px;
  min-width: 0;
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
  color: inherit;
}
.sg_pending_invite_text strong {
  font-weight: 700;
}
.sg_pending_invite_actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}
.sg_pending_btn_accept,
.sg_pending_btn_reject {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.sg_pending_btn_accept {
  color: #fff;
  background: #2e7d32;
}
.sg_pending_btn_accept:hover {
  filter: brightness(1.06);
}
.sg_pending_btn_reject {
  color: #fff;
  background: #37474f;
}
.sg_pending_btn_reject:hover {
  filter: brightness(1.08);
}

.sg_icon_btn.sg_leave_icon_btn {
  color: #e53935;
  opacity: 0.9;
  font-size: 18px;
}
.sg_icon_btn.sg_leave_icon_btn:hover {
  background: rgba(229, 57, 53, 0.12);
  opacity: 1;
}
.sg_sound_modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sg_sound_modal.hidden {
  display: none !important;
}
.sg_sound_modal_content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.sg_sound_modal_title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}
.sg_sound_row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sg_sound_label {
  font-size: 14px;
  width: 60px;
  flex-shrink: 0;
}
.sg_sound_status {
  font-size: 12px;
  color: #888;
  min-width: 28px;
}
.sg_toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.sg_toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sg_toggle_slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}
.sg_toggle_slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.sg_toggle input:checked + .sg_toggle_slider {
  background: #03add8;
}
.sg_toggle input:checked + .sg_toggle_slider:before {
  transform: translateX(22px);
}
.sg_sound_save {
  width: 100%;
  margin-top: 8px;
}
.sg_footer_icon {
  text-align: center;
  cursor: pointer;
  vertical-align: middle;
  color: #fff;
  font-size: 18px;
}
.sg_footer_icon:hover {
  opacity: 0.9;
}
.sg_footer_icon.hidden {
  display: none !important;
}

#wname {
  color: #2455db;
}
