      :root {
          --primary-color: #F5C518;
          /* A vibrant yellow for highlights */
          --background-color: linear-gradient(to right, #D4AF37, #FFD700);
          /* Dark background for contrast */
          --text-color: #FFFFFF;
          /* White text for readability */
          --card-background: #2A2F32;
          /* Slightly lighter background for cards */
          --hover-color: #4A4F52;
          /* Hover effect color */
          --font-family: 'Roboto', sans-serif;
      }

      body {
          display: flex;
          background: radial-gradient(circle, #181818, #0d0d0d);
          color: #f5f5f5;
          font-family: Arial, sans-serif;
          justify-content: center;
          align-items: center;
          height: 100vh;
          min-height: 100vh;
          min-height: 100dvh;
      }

      header h2 {
          color: var(--primary-color);
          margin: 0 0 15px 0;
          font-weight: 500;
      }

      .container {
          display: flex;
          flex-wrap: wrap;
          justify-content: center;
          align-items: stretch;
      }

      .error-message {
          position: fixed;
          top: 20px;
          left: 50%;
          transform: translateX(-50%);
          background: rgba(255, 0, 0, 0.8);
          color: white;
          padding: 10px 20px;
          border-radius: 5px;
          font-size: 16px;
          display: none;
      }

      .default-button {
          background: linear-gradient(to right, #D4AF37, #FFD700);
          border: none;
          color: black;
          font-size: 12px;
          padding: 8px 12px;
          border-radius: 6px;
          cursor: pointer;
          transition: 0.3s;
      }

      .default-button:hover {
          background: linear-gradient(to right, #FFD700, #FFA500);
          box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
      }

      .board-container {
          padding: 30px;
          display: flex;
          flex-direction: column;
          align-items: center;
          /* overflow-y: auto; */
          height: 100%;
          width: min(90vw, 700px);
          aspect-ratio: 1;
          border: 1px solid rgba(212, 175, 55, 0.2);
          box-shadow: 0px 1px 5px rgba(212, 175, 55, 0.4);
      }

      #board {
          width: 80%;
          height: 80%;

      }

      .player-info,
      .opponent-info {
          display: flex;
          align-items: center;
          flex-wrap: nowrap;
          justify-content: flex-start;
          /* Align avatar and text vertically */
          gap: 10px;
          /* Space between avatar and name */
          width: 90%;
          padding: 10px 20px;
          margin: 8px 0;
          color: #FFD700;
      }

      .avatar {
          width: 40px;
          height: 40px;
          border-radius: 10%;
          object-fit: cover;
          margin-right: 10px;
      }


      #find-match-btn {
          background: linear-gradient(to right, #D4AF37, #FFD700);
          color: black;
          font-size: 18px;
          font-weight: bold;
          padding: 12px 20px;
          border: none;
          border-radius: 8px;
          cursor: pointer;
          transition: all 0.3s ease;
          box-shadow: 0px 4px 10px rgba(212, 175, 55, 0.5);
          margin-top: 15px;
      }

      #find-match-btn:hover {
          background: linear-gradient(to right, #FFD700, #FFA500);
          box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
          transform: scale(1.05);
      }

      #find-match-btn:active {
          transform: scale(0.95);
          box-shadow: 0px 2px 8px rgba(212, 175, 55, 0.4);
      }


      .player-info,
      .opponent-info span {
          font-size: clamp(12px, 1vw, 16px);
      }

      .game-sidebar {
          width: min(90vw, 360px);
          padding: 20px;
          margin-left: 20px;
          display: flex;
          flex-direction: column;
          border: 1px solid rgba(212, 175, 55, 0.2);
          box-shadow: 0px 1px 5px rgba(212, 175, 55, 0.4);
      }

      .chat-input-container {
          display: flex;
          align-items: center;
          border: none;
          border-top: .5px solid rgba(212, 175, 55, 0.4);
          width: 100%;
      }

      .chat-input-container.disabled {
          opacity: 0.5;
          pointer-events: none;
      }

      .chat-input-container input:disabled,
      .chat-input-container button:disabled {
          cursor: not-allowed;
      }

      #chat-input {
          flex: 1;
          background: transparent;
          border: none;
          color: #FFD700;
          padding: 6px;
          font-size: 14px;
          outline: none;
      }

      #chat-input::placeholder {
          color: rgba(255, 215, 0, 0.6);
      }

      #send-btn {
          background: linear-gradient(to right, #D4AF37, #FFD700);
          border: none;
          color: black;
          font-size: 18px;
          padding: 8px 12px;
          border-radius: 6px;
          cursor: pointer;
          transition: 0.3s;
      }

      #send-btn:hover {
          background: linear-gradient(to right, #FFD700, #FFA500);
          box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
      }

      .moves {
          flex: 7;
          background: #212020;
          padding: 12px;
          border-radius: 8px;
          overflow-y: auto;
          width: 100%;
          box-sizing: border-box;
          max-height: 300px;
          min-height: 140px;
      }

      .moves::before {
          content: "Moves";
          text-align: center;
          display: block;
          font-size: 14px;
          font-weight: bold;
          color: #FFD700;
          margin-top: 20px;
          margin-bottom: 10px;
          border-bottom: 1px solid rgba(212, 175, 55, 0.4);
      }

      .chat {
          display: flex;
          flex-direction: column;
          justify-content: flex-end;
          position: relative;
          flex: 3;
          background: #212020;
          overflow-y: auto;
          padding: 10px;
          min-height: 120px;
          width: 100%;
          box-sizing: border-box;
      }


      .chat::before {
          content: "Chat";
          text-align: center;
          display: block;
          font-size: 14px;
          font-weight: bold;
          color: #FFD700;
          margin-bottom: 8px;
          border-bottom: 1px solid rgba(212, 175, 55, 0.4);
      }

      .chat input {
          background: #292929;
          border: 1px solid #D4AF37;
          color: #e0e0e0;
          padding: 4px;
          border-radius: 6px;
          outline: none;
          transition: 0.3s ease;
      }

      .chat input:focus {
          border-color: #FFD700;
      }

      .chat-messages-container {
          display: flex;
          flex-direction: column;
      }

      .messages {
          flex: 3;
          overflow-y: auto;
          padding: 10px;
          color: #FFD700;
          font-size: 14px;
          margin-bottom: 10px;
          max-height: 230px;
      }

      .message {
          max-width: 75%;
          padding: 8px 12px;
          margin: 5px;
          border-radius: 10px;
          word-wrap: break-word;
      }

      .white-message {
          align-self: flex-end;
          background-color: #f0d9b5;
          color: black;
      }

      .black-message {
          align-self: flex-start;
          background-color: #b58863;
          color: white;
      }


      .move-row {
          display: grid;
          grid-template-columns: 1fr 2fr 2fr;
          padding: 8px 16px;
          align-items: center;
          color: white;
          font-weight: 500;
          border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      }

      .white-move {
          color: #f0d9b5;
      }

      .black-move {
          color: #b58863;
      }

      @media (max-width: 600px) {

          .container {
              flex-direction: column;
              align-items: center;
              overflow-y: auto;
          }

          .board-container {
              width: 95vw;
              height: auto;
          }

          .game-sidebar {
              width: 95%;
              margin-left: 0;
              margin-top: 20px;
              order: 2;
              position: relative;
              max-height: 80vh;
              overflow-y: auto;
          }

          #board {
              width: 90vw;
              height: 90vw;
          }
      }


      @media (max-width: 1024px) and (orientation: landscape) {
          .container {
              flex-direction: row;
              /* Keep layout horizontal */
              align-items: center;
          }

          .board-container {
              width: min(70vh, 90vw);
              /* Adjust width for landscape */
              height: min(70vh, 90vw);
              /* Adjust height */
          }

          .game-sidebar {
              width: min(30vw, 300px);
              /* Adjust sidebar size */
              margin-left: 10px;
              /* Reduce spacing */
          }
      }

      .resign-draw-container {
          display: flex;
          border-top: 1px solid #2a2a2a;
          justify-content: space-around;
          padding-left: 10px;
          padding-right: 10px
      }

      .resign-draw-button {
          text-align: center;
          color: #ddd;
          padding: 4px 7px;
          font-size: 0.9rem;
          cursor: pointer;
          transition: background-color 0.3s ease;
          border-radius: 5px;
          border: 1px solid transparent;
      }

      .resign-draw-button:hover {
          background-color: #333;
          border-color: #555;
      }


      /* Sidebar Styles Code (Start) */
      .burger-btn {
          position: fixed;
          top: 20px;
          left: 20px;
          font-size: 24px;
          background: transparent;
          color: #FFD700;
          border: none;
          cursor: pointer;
          z-index: 1000;
          transition: transform 0.3s;
      }

      .burger-btn:hover {
          transform: scale(1.1);
      }

      .sidebar {
          position: fixed;
          top: 0;
          left: -200px;
          width: 100px;
          height: 100%;
          background: #161616;
          padding: 20px;
          transition: left 0.3s ease-in-out;
          box-shadow: 1px 0 1px rgba(212, 175, 55, 0.4);
          border-right: 1px solid rgba(212, 175, 55, 0.2);
          z-index: 999;
      }

      .sidebar.open {
          left: 0;
      }

      .user-profile {
          text-align: center;
          padding: 15px 0;
          border-bottom: 1px solid rgba(212, 175, 55, 0.2);
      }

      .user-profile img {
          width: 60px;
          height: 60px;
          border-radius: 50%;
          border: 2px solid #FFD700;
          margin-bottom: 5px;
      }

      .user-profile h3 {
          color: #FFD700;
          margin: 5px 0;
          font-size: 16px;
      }

      .user-profile p {
          color: rgba(255, 215, 0, 0.8);
          font-size: 12px;
          margin-bottom: 10px;
      }

      .close-btn {
          position: absolute;
          top: 10px;
          right: 15px;
          font-size: 20px;
          background: none;
          border: none;
          color: #FFD700;
          cursor: pointer;
      }

      .sidebar-content h2 {
          color: #FFD700;
          text-align: center;
      }

      .sidebar-content ul {
          list-style: none;
          padding: 0;
          margin: 20px 0;
      }

      .sidebar-content ul li {
          margin: 10px 0;
      }

      .sidebar-content ul li a {
          color: #FFD700;
          text-decoration: none;
          font-size: 14px;
          display: block;
          padding: 8px;
          border-radius: 6px;
          transition: background 0.3s ease;
      }

      .sidebar-content ul li a:hover {
          background: rgba(212, 175, 55, 0.3);
      }

      .user-info {
          background: rgba(255, 215, 0, 0.1);
          padding: 8px;
          border-radius: 5px;
          text-align: left;
          font-size: 12px;
          color: #FFD700;
      }

      .user-info p {
          margin: 5px 0;
          display: flex;
          align-items: center;
          justify-content: space-between;
      }

      .copy-text {
          cursor: pointer;
          transition: color 0.3s ease, text-shadow 0.3s ease;
      }

      .copy-text:hover {
          color: #FFD700;
          /* Gold color */
          text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
          /* Soft glow effect */
          text-decoration: none;
          /* Remove default underline */
          font-weight: bold;
      }

      /* Sidebar footer */
      .sidebar-footer {
          margin-top: auto;
          padding: 20px 0;
          border-top: 1px solid rgba(212, 175, 55, 0.2);
          display: flex;
          flex-direction: column;
          align-items: center;
          gap: 16px;
          position: absolute;
          bottom: 30px;
          left: 0;
          right: 0;
      }

      .footer-icon {
          width: 20px;
          height: 20px;
          filter: brightness(0) saturate(100%) invert(92%) sepia(61%) saturate(631%) hue-rotate(3deg) brightness(101%) contrast(101%);
      }

      .footer-icon:hover {
          transform: scale(1.8);
          filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
      }

      @media screen and (min-width: 769px) {
          .sidebar {
              left: 0;
          }

          .burger-btn {
              display: none;
          }

          .close-btn {
              display: none;
          }
      }

      @media screen and (max-width: 768px) {
          .sidebar {
              top: -100%;
              left: 0;
              width: 100%;
              height: 100px;
              transition: top 0.3s ease-in-out;
              box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
              border-bottom: 2px solid rgba(212, 175, 55, 0.2);
              display: flex;
              align-items: center;
              justify-content: space-between;
              padding: 0 15px;
          }

          .sidebar.open {
              top: 0;
          }

          /* User Profile Layout for Mobile */
          .user-profile {
              display: flex;
              align-items: center;
              gap: 10px;
          }

          .user-profile img {
              width: 40px;
              height: 40px;
              border-radius: 50%;
              border: 2px solid #FFD700;
          }

          .user-profile h3 {
              color: #FFD700;
              font-size: 14px;
              margin: 0;
          }

          .user-profile p {
              color: rgba(255, 215, 0, 0.8);
              font-size: 12px;
              margin: 0;
          }

          /* Adjust Menu to Be in One Row */
          .sidebar-content ul {
              display: flex;
              justify-content: center;
              gap: 10px;
              padding: 0px;
          }

          .sidebar-content ul li {
              margin: 0;
          }

          .sidebar-content ul li a {
              font-size: 12px;
              padding: 5px;
          }

          /* Footer Icons for Mobile */
          .sidebar-footer {
              position: absolute;
              right: 10px;
              bottom: 10px;
              top: auto;
              border-top: none;
              padding: 0;
              display: flex;
              gap: 12px;
              align-items: center;
              justify-content: flex-end;
          }

          .footer-icon {
              width: 22px;
              height: 22px;
              filter: brightness(0) saturate(100%) invert(92%) sepia(61%) saturate(631%) hue-rotate(3deg) brightness(101%) contrast(101%);
          }
      }

      /* Sidebar Styles Code (End) */


      /* Spinner Styles Code (Start) */
      #loading-spinner {
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: rgba(0, 0, 0, 0.7);
          display: none;
          align-items: center;
          justify-content: center;
          z-index: 1000;
      }

      .spinner {
          width: 60px;
          height: 60px;
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
      }

      .spinner::before,
      .spinner::after {
          content: "";
          position: absolute;
          border-radius: 50%;
          border: 5px solid transparent;
          animation: spin 1.2s linear infinite;
      }

      .spinner::before {
          width: 100%;
          height: 100%;
          border-top-color: #FFD700;
          border-left-color: #FFD700;
      }

      .spinner::after {
          width: 80%;
          height: 80%;
          border-right-color: #FFD700;
          border-bottom-color: #FFD700;
          animation-direction: reverse;
      }

      @keyframes spin {
          0% {
              transform: rotate(0deg) scale(1);
              opacity: 0.8;
          }

          50% {
              transform: rotate(180deg) scale(1.1);
              opacity: 1;
          }

          100% {
              transform: rotate(360deg) scale(1);
              opacity: 0.8;
          }
      }

      #loading-spinner.active {
          display: flex;
      }

      /* Spinner Styles Code (End) */




      /* Game Start Animation Styles Code (Start) */
      #game-start-animation {
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: rgba(0, 0, 0, 0.85);
          display: flex;
          justify-content: center;
          align-items: center;
          z-index: 9999;
          opacity: 0;
          pointer-events: none;
          transition: opacity 0.5s ease-in-out;
      }

      .animation-content {
          display: flex;
          align-items: center;
          gap: 50px;
          transform: scale(0);
          animation: popIn 0.6s ease-out forwards;
      }

      .player {
          display: flex;
          flex-direction: column;
          align-items: center;
      }

      .player img {
          width: 100px;
          height: 100px;
          border-radius: 50%;
          border: 3px solid gold;
          box-shadow: 0px 0px 20px gold;
          margin-bottom: 10px;
      }

      .vs-text {
          font-size: 2.5rem;
          font-weight: bold;
          color: white;
          text-shadow: 0px 0px 10px red;
          animation: pulse 1s infinite alternate;
      }

      @keyframes popIn {
          0% {
              transform: scale(0);
              opacity: 0;
          }

          100% {
              transform: scale(1);
              opacity: 1;
          }
      }

      @keyframes pulse {
          0% {
              transform: scale(1);
              opacity: 0.8;
          }

          100% {
              transform: scale(1.2);
              opacity: 1;
          }
      }

      @keyframes fadeOut {
          0% {
              opacity: 1;
          }

          100% {
              opacity: 0;
          }
      }



      /* Game Result Modal */

      /* Modal base */


      #resultModal {
          position: fixed;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          background: rgba(29, 28, 28, 0.6);
          backdrop-filter: blur(10px);
          color: #f5f5f5;
          border-radius: 12px;
          padding: 24px;
          width: 90%;
          max-width: 500px;
          z-index: 1000;
          box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
      }

      #resultModal h2 {
          text-align: center;
          margin-bottom: 20px;
          color: gold;
      }

      #resultModal .players {
          display: flex;
          justify-content: space-around;
          align-items: center;
          margin-bottom: 16px;
      }

      #resultModal .player {
          display: flex;
          flex-direction: column;
          align-items: center;
      }

      #resultModal .avatar {
          width: 64px;
          height: 64px;
          border-radius: 50%;
          object-fit: cover;
          border: 2px solid gold;
          margin-bottom: 8px;
      }

      #resultModal .vs {
          font-size: 1.5rem;
          color: #ccc;
      }

      #resultModal .name {
          font-weight: bold;
          font-size: 1rem;
          text-align: center;
      }

      #result-description {
          text-align: center;
          font-style: italic;
          margin-bottom: 20px;
          color: #ccc;
      }

      #resultModal button {
          display: block;
          margin: 0 auto;
          background: linear-gradient(to right, #D4AF37, #FFD700);
          color: black;
          border: none;
          padding: 10px 20px;
          font-weight: bold;
          border-radius: 6px;
          cursor: pointer;
          transition: background-color 0.3s ease;
      }

      #resultModal button:hover {
          background: linear-gradient(to right, #FFD700, #FFA500);
          box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
          transform: scale(1.05);
      }

      .result-avatar {
          width: 100px;
          height: 100px;
          border-radius: 50%;
          background-size: cover;
          background-position: center;
          margin: 0 auto 10px;
          border: 4px solid transparent;
          box-shadow: none;
      }

      .result-avatar.winner {
          border-color: #00ff88;
          box-shadow: 0 0 10px 4px rgba(0, 255, 136, 0.6);
          animation: winnerPulse 2s infinite;
      }

      .result-avatar.loser {
          border-color: #ff3b3b;
          box-shadow: 0 0 10px 4px rgba(255, 59, 59, 0.5);
          filter: grayscale(40%);
          opacity: 0.7;
          animation: loserPulse 2s infinite;
      }

      .result-avatar.draw {
          border-color: #808080;
          box-shadow: 0 0 10px 4px rgba(128, 128, 128, 0.6);
          animation: drawPulse 2s infinite;
      }

      @keyframes drawPulse {
          0% {
              box-shadow: 0 0 10px 4px rgba(128, 128, 128, 0.5);
          }

          50% {
              box-shadow: 0 0 15px 8px rgba(128, 128, 128, 0.9);
          }

          100% {
              box-shadow: 0 0 10px 4px rgba(128, 128, 128, 0.5);
          }
      }


      @keyframes winnerPulse {
          0% {
              box-shadow: 0 0 10px 4px rgba(0, 255, 136, 0.5);
          }

          50% {
              box-shadow: 0 0 15px 8px rgba(0, 255, 136, 0.9);
          }

          100% {
              box-shadow: 0 0 10px 4px rgba(0, 255, 136, 0.5);
          }
      }

      @keyframes loserPulse {
          0% {
              box-shadow: 0 0 10px 4px rgba(255, 59, 59, 0.5);
          }

          50% {
              box-shadow: 0 0 15px 8px rgba(255, 59, 59, 0.8);
          }

          100% {
              box-shadow: 0 0 10px 4px rgba(255, 59, 59, 0.5);
          }

      }