body {
  font-family: "Segoe UI", sans-serif;
  background: #0f172a;
  color: #fff;
  padding: 20px;
  margin: 0;
}
.app {
  max-width: 900px;
  margin: auto;
}
h2 {
  text-align: center;
  margin-bottom: 35px;
}
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  justify-content: center;
}
input,
select,
button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  backdrop-filter: blur(4px);
}

select {
  color: #fafbff;
}
option {
  color: #080f2a;
}
button {
  cursor: pointer;
  font-weight: 600;
}
.map-wrap {
  position: relative;
  display: inline-block;
  margin-left: 40px;
}
.grid {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  position: relative;
}
.cell {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 37, 0.7);
  border: 1px solid #334155;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease;
}
.cell:hover {
  transform: translateY(-3px);
  background: rgba(148, 163, 184, 0.15);
}
.cell.one {
  background: #1b549b64;
  color: #e6edf7;
  box-shadow: inset 0 0 6px #0005;
}
.cell.x {
  background: #5072a1be;
  color: #fff;
}
.labels-row,
.labels-col {
  display: flex;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.labels-row {
  flex-direction: column;
  margin-right: 8px;
  gap: 40px;
  margin-top: 4px;
}
.labels-col {
  margin-left: 58px;
  margin-bottom: 6px;
}
.labels-row > div,
.labels-col > div {
  width: 52px;
  text-align: center;
  padding: 4px 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
.expr {
  margin-top: 16px;
  padding: 12px;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 10px;
  font-family: monospace;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  min-height: 36px;
  word-wrap: break-word;
}
.hint {
  text-align: center;
  color: #9aa7c7;
  font-size: 13px;
  margin-top: 6px;
}

/* 🌐 Mobile Responsive Styles */
@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  input,
  select,
  button {
    width: 100%;
    font-size: 15px;
    padding: 10px;
  }

  .map-wrap {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .grid {
    gap: 4px;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)) !important;
  }

  .cell {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .labels-row {
    flex-direction: row;
    justify-content: center;
    margin-right: 0;
    gap: 6px;
    margin-top: 8px;
    order: 2;
  }

  .labels-col {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    gap: 6px;
  }

  .labels-row > div,
  .labels-col > div {
    width: 36px;
    font-size: 12px;
    padding: 3px 0;
  }

  .expr {
    font-size: 14px;
    padding: 10px;
  }

  .hint {
    font-size: 12px;
    margin-top: 10px;
  }
}
