* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff, #ffffff);
    min-height: 100vh;
    padding: 20px;
    color: #1e293b;
  }
  
  .click-highlight {
    position: fixed;
  
    width: 120px;
    height: 120px;
  
    border-radius: 50%;
  
    background: radial-gradient(
      circle,
      rgba(255, 255, 0, 0.35) 0%,
      rgba(255, 255, 0, 0.15) 60%,
      transparent 100%
    );
  
    pointer-events: none;
  
    transform: translate(-50%, -50%) scale(0);
  
    animation: clickPulse 0.8s ease-out;
  
    z-index: 99999;
  }
  
  @keyframes clickPulse {
    0% {
      transform: translate(-50%, -50%) scale(0.2);
      opacity: 1;
    }
  
    100% {
      transform: translate(-50%, -50%) scale(1.8);
      opacity: 0;
    }
  }
  
  .team-active {
    animation: activeBlink 0.8s infinite;
  
    box-shadow: 0 0 20px rgb(255, 209, 4);
  }
  
  @keyframes activeBlink {
    0% {
      transform: scale(1);
    }
  
    50% {
      transform: scale(1.05);
    }
  
    100% {
      transform: scale(1);
    }
  }
  
  .container {
    padding: 50px;
    margin: auto;
  }
  
  .header {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .header-container h1 {
    margin-bottom: 0;
    color: #0f172a;
  }
  
  .header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
  }
  
  .timer-box {
    background: #fee2e2;
    color: #dc2626;
    font-size: 30px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 15px;
  }
  
  #timer {
    min-width: 50px;
    display: inline-block;
    text-align: center;
  }
  
  .time-setting {
    background: #e0f2fe;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
  }
  
  .time-setting input {
    width: 70px;
    text-align: center;
  }
  
  .panel {
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  }
  
  .panel h2 {
    margin-bottom: 15px;
  }
  
  textarea {
    width: 100%;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    resize: vertical;
    font-size: 15px;
  }
  
  .button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
  }
  
  button {
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.25s;
  }
  
  button:hover {
    transform: translateY(-2px);
  }
  
  #loadSentenceBtn {
    background: #22c55e;
    color: white;
  }
  
  #randomSentenceBtn {
    background: #ec4899;
    color: white;
  }
  
  #correctBtn {
    background: #22c55e;
    color: white;
  }
  
  #wrongBtn {
    background: #ef4444;
    color: white;
    display: none; /* Hide the wrong button */
  }
  
  #resetWordsBtn {
    background: #f59e0b;
    color: white;
  }
  
  #endGameBtn {
    background: #111827;
    color: white;
  }
  
  #status {
    font-size: 24px;
    font-weight: bold;
    color: #2563eb;
  }
  
  .stt-alert {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .message-stt-arlert {
    background: #f8d7da;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #842029;
    border-color: #f5c2c7;
    text-align: center;
  }
  
  #questionInfo {
    background: #dbeafe;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: bold;
  }
  
  #wordBank,
  #answerArea {
    min-height: 120px;
    border: 3px dashed #94a3b8;
    border-radius: 15px;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
  }
  
  #answerArea {
    border-color: #f472b6;
  }
  
  #wordBank.drag-over,
  #answerArea.drag-over {
    background: #e0f2fe;
  }
  
  .word {
    background: #bfdbfe;
    color: #1e3a8a;
    padding: 10px 14px;
    border-radius: 10px;
    user-select: none;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .word.dragging {
    opacity: 0.5;
  }
  
  .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
  
  .team-btn {
    font-size: 22px;
    padding: 15px;
    font-weight: bold;
  }
  
  .rabbit {
    background: #fde68a;
  }
  
  .panda {
    background: #d1fae5;
  }
  
  .cat {
    background: #ddd6fe;
  }
  
  .dog {
    background: #bfdbfe;
  }
  
  .fox {
    background: #fecaca;
  }
  
  .lane {
    margin-bottom: 15px;
  }
  
  .lane-name {
    font-weight: bold;
    margin-bottom: 6px;
  }
  
  .track {
    position: relative;
    height: 64px;
    background: #dbeafe;
    border-radius: 32px;
    overflow: hidden;
    border: 2px solid #93c5fd;
  }
  
  .runner {
    position: absolute;
    left: 0;
    top: 8px;
    font-size: 38px;
    transition:
      left 0.5s ease,
      transform 0.3s;
  }
  
  .runner.finished {
    transform: scale(1.25);
  }
  
  .finish {
    position: absolute;
    right: 10px;
    top: 16px;
    font-size: 24px;
  }
  
  .modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
  }
  
  .modal-content {
    background: white;
    width: min(600px, 90%);
    border-radius: 25px;
    padding: 25px;
    text-align: center;
  }
  
  .modal-content h2 {
    margin-bottom: 20px;
  }
  
  #rankingList {
    text-align: left;
  }
  
  .rank-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8fafc;
    font-size: 20px;
  }
  
  .rank-1 {
    background: #fef3c7;
  }
  
  .rank-2 {
    background: #e5e7eb;
  }
  
  .rank-3 {
    background: #fed7aa;
  }
  
  #closeRankingBtn {
    margin-top: 15px;
    background: #2563eb;
    color: white;
  }
  
  .finished-badge {
    color: #16a34a;
    font-weight: bold;
  }
  
  @media (max-width: 768px) {
    .header-actions {
      flex-direction: column;
      align-items: flex-start;
    }
  
    .team-grid {
      grid-template-columns: 1fr;
    }
  
    .runner {
      font-size: 30px;
    }
  
    .timer-box {
      font-size: 24px;
    }
  }
  
  .game-layout {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 20px;
  }
  
  .left-panel {
    display: flex;
    flex-direction: column;
  }
  
  .center-panel {
    display: flex;
    flex-direction: column;
  }
  
  .right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .timer-panel {
    text-align: center;
  }
  
  .timer-panel #timer {
    font-size: 72px;
    color: red;
    font-weight: bold;
    margin: 10px 0;
  }
  
  .team-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .track {
    height: 50px;
  }
  
  .runner {
    top: 4px;
    font-size: 32px;
  }
  
  @media (max-width: 1200px) {
    .game-layout {
      grid-template-columns: 1fr;
    }
  }
  
  .word {
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  }
  
  .word:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }
  
  /* Mode specific cursors */
  body.mode-drag .word {
    cursor: grab;
  }
  
  body.mode-drag .word:active {
    cursor: grabbing;
  }
  
  body.mode-click #wordBank .word {
    cursor: pointer;
  }
  
  body.mode-click #answerArea .word {
    cursor: pointer;
  }
  
  body.mode-click #answerArea .word:active {
    cursor: grabbing;
  }

  /* Segmented control layout for Mode Selector */
  .interaction-mode-selector {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }
  
  .mode-label {
    font-weight: bold;
    font-size: 14px;
    color: #64748b;
  }
  
  .segmented-control {
    display: flex;
    position: relative;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 20px;
    width: 270px;
    user-select: none;
  }
  
  .segmented-control input {
    display: none;
  }
  
  .segmented-control label {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    padding: 8px 0;
    cursor: pointer;
    z-index: 2;
    transition: color 0.25s ease;
  }
  
  .segmented-control input:checked + label {
    color: #1e293b;
  }
  
  .segmented-control-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    z-index: 1;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .segmented-control input#modeClick:checked ~ .segmented-control-slider {
    transform: translateX(100%);
  }
  
  .word.dragging {
    opacity: 0.7;
  
    transform: scale(1.25) rotate(-3deg);
  
    z-index: 9999;
  
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
  
    cursor: grabbing;
  }
  
  .drag-focus {
    position: fixed;
  
    width: 180px;
    height: 180px;
  
    border-radius: 50%;
  
    background: radial-gradient(
      circle,
      rgba(59, 130, 246, 0.25) 0%,
      rgba(96, 165, 250, 0.15) 50%,
      transparent 100%
    );
  
    transform: translate(-50%, -50%) scale(0.2);
  
    pointer-events: none;
  
    z-index: 99999;
  
    animation: dragFocusAnimation 0.8s ease-out;
  }
  
  @keyframes dragFocusAnimation {
    0% {
      opacity: 1;
  
      transform: translate(-50%, -50%) scale(0.2);
    }
  
    100% {
      opacity: 0;
  
      transform: translate(-50%, -50%) scale(2);
    }
  }
  
  #wordBank.drag-over,
  #answerArea.drag-over {
    background: #dbeafe;
  
    border-color: #3b82f6;
  
    transform: scale(1.02);
  
    transition: 0.15s;
  }
  
  .big-cursor {
    position: fixed;
  
    width: 80px;
    height: 80px;
  
    border-radius: 50%;
  
    background: radial-gradient(
      circle,
      rgba(59, 130, 246, 0.25),
      rgba(96, 165, 250, 0.08),
      transparent
    );
  
    border: 3px solid rgba(59, 130, 246, 0.7);
  
    pointer-events: none;
  
    z-index: 999999;
  
    transform: translate(-50%, -50%);
  
    transition:
      width 0.15s ease,
      height 0.15s ease,
      transform 0.08s linear;
  }
  
  @keyframes cursorPulse {
    0% {
      transform: translate(-50%, -50%) scale(1);
    }
  
    50% {
      transform: translate(-50%, -50%) scale(1.15);
    }
  
    100% {
      transform: translate(-50%, -50%) scale(1);
    }
  }
  
