body {
  font-family: 'Montserrat', Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
}

/* Portrait orientation message for mobile */
.orientation-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  color: white;
  z-index: 9999;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.orientation-message img {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  animation: rotate 1.5s infinite ease-in-out;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

.orientation-message p {
  font-size: 18px;
  max-width: 80%;
}

/* Enforce landscape orientation - show message and hide app in portrait mode */
@media screen and (max-width: 768px) and (orientation: portrait) {
  .orientation-message {
    display: flex !important; /* Force display with !important */
  }
  
  .app {
    display: none !important; /* Force hide with !important */
  }
}

/* Remove any overrides that might have been added */
@media screen and (max-width: 768px) {
  @media (orientation: portrait) {
    /* Remove any overrides that might have allowed portrait mode */
    .orientation-message {
      display: flex !important;
    }
    
    .app {
      display: none !important;
    }
    
    /* Remove the continue button if it was added */
    .btn-continue {
      display: none;
    }
  }
}

.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-title {
  text-align: center;
  font-family: 'Pacifico', cursive;
  font-size: 2rem;
  font-weight: normal;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #f39c12, #48dbfb, #1dd1a1, #ffeaa7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.player-setup {
  margin: 0 auto 20px;
}

.player-fields-container {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.player-field {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 4px;
  height: 28px;
  width: 220px;
}

.player-1-field {
  border-left: 4px solid #f39c12;
  background-color: rgba(243, 156, 18, 0.1);
}

.player-2-field {
  border-left: 4px solid #48dbfb;
  background-color: rgba(72, 219, 251, 0.1);
}

.player-field label {
  font-weight: bold;
  margin-right: 10px;
  width: 50px;
  font-size: 12px;
  white-space: nowrap;
}

.player-name-input {
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  flex-grow: 1;
  height: 20px;
}

.turn-indicator-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.turn-indicator {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  padding: 12px 30px;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  text-align: center;
  border: none;
  cursor: pointer;
}

.player-1 {
  background-color: #f39c12;
}

.player-2 {
  background-color: #48dbfb;
}

/* Player text colors */
.text-player-1 {
  color: #e67e00 !important;
  font-weight: bold;
  text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.2);
}

.text-player-2 {
  color: #0097e6 !important;
  font-weight: bold;
  text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.2);
}

.start-button {
  background-color: #27ae60;
  transition: background-color 0.3s, transform 0.2s;
}

.start-button:hover {
  background-color: #2ecc71;
  transform: scale(1.05);
}

.game-complete {
  background-color: #8e44ad;
}

/* Circle mode toggle switch styles */
.circle-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto 20px;
  max-width: 300px;
}

.toggle-label {
  font-size: 14px;
  font-weight: bold;
  color: #555;
  margin: 0 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #f39c12;
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #48dbfb;
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px #48dbfb;
}

input:checked + .toggle-slider:before {
  transform: translateX(32px);
}

.venn-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
}

.venn-diagram {
  width: 100%;
  height: auto;
}

.circle {
  fill-opacity: 0.3;
  stroke: #000;
  stroke-width: 2;
}

.circle-1 {
  fill: #f39c12;
}

.circle-2 {
  fill: #48dbfb;
}

.circle-3 {
  fill: #1dd1a1;
}

.circle-4 {
  fill: #ffeaa7;
}

.topic-button {
  position: absolute;
  border: 2px solid #3498db;
  background-color: white;
  color: #2c3e50;
  font-weight: bold;
  padding: 8px 10px;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 2px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  width: 100px;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  hyphens: auto;
  overflow: hidden;
  line-height: 1.1;
}

/* Add adaptive font sizing based on content length */
.topic-button:not(:empty) {
  font-size: 14px;
}

.topic-button[data-length="medium"]:not(:empty) {
  font-size: 12px;
}

.topic-button[data-length="long"]:not(:empty) {
  font-size: 10px;
}

.topic-button[data-length="very-long"]:not(:empty) {
  font-size: 9px;
}

