* {
  box-sizing: border-box;
}

body {
  font-family: 'Mulish', sans-serif;
  margin: 0;
  background: #f4f6f9;
  color: #333;
  min-height: 100vh;
  overflow: hidden;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5px 20px 100px;
  text-align: center;
}

:fullscreen .container {
  padding: 100px 10px 40px;
}

/* Sabit üst menü */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-width: 320px;
  background-color: #3b5998;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.fixed-header .logo {
  font-size: 1.5em;
  font-weight: bold;
}

.fixed-header .header-right {
  display: flex;
  align-items: center;
}

.home-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 15px;
  font-size: 1em;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  margin-left: 10px;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
}

.home-button i {
  margin-right: 6px;
}

#numberGrid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  margin-top: 80px;
}

.cell {
  width: 80px;
  height: 70px;
  background: linear-gradient(to bottom, #dbeafe, #bfdbfe);
  border: 2px solid #1877F2;
  border-radius: 20px;
  font-size: 32px;
  font-weight: bold;
  color: #1e3a8a;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer; /* changed from grab */
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cell:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
  background: linear-gradient(to bottom, #c7d2fe, #a5b4fc);
}

/* removed .cell:active grabbing cursor */

/* Kontroller */
#controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 25px;
}

#controls label {
  font-size: 20px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 6px;
}

#digitCount {
  padding: 10px 16px;
  font-size: 18px;
  border: 2px solid #1877F2;
  border-radius: 8px;
  background-color: #f0f4ff;
  color: #1a237e;
  appearance: auto;
}

#digitCount:focus {
  border-color: #0f5ed7;
  box-shadow: 0 0 5px rgba(24, 119, 242, 0.5);
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
  transform: scale(1.05);
}

#speakBtn {
  background-color: #1877F2;
  color: white;
}

#speakBtn:hover {
  background-color: #0f5ed7;
}

#clearBtn {
  background-color: #e53935;
  color: white;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10;
}

#clearBtn:hover {
  background-color: #c62828;
}

#fullscreenBtn {
  background-color: #34A853;
  color: white;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
}

#fullscreenBtn:hover {
  background-color: #2c8f47;
}

/* Slot alanı */
#dynamicSlots {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.drop-slot {
  width: 80px;
  height: 80px;
  background-color: #fff;
  border: 3px dashed #34A853;
  border-radius: 12px;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Sonuç ve okunuş */
#reading {
  font-size: 20px;
  background-color: #ffebee;
  border: 2px solid #d32f2f;
  border-radius: 10px;
  padding: 8px 16px;
  margin: 12px auto 6px;
  max-width: 800px;
  font-weight: bold;
  color: #b71c1c;
  box-shadow: 0 4px 10px rgba(211, 47, 47, 0.1);
  text-align: center;
  display: none;
}

#composition {
  font-size: 17px;
  background-color: #e3f2fd;
  border: 2px solid #1877F2;
  border-radius: 10px;
  padding: 8px 16px;
  margin: 6px auto 12px;
  max-width: 800px;
  font-weight: bold;
  color: #0d47a1;
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.12);
  text-align: center;
  display: none;
}

/* Görsel temsil */
#visualization {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.visual-col {
  width: 120px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.visual-col > div:first-child {
  font-weight: bold;
  margin-bottom: 4px;
}

.circle-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 3px;
  column-gap: 4px;
  justify-items: center;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 0;
}

.circle {
  width: 18px;
  height: 18px;
  background-color: #fbbc05;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

/* Alt bilgi */
.footer-text {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  text-align: center;
  font-size: 0.9em;
  color: #666;
  z-index: 0;
  padding: 5px 10px;
  box-sizing: border-box;
}

/* Mobil destek uyarısı */
.mobile-not-supported-message {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #e0f2f7;
}
.mobile-not-supported-message .message-content {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 40px;
  max-width: 500px;
  width: 90%;
  color: #333;
  font-family: 'Mulish', sans-serif;
  text-align: center;
}
.mobile-not-supported-message h2 {
  font-size: 2em;
  color: #3b5998;
  margin-bottom: 20px;
}
.mobile-not-supported-message p {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  body { overflow: hidden !important; }
  #hundred-chart-app-container { display: none !important; }
  .mobile-not-supported-message { display: flex !important; }
}

@media (min-width: 769px) {
  .mobile-not-supported-message { display: none !important; }
  #hundred-chart-app-container { display: block !important; }
  body { overflow: auto !important; }
}

/* Seçili rakam vurgusu */
.cell.selected {
  outline: 3px solid #34A853;
  outline-offset: 2px;
}
