.word-box-text {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100%;
  height: 100%;
  font-size: inherit;
  line-height: 1;
}
body { background: #fff; margin: 0; font-family: 'Avenir Next', Arial, sans-serif; overflow: hidden; }
.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  margin-top: 40px;
  width: 100vw;
  box-sizing: border-box;
}
#scoreboardCard, #timerCard, #speedCard {
  height: 3vw;
  width: 20vw;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
}
#scoreboard, #timer {
  height: 50%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#arenaCard {
  width: 90vw;
  max-width: 800px;
  aspect-ratio: 3 / 2;
  min-width: 0 !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}
.arena-side-containers {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  gap: 16px;
  margin-top: 16px;
  box-sizing: border-box;
}
#wordCollectionCard, #garbageCanCard {
  width: 48%;
  max-width: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  container-type: size;
}
.word-box {
  background: transparent;
  border: none;
  border-bottom: 2px solid #888;
  border-radius: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  transition: width 0.2s, height 0.2s, font-size 0.2s;
  font-size: clamp(0.5rem, 8cqh, 1.1rem);
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 4px;
  padding-bottom: 0px;
}
.card { background: #f5f5ff; border-radius: 18px; padding: 12px; margin: 0; display: flex; flex-direction: column; align-items: center; }
#gameCanvas { background: #f5f5ff; border-radius: 18px; box-shadow: none; margin: 0; display: block; }
.modal {
  position: fixed; left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.98); z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Avenir Next', Arial, sans-serif;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}
.modal .close { position: absolute; top: 16px; right: 24px; font-size: 1.5em; color: #888; cursor: pointer; }
.modal .title { font-size: clamp(2.8em, 9vw, 5.5em); color: #006400; text-shadow: 2px 2px #000; margin-bottom: 0.05em; }
.modal .date { font-size: clamp(1.3em, 3.5vw, 2.5em); color: #222; margin-bottom: 0.5em; text-align: center; line-height: 2.2; }
.modal .score { font-size: clamp(1.3em, 3.5vw, 2.5em); color: #222; margin-bottom: 0.5em; }
.modal .btn { font-size: clamp(0.9em, 2.5vw, 1.5em); padding: 0.4em 1.5em; border-radius: 12px; background: #222; color: #fff; border: none; cursor: pointer; margin-top: 0.5em; max-width: 90vw; box-sizing: border-box; }

/* Mobile-specific modal styling for better readability */
@media (max-width: 768px) {
  .modal {
    padding: 40px 20px;
  }
  .modal .title { 
    font-size: clamp(3.5em, 12vw, 6em); 
    margin-bottom: 0.2em; 
  }
  .modal .date { 
    font-size: clamp(1.8em, 5vw, 3em); 
    margin-bottom: 0.8em; 
    line-height: 1.8;
  }
  .modal .score { 
    font-size: clamp(1.8em, 5vw, 3em); 
    margin-bottom: 0.8em; 
  }
  .modal .btn { 
    font-size: clamp(1.2em, 4vw, 2em); 
    padding: 0.6em 2em; 
    margin-top: 1em;
    margin-bottom: 0.5em;
    min-height: 44px; /* Better touch target */
  }
}