.topic-button:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.topic-button.relevant {
  background-color: rgba(46, 204, 113, 0.5);
  border-color: #27ae60;
  box-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

.topic-button.not-relevant {
  background-color: rgba(255, 118, 117, 0.3);
  border-color: #e74c3c;
  opacity: 0.7;
  color: #7f8c8d;
  transition: all 0.2s ease;
}

.topic-1 {
  left: 2px;
  top: 2px;
}

.topic-2 {
  right: 2px;
  top: 2px;
}

.topic-3 {
  left: 40%;
  bottom: 0px;
}

.topic-4 {
  right: 2px;
  bottom: 2px;
}

.cell-button {
  position: absolute;
  border: 1px solid #ccc;
  background-color: rgba(255, 255, 255, 0.8);
  color: #777;
  padding: 10px;
  border-radius: 20px;
  text-align: center;
  width: 90px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  overflow: hidden;
  word-break: break-word;
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.1;
}

/* Text scaling for cells based on content length */
.cell-button.filled {
  font-size: 12px;
}

.cell-button.filled[data-length="medium"] {
  font-size: 11px;
}

.cell-button.filled[data-length="long"] {
  font-size: 10px;
}

.cell-button.filled[data-length="very-long"] {
  font-size: 9px;
}

.cell-button.filled[data-length="extreme"] {
  font-size: 8px;
}

.cell-button:hover {
  background-color: #f5f5f5;
  border-color: #999;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cell-button.filled {
  border-width: 1.5px;
  color: inherit;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cell-button.highlighted {
  border: 3px solid #f39c12;
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.7);
  margin: -3px;
  transition: all 0.2s ease;
}

.cell-button.highlighted-player-2 {
  border: 3px solid #0097e6;
  box-shadow: 0 0 10px rgba(0, 151, 230, 0.7);
  margin: -3px;
  transition: all 0.2s ease;
}

.cell-button.disabled {
  background-color: rgba(240, 240, 240, 0.6);
  border-color: #ddd;
  cursor: not-allowed;
  pointer-events: none;
}

/* Ensure text remains fully visible even in disabled cells */
.cell-button.disabled.text-player-1,
.cell-button.disabled.text-player-2 {
  opacity: 1;
  font-weight: bold;
}

/* THREE CIRCLE MODE CELL POSITIONING - Adjusted for smaller circles */
.three-circle-mode .cell-1 {
  left: 65px; /* Keep horizontal position unchanged */
  top: 145px; /* Move down from 135px by 10px */
}

.three-circle-mode .cell-2 {
  right: 60px; /* Keep horizontal position unchanged */
  top: 145px; /* Move down from 135px by 10px */
}

.three-circle-mode .cell-3 {
  left: 50%;
  bottom: 90px; /* Move closer to center of circle 3 */
  transform: translateX(-50%);
}

/* Two circle intersections - adjust for smaller circles */
.three-circle-mode .cell-12 {
  left: 51%;
  top: 95px; /* Adjusted for intersection of smaller circles */
  transform: translateX(-50%);
}

.three-circle-mode .cell-13 {
  left: 125px; /* Adjusted for intersection of smaller circles */
  top: 355px;
  transform: translateY(-50%);
}

.three-circle-mode .cell-23 {
  right: 120px; /* Adjusted for intersection of smaller circles */
  top: 355px;
  transform: translateY(-50%);
}

/* Three-circle intersection (center) */
.three-circle-mode.venn-container .cell-123,
.three-circle-mode .cell-123 {
  left: 50%;
  top: 280px !important; /* Adjusted for intersection of all three smaller circles */
  transform: translate(-50%, -50%);
}

/* FOUR CIRCLE MODE POSITIONING OVERRIDES */
/* Topic button positioning in 4-circle mode */
.four-circle-mode .topic-1 {
  left: 2px;
  top: 2px;
}

.four-circle-mode .topic-2 {
  right: 2px;
  top: 2px;
}

.four-circle-mode .topic-3 {
  left: 2px;
  bottom: 2px;
}

.four-circle-mode .topic-4 {
  right: 2px;
  bottom: 2px;
}

/* Single regions */
.four-circle-mode .cell-1 {
  left: 95px;
  top: 75px;
}

.four-circle-mode .cell-2 {
  right: 95px;
  top: 75px;
}

.four-circle-mode .cell-3 {
  left: 75px;
  bottom: 120px;
}

.four-circle-mode .cell-4 {
  right: 75px;
  bottom: 120px;
}

/* Two circle regions */
.four-circle-mode .cell-12 {
  left: 50%;
  top: 75px;
  transform: translateX(-50%);
}

.four-circle-mode .cell-13 {
  left: 62px;
  top: 50%;
  transform: translateY(-50%);
}

.four-circle-mode .cell-24 {
  right: 62px;
  top: 50%;
  transform: translateY(-50%);
}

.four-circle-mode .cell-34 {
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
}

/* This cell is causing issues in the diagram - should be hidden in 4-circle mode */
.four-circle-mode .cell-23 {
  display: none;
}

/* Triple circle regions */
.four-circle-mode .cell-123 {
  left: 160px;
  top: 170px;
}

.four-circle-mode .cell-124 {
  right: 160px;
  top: 170px;
}

.four-circle-mode .cell-134 {
  left: 160px;
  bottom: 185px;
}

.four-circle-mode .cell-234 {
  right: 160px;
  bottom: 185px;
}

/* Center region (all four circles) */
.four-circle-mode .cell-1234 {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}





/* Adjust SVG circle positions to create better intersections */
.four-circle-mode .venn-diagram .circle-1 {
  cx: 190px;
  cy: 190px;
}

.four-circle-mode .venn-diagram .circle-2 {
  cx: 310px;
  cy: 190px;
}

.four-circle-mode .venn-diagram .circle-3 {
  cx: 190px;
  cy: 310px;
}

.four-circle-mode .venn-diagram .circle-4 {
  cx: 310px;
  cy: 310px;
}

/* Make circles slightly smaller in 4-circle mode to avoid too much overlap */
.four-circle-mode .venn-diagram .circle {
  r: 165px;
}

/* Mode-specific styles */
.three-circle-mode .topic-4{}
.three-circle-mode .cell-4,
.three-circle-mode .cell-24,
.three-circle-mode .cell-34,
.three-circle-mode .cell-124,
.three-circle-mode .cell-134,
.three-circle-mode .cell-234,
.three-circle-mode .cell-1234 {
  display: none;
}

.three-circle-mode .circle-4 {
  opacity: 0;
}

/* Adjust positions in 3-circle mode */
.three-circle-mode .circle-3 {
  cx: 250;
  cy: 300;
}

.instructions {
  margin-top: 30px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #3498db;
}

.instructions h2 {
  margin-top: 0;
  color: #2c3e50;
}

.instructions ol {
  padding-left: 20px;
}

.instructions li {
  margin-bottom: 8px;
}

/* Theme selector styles */
.theme-selector-container {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.theme-label {
  margin-right: 5px;
  font-weight: bold;
  font-size: 14px;
  color: #333;
}

.theme-selector {
  padding: 6px 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.theme-selector:hover {
  border-color: #3498db;
}

.theme-selector:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}


.game-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  padding: 6px 12px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background-color: #2980b9;
  opacity: 0.9;
}

/* Game Summary/Evaluation Styles */
.game-summary {
  margin-top: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #3498db;
}

.game-summary h2 {
  margin-top: 0;
  color: #2c3e50;
  margin-bottom: 20px;
}

.loading-indicator {
  text-align: center;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid #3498db;
  width: 30px;
  height: 30px;
  margin: 15px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.evaluation-content {
  line-height: 1.6;
  font-size: 15px;
  padding: 10px;
}

.evaluation-content h1 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 1.8em;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.evaluation-content p {
  margin: 8px 0;
}

.evaluation-content hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 15px 0;
}

.error-message {
  color: #e74c3c;
  padding: 10px;
  border: 1px solid #e74c3c;
  border-radius: 4px;
  background-color: rgba(231, 76, 60, 0.1);
  margin: 15px 0;
}

/* Notification message */
.notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(52, 73, 94, 0.95);
  color: white;
  padding: 20px 30px;
  border-radius: 8px;
  text-align: center;
  max-width: 80%;
  animation: fadeIn 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-size: 18px;
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Shared styles that apply to both modes */
.topic-cell {
  position: absolute;
  /* ... existing code ... */
}

/* Three-circle mode specific positioning */
.mode-three .topic-cell {
  /* ... existing code ... */
}

.mode-three .topic-cell:nth-child(1) {
  top: 20%;
  left: 20%;
  /* ... existing code ... */
}

.mode-three .topic-cell:nth-child(2) {
  top: 20%;
  right: 20%;
  /* ... existing code ... */
}

.mode-three .topic-cell:nth-child(3) {
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  /* ... existing code ... */
}

/* For 4-circle mode - apply more specific rules with !important */
.four-circles .topic-cell,
.mode-four .topic-cell,
body[data-circle-count="4"] .topic-cell {
  position: absolute !important;
}

/* Top topic/player 1 */
.four-circles .topic-cell:nth-child(1),
.mode-four .topic-cell:nth-child(1),
body[data-circle-count="4"] .topic-cell:nth-child(1) {
  top: 10% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10 !important;
}

/* Right topic/player 2 */
.four-circles .topic-cell:nth-child(2),
.mode-four .topic-cell:nth-child(2),
body[data-circle-count="4"] .topic-cell:nth-child(2) {
  top: 50% !important;
  right: 10% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
}

/* Bottom topic/player 3 */
.four-circles .topic-cell:nth-child(3),
.mode-four .topic-cell:nth-child(3),
body[data-circle-count="4"] .topic-cell:nth-child(3) {
  bottom: 10% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10 !important;
}

/* Left topic/player 4 */
.four-circles .topic-cell:nth-child(4),
.mode-four .topic-cell:nth-child(4),
body[data-circle-count="4"] .topic-cell:nth-child(4) {
  top: 50% !important;
  left: 10% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
}

/* Fix SVG circle positions in 4-circle mode */
.four-circle-mode .venn-diagram .circle-3,
.four-circles .venn-diagram .circle-3,
body[data-circle-count="4"] .venn-diagram .circle-3 {
  cx: 200 !important; /* Match with circle-1 x-position (was 250) */
}

.four-circle-mode .circle-4,
.mode-four .circle-4,
body[data-circle-count="4"] .circle-4 {
  cx: 300 !important; /* Match with circle-2 x-position */
  cy: 300 !important; /* Keep original y-position */
}

/* Three-circle mode positioning preservation */
.three-circle-mode .venn-diagram .circle-3,
.three-circles .venn-diagram .circle-3,
body[data-circle-count="3"] .venn-diagram .circle-3 {
  cx: 250 !important; /* Keep centered for 3-circle mode */
}

/* Hide the impossible intersection */
.four-circle-mode .cell-23 {
  display: none;
}

/* Adjust SVG circle positions in 3-circle mode to increase distance between circles */
.three-circle-mode .venn-diagram .circle-1,
.three-circles .venn-diagram .circle-1,
body[data-circle-count="3"] .venn-diagram .circle-1 {
  cx: 180px !important; /* Move outward (was 220px) */
  cy: 180px !important; /* Move up (was 220px) */
}

.three-circle-mode .venn-diagram .circle-2,
.three-circles .venn-diagram .circle-2,
body[data-circle-count="3"] .venn-diagram .circle-2 {
  cx: 320px !important; /* Move outward (was 280px) */
  cy: 180px !important; /* Move up (was 220px) */
}

.three-circle-mode .venn-diagram .circle-3,
.three-circles .venn-diagram .circle-3,
body[data-circle-count="3"] .venn-diagram .circle-3 {
  cx: 250px !important; /* Keep centered horizontally */
  cy: 320px !important; /* Move down (was 280px) */
}

/* Make three-circle mode cells 10% smaller and more oval */
.three-circle-mode .cell-button {
  width: 94px;  /* 10% smaller than current 104px */
  height: 52px; /* 10% smaller than current 58px */
  margin-left: -5px; /* Adjusted margin for smaller width */
  margin-top: -3px;  /* Adjusted margin for smaller height */
  border-radius: 26px; /* Increased border radius for more oval appearance */
}

/* Adjust the highlighted state to match the new smaller, more oval shape */
.three-circle-mode .cell-button.highlighted {
  border: 3px solid #f39c12;
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.7);
  margin-left: -8px; /* Adjusted for smaller width + border */
  margin-top: -6px;  /* Adjusted for smaller height + border */
  border-radius: 28px; /* Increased to account for border thickness */
  transition: all 0.2s ease;
}