.team-toolbar{
    margin-bottom:15px;
    margin-top: 15px;
}

.team-item{
    display:flex;
    gap:8px;
    align-items:center;
}

.team-item .team-btn{
    flex:1;
}

.team-edit{
    background:#2563eb;
    color:white;
}

.team-delete{
    background:#ef4444;
    color:white;
}

.team-grid{

  display:flex;

  flex-direction:column;

  gap:14px;

}

.team-btn{

  width:100%;
  height:50px;

  display:flex;
  justify-content:space-between;
  align-items:center;

  padding:0 22px;

  border:none;
  border-radius:22px;

  cursor:pointer;

  overflow:hidden;

  transition:.25s;

  box-shadow:
      0 10px 24px rgba(0,0,0,.08),
      inset 0 1px 0 rgba(255,255,255,.9);

}

.team-btn:hover{

  transform:translateY(-4px);

  box-shadow:
      0 18px 36px rgba(0,0,0,.12),
      inset 0 1px 0 rgba(255,255,255,.95);

}

.team-btn:active{

  transform:scale(.985);

}
.rabbit{

  background:linear-gradient(90deg,#FFE082,#FFF8DC);

  border-left:6px solid #FFB300;

}

.panda{

  background:linear-gradient(90deg,#C8F7D8,#EFFFF8);

  border-left:6px solid #00C853;

}

.cat{

  background:linear-gradient(90deg,#D8CCFF,#F6F3FF);

  border-left:6px solid #7C4DFF;

}

.dog{

  background:linear-gradient(90deg,#CFE4FF,#F5FAFF);

  border-left:6px solid #2979FF;

}

.fox{

  background:linear-gradient(90deg,#FFD5D5,#FFF6F6);

  border-left:6px solid #FF5252;

}
.team-left{

  display:flex;
  align-items:center;
  gap:5px;

}
.team-right{

  display:flex;

  gap:5px;

}
.team-emoji{

  font-size:30px;

  line-height:1;

}

.team-text{

  font-size:25px;

  font-weight:700;

  color:#111827;

  letter-spacing:.3px;

}
.rename-btn{

  width:20px;
  height:20px;

  display:flex;
  justify-content:center;
  align-items:center;

  font-size:10px;

  border-radius:5px;

  background:#F4F8FF;

  color:#377DFF;

  border:1px solid #9CC2FF;

  box-shadow:
      0 4px 12px rgba(55,125,255,.15);

  transition:.25s;

}

.rename-btn:hover{

  background:#377DFF;

  color:white;

  transform:translateY(-2px);

}
.delete-btn{

  width:20px;
  height:20px;

  display:flex;
  justify-content:center;
  align-items:center;

  font-size:10px;

  border-radius:5px;

  background:#FFF7F7;

  color:#E53935;

  border:1px solid #FFB0AE;

  box-shadow:
      0 4px 12px rgba(229,57,53,.15);

  transition:.25s;

}

.delete-btn:hover{

  background:#E53935;

  color:white;

  transform:translateY(-2px);

}
#addTeamBtn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 5px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #4285F4, #3367D6);
  color: white;
  font-size: 12px;
  font-weight: 100;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(66, 133, 244, .28);
  transition: .25s;
}

#addTeamBtn:hover{

  transform:translateY(-3px);

  box-shadow:0 18px 36px rgba(66,133,244,.35);

}