/* Make three-circle mode circles 15% smaller */
.three-circle-mode .venn-diagram .circle {
  r: 153px !important; /* 180px * 0.85 = 153px */
}

/* Adjust SVG circle positions in 3-circle mode with smaller circles */
.three-circle-mode .venn-diagram .circle-1,
.three-circles .venn-diagram .circle-1,
body[data-circle-count="3"] .venn-diagram .circle-1 {
  cx: 190px !important; /* Adjusted for smaller circle */
  cy: 190px !important;
}

.three-circle-mode .venn-diagram .circle-2,
.three-circles .venn-diagram .circle-2,
body[data-circle-count="3"] .venn-diagram .circle-2 {
  cx: 310px !important; /* Adjusted for smaller circle */
  cy: 190px !important;
}

.three-circle-mode .venn-diagram .circle-3,
.three-circles .venn-diagram .circle-3,
body[data-circle-count="3"] .venn-diagram .circle-3 {
  cx: 250px !important; /* Keep centered horizontally */
  cy: 300px !important; /* Adjusted for smaller circle */
}

/* Make cells 13 and 23 an additional 15% smaller */
.three-circle-mode .cell-13,
.three-circle-mode .cell-23 {
  width: 80px;  /* 15% smaller than the current 94px */
  height: 44px; /* 15% smaller than the current 52px */
  margin-left: -5px; /* Adjusted for smaller width */
  margin-top: -3px;  /* Adjusted for smaller height */
  border-radius: 22px; /* Adjusted border-radius for smaller size */
}

/* Adjust the highlighted state for these smaller cells */
.three-circle-mode .cell-13.highlighted,
.three-circle-mode .cell-23.highlighted {
  margin-left: -8px; /* Adjusted for smaller width + border */
  margin-top: -6px;  /* Adjusted for smaller height + border */
  border-radius: 24px; /* Adjusted for border thickness */
}

/* Make cells about 7% smaller in 4-circle mode */
.four-circle-mode .cell-button {
  width: 84px;  /* 7% smaller than the standard 90px */
  height: 47px; /* 7% smaller than the standard 50px */
  font-size: 12px; /* Slightly smaller font to fit the reduced size */
  padding: 8px;    /* Reduced padding */
}

/* Adjust the highlighted state for the smaller cells */
.four-circle-mode .cell-button.highlighted,
.four-circle-mode .cell-button.highlighted-player-2 {
  margin: -2px; /* Slightly reduced margin to account for smaller size */
}

/* Maintain proper spacing with smaller cells */
.four-circle-mode .cell-button.filled[data-length="medium"] {
  font-size: 10.5px; /* 7% smaller than standard 11px */
}

.four-circle-mode .cell-button.filled[data-length="long"] {
  font-size: 9.5px; /* 7% smaller than standard 10px */
}

.four-circle-mode .cell-button.filled[data-length="very-long"] {
  font-size: 8.5px; /* 7% smaller than standard 9px */
}

.four-circle-mode .cell-button.filled[data-length="extreme"] {
  font-size: 7.5px; /* 7% smaller than standard 8px */
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
  /* General mobile adjustments */
  body {
    padding: 10px;
  }
  
  .app {
    padding: 10px;
  }
  
  .game-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }
  
  /* Make the player setup more compact */
  .player-fields-container {
    flex-direction: column;
    gap: 5px;
  }
  
  .player-field {
    width: 100%;
  }
  
  /* Make buttons more touch-friendly */
  button, .turn-indicator {
    padding: 12px;
    min-height: 44px; /* Minimum touch target size */
  }
  
  /* Allow portrait mode with adjusted layout */
  @media (orientation: portrait) {
    /* Override the orientation message */
    .orientation-message {
      display: none !important;
    }
    
    .app {
      display: block !important;
    }
    
    /* Stack the toggles */
    .toggles-container {
      flex-direction: column;
      gap: 15px;
    }
    
    .circle-toggle-container, .voice-toggle-container {
      left: 0 !important;
      right: 0 !important;
    }
    
    /* Make the Venn diagram fit the screen */
    .venn-container {
      transform: scale(0.85);
      transform-origin: top center;
      margin-bottom: 0;
    }
    
    /* Adjust cells for better visibility */
    .cell-button {
      font-size: 10px; /* Smaller font */
    }
    
    /* Make topic buttons more compact */
    .topic-button {
      width: 80px;
      font-size: 12px;
      padding: 6px 8px;
    }
    
    /* Stack game controls */
    .game-controls {
      flex-direction: column;
      gap: 8px;
    }
    
    /* Collapse instructions by default */
    .instructions {
      max-height: 40px;
      overflow: hidden;
      transition: max-height 0.3s ease;
      cursor: pointer;
    }
    
    .instructions.expanded {
      max-height: 500px;
    }
    
    .instructions h2::after {
      content: " (tap to expand)";
      font-size: 0.8em;
      opacity: 0.7;
    }
  }
}

/* Additional styles for very small screens */
@media screen and (max-width: 375px) {
  .venn-container {
    transform: scale(0.75);
  }
  
  .topic-button {
    width: 70px;
    font-size: 11px;
  }
}